Fork me on GitHub

Changeset 4154bbd in git for modules/VertexSorter.cc


Ignore:
Timestamp:
Sep 1, 2016, 12:56:40 PM (8 years ago)
Author:
Pavel Demin <pavel.demin@…>
Branches:
ImprovedOutputFile, Timing, dual_readout, llp, master
Children:
61569e0
Parents:
95b4e9f
Message:

adapt vertexing modules to ROOT 5.34 and GCC 4.4

File:
1 edited

Legend:

Unmodified
Added
Removed
  • modules/VertexSorter.cc

    r95b4e9f r4154bbd  
    115115  Candidate *candidate, *jetCandidate, *beamSpotCandidate;
    116116  map<Int_t, UInt_t> clusterIDToIndex;
     117  map<Int_t, UInt_t>::const_iterator itClusterIDToIndex;
    117118  map<Int_t, Double_t> clusterIDToSumPT2;
     119  map<Int_t, Double_t>::const_iterator itClusterIDToSumPT2;
    118120  vector<pair<Int_t, Double_t> > sortedClusterIDs;
     121  vector<pair<Int_t, Double_t> >::const_iterator itSortedClusterIDs;
    119122
    120123  for (Int_t iCluster = 0; iCluster < fInputArray->GetEntries (); iCluster++)
     
    161164        }
    162165
    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));
    165168      sort (sortedClusterIDs.begin (), sortedClusterIDs.end (), secondDescending);
    166169    }
     
    193196          if (candidate->IsPU)
    194197            continue;
    195           for (const auto &clusterID : clusterIDToIndex)
     198          for (itClusterIDToIndex = clusterIDToIndex.begin(); itClusterIDToIndex != clusterIDToIndex.end(); ++itClusterIDToIndex)
    196199            {
    197               if (candidate->ClusterIndex != clusterID.first)
     200              if (candidate->ClusterIndex != itClusterIDToIndex->first)
    198201                continue;
    199               clusterIDToSumPT2.at (clusterID.first) += candidate->Momentum.Pt () * candidate->Momentum.Pt ();
     202              clusterIDToSumPT2.at (itClusterIDToIndex->first) += candidate->Momentum.Pt () * candidate->Momentum.Pt ();
    200203            }
    201204        }
    202205
    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));
    205208      sort (sortedClusterIDs.begin (), sortedClusterIDs.end (), secondDescending);
    206209    }
     
    214217      throw 0;
    215218    }
    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));
    220222      if (fMethod == "BTV")
    221         cluster->BTVSumPT2 = clusterID.second;
     223        cluster->BTVSumPT2 = itSortedClusterIDs->second;
    222224      else if (fMethod == "GenClosest")
    223         cluster->GenDeltaZ = clusterID.second;
     225        cluster->GenDeltaZ = itSortedClusterIDs->second;
    224226      else if (fMethod == "GenBest")
    225         cluster->GenSumPT2 = clusterID.second;
     227        cluster->GenSumPT2 = itSortedClusterIDs->second;
    226228      fOutputArray->Add (cluster);
    227229    }
Note: See TracChangeset for help on using the changeset viewer.