Changeset 4154bbd in git for modules/VertexSorter.cc
- Timestamp:
- Sep 1, 2016, 12:56:40 PM (8 years ago)
- Branches:
- ImprovedOutputFile, Timing, dual_readout, llp, master
- Children:
- 61569e0
- Parents:
- 95b4e9f
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
modules/VertexSorter.cc
r95b4e9f r4154bbd 115 115 Candidate *candidate, *jetCandidate, *beamSpotCandidate; 116 116 map<Int_t, UInt_t> clusterIDToIndex; 117 map<Int_t, UInt_t>::const_iterator itClusterIDToIndex; 117 118 map<Int_t, Double_t> clusterIDToSumPT2; 119 map<Int_t, Double_t>::const_iterator itClusterIDToSumPT2; 118 120 vector<pair<Int_t, Double_t> > sortedClusterIDs; 121 vector<pair<Int_t, Double_t> >::const_iterator itSortedClusterIDs; 119 122 120 123 for (Int_t iCluster = 0; iCluster < fInputArray->GetEntries (); iCluster++) … … 161 164 } 162 165 163 for ( const auto &clusterID : clusterIDToSumPT2)164 sortedClusterIDs.push_back (make_pair ( clusterID.first, clusterID.second));166 for (itClusterIDToSumPT2 = clusterIDToSumPT2.begin(); itClusterIDToSumPT2 != clusterIDToSumPT2.end(); ++itClusterIDToSumPT2) 167 sortedClusterIDs.push_back (make_pair (itClusterIDToSumPT2->first, itClusterIDToSumPT2->second)); 165 168 sort (sortedClusterIDs.begin (), sortedClusterIDs.end (), secondDescending); 166 169 } … … 193 196 if (candidate->IsPU) 194 197 continue; 195 for ( const auto &clusterID : clusterIDToIndex)198 for (itClusterIDToIndex = clusterIDToIndex.begin(); itClusterIDToIndex != clusterIDToIndex.end(); ++itClusterIDToIndex) 196 199 { 197 if (candidate->ClusterIndex != clusterID.first)200 if (candidate->ClusterIndex != itClusterIDToIndex->first) 198 201 continue; 199 clusterIDToSumPT2.at ( clusterID.first) += candidate->Momentum.Pt () * candidate->Momentum.Pt ();202 clusterIDToSumPT2.at (itClusterIDToIndex->first) += candidate->Momentum.Pt () * candidate->Momentum.Pt (); 200 203 } 201 204 } 202 205 203 for ( const auto &clusterID : clusterIDToSumPT2)204 sortedClusterIDs.push_back (make_pair ( clusterID.first, clusterID.second));206 for (itClusterIDToSumPT2 = clusterIDToSumPT2.begin(); itClusterIDToSumPT2 != clusterIDToSumPT2.end(); ++itClusterIDToSumPT2) 207 sortedClusterIDs.push_back (make_pair (itClusterIDToSumPT2->first, itClusterIDToSumPT2->second)); 205 208 sort (sortedClusterIDs.begin (), sortedClusterIDs.end (), secondDescending); 206 209 } … … 214 217 throw 0; 215 218 } 216 217 for (const auto &clusterID : sortedClusterIDs) 218 { 219 Candidate *cluster = (Candidate *) fInputArray->At (clusterIDToIndex.at (clusterID.first)); 219 for (itSortedClusterIDs = sortedClusterIDs.begin(); itSortedClusterIDs != sortedClusterIDs.end(); ++itSortedClusterIDs) 220 { 221 Candidate *cluster = (Candidate *) fInputArray->At (clusterIDToIndex.at (itSortedClusterIDs->first)); 220 222 if (fMethod == "BTV") 221 cluster->BTVSumPT2 = clusterID.second;223 cluster->BTVSumPT2 = itSortedClusterIDs->second; 222 224 else if (fMethod == "GenClosest") 223 cluster->GenDeltaZ = clusterID.second;225 cluster->GenDeltaZ = itSortedClusterIDs->second; 224 226 else if (fMethod == "GenBest") 225 cluster->GenSumPT2 = clusterID.second;227 cluster->GenSumPT2 = itSortedClusterIDs->second; 226 228 fOutputArray->Add (cluster); 227 229 }
Note:
See TracChangeset
for help on using the changeset viewer.