- Timestamp:
- Apr 3, 2017, 4:52:11 PM (8 years ago)
- Branches:
- ImprovedOutputFile, Timing, dual_readout, llp, master
- Children:
- accffb9
- Parents:
- 781edf86
- Location:
- modules
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
modules/ParticlePropagator.cc
r781edf86 r9330b7b 86 86 return; 87 87 } 88 89 fRadiusMax = GetDouble("RadiusMax", fRadius); 90 fHalfLengthMax = GetDouble("HalfLengthMax", fHalfLength); 88 91 89 92 // import array with output from filter/classifier module … … 160 163 161 164 // check that particle position is inside the cylinder 162 if(TMath::Hypot(x, y) > fRadius || TMath::Abs(z) > fHalfLength)165 if(TMath::Hypot(x, y) > fRadiusMax || TMath::Abs(z) > fHalfLengthMax) 163 166 { 164 167 continue; … … 177 180 } 178 181 179 if(TMath::Abs(q) < 1.0E-9 || TMath::Abs(fBz) < 1.0E-9) 182 if(TMath::Hypot(x, y) > fRadius || TMath::Abs(z) > fHalfLength) 183 { 184 mother = candidate; 185 candidate = static_cast<Candidate*>(candidate->Clone()); 186 187 candidate->InitialPosition = candidatePosition; 188 candidate->Position = candidatePosition; 189 candidate->L = 0.0; 190 191 candidate->Momentum = candidateMomentum; 192 candidate->AddCandidate(mother); 193 194 fOutputArray->Add(candidate); 195 } 196 else if(TMath::Abs(q) < 1.0E-9 || TMath::Abs(fBz) < 1.0E-9) 180 197 { 181 198 // solve pt2*t^2 + 2*(px*x + py*y)*t - (fRadius2 - x*x - y*y) = 0 … … 271 288 // momentum, since the orignal particle momentum isn't known 272 289 273 px = TMath::Sign(1.0, r) * pt * (-y_c / r_c);274 py = TMath::Sign(1.0, r) * pt * (x_c / r_c);290 px = TMath::Sign(1.0, r) * pt * (-y_c / r_c); 291 py = TMath::Sign(1.0, r) * pt * (x_c / r_c); 275 292 etap = candidateMomentum.Eta(); 276 293 phip = TMath::ATan2(py, px); … … 280 297 // calculate additional track parameters (correct for beamspot position) 281 298 282 d0 = ( 299 d0 = ((x - bsx) * py - (y - bsy) * px) / pt; 283 300 dz = z - ((x - bsx) * px + (y - bsy) * py) / pt * (pz / pt); 284 301 p = candidateMomentum.P(); 285 ctgTheta = 1.0 / TMath::Tan (candidateMomentum.Theta 302 ctgTheta = 1.0 / TMath::Tan (candidateMomentum.Theta()); 286 303 287 304 … … 301 318 else 302 319 { 303 asinrho = TMath::ASin( (fRadius*fRadius - r_c*r_c - r*r) / (2*TMath::Abs(r)*r_c));320 asinrho = TMath::ASin((fRadius*fRadius - r_c*r_c - r*r) / (2*TMath::Abs(r)*r_c)); 304 321 delta = phi_0 - phi; 305 322 if(delta <-TMath::Pi()) delta += 2*TMath::Pi(); … … 356 373 candidate->Momentum = candidateMomentum; 357 374 358 candidate->L =l*1.0E3;359 360 375 candidate->L = l*1.0E3; 376 377 candidate->Xd = xd*1.0E3; 361 378 candidate->Yd = yd*1.0E3; 362 379 candidate->Zd = zd*1.0E3; -
modules/ParticlePropagator.h
r781edf86 r9330b7b 50 50 private: 51 51 52 Double_t fRadius, fRadius2, f HalfLength;52 Double_t fRadius, fRadius2, fRadiusMax, fHalfLength, fHalfLengthMax; 53 53 Double_t fBz; 54 54
Note:
See TracChangeset
for help on using the changeset viewer.