Fork me on GitHub

Changeset 1d9974e in git


Ignore:
Timestamp:
Jun 17, 2015, 5:13:16 PM (9 years ago)
Author:
Pavel Demin <pavel.demin@…>
Branches:
ImprovedOutputFile, Timing, dual_readout, llp, master
Children:
d38348d
Parents:
a446115
Message:

fix default input arrays

Location:
modules
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • modules/JetFlavorAssociation.cc

    ra446115 r1d9974e  
    8787//------------------------------------------------------------------------------
    8888
    89 class PartonClassifierLHEF: public ExRootClassifier
     89class ParticleLHEFClassifier: public ExRootClassifier
    9090{
    9191public:
    9292
    93   PartonClassifierLHEF() {}
     93  ParticleLHEFClassifier() {}
    9494  Int_t GetCategory(TObject *object);
    9595  Double_t fEtaMax, fPTMin;
    9696};
    9797
    98 Int_t PartonClassifierLHEF::GetCategory(TObject *object)
     98Int_t ParticleLHEFClassifier::GetCategory(TObject *object)
    9999{
    100100  // select parton in the parton list
    101101
    102   Candidate *parton = static_cast<Candidate *>(object);
    103   const TLorentzVector &momentum = parton->Momentum;
     102  Candidate *particleLHEF = static_cast<Candidate *>(object);
     103  const TLorentzVector &momentum = particleLHEF->Momentum;
    104104  Int_t pdgCode;
    105105
     
    107107  if(momentum.Pt() <= fPTMin || TMath::Abs(momentum.Eta()) > fEtaMax) return -1;
    108108
    109   pdgCode = TMath::Abs(parton->PID);
    110   if(parton->Status == -1) return -1;
     109  pdgCode = TMath::Abs(particleLHEF->PID);
     110  if(particleLHEF->Status == -1) return -1;
    111111  if(pdgCode != 21 && pdgCode > 5) return -1; // not a parton, skip
    112   if(parton->Status != 1) return -1; // if status 3 return
     112  if(particleLHEF->Status != 1) return -1; // if status 3 return
    113113
    114114  return 0;
     
    118118
    119119JetFlavorAssociation::JetFlavorAssociation() :
    120   fClassifier(0), fFilter(0),
    121   fItPartonInputArray(0), fItPartonInputArrayLHEF(0),
    122   fItJetInputArray(0), fItParticleInputArray(0)
    123 {
    124   fClassifier = new PartonClassifier;
    125   fClassifierLHEF = new PartonClassifierLHEF;
     120  fPartonClassifier(0), fPartonFilter(0), fParticleLHEFFilter(0),
     121  fItPartonInputArray(0), fItParticleInputArray(0),
     122  fItParticleLHEFInputArray(0), fItJetInputArray(0)
     123{
     124  fPartonClassifier = new PartonClassifier;
     125  fParticleLHEFClassifier = new ParticleLHEFClassifier;
    126126}
    127127
     
    130130JetFlavorAssociation::~JetFlavorAssociation()
    131131{
    132   if(fClassifier) delete fClassifier;
    133   if(fClassifierLHEF) delete fClassifierLHEF;
     132  if(fPartonClassifier) delete fPartonClassifier;
     133  if(fParticleLHEFClassifier) delete fParticleLHEFClassifier;
    134134}
    135135
     
    142142  fDeltaR = GetDouble("DeltaR", 0.5);
    143143
    144   fClassifier->fPTMin = GetDouble("PartonPTMin", 0.);
    145   fClassifier->fEtaMax = GetDouble("PartonEtaMax",2.5);
    146 
    147   fClassifierLHEF->fPTMin = GetDouble("PartonPTMin", 0.);
    148   fClassifierLHEF->fEtaMax = GetDouble("PartonEtaMax",2.5);
     144  fPartonClassifier->fPTMin = GetDouble("PartonPTMin", 0.0);
     145  fPartonClassifier->fEtaMax = GetDouble("PartonEtaMax", 2.5);
     146
     147  fParticleLHEFClassifier->fPTMin = GetDouble("PartonPTMin", 0.0);
     148  fParticleLHEFClassifier->fEtaMax = GetDouble("PartonEtaMax", 2.5);
    149149
    150150  // import input array(s)
     
    152152  fItPartonInputArray = fPartonInputArray->MakeIterator();
    153153
    154   fPartonInputArrayLHEF = ImportArray(GetString("PartonInputArrayLHEF", "Delphes/partonsLHEF"));
    155   fItPartonInputArrayLHEF = fPartonInputArrayLHEF->MakeIterator();
    156 
    157   fFilter = new ExRootFilter(fPartonInputArray);
    158   fFilterLHEF = new ExRootFilter(fPartonInputArrayLHEF);
     154  fParticleInputArray = ImportArray(GetString("ParticleInputArray", "Delphes/allParticles"));
     155  fItParticleInputArray = fParticleInputArray->MakeIterator();
     156
     157  fParticleLHEFInputArray = ImportArray(GetString("ParticleLHEFInputArray", "Delphes/allParticlesLHEF"));
     158  fItParticleLHEFInputArray = fParticleLHEFInputArray->MakeIterator();
     159
     160  fPartonFilter = new ExRootFilter(fPartonInputArray);
     161  fParticleLHEFFilter = new ExRootFilter(fParticleLHEFInputArray);
    159162
    160163  fJetInputArray = ImportArray(GetString("JetInputArray", "FastJetFinder/jets"));
    161164  fItJetInputArray = fJetInputArray->MakeIterator();
    162 
    163   fParticleInputArray = ImportArray(GetString("ParticleInputArray", "Delphes/allParticles"));
    164   fItParticleInputArray = fParticleInputArray->MakeIterator();
    165 
    166165}
    167166
     
    170169void JetFlavorAssociation::Finish()
    171170{
    172   if(fFilter) delete fFilter;
    173   if(fFilterLHEF) delete fFilterLHEF;
     171  if(fPartonFilter) delete fPartonFilter;
     172  if(fParticleLHEFFilter) delete fParticleLHEFFilter;
    174173
    175174  if(fItJetInputArray) delete fItJetInputArray;
     175  if(fItParticleLHEFInputArray) delete fItParticleLHEFInputArray;
    176176  if(fItParticleInputArray) delete fItParticleInputArray;
    177177  if(fItPartonInputArray) delete fItPartonInputArray;
    178   if(fItPartonInputArrayLHEF) delete fItPartonInputArrayLHEF;
    179178}
    180179
     
    185184  Candidate *jet;
    186185  TObjArray *partonArray;
    187   TObjArray *partonArrayLHEF;
     186  TObjArray *partonLHEFArray;
    188187
    189188  // select quark && gluons
    190   fFilter->Reset();
    191   partonArray = fFilter->GetSubArray(fClassifier, 0); // get the filtered parton array
     189  fPartonFilter->Reset();
     190  partonArray = fPartonFilter->GetSubArray(fPartonClassifier, 0); // get the filtered parton array
    192191
    193192  if(partonArray == 0) return;
    194193  TIter itPartonArray(partonArray);
    195194
    196   fFilterLHEF->Reset();
    197   partonArrayLHEF = fFilterLHEF->GetSubArray(fClassifierLHEF, 0); // get the filtered parton array
    198 
    199   if(partonArrayLHEF == 0) return;
    200   TIter itPartonLHEFArray(partonArrayLHEF);
     195  fParticleLHEFFilter->Reset();
     196  partonLHEFArray = fParticleLHEFFilter->GetSubArray(fParticleLHEFClassifier, 0); // get the filtered parton array
     197
     198  if(partonLHEFArray == 0) return;
     199  TIter itPartonLHEFArray(partonLHEFArray);
    201200
    202201  // loop over all input jets
  • modules/JetFlavorAssociation.h

    ra446115 r1d9974e  
    3737class ExRootFilter;
    3838class PartonClassifier;
    39 class PartonClassifierLHEF;
     39class ParticleLHEFClassifier;
    4040
    4141class JetFlavorAssociation: public DelphesModule
     
    5050  void Finish();
    5151
    52   void GetAlgoFlavor(Candidate *jet, TIter &itPartonArray, TIter &itPartonArrayLHEF);
    53   void GetPhysicsFlavor(Candidate *jet, TIter &itPartonArray, TIter &itPartonArrayLHEF);
     52  void GetAlgoFlavor(Candidate *jet, TIter &itPartonArray, TIter &itPartonLHEFArray);
     53  void GetPhysicsFlavor(Candidate *jet, TIter &itPartonArray, TIter &itPartonLHEFArray);
    5454
    5555private:
    5656
    57   Double_t  fDeltaR;
     57  Double_t fDeltaR;
    5858
    59   PartonClassifier  *fClassifier; //!
    60   PartonClassifierLHEF *fClassifierLHEF; //!
     59  PartonClassifier *fPartonClassifier; //!
     60  ParticleLHEFClassifier *fParticleLHEFClassifier; //!
    6161
    62   ExRootFilter *fFilter;
    63   ExRootFilter *fFilterLHEF;
     62  ExRootFilter *fPartonFilter;
     63  ExRootFilter *fParticleLHEFFilter;
    6464
    6565  TIterator *fItPartonInputArray; //!
    66   TIterator *fItPartonInputArrayLHEF; //!
     66  TIterator *fItParticleInputArray; //!
     67  TIterator *fItParticleLHEFInputArray; //!
    6768  TIterator *fItJetInputArray; //!
    68   TIterator *fItParticleInputArray; //!
    6969
    7070  const TObjArray *fPartonInputArray; //!
    71   const TObjArray *fPartonInputArrayLHEF; //!
     71  const TObjArray *fParticleInputArray; //!
     72  const TObjArray *fParticleLHEFInputArray; //!
    7273  const TObjArray *fJetInputArray; //!
    73   const TObjArray *fParticleInputArray; //!
    7474
    7575  ClassDef(JetFlavorAssociation, 1)
Note: See TracChangeset for help on using the changeset viewer.