Changeset d41ba4a in git for modules/ParticlePropagator.cc
- Timestamp:
- Dec 20, 2013, 11:30:49 PM (11 years ago)
- Branches:
- ImprovedOutputFile, Timing, dual_readout, llp, master
- Children:
- 41f30b4
- Parents:
- 8555f6d
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
modules/ParticlePropagator.cc
r8555f6d rd41ba4a 3 3 * 4 4 * Propagates charged and neutral particles 5 * from a given vertex to a cylinder defined by its radius, 5 * from a given vertex to a cylinder defined by its radius, 6 6 * its half-length, centered at (0,0,0) and with its axis 7 7 * oriented along the z-axis. … … 33 33 #include "TLorentzVector.h" 34 34 35 #include <algorithm> 35 #include <algorithm> 36 36 #include <stdexcept> 37 37 #include <iostream> … … 62 62 fBz = GetDouble("Bz", 0.0); 63 63 if(fRadius < 1.0E-2) 64 { 64 { 65 65 cout << "ERROR: magnetic field radius is too low\n"; 66 66 return; … … 106 106 Double_t tmp, discr, discr2; 107 107 Double_t delta, gammam, omega, asinrho; 108 108 109 109 const Double_t c_light = 2.99792458E8; 110 110 111 111 fItInputArray->Reset(); 112 112 while((candidate = static_cast<Candidate*>(fItInputArray->Next()))) … … 142 142 tmp = px*y - py*x; 143 143 discr2 = pt2*fRadius2 - tmp*tmp; 144 144 145 145 if(discr2 < 0) 146 146 { … … 153 153 t1 = (-tmp + discr)/pt2; 154 154 t2 = (-tmp - discr)/pt2; 155 t = (t1 < 0) ? t2 : t1; 155 t = (t1 < 0) ? t2 : t1; 156 156 157 157 z_t = z + pz*t; … … 160 160 t3 = (+fHalfLength - z) / pz; 161 161 t4 = (-fHalfLength - z) / pz; 162 t = (t3 < 0) ? t4 : t3; 162 t = (t3 < 0) ? t4 : t3; 163 163 } 164 164 … … 170 170 candidate = static_cast<Candidate*>(candidate->Clone()); 171 171 172 candidate->Position.SetXYZT(x_t*1.0E3, y_t*1.0E3, z_t*1.0E3, candidatePosition.T() + t );172 candidate->Position.SetXYZT(x_t*1.0E3, y_t*1.0E3, z_t*1.0E3, candidatePosition.T() + t*e*1.0E3); 173 173 174 174 candidate->Momentum = candidateMomentum; 175 175 candidate->AddCandidate(mother); 176 176 177 177 fOutputArray->Add(candidate); 178 if(TMath::Abs(q) > 1.0E-9) 178 if(TMath::Abs(q) > 1.0E-9) 179 179 { 180 180 switch(TMath::Abs(candidate->PID)) … … 195 195 196 196 // 1. initial transverse momentum p_{T0} : Part->pt 197 // initial transverse momentum direction \phi_0 = -atan(p_X0/p_Y0) 197 // initial transverse momentum direction \phi_0 = -atan(p_X0/p_Y0) 198 198 // relativistic gamma : gamma = E/mc² ; gammam = gamma \times m 199 199 // giration frequency \omega = q/(gamma m) fBz … … 201 201 202 202 gammam = e*1.0E9 / (c_light*c_light); // gammam in [eV/c²] 203 omega = q * fBz / (gammam); // omega is here in [ 89875518 / s] 204 r = pt / (q * fBz) * 1.0E9/c_light; // in [m] 203 omega = q * fBz / (gammam); // omega is here in [ 89875518 / s] 204 r = pt / (q * fBz) * 1.0E9/c_light; // in [m] 205 205 206 206 phi_0 = TMath::ATan2(py, px); // [rad] in [-pi; pi] … … 250 250 t_rb = TMath::Min(t4, TMath::Min(t5, t6)); 251 251 t_r = TMath::Min(t_ra, t_rb); 252 t = TMath::Min(t_r, t_z); 252 t = TMath::Min(t_r, t_z); 253 253 } 254 254 … … 264 264 candidate = static_cast<Candidate*>(candidate->Clone()); 265 265 266 candidate->Position.SetXYZT(x_t*1.0E3, y_t*1.0E3, z_t*1.0E3, candidatePosition.T() + t );266 candidate->Position.SetXYZT(x_t*1.0E3, y_t*1.0E3, z_t*1.0E3, candidatePosition.T() + t*c_light*1.0E3); 267 267 268 268 candidate->Momentum = candidateMomentum;
Note:
See TracChangeset
for help on using the changeset viewer.