Fork me on GitHub

Changeset 5658083 in git for modules/VertexSorter.cc


Ignore:
Timestamp:
May 18, 2016, 11:39:09 AM (8 years ago)
Author:
Michele Selvaggi <michele.selvaggi@…>
Branches:
ImprovedOutputFile, Timing, dual_readout, llp, master
Children:
bc4bff0
Parents:
641cb3d
Message:

changed datatype to ROOT compliant

File:
1 edited

Legend:

Unmodified
Added
Removed
  • modules/VertexSorter.cc

    r641cb3d r5658083  
    11/** \class VertexSorter
    22 *
    3  *  Merges particles from pile-up sample into event
    4  *
    5  *
    6  *  $Date: 2013-02-12 15:13:59 +0100 (Tue, 12 Feb 2013) $
    7  *  $Revision: 907 $
    8  *
    9  *
    10  *  \author M. Selvaggi - UCL, Louvain-la-Neuve
    11  *
    12  */
     3 *
     4 *  Sorts vertices according to different criteria
     5 *
     6 *  \authors A. Hart, M. Selvaggi
     7 *
     8 *
     9*/
    1310
    1411#include <unordered_map>
    1512#include "modules/VertexSorter.h"
    16 
    17 //#include "CLHEP/Units/GlobalSystemOfUnits.h"
    18 //#include "CLHEP/Units/GlobalPhysicalConstants.h"
    1913
    2014#include "classes/DelphesClasses.h"
     
    3731#include "TVector3.h"
    3832
    39 static const double mm  = 1.;
    40 static const double m = 1000.*mm;
    41 static const double ns  = 1.;
    42 static const double s = 1.e+9 *ns;
    43 static const double c_light   = 2.99792458e+8 * m/s;
     33static const Double_t mm  = 1.;
     34static const Double_t m = 1000.*mm;
     35static const Double_t ns  = 1.;
     36static const Double_t s = 1.e+9 *ns;
     37static const Double_t c_light   = 2.99792458e+8 * m/s;
    4438
    4539//------------------------------------------------------------------------------
     
    9690//------------------------------------------------------------------------------
    9791//
    98 bool VertexSorter::secondDescending (pair<unsigned, double> pair0, pair<unsigned, double> pair1)
     92Bool_t VertexSorter::secondDescending (pair<UInt_t, Double_t> pair0, pair<UInt_t, Double_t> pair1)
    9993{
    10094  return (pair0.second > pair1.second);
    10195}
    102 bool VertexSorter::secondAscending (pair<unsigned, double> pair0, pair<unsigned, double> pair1)
     96Bool_t VertexSorter::secondAscending (pair<UInt_t, Double_t> pair0, pair<UInt_t, Double_t> pair1)
    10397{
    10498  return (pair0.second < pair1.second);
     
    108102{
    109103  Candidate *candidate, *jetCandidate, *beamSpotCandidate;
    110   unordered_map<int, unsigned> clusterIDToIndex;
    111   unordered_map<int, double> clusterIDToSumPT2;
    112   vector<pair<int, double> > sortedClusterIDs;
    113 
    114   for (int iCluster = 0; iCluster < fInputArray->GetEntries (); iCluster++)
     104  unordered_map<Int_t, UInt_t> clusterIDToIndex;
     105  unordered_map<Int_t, Double_t> clusterIDToSumPT2;
     106  vector<pair<Int_t, Double_t> > sortedClusterIDs;
     107
     108  for (Int_t iCluster = 0; iCluster < fInputArray->GetEntries (); iCluster++)
    115109    {
    116110      const Candidate &cluster = *((Candidate *) fInputArray->At (iCluster));
     
    135129            continue;
    136130          TLorentzVector p (candidate->Momentum.Px (), candidate->Momentum.Py (), candidate->Momentum.Pz (), candidate->Momentum.E ());
    137           bool isInJet = false;
     131          Bool_t isInJet = false;
    138132
    139133          fItJetInputArray->Reset();
     
    173167
    174168      beamSpotCandidate = (Candidate *) fBeamSpotInputArray->At (0);
    175       for (int iCluster = 0; iCluster < fInputArray->GetEntries (); iCluster++)
     169      for (Int_t iCluster = 0; iCluster < fInputArray->GetEntries (); iCluster++)
    176170        {
    177171          const Candidate &cluster = *((Candidate *) fInputArray->At (iCluster));
Note: See TracChangeset for help on using the changeset viewer.