Changeset 6049672 in git
- Timestamp:
- Jan 23, 2020, 8:59:46 PM (5 years ago)
- Branches:
- Timing
- Children:
- 4ac0049
- Parents:
- e70228d
- Files:
-
- 2 added
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
cards/FCC/FCChh_PileUpVtx.tcl
re70228d r6049672 48 48 49 49 VertexFinderDA4D 50 TrackTimingPileUpSubtractor50 PileUpSubtractor4D 51 51 52 52 HighMassVertexRecover … … 568 568 set InputArray ECal/eflowPhotons 569 569 set OutputArray timeSmearingPhotons 570 set TimeResolution {sqrt(20^2 + 150^2)/energy^2} 570 571 } 571 572 … … 579 580 580 581 # assume 30 ps resolution for now 581 set TimeResolution { 30E-12}582 set TimeResolution {sqrt(20^2 + 150^2)/energy^2} 582 583 } 583 584 … … 619 620 ########################## 620 621 621 module TrackTimingPileUpSubtractor TrackTimingPileUpSubtractor{622 module PileUpSubtractor4D PileUpSubtractor4D { 622 623 # add InputArray InputArray OutputArray 623 624 -
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 -
modules/TimeSmearing.h
re70228d r6049672 45 45 46 46 private: 47 D ouble_t fTimeResolution; //!47 DelphesFormula *fFormula; 48 48 Double_t fEtaMax; 49 49 -
modules/TrackPileUpSubtractor.cc
re70228d r6049672 117 117 void TrackPileUpSubtractor::Process() 118 118 { 119 Candidate *candidate, *particle , *particleTest;119 Candidate *candidate, *particle; 120 120 map<TIterator *, TObjArray *>::iterator itInputMap; 121 121 TIterator *iterator; … … 123 123 Double_t z, zvtx = 0; 124 124 Double_t pt, eta, phi, e; 125 Double_t sumPT2 = 0; 126 Double_t sumSquare = 0; 127 int counter = 0; 128 Double_t tempPTSquare = 0; 129 Double_t tempZVertex = 0; 125 130 126 // find z position of primary vertex 131 127 132 cout << " ---------- NEW EVENT --------- " << endl;133 134 128 fItVertexInputArray->Reset(); 135 cout << " NUMBER OF VERTICES : " << fVertexInputArray->GetEntriesFast() << endl;136 129 while((candidate = static_cast<Candidate *>(fItVertexInputArray->Next()))) 137 130 { 138 cout << " ---------- NEW VERTEX --------- " << candidate->IsPU << endl; 139 tempZVertex = candidate->Position.Z(); 140 tempPTSquare = candidate->SumPT2; 141 if(tempPTSquare > sumSquare) 142 { 143 sumSquare = tempPTSquare; 144 zvtx = tempZVertex; 145 cout << " Sum Square : " << sumSquare << " Z of Vertex : " << zvtx << " Is PileUp : " << candidate->IsPU << endl; 146 } 147 148 /* 149 for(int i = 0; i < candidate->GetCandidates()->GetEntriesFast(); i++) 150 { 151 particleTest = static_cast<Candidate *>(candidate->GetCandidates()->At(i)); 152 TLorentzVector &candidateMomentumNew = particleTest->Momentum; 153 if(candidateMomentumNew.Pt() > 1.0) 154 sumSquare += (candidateMomentumNew.Pt()*candidateMomentumNew.Pt()); 155 cout << candidateMomentumNew.Pt() << " " << candidate->SumPT2 << " counter : " << candidate->GetCandidates()->GetEntriesFast() << endl; 156 } 157 */ 131 if(!candidate->IsPU) 132 { 133 zvtx = candidate->Position.Z(); 134 } 158 135 } 159 136 … … 169 146 { 170 147 particle = static_cast<Candidate *>(candidate->GetCandidates()->At(0)); 171 const TLorentzVector &candidateMomentum = candidate->Momentum;148 const TLorentzVector &candidateMomentum = particle->Momentum; 172 149 173 150 eta = candidateMomentum.Eta(); … … 176 153 e = candidateMomentum.E(); 177 154 178 z = candidate->Position.Z(); 179 counter ++; 180 //sum = pt*pt; 181 if(pt > 1.0) 182 sumPT2 += pt*pt; 155 z = particle->Position.Z(); 183 156 184 157 // apply pile-up subtraction 185 158 // assume perfect pile-up subtraction for tracks outside fZVertexResolution 186 // cout << particle->IsRecoPU << " ParticleSumSquare : " << sumPT2 << " VertexResult : " << sumSquare << " Added SumSquare : " << zvtx << endl;187 //cout << pt << " " << candidate->IsPU << " " << TMath::Abs(z - zvtx) << " " << sumPT2 << " " << sumPT2 << endl;188 159 189 190 if(particle->Charge != 0 && TMath::Abs(z - zvtx) > fFormula->Eval(pt, eta, phi, e) * 1.0e3) 160 if(candidate->Charge != 0 && candidate->IsPU && TMath::Abs(z - zvtx) > fFormula->Eval(pt, eta, phi, e) * 1.0e3) 191 161 { 192 162 candidate->IsRecoPU = 1; 193 //cout << TMath::Abs(z - zvtx) << " " << fFormula->Eval(pt, eta, phi, e) * 1.0e3 << endl;194 163 } 195 164 else
Note:
See TracChangeset
for help on using the changeset viewer.