- Timestamp:
- Jan 9, 2020, 1:40:08 AM (5 years ago)
- Branches:
- Timing
- Children:
- 9c52415
- Parents:
- 03b9c0f
- Location:
- modules
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
modules/ModulesLinkDef.h
r03b9c0f r7939c6c 38 38 #include "modules/ImpactParameterSmearing.h" 39 39 #include "modules/TimeSmearing.h" 40 #include "modules/TimeSmearingNeutral.h"41 40 #include "modules/SimpleCalorimeter.h" 42 41 #include "modules/DenseTrackFilter.h" … … 95 94 #pragma link C++ class ImpactParameterSmearing+; 96 95 #pragma link C++ class TimeSmearing+; 97 #pragma link C++ class TimeSmearingNeutral+;98 96 #pragma link C++ class SimpleCalorimeter+; 99 97 #pragma link C++ class DenseTrackFilter+; -
modules/TimeSmearing.cc
r03b9c0f r7939c6c 53 53 54 54 TimeSmearing::TimeSmearing() : 55 f Formula(0), fItInputArray(0)55 fItInputArray(0) 56 56 { 57 fFormula = new DelphesFormula;58 57 } 59 58 … … 61 60 62 61 TimeSmearing::~TimeSmearing() 63 { 64 if(fFormula) delete fFormula; 62 { 65 63 } 66 64 … … 71 69 // read resolution formula 72 70 73 f Formula->Compile(GetString("TimeResolution", "1.0"));71 fTimeResolution = GetDouble("TimeResolution", 1.); 74 72 75 73 // import input array … … 77 75 fInputArray = ImportArray(GetString("InputArray", "MuonMomentumSmearing/muons")); 78 76 fItInputArray = fInputArray->MakeIterator(); 79 80 77 // create output array 81 78 … … 95 92 { 96 93 Candidate *candidate, *mother; 97 Double_t ti, tf_smeared, tf, timeResolution; 98 Double_t pt, eta, phi, e, d0, dz, ctgTheta; 94 Double_t ti, tf_smeared, tf; 95 Double_t pt, eta, phi, e, p, l; 96 Double_t sigma_t, beta_particle; 99 97 100 98 101 99 const Double_t c_light = 2.99792458E8; 100 101 cout << " STARTINNNGG ---------->" << endl; 102 102 103 103 fItInputArray->Reset(); … … 114 114 pt = candidateMomentum.Pt(); 115 115 e = candidateMomentum.E(); 116 d0 = candidate->D0; 117 dz = candidate->DZ; 118 ctgTheta = candidate->CtgTheta; 116 p = candidateMomentum.P(); 117 beta_particle = p/e; 118 l = candidate->L; 119 // apply smearing formula 119 120 120 // apply smearing formula 121 122 timeResolution = fFormula->Eval(pt, eta, phi, e, d0, dz, ctgTheta); 123 if(fabs(candidate->Position.Eta())<fEtaMax) 121 if(candidate->Charge != 0) 124 122 { 125 tf_smeared = tf + timeResolution*gRandom->Gaus(0, 1); 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); 127 candidate->InitialPosition.SetT((100+ti)*1.0E3*c_light); 128 candidate->Position.SetT(tf_smeared*1.0E3*c_light); 129 candidate->ErrorT = fTimeResolution*1.0E3*c_light; 130 fOutputArray->Add(candidate); 126 131 } 127 else continue; 128 129 // double beta_particle = candidate->Momentum.P()/candidate->Momentum.E(); 130 // ti = tf_smeared - candidate->Ld*1.0E-3/(c_light*beta_particle); 131 132 mother = candidate; 133 candidate = static_cast<Candidate*>(candidate->Clone()); 134 candidate->AddCandidate(mother); 135 candidate->InitialPosition.SetT((100+ti)*1.0E3*c_light); 136 candidate->Position.SetT(tf_smeared*1.0E3*c_light); 137 candidate->ErrorT = timeResolution*1.0E3*c_light; 138 139 fOutputArray->Add(candidate); 132 else 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); 139 } 140 140 141 } 141 142 } -
modules/TimeSmearing.h
r03b9c0f r7939c6c 45 45 46 46 private: 47 D elphesFormula *fFormula; //!47 Double_t fTimeResolution; //! 48 48 Double_t fEtaMax; 49 49 -
modules/TrackTimingPileUpSubtractor.cc
r03b9c0f r7939c6c 75 75 76 76 // read resolution formula in m 77 f ZVertexResolution = GetDouble("ZVertexResolution", 3);78 f TVertexResolution = GetDouble("TVertexResolution", 3);77 fChargedMinSignificance = GetDouble("ChargedMinSignificance", 3); 78 fNeutralMinSignificance = GetDouble("NeutralMinSignificance", 3); 79 79 80 80 fPTMin = GetDouble("PTMin", 0.); … … 173 173 distanceNeutral = pow((tvtx - t),2)/pow((tvtx_err - t_err),2); 174 174 175 if(candidate->Charge != 0 && distanceCharged < f ZVertexResolution)175 if(candidate->Charge != 0 && distanceCharged < fChargedMinSignificance) 176 176 { 177 177 candidate->IsRecoPU = 1; 178 178 } 179 else if(candidate->Charge == 0 && distanceNeutral < f TVertexResolution)179 else if(candidate->Charge == 0 && distanceNeutral < fNeutralMinSignificance) 180 180 { 181 181 candidate->IsRecoPU = 1; -
modules/TrackTimingPileUpSubtractor.h
r03b9c0f r7939c6c 49 49 DelphesFormula *fFormula; //! 50 50 51 Double_t f ZVertexResolution;52 Double_t f TVertexResolution;51 Double_t fChargedMinSignificance; 52 Double_t fNeutralMinSignificance; 53 53 54 54 Double_t fPTMin;
Note:
See TracChangeset
for help on using the changeset viewer.