Fork me on GitHub

Changeset 3c46e17 in git


Ignore:
Timestamp:
Jun 4, 2016, 8:08:56 PM (9 years ago)
Author:
Michele Selvaggi <michele.selvaggi@…>
Branches:
ImprovedOutputFile, Timing, dual_readout, llp, master
Children:
a9c67b3a
Parents:
3f8df25
Message:

added SumPT2 sorting

Files:
4 edited

Legend:

Unmodified
Added
Removed
  • classes/DelphesClasses.cc

    r3f8df25 r3c46e17  
    4141CompBase *Tower::fgCompare = CompE<Tower>::Instance();
    4242CompBase *HectorHit::fgCompare = CompE<HectorHit>::Instance();
     43CompBase *Vertex::fgCompare = CompSumPT2<Vertex>::Instance();
    4344CompBase *Candidate::fgCompare = CompMomentumPt<Candidate>::Instance();
    4445
  • classes/DelphesClasses.h

    r3f8df25 r3c46e17  
    191191  Double_t GenSumPT2;
    192192
    193   ClassDef(Vertex, 2)
     193  static CompBase *fgCompare; //!
     194  const CompBase *GetCompare() const { return fgCompare; }
     195
     196  ClassDef(Vertex, 3)
    194197};
    195198
     
    651654  void SetFactory(DelphesFactory *factory) { fFactory = factory; }
    652655
    653   ClassDef(Candidate, 4)
     656  ClassDef(Candidate, 5)
    654657};
    655658
  • classes/SortableObject.h

    r3f8df25 r3c46e17  
    156156      return -1;
    157157    else if(t1->ET < t2->ET)
     158      return 1;
     159    else
     160      return 0;
     161  }
     162};
     163
     164//---------------------------------------------------------------------------
     165
     166template <typename T>
     167class CompSumPT2: public CompBase
     168{
     169  CompSumPT2() {}
     170public:
     171  static CompSumPT2 *Instance()
     172  {
     173    static CompSumPT2 single;
     174    return &single;
     175  }
     176
     177  Int_t Compare(const TObject *obj1, const TObject *obj2) const
     178  {
     179    const T *t1 = static_cast<const T*>(obj1);
     180    const T *t2 = static_cast<const T*>(obj2);
     181    if(t1->SumPT2 > t2->SumPT2)
     182      return -1;
     183    else if(t1->SumPT2 < t2->SumPT2)
    158184      return 1;
    159185    else
  • modules/TreeWriter.cc

    r3f8df25 r3c46e17  
    247247  Double_t x, y, z, t, xError, yError, zError, sigma, sumPT2, btvSumPT2, genDeltaZ, genSumPT2;
    248248  UInt_t index, ndf;
     249 
     250  array->Sort();
    249251 
    250252  // loop over all vertices
Note: See TracChangeset for help on using the changeset viewer.