- Timestamp:
- Dec 9, 2019, 11:07:13 PM (5 years ago)
- Branches:
- Timing
- Children:
- 9117aaa4
- Parents:
- 1363bf5
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
modules/TrackPileUpSubtractor.cc
r1363bf5 r34c28a9 117 117 void TrackPileUpSubtractor::Process() 118 118 { 119 Candidate *candidate, *particle ;119 Candidate *candidate, *particle, *particleTest; 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 125 Double_t sumPT2 = 0; 126 Double_t sumSquare = 0; 127 int counter = 0; 128 Double_t tempPTSquare = 0; 129 Double_t tempZVertex = 0; 126 130 // find z position of primary vertex 127 131 132 cout << " ---------- NEW EVENT --------- " << endl; 133 128 134 fItVertexInputArray->Reset(); 135 cout << " NUMBER OF VERTICES : " << fVertexInputArray->GetEntriesFast() << endl; 129 136 while((candidate = static_cast<Candidate *>(fItVertexInputArray->Next()))) 130 137 { 131 if(!candidate->IsPU) 132 { 133 zvtx = candidate->Position.Z(); 134 // break; 135 } 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 */ 136 158 } 137 159 … … 147 169 { 148 170 particle = static_cast<Candidate *>(candidate->GetCandidates()->At(0)); 149 const TLorentzVector &candidateMomentum = particle->Momentum;171 const TLorentzVector &candidateMomentum = candidate->Momentum; 150 172 151 173 eta = candidateMomentum.Eta(); … … 154 176 e = candidateMomentum.E(); 155 177 156 z = particle->Position.Z(); 178 z = candidate->Position.Z(); 179 counter ++; 180 //sum = pt*pt; 181 if(pt > 1.0) 182 sumPT2 += pt*pt; 157 183 158 184 // apply pile-up subtraction 159 185 // assume perfect pile-up subtraction for tracks outside fZVertexResolution 160 161 if(candidate->Charge != 0 && candidate->IsPU && TMath::Abs(z - zvtx) > fFormula->Eval(pt, eta, phi, e) * 1.0e3) 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 189 190 if(particle->Charge != 0 && TMath::Abs(z - zvtx) > fFormula->Eval(pt, eta, phi, e) * 1.0e3) 162 191 { 163 192 candidate->IsRecoPU = 1; 193 //cout << TMath::Abs(z - zvtx) << " " << fFormula->Eval(pt, eta, phi, e) * 1.0e3 << endl; 164 194 } 165 195 else
Note:
See TracChangeset
for help on using the changeset viewer.