Changeset 6049672 in git for modules/TimeSmearing.cc
- Timestamp:
- Jan 23, 2020, 8:59:46 PM (5 years ago)
- Branches:
- Timing
- Children:
- 4ac0049
- Parents:
- e70228d
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
modules/TimeSmearing.cc
re70228d r6049672 53 53 54 54 TimeSmearing::TimeSmearing() : 55 fItInputArray(0) 55 fItInputArray(0), fFormula(0) 56 56 { 57 fFormula = new DelphesFormula; 57 58 } 58 59 … … 61 62 TimeSmearing::~TimeSmearing() 62 63 { 64 if(fFormula) delete fFormula; 63 65 } 64 66 … … 67 69 void TimeSmearing::Init() 68 70 { 69 // read resolution formula 70 71 fTimeResolution = GetDouble("TimeResolution", 1.); 71 // read resolution formula 72 fFormula->Compile(GetString("TimeResolution", "0.001")); 72 73 73 74 // import input array … … 94 95 Double_t ti, tf_smeared, tf; 95 96 Double_t pt, eta, phi, e, p, l; 96 Double_t sigma_t, beta_particle; 97 Double_t beta_particle; 98 Double_t timeResolution; 97 99 98 100 99 101 const Double_t c_light = 2.99792458E8; 100 101 cout << " STARTINNNGG ---------->" << endl;102 102 103 103 fItInputArray->Reset(); … … 117 117 beta_particle = p/e; 118 118 l = candidate->L; 119 // apply smearing formula120 119 timeResolution = fFormula->Eval(e); 120 121 121 if(candidate->Charge != 0) 122 122 { 123 tf_smeared = tf + fTimeResolution*gRandom->Gaus(0, 1);124 //mother = candidate;125 //candidate = static_cast<Candidate*>(candidate->Clone()); // I am not sure that we need these lines !!!126 //candidate->AddCandidate(mother);123 tf_smeared = tf + timeResolution*gRandom->Gaus(0, 1); 124 mother = candidate; 125 candidate = static_cast<Candidate*>(candidate->Clone()); // I am not sure that we need these lines !!! 126 candidate->AddCandidate(mother); 127 127 candidate->InitialPosition.SetT((100+ti)*1.0E3*c_light); 128 128 candidate->Position.SetT(tf_smeared*1.0E3*c_light); 129 candidate->ErrorT = fTimeResolution*1.0E3*c_light;129 candidate->ErrorT = timeResolution*1.0E3*c_light; 130 130 fOutputArray->Add(candidate); 131 131 } 132 132 else 133 133 { 134 sigma_t = sqrt(pow(20,2) + pow(150,2)/e); 135 ti = sigma_t - l*1.0E3/(c_light*beta_particle); 136 candidate->InitialPosition.SetT(ti); 137 candidate->ErrorT = sigma_t*1.0E3*c_light; // Do we need to sum with 100 like in upside ? 138 fOutputArray->Add(candidate); 134 ti = timeResolution - l*1.0E3/(c_light*beta_particle); 135 candidate->InitialPosition.SetT(ti); 136 candidate->ErrorT = timeResolution*1.0E3*c_light; // Do we need to sum with 100 like in upside ? 137 fOutputArray->Add(candidate); 139 138 } 140 139
Note:
See TracChangeset
for help on using the changeset viewer.