Changeset 6049672 in git for modules/TrackPileUpSubtractor.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/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.