Changeset 1180bc1 in git for modules/BTagging.cc
- Timestamp:
- Jun 30, 2015, 2:38:29 PM (9 years ago)
- Branches:
- ImprovedOutputFile, Timing, dual_readout, llp, master
- Children:
- c627b07
- Parents:
- 6153fb0
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
modules/BTagging.cc
r6153fb0 r1180bc1 34 34 #include "classes/DelphesFormula.h" 35 35 36 #include "ExRootAnalysis/ExRootResult.h"37 #include "ExRootAnalysis/ExRootFilter.h"38 #include "ExRootAnalysis/ExRootClassifier.h"39 40 36 #include "TMath.h" 41 37 #include "TString.h" … … 55 51 //------------------------------------------------------------------------------ 56 52 57 class BTaggingPartonClassifier : public ExRootClassifier 53 BTagging::BTagging() : 54 fItJetInputArray(0) 58 55 { 59 public:60 61 BTaggingPartonClassifier() {}62 63 Int_t GetCategory(TObject *object);64 65 Double_t fEtaMax, fPTMin;66 };67 68 //------------------------------------------------------------------------------69 70 Int_t BTaggingPartonClassifier::GetCategory(TObject *object)71 {72 Candidate *parton = static_cast<Candidate*>(object);73 const TLorentzVector &momentum = parton->Momentum;74 Int_t pdgCode;75 76 if(momentum.Pt() <= fPTMin || TMath::Abs(momentum.Eta()) > fEtaMax) return -1;77 78 pdgCode = TMath::Abs(parton->PID);79 if(pdgCode != 21 && pdgCode > 5) return -1;80 81 return 0;82 }83 84 //------------------------------------------------------------------------------85 86 BTagging::BTagging() :87 fClassifier(0), fFilter(0),88 fItPartonInputArray(0), fItJetInputArray(0)89 {90 fClassifier = new BTaggingPartonClassifier;91 56 } 92 57 … … 95 60 BTagging::~BTagging() 96 61 { 97 if(fClassifier) delete fClassifier;98 62 } 99 63 … … 108 72 109 73 fBitNumber = GetInt("BitNumber", 0); 110 111 fDeltaR = GetDouble("DeltaR", 0.5);112 113 fClassifier->fPTMin = GetDouble("PartonPTMin", 1.0);114 fClassifier->fEtaMax = GetDouble("PartonEtaMax", 2.5);115 74 116 75 // read efficiency formulas … … 139 98 // import input array(s) 140 99 141 fPartonInputArray = ImportArray(GetString("PartonInputArray", "Delphes/partons"));142 fItPartonInputArray = fPartonInputArray->MakeIterator();143 144 fFilter = new ExRootFilter(fPartonInputArray);145 146 100 fJetInputArray = ImportArray(GetString("JetInputArray", "FastJetFinder/jets")); 147 101 fItJetInputArray = fJetInputArray->MakeIterator(); … … 155 109 DelphesFormula *formula; 156 110 157 if(fFilter) delete fFilter;158 111 if(fItJetInputArray) delete fItJetInputArray; 159 if(fItPartonInputArray) delete fItPartonInputArray;160 112 161 113 for(itEfficiencyMap = fEfficiencyMap.begin(); itEfficiencyMap != fEfficiencyMap.end(); ++itEfficiencyMap) … … 172 124 Candidate *jet; 173 125 Double_t pt, eta, phi, e; 174 TObjArray *partonArray;175 126 map< Int_t, DelphesFormula * >::iterator itEfficiencyMap; 176 127 DelphesFormula *formula; 177 178 // select quark and gluons179 fFilter->Reset();180 partonArray = fFilter->GetSubArray(fClassifier, 0);181 182 if(partonArray == 0) return;183 184 TIter itPartonArray(partonArray);185 128 186 129 // loop over all input jets
Note:
See TracChangeset
for help on using the changeset viewer.