Changeset 1d9974e in git for modules/JetFlavorAssociation.cc
- Timestamp:
- Jun 17, 2015, 5:13:16 PM (9 years ago)
- Branches:
- ImprovedOutputFile, Timing, dual_readout, llp, master
- Children:
- d38348d
- Parents:
- a446115
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
modules/JetFlavorAssociation.cc
ra446115 r1d9974e 87 87 //------------------------------------------------------------------------------ 88 88 89 class Part onClassifierLHEF: public ExRootClassifier89 class ParticleLHEFClassifier: public ExRootClassifier 90 90 { 91 91 public: 92 92 93 Part onClassifierLHEF() {}93 ParticleLHEFClassifier() {} 94 94 Int_t GetCategory(TObject *object); 95 95 Double_t fEtaMax, fPTMin; 96 96 }; 97 97 98 Int_t Part onClassifierLHEF::GetCategory(TObject *object)98 Int_t ParticleLHEFClassifier::GetCategory(TObject *object) 99 99 { 100 100 // select parton in the parton list 101 101 102 Candidate *part on= static_cast<Candidate *>(object);103 const TLorentzVector &momentum = part on->Momentum;102 Candidate *particleLHEF = static_cast<Candidate *>(object); 103 const TLorentzVector &momentum = particleLHEF->Momentum; 104 104 Int_t pdgCode; 105 105 … … 107 107 if(momentum.Pt() <= fPTMin || TMath::Abs(momentum.Eta()) > fEtaMax) return -1; 108 108 109 pdgCode = TMath::Abs(part on->PID);110 if(part on->Status == -1) return -1;109 pdgCode = TMath::Abs(particleLHEF->PID); 110 if(particleLHEF->Status == -1) return -1; 111 111 if(pdgCode != 21 && pdgCode > 5) return -1; // not a parton, skip 112 if(part on->Status != 1) return -1; // if status 3 return112 if(particleLHEF->Status != 1) return -1; // if status 3 return 113 113 114 114 return 0; … … 118 118 119 119 JetFlavorAssociation::JetFlavorAssociation() : 120 f Classifier(0), fFilter(0),121 fItPartonInputArray(0), fItPart onInputArrayLHEF(0),122 fIt JetInputArray(0), fItParticleInputArray(0)123 { 124 f Classifier = new PartonClassifier;125 f ClassifierLHEF = 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; 126 126 } 127 127 … … 130 130 JetFlavorAssociation::~JetFlavorAssociation() 131 131 { 132 if(f Classifier) delete fClassifier;133 if(f ClassifierLHEF) delete fClassifierLHEF;132 if(fPartonClassifier) delete fPartonClassifier; 133 if(fParticleLHEFClassifier) delete fParticleLHEFClassifier; 134 134 } 135 135 … … 142 142 fDeltaR = GetDouble("DeltaR", 0.5); 143 143 144 f Classifier->fPTMin = GetDouble("PartonPTMin", 0.);145 f Classifier->fEtaMax = GetDouble("PartonEtaMax",2.5);146 147 f ClassifierLHEF->fPTMin = GetDouble("PartonPTMin", 0.);148 f ClassifierLHEF->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); 149 149 150 150 // import input array(s) … … 152 152 fItPartonInputArray = fPartonInputArray->MakeIterator(); 153 153 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); 159 162 160 163 fJetInputArray = ImportArray(GetString("JetInputArray", "FastJetFinder/jets")); 161 164 fItJetInputArray = fJetInputArray->MakeIterator(); 162 163 fParticleInputArray = ImportArray(GetString("ParticleInputArray", "Delphes/allParticles"));164 fItParticleInputArray = fParticleInputArray->MakeIterator();165 166 165 } 167 166 … … 170 169 void JetFlavorAssociation::Finish() 171 170 { 172 if(f Filter) delete fFilter;173 if(f FilterLHEF) delete fFilterLHEF;171 if(fPartonFilter) delete fPartonFilter; 172 if(fParticleLHEFFilter) delete fParticleLHEFFilter; 174 173 175 174 if(fItJetInputArray) delete fItJetInputArray; 175 if(fItParticleLHEFInputArray) delete fItParticleLHEFInputArray; 176 176 if(fItParticleInputArray) delete fItParticleInputArray; 177 177 if(fItPartonInputArray) delete fItPartonInputArray; 178 if(fItPartonInputArrayLHEF) delete fItPartonInputArrayLHEF;179 178 } 180 179 … … 185 184 Candidate *jet; 186 185 TObjArray *partonArray; 187 TObjArray *parton ArrayLHEF;186 TObjArray *partonLHEFArray; 188 187 189 188 // select quark && gluons 190 f Filter->Reset();191 partonArray = f Filter->GetSubArray(fClassifier, 0); // get the filtered parton array189 fPartonFilter->Reset(); 190 partonArray = fPartonFilter->GetSubArray(fPartonClassifier, 0); // get the filtered parton array 192 191 193 192 if(partonArray == 0) return; 194 193 TIter itPartonArray(partonArray); 195 194 196 f FilterLHEF->Reset();197 parton ArrayLHEF = fFilterLHEF->GetSubArray(fClassifierLHEF, 0); // get the filtered parton array198 199 if(parton ArrayLHEF== 0) return;200 TIter itPartonLHEFArray(parton ArrayLHEF);195 fParticleLHEFFilter->Reset(); 196 partonLHEFArray = fParticleLHEFFilter->GetSubArray(fParticleLHEFClassifier, 0); // get the filtered parton array 197 198 if(partonLHEFArray == 0) return; 199 TIter itPartonLHEFArray(partonLHEFArray); 201 200 202 201 // loop over all input jets
Note:
See TracChangeset
for help on using the changeset viewer.