- Timestamp:
- Dec 19, 2014, 11:43:21 PM (10 years ago)
- Branches:
- ImprovedOutputFile, Timing, dual_readout, llp, master
- Children:
- 2b900b8
- Parents:
- 764f12a0
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
modules/ImpactParameterSmearing.cc
r764f12a0 r4d753a1 24 24 * 25 25 */ 26 26 27 27 28 28 #include "modules/ImpactParameterSmearing.h" … … 44 44 #include "TLorentzVector.h" 45 45 46 #include <algorithm> 46 #include <algorithm> 47 47 #include <stdexcept> 48 48 #include <iostream> … … 96 96 { 97 97 Candidate *candidate, *particle, *mother; 98 Double_t xd, yd, zd, dxy, dz, sx, sy, sz, ddxy, ddz; 99 Double_t pt, eta, px, py, ang_mom; 100 101 // cout<<"New event"<<endl; 98 Double_t xd, yd, zd, dxy, sx, sy, sz, ddxy; 99 Double_t pt, eta, px, py; 102 100 103 101 fItInputArray->Reset(); 104 102 while((candidate = static_cast<Candidate*>(fItInputArray->Next()))) 105 103 { 106 107 // take momentum before smearing (otherwise apply double smearing on dxy)104 105 // take momentum before smearing (otherwise apply double smearing on dxy) 108 106 particle = static_cast<Candidate*>(candidate->GetCandidates()->At(0)); 109 107 110 108 const TLorentzVector &candidateMomentum = particle->Momentum; 111 // const TLorentzVector &candidateMomentum = candidate->Momentum; 112 109 113 110 eta = candidateMomentum.Eta(); 114 111 pt = candidateMomentum.Pt(); 115 112 px = candidateMomentum.Px(); 116 113 py = candidateMomentum.Py(); 117 114 118 115 // calculate coordinates of closest approach to track circle in transverse plane xd, yd, zd 119 116 xd = candidate->Xd; 120 117 yd = candidate->Yd; 121 118 zd = candidate->Zd; 122 123 // calculate smeared values 124 sx = gRandom->Gaus(0 ,fFormula->Eval(pt, eta));125 sy = gRandom->Gaus(0 ,fFormula->Eval(pt, eta));126 sz = gRandom->Gaus(0 ,fFormula->Eval(pt, eta));127 119 120 // calculate smeared values 121 sx = gRandom->Gaus(0.0, fFormula->Eval(pt, eta)); 122 sy = gRandom->Gaus(0.0, fFormula->Eval(pt, eta)); 123 sz = gRandom->Gaus(0.0, fFormula->Eval(pt, eta)); 124 128 125 xd += sx; 129 126 yd += sy; 130 zd += sz; 131 132 // calculate impact paramater (after-smearing) 133 ang_mom = (xd*py - yd*px); 134 dxy = ang_mom/pt; 135 dz = zd; 136 137 ddxy = gRandom->Gaus(0,fFormula->Eval(pt, eta)); 138 ddz = gRandom->Gaus(0,fFormula->Eval(pt, eta)); 139 140 //fill smeared values in candidate 127 zd += sz; 128 129 // calculate impact parameter (after-smearing) 130 dxy = (xd*py - yd*px)/pt; 131 132 ddxy = gRandom->Gaus(0.0, fFormula->Eval(pt, eta)); 133 134 // fill smeared values in candidate 141 135 mother = candidate; 142 136 143 137 candidate = static_cast<Candidate*>(candidate->Clone()); 144 138 candidate->Xd = xd; 145 139 candidate->Yd = yd; 146 140 candidate->Zd = zd; 147 141 148 142 candidate->Dxy = dxy; 149 143 candidate->SDxy = ddxy; 150 144 151 145 candidate->AddCandidate(mother); 152 146 fOutputArray->Add(candidate);
Note:
See TracChangeset
for help on using the changeset viewer.