ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/OSUT3Analysis/AnaTools/plugins/OSUAnalysis.cc
Revision: 1.2
Committed: Tue Jan 22 13:50:22 2013 UTC (12 years, 3 months ago) by lantonel
Content type: text/plain
Branch: MAIN
CVS Tags: V01-00-02
Changes since 1.1: +6 -4 lines
Log Message:
took out muons

File Contents

# User Rev Content
1 lantonel 1.1 #include "OSUT3Analysis/AnaTools/plugins/OSUAnalysis.h"
2    
3     OSUAnalysis::OSUAnalysis (const edm::ParameterSet &cfg) :
4     // Retrieve parameters from the configuration file.
5     jets_ (cfg.getParameter<edm::InputTag> ("jets")),
6     muons_ (cfg.getParameter<edm::InputTag> ("muons")),
7     electrons_ (cfg.getParameter<edm::InputTag> ("electrons")),
8     events_ (cfg.getParameter<edm::InputTag> ("events")),
9     taus_ (cfg.getParameter<edm::InputTag> ("taus")),
10     mets_ (cfg.getParameter<edm::InputTag> ("mets")),
11     tracks_ (cfg.getParameter<edm::InputTag> ("tracks")),
12     genjets_ (cfg.getParameter<edm::InputTag> ("genjets")),
13     mcparticles_ (cfg.getParameter<edm::InputTag> ("mcparticles")),
14     primaryvertexs_ (cfg.getParameter<edm::InputTag> ("primaryvertexs")),
15     bxlumis_ (cfg.getParameter<edm::InputTag> ("bxlumis")),
16     photons_ (cfg.getParameter<edm::InputTag> ("photons")),
17     superclusters_ (cfg.getParameter<edm::InputTag> ("superclusters")),
18    
19    
20     channels_ (cfg.getParameter<vector<edm::ParameterSet> >("channels"))
21    
22     {
23     TH1::SetDefaultSumw2 ();
24    
25     // Construct Cutflow Objects. These store the results of cut decisions and
26     // handle filling cut flow histograms.
27     masterCutFlow_ = new CutFlow (fs_);
28     std::vector<TFileDirectory> directories;
29    
30    
31     channel tempChannel;
32     //loop over all channels (event selections)
33     for(uint currentChannel = 0; currentChannel != channels_.size(); currentChannel++){
34    
35     //get name of channel
36     string channelName (channels_.at(currentChannel).getParameter<string>("name"));
37     tempChannel.name = channelName;
38     TString channelLabel = channelName;
39    
40    
41     //create cutFlow for this channel
42     cutFlows_.push_back (new CutFlow (fs_, channelName));
43    
44     //book a directory in the output file with the name of the channel
45     TFileDirectory subDir = fs_->mkdir( channelName );
46     directories.push_back(subDir);
47     std::map<std::string, TH1D*> histoMap;
48     oneDHists_.push_back(histoMap);
49    
50    
51 lantonel 1.2 /* //muon histograms
52 lantonel 1.1 oneDHists_.at(currentChannel)["muonPt"] = directories.at(currentChannel).make<TH1D> ("muonPt",channelLabel+" channel: Muon Transverse Momentum; p_{T} [GeV]", 100, 0, 500);
53     oneDHists_.at(currentChannel)["muonEta"] = directories.at(currentChannel).make<TH1D> ("muonEta",channelLabel+" channel: Muon Eta; #eta", 100, -5, 5);
54     oneDHists_.at(currentChannel)["muonD0"] = directories.at(currentChannel).make<TH1D> ("muonD0",channelLabel+" channel: Muon d_{0}; d_{0} [cm] ", 1000, -1, 1);
55     oneDHists_.at(currentChannel)["muonAbsD0"] = directories.at(currentChannel).make<TH1D> ("muonAbsD0",channelLabel+" channel: Muon d_{0}; |d_{0}| [cm] ", 1000, 0, 1);
56     oneDHists_.at(currentChannel)["muonD0Sig"] = directories.at(currentChannel).make<TH1D> ("muonD0Sig",channelLabel+" channel: Muon d_{0} Significance; d_{0} / #sigma_{d_{0}} ", 1000, -10.0, 10.0);
57     oneDHists_.at(currentChannel)["muonAbsD0Sig"] = directories.at(currentChannel).make<TH1D> ("muonAbsD0Sig",channelLabel+" channel: Muon d_{0} Significance; |d_{0}| / #sigma_{d_{0}} ", 1000, 0, 10.0);
58     oneDHists_.at(currentChannel)["muonIso"] = directories.at(currentChannel).make<TH1D> ("muonIso",channelLabel+" channel: Muon Combined Relative Isolation; rel. iso. ", 1000, 0, 1);
59     oneDHists_.at(currentChannel)["numMuons"] = directories.at(currentChannel).make<TH1D> ("numMuons",channelLabel+" channel: Number of Selected Muons; # muons", 10, 0, 10);
60 lantonel 1.2 */
61 lantonel 1.1
62     //electron histograms
63     oneDHists_.at(currentChannel)["electronPt"] = directories.at(currentChannel).make<TH1D> ("electronPt",channelLabel+" channel: Electron Transverse Momentum; p_{T} [GeV]", 100, 0, 500);
64     oneDHists_.at(currentChannel)["electronEta"] = directories.at(currentChannel).make<TH1D> ("electronEta",channelLabel+" channel: Electron Eta; #eta", 50, -5, 5);
65     oneDHists_.at(currentChannel)["electronD0"] = directories.at(currentChannel).make<TH1D> ("electronD0",channelLabel+" channel: Electron d_{0}; d_{0} [cm] ", 1000, -1, 1);
66     oneDHists_.at(currentChannel)["electronAbsD0"] = directories.at(currentChannel).make<TH1D> ("electronAbsD0",channelLabel+" channel: Electron d_{0}; |d_{0}| [cm] ", 1000, 0, 1);
67     oneDHists_.at(currentChannel)["electronD0Sig"] = directories.at(currentChannel).make<TH1D> ("electronD0Sig",channelLabel+" channel: Electron d_{0} Significance; d_{0} / #sigma_{d_{0}} ", 1000, -10.0, 10.0);
68     oneDHists_.at(currentChannel)["electronAbsD0Sig"] = directories.at(currentChannel).make<TH1D> ("electronAbsD0Sig",channelLabel+" channel: Electron d_{0} Significance; |d_{0}| / #sigma_{d_{0}} ", 1000, 0, 10.0);
69     oneDHists_.at(currentChannel)["electronIso"] = directories.at(currentChannel).make<TH1D> ("electronIso",channelLabel+" channel: Electron Combined Relative Isolation; rel. iso. ", 1000, 0, 1);
70     oneDHists_.at(currentChannel)["electronFbrem"] = directories.at(currentChannel).make<TH1D> ("electronFbrem",channelLabel+" channel: Electron Brem. Energy Fraction; fbrem", 1000, 0, 2);
71     oneDHists_.at(currentChannel)["numElectrons"] = directories.at(currentChannel).make<TH1D> ("numElectrons",channelLabel+" channel: Number of Selected Electrons; # electrons", 10, 0, 10);
72    
73    
74    
75     //get list of cuts for this channel
76     vector<edm::ParameterSet> cuts_ (channels_.at(currentChannel).getParameter<vector<edm::ParameterSet> >("cuts"));
77    
78     vector<string> tempInputCollections;
79    
80    
81     //loop over and parse all cuts
82     for(uint currentCut = 0; currentCut != cuts_.size(); currentCut++){
83    
84     cut tempCut;
85     //store input collection for cut
86     string inputCollection = cuts_.at(currentCut).getParameter<string> ("inputCollection");
87     tempCut.inputCollection = inputCollection;
88    
89     tempInputCollections.push_back(inputCollection);
90     allNecessaryObjects.push_back(inputCollection);
91    
92     //split cut string into parts and store them
93     string cutString = cuts_.at(currentCut).getParameter<string> ("cutString");
94     std::vector<string> cutStringVector = splitString(cutString);
95     tempCut.variable = cutStringVector.at(0);// variable to cut on
96     tempCut.comparativeOperator = cutStringVector.at(1);// comparison to make
97     tempCut.cutValue = atof(cutStringVector.at(2).c_str());// threshold value to pass cut
98    
99     //get number of objects required to pass cut for event to pass
100     string numberRequiredString = cuts_.at(currentCut).getParameter<string> ("numberRequired");
101     std::vector<string> numberRequiredVector = splitString(numberRequiredString);
102    
103     // determine number required if comparison contains "="
104     int numberRequiredInt = atoi(numberRequiredVector.at(1).c_str());
105     if(numberRequiredVector.at(0) == ">") numberRequiredInt++;
106     else if(numberRequiredVector.at(0) == "<") numberRequiredInt--;
107    
108     tempCut.numberRequired = numberRequiredInt;// number of objects required to pass the cut
109     tempCut.eventComparativeOperator = numberRequiredVector.at(0);// comparison to make
110    
111    
112     string tempCutName;
113     if(cuts_.at(currentCut).exists("alias")){
114     tempCutName = cuts_.at(currentCut).getParameter<string> ("alias");
115     }
116     else{
117     //construct string for cutflow table
118     bool plural = numberRequiredInt != 1;
119     string collectionString = plural ? inputCollection : inputCollection.substr(0, inputCollection.size()-1);
120     string cutName = numberRequiredString + " " + collectionString + " with " + cutString;
121     tempCutName = cutName;
122     }
123     tempCut.name = tempCutName;
124    
125    
126     tempChannel.cuts.push_back(tempCut);
127    
128    
129     }//end loop over cuts
130    
131     //make unique vector of all objects that this channel cuts on (so we know to set flags for those)
132     sort( tempInputCollections.begin(), tempInputCollections.end() );
133     tempInputCollections.erase( unique( tempInputCollections.begin(), tempInputCollections.end() ), tempInputCollections.end() );
134     tempChannel.inputCollections = tempInputCollections;
135    
136     channels.push_back(tempChannel);
137     tempChannel.cuts.clear();
138    
139     }//end loop over channels
140    
141    
142     //make unique vector of objects we need to cut on (so we make sure to get them from the event)
143     sort( allNecessaryObjects.begin(), allNecessaryObjects.end() );
144     allNecessaryObjects.erase( unique( allNecessaryObjects.begin(), allNecessaryObjects.end() ), allNecessaryObjects.end() );
145    
146    
147     }
148    
149     OSUAnalysis::~OSUAnalysis ()
150     {
151     // Destroying the CutFlow objects causes the cut flow numbers and time
152     // information to be printed to standard output.
153     for(uint currentChannel = 0; currentChannel != channels_.size(); currentChannel++){
154     delete cutFlows_.at(currentChannel);
155     }
156     }
157    
158     void
159     OSUAnalysis::analyze (const edm::Event &event, const edm::EventSetup &setup)
160     {
161 lantonel 1.2
162 lantonel 1.1 // Retrieve necessary collections from the event.
163     edm::Handle<BNjetCollection> jets;
164     if (std::find(allNecessaryObjects.begin(), allNecessaryObjects.end(), "jets") != allNecessaryObjects.end())
165     event.getByLabel (jets_, jets);
166    
167     edm::Handle<BNmuonCollection> muons;
168     if (std::find(allNecessaryObjects.begin(), allNecessaryObjects.end(), "muons") != allNecessaryObjects.end())
169     event.getByLabel (muons_, muons);
170    
171     edm::Handle<BNelectronCollection> electrons;
172     if (std::find(allNecessaryObjects.begin(), allNecessaryObjects.end(), "electrons") != allNecessaryObjects.end())
173     event.getByLabel (electrons_, electrons);
174    
175     edm::Handle<BNeventCollection> events;
176     if (std::find(allNecessaryObjects.begin(), allNecessaryObjects.end(), "events") != allNecessaryObjects.end())
177     event.getByLabel (events_, events);
178    
179     edm::Handle<BNtauCollection> taus;
180     if (std::find(allNecessaryObjects.begin(), allNecessaryObjects.end(), "taus") != allNecessaryObjects.end())
181     event.getByLabel (taus_, taus);
182    
183     edm::Handle<BNmetCollection> mets;
184     if (std::find(allNecessaryObjects.begin(), allNecessaryObjects.end(), "mets") != allNecessaryObjects.end())
185     event.getByLabel (mets_, mets);
186    
187     edm::Handle<BNtrackCollection> tracks;
188     if (std::find(allNecessaryObjects.begin(), allNecessaryObjects.end(), "tracks") != allNecessaryObjects.end())
189     event.getByLabel (tracks_, tracks);
190    
191     edm::Handle<BNgenjetCollection> genjets;
192     if (std::find(allNecessaryObjects.begin(), allNecessaryObjects.end(), "genjets") != allNecessaryObjects.end())
193     event.getByLabel (genjets_, genjets);
194    
195     edm::Handle<BNmcparticleCollection> mcparticles;
196     if (std::find(allNecessaryObjects.begin(), allNecessaryObjects.end(), "mcparticles") != allNecessaryObjects.end())
197     event.getByLabel (mcparticles_, mcparticles);
198    
199     edm::Handle<BNprimaryvertexCollection> primaryvertexs;
200     if (std::find(allNecessaryObjects.begin(), allNecessaryObjects.end(), "primaryvertexs") != allNecessaryObjects.end())
201     event.getByLabel (primaryvertexs_, primaryvertexs);
202    
203     edm::Handle<BNbxlumiCollection> bxlumis;
204     if (std::find(allNecessaryObjects.begin(), allNecessaryObjects.end(), "bxlumis") != allNecessaryObjects.end())
205     event.getByLabel (bxlumis_, bxlumis);
206    
207     edm::Handle<BNphotonCollection> photons;
208     if (std::find(allNecessaryObjects.begin(), allNecessaryObjects.end(), "photons") != allNecessaryObjects.end())
209     event.getByLabel (photons_, photons);
210    
211     edm::Handle<BNsuperclusterCollection> superclusters;
212     if (std::find(allNecessaryObjects.begin(), allNecessaryObjects.end(), "superclusters") != allNecessaryObjects.end())
213     event.getByLabel (superclusters_, superclusters);
214    
215    
216     //loop over all channels
217    
218     for(uint currentChannelIndex = 0; currentChannelIndex != channels.size(); currentChannelIndex++){
219     channel currentChannel = channels.at(currentChannelIndex);
220    
221     flagMap individualFlags;
222     flagMap cumulativeFlags;
223     counterMap passingCounter;
224    
225    
226    
227    
228     //loop over all cuts
229     for(uint currentCutIndex = 0; currentCutIndex != currentChannel.cuts.size(); currentCutIndex++){
230     cut currentCut = currentChannel.cuts.at(currentCutIndex);
231    
232     for(uint currentObjectIndex = 0; currentObjectIndex != allNecessaryObjects.size(); currentObjectIndex++){
233    
234     string currentObject = allNecessaryObjects.at(currentObjectIndex);
235     individualFlags[currentObject].push_back (vector<bool> ());
236     cumulativeFlags[currentObject].push_back (vector<bool> ());
237    
238     if(currentObject == "jets") setObjectFlags(currentCut,currentCutIndex,individualFlags,cumulativeFlags,jets.product(),"jets");
239     else if(currentObject == "muons") setObjectFlags(currentCut,currentCutIndex,individualFlags,cumulativeFlags,muons.product(),"muons");
240     else if(currentObject == "electrons") setObjectFlags(currentCut,currentCutIndex,individualFlags,cumulativeFlags,electrons.product(),"electrons");
241     else if(currentObject == "events") setObjectFlags(currentCut,currentCutIndex,individualFlags,cumulativeFlags,events.product(),"events");
242     else if(currentObject == "taus") setObjectFlags(currentCut,currentCutIndex,individualFlags,cumulativeFlags,taus.product(),"taus");
243     else if(currentObject == "mets") setObjectFlags(currentCut,currentCutIndex,individualFlags,cumulativeFlags,mets.product(),"mets");
244     else if(currentObject == "tracks") setObjectFlags(currentCut,currentCutIndex,individualFlags,cumulativeFlags,tracks.product(),"tracks");
245     else if(currentObject == "genjets") setObjectFlags(currentCut,currentCutIndex,individualFlags,cumulativeFlags,genjets.product(),"genjets");
246     else if(currentObject == "mcparticles") setObjectFlags(currentCut,currentCutIndex,individualFlags,cumulativeFlags,mcparticles.product(),"mcparticles");
247     else if(currentObject == "primaryvertexs") setObjectFlags(currentCut,currentCutIndex,individualFlags,cumulativeFlags,primaryvertexs.product(),"primaryvertexs");
248     else if(currentObject == "bxlumis") setObjectFlags(currentCut,currentCutIndex,individualFlags,cumulativeFlags,bxlumis.product(),"bxlumis");
249     else if(currentObject == "photons") setObjectFlags(currentCut,currentCutIndex,individualFlags,cumulativeFlags,photons.product(),"photons");
250     else if(currentObject == "superclusters") setObjectFlags(currentCut,currentCutIndex,individualFlags,cumulativeFlags,superclusters.product(),"superclusters");
251    
252    
253     }
254    
255    
256    
257     }//end loop over all cuts
258    
259    
260    
261 lantonel 1.2
262 lantonel 1.1 //use cumulative flags to apply cuts at event level
263    
264     bool eventPassedAllCuts = true;
265    
266     for(uint currentCutIndex = 0; currentCutIndex != currentChannel.cuts.size(); currentCutIndex++){
267    
268     //loop over all objects and count how many passed the cumulative selection up to this point
269     cut currentCut = currentChannel.cuts.at(currentCutIndex);
270     int numberPassing = 0;
271    
272     for (uint object = 0; object != cumulativeFlags[currentCut.inputCollection].at(currentCutIndex).size() ; object++)
273     if(cumulativeFlags[currentCut.inputCollection].at(currentCutIndex).at(object)) numberPassing++;
274    
275    
276     bool cutDecision = evaluateComparison(numberPassing,currentCut.eventComparativeOperator,currentCut.numberRequired);
277     cutFlows_.at(currentChannelIndex)->at (currentCut.name) = cutDecision;
278    
279     eventPassedAllCuts = eventPassedAllCuts && cutDecision;
280    
281     }
282    
283     cutFlows_.at(currentChannelIndex)->fillCutFlow();
284    
285     string lastCutName = currentChannel.cuts.back().name; //get name of final cut
286    
287    
288    
289    
290    
291     if(!eventPassedAllCuts)continue;
292    
293    
294    
295     vector<bool> electronFlags = cumulativeFlags["electrons"].back();
296     int electronCounter = 0;
297    
298     for (uint electronIndex = 0; electronIndex != electronFlags.size(); electronIndex++){
299     if(!electronFlags.at(electronIndex)) continue;
300    
301    
302     electronCounter++;
303     oneDHists_.at(currentChannelIndex)["electronPt"]->Fill (electrons->at(electronIndex).pt);
304     oneDHists_.at(currentChannelIndex)["electronEta"]->Fill (electrons->at(electronIndex).eta);
305     oneDHists_.at(currentChannelIndex)["electronD0"]->Fill (electrons->at(electronIndex).correctedD0Vertex);
306     oneDHists_.at(currentChannelIndex)["electronAbsD0"]->Fill (fabs(electrons->at(electronIndex).correctedD0Vertex));
307     oneDHists_.at(currentChannelIndex)["electronD0Sig"]->Fill (electrons->at(electronIndex).correctedD0Vertex / electrons->at(electronIndex).tkD0err);
308     oneDHists_.at(currentChannelIndex)["electronAbsD0Sig"]->Fill (fabs(electrons->at(electronIndex).correctedD0Vertex) / electrons->at(electronIndex).tkD0err);
309     oneDHists_.at(currentChannelIndex)["electronIso"]->Fill (((electrons->at(electronIndex).trackIso + electrons->at(electronIndex).caloIso) / electrons->at(electronIndex).pt));
310     oneDHists_.at(currentChannelIndex)["electronFbrem"]->Fill (electrons->at(electronIndex).fbrem);
311     }
312     oneDHists_.at(currentChannelIndex)["numElectrons"]->Fill (electronCounter);
313    
314    
315 lantonel 1.2 /* vector<bool> muonFlags = cumulativeFlags["muons"].back();
316 lantonel 1.1 int muonCounter = 0;
317    
318    
319     for (uint muonIndex = 0; muonIndex != muonFlags.size(); muonIndex++){
320     if(!muonFlags.at(muonIndex)) continue;
321     muonCounter++;
322    
323     oneDHists_.at(currentChannelIndex)["muonPt"]->Fill (muons->at(muonIndex).pt);
324     oneDHists_.at(currentChannelIndex)["muonEta"]->Fill (muons->at(muonIndex).eta);
325     oneDHists_.at(currentChannelIndex)["muonD0"]->Fill (muons->at(muonIndex).correctedD0Vertex);
326     oneDHists_.at(currentChannelIndex)["muonAbsD0"]->Fill (fabs(muons->at(muonIndex).correctedD0Vertex));
327     oneDHists_.at(currentChannelIndex)["muonD0Sig"]->Fill (muons->at(muonIndex).correctedD0Vertex / muons->at(muonIndex).tkD0err);
328     oneDHists_.at(currentChannelIndex)["muonAbsD0Sig"]->Fill (fabs(muons->at(muonIndex).correctedD0Vertex) / muons->at(muonIndex).tkD0err);
329     oneDHists_.at(currentChannelIndex)["muonIso"]->Fill (((muons->at(muonIndex).trackIso + muons->at(muonIndex).caloIso) / muons->at(muonIndex).pt));
330     }
331     oneDHists_.at(currentChannelIndex)["numMuons"]->Fill (muonCounter);
332 lantonel 1.2 */
333 lantonel 1.1
334    
335    
336    
337     } //end loop over channel
338    
339     masterCutFlow_->fillCutFlow();
340    
341    
342     }
343    
344    
345     bool
346     OSUAnalysis::evaluateComparison (double testValue, string comparison, double cutValue){
347    
348     if(comparison == ">") return testValue > cutValue;
349     else if(comparison == ">=") return testValue >= cutValue;
350     else if(comparison == "<") return testValue < cutValue;
351     else if(comparison == "<=") return testValue <= cutValue;
352     else {std::cout << "WARNING: invalid comparison operator '" << comparison << "'\n"; return false;}
353    
354     }
355    
356     std::vector<std::string>
357     OSUAnalysis::splitString (string inputString){
358    
359     std::stringstream stringStream(inputString);
360     std::istream_iterator<std::string> begin(stringStream);
361     std::istream_iterator<std::string> end;
362     std::vector<std::string> stringVector(begin, end);
363     return stringVector;
364    
365     }
366    
367     double
368     OSUAnalysis::valueLookup (const BNjet* object, string variable){
369    
370     double value = 0.0;
371     if(variable == "energy") value = object->energy;
372     else if(variable == "et") value = object->et;
373     else if(variable == "pt") value = object->pt;
374     else if(variable == "px") value = object->px;
375     else if(variable == "py") value = object->py;
376     else if(variable == "pz") value = object->pz;
377     else if(variable == "phi") value = object->phi;
378     else if(variable == "eta") value = object->eta;
379     else if(variable == "theta") value = object->theta;
380     else if(variable == "Upt") value = object->Upt;
381     else if(variable == "Uenergy") value = object->Uenergy;
382     else if(variable == "L2pt") value = object->L2pt;
383     else if(variable == "L2L3pt") value = object->L2L3pt;
384     else if(variable == "L2L3respt") value = object->L2L3respt;
385     else if(variable == "respt") value = object->respt;
386     else if(variable == "EMfrac") value = object->EMfrac;
387     else if(variable == "Hadfrac") value = object->Hadfrac;
388     else if(variable == "charge") value = object->charge;
389     else if(variable == "mass") value = object->mass;
390     else if(variable == "area") value = object->area;
391     else if(variable == "fHPD") value = object->fHPD;
392     else if(variable == "approximatefHPD") value = object->approximatefHPD;
393     else if(variable == "genPartonET") value = object->genPartonET;
394     else if(variable == "genPartonPT") value = object->genPartonPT;
395     else if(variable == "genPartonEta") value = object->genPartonEta;
396     else if(variable == "genPartonPhi") value = object->genPartonPhi;
397     else if(variable == "genJetET") value = object->genJetET;
398     else if(variable == "genJetPT") value = object->genJetPT;
399     else if(variable == "genJetEta") value = object->genJetEta;
400     else if(variable == "genJetPhi") value = object->genJetPhi;
401     else if(variable == "btagTChighPur") value = object->btagTChighPur;
402     else if(variable == "btagTChighEff") value = object->btagTChighEff;
403     else if(variable == "btagJetProb") value = object->btagJetProb;
404     else if(variable == "btagJetBProb") value = object->btagJetBProb;
405     else if(variable == "btagSoftEle") value = object->btagSoftEle;
406     else if(variable == "btagSoftMuon") value = object->btagSoftMuon;
407     else if(variable == "btagSoftMuonNoIP") value = object->btagSoftMuonNoIP;
408     else if(variable == "btagSecVertex") value = object->btagSecVertex;
409     else if(variable == "btagSecVertexHighEff") value = object->btagSecVertexHighEff;
410     else if(variable == "btagSecVertexHighPur") value = object->btagSecVertexHighPur;
411     else if(variable == "btagCombinedSecVertex") value = object->btagCombinedSecVertex;
412     else if(variable == "btagCombinedSecVertexMVA") value = object->btagCombinedSecVertexMVA;
413     else if(variable == "btagSoftMuonByPt") value = object->btagSoftMuonByPt;
414     else if(variable == "btagSoftMuonByIP3") value = object->btagSoftMuonByIP3;
415     else if(variable == "btagSoftElectronByPt") value = object->btagSoftElectronByPt;
416     else if(variable == "btagSoftElectronByIP3") value = object->btagSoftElectronByIP3;
417     else if(variable == "n90Hits") value = object->n90Hits;
418     else if(variable == "hitsInN90") value = object->hitsInN90;
419     else if(variable == "chargedHadronEnergyFraction") value = object->chargedHadronEnergyFraction;
420     else if(variable == "neutralHadronEnergyFraction") value = object->neutralHadronEnergyFraction;
421     else if(variable == "chargedEmEnergyFraction") value = object->chargedEmEnergyFraction;
422     else if(variable == "neutralEmEnergyFraction") value = object->neutralEmEnergyFraction;
423     else if(variable == "fLong") value = object->fLong;
424     else if(variable == "fShort") value = object->fShort;
425     else if(variable == "etaetaMoment") value = object->etaetaMoment;
426     else if(variable == "phiphiMoment") value = object->phiphiMoment;
427     else if(variable == "JESunc") value = object->JESunc;
428     else if(variable == "JECuncUp") value = object->JECuncUp;
429     else if(variable == "JECuncDown") value = object->JECuncDown;
430     else if(variable == "puJetMVA_full") value = object->puJetMVA_full;
431     else if(variable == "puJetMVA_simple") value = object->puJetMVA_simple;
432     else if(variable == "puJetMVA_cutbased") value = object->puJetMVA_cutbased;
433     else if(variable == "dZ") value = object->dZ;
434     else if(variable == "dR2Mean") value = object->dR2Mean;
435     else if(variable == "dRMean") value = object->dRMean;
436     else if(variable == "frac01") value = object->frac01;
437     else if(variable == "frac02") value = object->frac02;
438     else if(variable == "frac03") value = object->frac03;
439     else if(variable == "frac04") value = object->frac04;
440     else if(variable == "frac05") value = object->frac05;
441     else if(variable == "frac06") value = object->frac06;
442     else if(variable == "frac07") value = object->frac07;
443     else if(variable == "beta") value = object->beta;
444     else if(variable == "betaStar") value = object->betaStar;
445     else if(variable == "betaClassic") value = object->betaClassic;
446     else if(variable == "betaStarClassic") value = object->betaStarClassic;
447     else if(variable == "ptD") value = object->ptD;
448     else if(variable == "nvtx") value = object->nvtx;
449     else if(variable == "d0") value = object->d0;
450     else if(variable == "leadCandPt") value = object->leadCandPt;
451     else if(variable == "leadCandVx") value = object->leadCandVx;
452     else if(variable == "leadCandVy") value = object->leadCandVy;
453     else if(variable == "leadCandVz") value = object->leadCandVz;
454     else if(variable == "leadCandDistFromPV") value = object->leadCandDistFromPV;
455     else if(variable == "flavour") value = object->flavour;
456     else if(variable == "Nconst") value = object->Nconst;
457     else if(variable == "jetIDMinimal") value = object->jetIDMinimal;
458     else if(variable == "jetIDLooseAOD") value = object->jetIDLooseAOD;
459     else if(variable == "jetIDLoose") value = object->jetIDLoose;
460     else if(variable == "jetIDTight") value = object->jetIDTight;
461     else if(variable == "genPartonId") value = object->genPartonId;
462     else if(variable == "genPartonMotherId") value = object->genPartonMotherId;
463     else if(variable == "genPartonMother0Id") value = object->genPartonMother0Id;
464     else if(variable == "genPartonMother1Id") value = object->genPartonMother1Id;
465     else if(variable == "genPartonGrandMotherId") value = object->genPartonGrandMotherId;
466     else if(variable == "genPartonGrandMother00Id") value = object->genPartonGrandMother00Id;
467     else if(variable == "genPartonGrandMother01Id") value = object->genPartonGrandMother01Id;
468     else if(variable == "genPartonGrandMother10Id") value = object->genPartonGrandMother10Id;
469     else if(variable == "genPartonGrandMother11Id") value = object->genPartonGrandMother11Id;
470     else if(variable == "chargedMultiplicity") value = object->chargedMultiplicity;
471     else if(variable == "neutralMultiplicity") value = object->neutralMultiplicity;
472     else if(variable == "nconstituents") value = object->nconstituents;
473     else if(variable == "nHit") value = object->nHit;
474     else if(variable == "puJetId_full") value = object->puJetId_full;
475     else if(variable == "puJetId_simple") value = object->puJetId_simple;
476     else if(variable == "puJetId_cutbased") value = object->puJetId_cutbased;
477     else if(variable == "puJetId_tight_full") value = object->puJetId_tight_full;
478     else if(variable == "puJetId_tight_simple") value = object->puJetId_tight_simple;
479     else if(variable == "puJetId_tight_cutbased") value = object->puJetId_tight_cutbased;
480     else if(variable == "puJetId_medium_full") value = object->puJetId_medium_full;
481     else if(variable == "puJetId_medium_simple") value = object->puJetId_medium_simple;
482     else if(variable == "puJetId_medium_cutbased") value = object->puJetId_medium_cutbased;
483     else if(variable == "puJetId_loose_full") value = object->puJetId_loose_full;
484     else if(variable == "puJetId_loose_simple") value = object->puJetId_loose_simple;
485     else if(variable == "puJetId_loose_cutbased") value = object->puJetId_loose_cutbased;
486    
487    
488     else{std::cout << "WARNING: invalid variable '" << variable << "'\n"; value = -999;}
489    
490    
491     return value;
492     }
493    
494    
495    
496     double
497     OSUAnalysis::valueLookup (const BNmuon* object, string variable){
498    
499     double value = 0.0;
500     if(variable == "energy") value = object->energy;
501     else if(variable == "et") value = object->et;
502     else if(variable == "pt") value = object->pt;
503     else if(variable == "px") value = object->px;
504     else if(variable == "py") value = object->py;
505     else if(variable == "pz") value = object->pz;
506     else if(variable == "phi") value = object->phi;
507     else if(variable == "eta") value = object->eta;
508     else if(variable == "theta") value = object->theta;
509     else if(variable == "trackIso") value = object->trackIso;
510     else if(variable == "ecalIso") value = object->ecalIso;
511     else if(variable == "hcalIso") value = object->hcalIso;
512     else if(variable == "caloIso") value = object->caloIso;
513     else if(variable == "trackIsoDR03") value = object->trackIsoDR03;
514     else if(variable == "ecalIsoDR03") value = object->ecalIsoDR03;
515     else if(variable == "hcalIsoDR03") value = object->hcalIsoDR03;
516     else if(variable == "caloIsoDR03") value = object->caloIsoDR03;
517     else if(variable == "trackVetoIsoDR03") value = object->trackVetoIsoDR03;
518     else if(variable == "ecalVetoIsoDR03") value = object->ecalVetoIsoDR03;
519     else if(variable == "hcalVetoIsoDR03") value = object->hcalVetoIsoDR03;
520     else if(variable == "caloVetoIsoDR03") value = object->caloVetoIsoDR03;
521     else if(variable == "trackIsoDR05") value = object->trackIsoDR05;
522     else if(variable == "ecalIsoDR05") value = object->ecalIsoDR05;
523     else if(variable == "hcalIsoDR05") value = object->hcalIsoDR05;
524     else if(variable == "caloIsoDR05") value = object->caloIsoDR05;
525     else if(variable == "trackVetoIsoDR05") value = object->trackVetoIsoDR05;
526     else if(variable == "ecalVetoIsoDR05") value = object->ecalVetoIsoDR05;
527     else if(variable == "hcalVetoIsoDR05") value = object->hcalVetoIsoDR05;
528     else if(variable == "caloVetoIsoDR05") value = object->caloVetoIsoDR05;
529     else if(variable == "hcalE") value = object->hcalE;
530     else if(variable == "ecalE") value = object->ecalE;
531     else if(variable == "genET") value = object->genET;
532     else if(variable == "genPT") value = object->genPT;
533     else if(variable == "genPhi") value = object->genPhi;
534     else if(variable == "genEta") value = object->genEta;
535     else if(variable == "genMotherET") value = object->genMotherET;
536     else if(variable == "genMotherPT") value = object->genMotherPT;
537     else if(variable == "genMotherPhi") value = object->genMotherPhi;
538     else if(variable == "genMotherEta") value = object->genMotherEta;
539     else if(variable == "vx") value = object->vx;
540     else if(variable == "vy") value = object->vy;
541     else if(variable == "vz") value = object->vz;
542     else if(variable == "tkNormChi2") value = object->tkNormChi2;
543     else if(variable == "tkPT") value = object->tkPT;
544     else if(variable == "tkEta") value = object->tkEta;
545     else if(variable == "tkPhi") value = object->tkPhi;
546     else if(variable == "tkDZ") value = object->tkDZ;
547     else if(variable == "tkD0") value = object->tkD0;
548     else if(variable == "tkD0bs") value = object->tkD0bs;
549     else if(variable == "tkD0err") value = object->tkD0err;
550     else if(variable == "samNormChi2") value = object->samNormChi2;
551     else if(variable == "samPT") value = object->samPT;
552     else if(variable == "samEta") value = object->samEta;
553     else if(variable == "samPhi") value = object->samPhi;
554     else if(variable == "samDZ") value = object->samDZ;
555     else if(variable == "samD0") value = object->samD0;
556     else if(variable == "samD0bs") value = object->samD0bs;
557     else if(variable == "samD0err") value = object->samD0err;
558     else if(variable == "comNormChi2") value = object->comNormChi2;
559     else if(variable == "comPT") value = object->comPT;
560     else if(variable == "comEta") value = object->comEta;
561     else if(variable == "comPhi") value = object->comPhi;
562     else if(variable == "comDZ") value = object->comDZ;
563     else if(variable == "comD0") value = object->comD0;
564     else if(variable == "comD0bs") value = object->comD0bs;
565     else if(variable == "comD0err") value = object->comD0err;
566     else if(variable == "isolationR03emVetoEt") value = object->isolationR03emVetoEt;
567     else if(variable == "isolationR03hadVetoEt") value = object->isolationR03hadVetoEt;
568     else if(variable == "normalizedChi2") value = object->normalizedChi2;
569     else if(variable == "dVzPVz") value = object->dVzPVz;
570     else if(variable == "dB") value = object->dB;
571     else if(variable == "ptErr") value = object->ptErr;
572     else if(variable == "innerTrackNormChi2") value = object->innerTrackNormChi2;
573     else if(variable == "correctedD0") value = object->correctedD0;
574     else if(variable == "correctedD0Vertex") value = object->correctedD0Vertex;
575     else if(variable == "correctedDZ") value = object->correctedDZ;
576     else if(variable == "particleIso") value = object->particleIso;
577     else if(variable == "chargedHadronIso") value = object->chargedHadronIso;
578     else if(variable == "neutralHadronIso") value = object->neutralHadronIso;
579     else if(variable == "photonIso") value = object->photonIso;
580     else if(variable == "puChargedHadronIso") value = object->puChargedHadronIso;
581     else if(variable == "chargedHadronIsoDR03") value = object->chargedHadronIsoDR03;
582     else if(variable == "neutralHadronIsoDR03") value = object->neutralHadronIsoDR03;
583     else if(variable == "photonIsoDR03") value = object->photonIsoDR03;
584     else if(variable == "puChargedHadronIsoDR03") value = object->puChargedHadronIsoDR03;
585     else if(variable == "chargedHadronIsoDR04") value = object->chargedHadronIsoDR04;
586     else if(variable == "neutralHadronIsoDR04") value = object->neutralHadronIsoDR04;
587     else if(variable == "photonIsoDR04") value = object->photonIsoDR04;
588     else if(variable == "puChargedHadronIsoDR04") value = object->puChargedHadronIsoDR04;
589     else if(variable == "rhoPrime") value = object->rhoPrime;
590     else if(variable == "AEffDr03") value = object->AEffDr03;
591     else if(variable == "AEffDr04") value = object->AEffDr04;
592     else if(variable == "pfIsoR03SumChargedHadronPt") value = object->pfIsoR03SumChargedHadronPt;
593     else if(variable == "pfIsoR03SumNeutralHadronEt") value = object->pfIsoR03SumNeutralHadronEt;
594     else if(variable == "pfIsoR03SumPhotonEt") value = object->pfIsoR03SumPhotonEt;
595     else if(variable == "pfIsoR03SumPUPt") value = object->pfIsoR03SumPUPt;
596     else if(variable == "pfIsoR04SumChargedHadronPt") value = object->pfIsoR04SumChargedHadronPt;
597     else if(variable == "pfIsoR04SumNeutralHadronEt") value = object->pfIsoR04SumNeutralHadronEt;
598     else if(variable == "pfIsoR04SumPhotonEt") value = object->pfIsoR04SumPhotonEt;
599     else if(variable == "pfIsoR04SumPUPt") value = object->pfIsoR04SumPUPt;
600     else if(variable == "IP") value = object->IP;
601     else if(variable == "IPError") value = object->IPError;
602     else if(variable == "timeAtIpInOut") value = object->timeAtIpInOut;
603     else if(variable == "timeAtIpInOutErr") value = object->timeAtIpInOutErr;
604     else if(variable == "timeAtIpOutIn") value = object->timeAtIpOutIn;
605     else if(variable == "timeAtIpOutInErr") value = object->timeAtIpOutInErr;
606     else if(variable == "ecal_time") value = object->ecal_time;
607     else if(variable == "hcal_time") value = object->hcal_time;
608     else if(variable == "ecal_timeError") value = object->ecal_timeError;
609     else if(variable == "hcal_timeError") value = object->hcal_timeError;
610     else if(variable == "energy_ecal") value = object->energy_ecal;
611     else if(variable == "energy_hcal") value = object->energy_hcal;
612     else if(variable == "e3x3_ecal") value = object->e3x3_ecal;
613     else if(variable == "e3x3_hcal") value = object->e3x3_hcal;
614     else if(variable == "energyMax_ecal") value = object->energyMax_ecal;
615     else if(variable == "energyMax_hcal") value = object->energyMax_hcal;
616     else if(variable == "charge") value = object->charge;
617     else if(variable == "IDGMPTight") value = object->IDGMPTight;
618     else if(variable == "tkNumValidHits") value = object->tkNumValidHits;
619     else if(variable == "tkCharge") value = object->tkCharge;
620     else if(variable == "samNumValidHits") value = object->samNumValidHits;
621     else if(variable == "samCharge") value = object->samCharge;
622     else if(variable == "comNumValidHits") value = object->comNumValidHits;
623     else if(variable == "comCharge") value = object->comCharge;
624     else if(variable == "genId") value = object->genId;
625     else if(variable == "genCharge") value = object->genCharge;
626     else if(variable == "genNumberOfMothers") value = object->genNumberOfMothers;
627     else if(variable == "genMotherId") value = object->genMotherId;
628     else if(variable == "genMotherCharge") value = object->genMotherCharge;
629     else if(variable == "genMother0Id") value = object->genMother0Id;
630     else if(variable == "genMother1Id") value = object->genMother1Id;
631     else if(variable == "genGrandMother00Id") value = object->genGrandMother00Id;
632     else if(variable == "genGrandMother01Id") value = object->genGrandMother01Id;
633     else if(variable == "genGrandMother10Id") value = object->genGrandMother10Id;
634     else if(variable == "genGrandMother11Id") value = object->genGrandMother11Id;
635     else if(variable == "isPFMuon") value = object->isPFMuon;
636     else if(variable == "isGoodMuon_1StationTight") value = object->isGoodMuon_1StationTight;
637     else if(variable == "isGlobalMuon") value = object->isGlobalMuon;
638     else if(variable == "isTrackerMuon") value = object->isTrackerMuon;
639     else if(variable == "isStandAloneMuon") value = object->isStandAloneMuon;
640     else if(variable == "isGlobalMuonPromptTight") value = object->isGlobalMuonPromptTight;
641     else if(variable == "numberOfValidMuonHits") value = object->numberOfValidMuonHits;
642     else if(variable == "numberOfValidTrackerHits") value = object->numberOfValidTrackerHits;
643     else if(variable == "numberOfLayersWithMeasurement") value = object->numberOfLayersWithMeasurement;
644     else if(variable == "pixelLayersWithMeasurement") value = object->pixelLayersWithMeasurement;
645     else if(variable == "numberOfMatches") value = object->numberOfMatches;
646     else if(variable == "numberOfValidTrackerHitsInnerTrack") value = object->numberOfValidTrackerHitsInnerTrack;
647     else if(variable == "numberOfValidPixelHits") value = object->numberOfValidPixelHits;
648     else if(variable == "numberOfMatchedStations") value = object->numberOfMatchedStations;
649     else if(variable == "time_ndof") value = object->time_ndof;
650    
651     else{std::cout << "WARNING: invalid variable '" << variable << "'\n"; value = -999;}
652    
653    
654     return value;
655     }
656    
657    
658     double
659     OSUAnalysis::valueLookup (const BNelectron* object, string variable){
660    
661     double value = 0.0;
662     if(variable == "energy") value = object->energy;
663     else if(variable == "et") value = object->et;
664     else if(variable == "gsfEt") value = object->gsfEt;
665     else if(variable == "pt") value = object->pt;
666     else if(variable == "px") value = object->px;
667     else if(variable == "py") value = object->py;
668     else if(variable == "pz") value = object->pz;
669     else if(variable == "phi") value = object->phi;
670     else if(variable == "eta") value = object->eta;
671     else if(variable == "theta") value = object->theta;
672     else if(variable == "pIn") value = object->pIn;
673     else if(variable == "pOut") value = object->pOut;
674     else if(variable == "EscOverPin") value = object->EscOverPin;
675     else if(variable == "EseedOverPout") value = object->EseedOverPout;
676     else if(variable == "hadOverEm") value = object->hadOverEm;
677     else if(variable == "trackIso") value = object->trackIso;
678     else if(variable == "ecalIso") value = object->ecalIso;
679     else if(variable == "hcalIso") value = object->hcalIso;
680     else if(variable == "caloIso") value = object->caloIso;
681     else if(variable == "trackIsoDR03") value = object->trackIsoDR03;
682     else if(variable == "ecalIsoDR03") value = object->ecalIsoDR03;
683     else if(variable == "hcalIsoDR03") value = object->hcalIsoDR03;
684     else if(variable == "hcalIsoDR03depth1") value = object->hcalIsoDR03depth1;
685     else if(variable == "hcalIsoDR03depth2") value = object->hcalIsoDR03depth2;
686     else if(variable == "caloIsoDR03") value = object->caloIsoDR03;
687     else if(variable == "trackIsoDR04") value = object->trackIsoDR04;
688     else if(variable == "ecalIsoDR04") value = object->ecalIsoDR04;
689     else if(variable == "hcalIsoDR04") value = object->hcalIsoDR04;
690     else if(variable == "hcalIsoDR04depth1") value = object->hcalIsoDR04depth1;
691     else if(variable == "hcalIsoDR04depth2") value = object->hcalIsoDR04depth2;
692     else if(variable == "caloIsoDR04") value = object->caloIsoDR04;
693     else if(variable == "fbrem") value = object->fbrem;
694     else if(variable == "absInvEMinusInvPin") value = object->absInvEMinusInvPin;
695     else if(variable == "delPhiIn") value = object->delPhiIn;
696     else if(variable == "delEtaIn") value = object->delEtaIn;
697     else if(variable == "genET") value = object->genET;
698     else if(variable == "genPT") value = object->genPT;
699     else if(variable == "genPhi") value = object->genPhi;
700     else if(variable == "genEta") value = object->genEta;
701     else if(variable == "genMotherET") value = object->genMotherET;
702     else if(variable == "genMotherPT") value = object->genMotherPT;
703     else if(variable == "genMotherPhi") value = object->genMotherPhi;
704     else if(variable == "genMotherEta") value = object->genMotherEta;
705     else if(variable == "vx") value = object->vx;
706     else if(variable == "vy") value = object->vy;
707     else if(variable == "vz") value = object->vz;
708     else if(variable == "scEnergy") value = object->scEnergy;
709     else if(variable == "scRawEnergy") value = object->scRawEnergy;
710     else if(variable == "scSigmaEtaEta") value = object->scSigmaEtaEta;
711     else if(variable == "scSigmaIEtaIEta") value = object->scSigmaIEtaIEta;
712     else if(variable == "scE1x5") value = object->scE1x5;
713     else if(variable == "scE2x5Max") value = object->scE2x5Max;
714     else if(variable == "scE5x5") value = object->scE5x5;
715     else if(variable == "scEt") value = object->scEt;
716     else if(variable == "scEta") value = object->scEta;
717     else if(variable == "scPhi") value = object->scPhi;
718     else if(variable == "scZ") value = object->scZ;
719     else if(variable == "tkNormChi2") value = object->tkNormChi2;
720     else if(variable == "tkPT") value = object->tkPT;
721     else if(variable == "tkEta") value = object->tkEta;
722     else if(variable == "tkPhi") value = object->tkPhi;
723     else if(variable == "tkDZ") value = object->tkDZ;
724     else if(variable == "tkD0") value = object->tkD0;
725     else if(variable == "tkD0bs") value = object->tkD0bs;
726     else if(variable == "tkD0err") value = object->tkD0err;
727     else if(variable == "mva") value = object->mva;
728     else if(variable == "mvaTrigV0") value = object->mvaTrigV0;
729     else if(variable == "mvaNonTrigV0") value = object->mvaNonTrigV0;
730     else if(variable == "dist") value = object->dist;
731     else if(variable == "dcot") value = object->dcot;
732     else if(variable == "convradius") value = object->convradius;
733     else if(variable == "convPointX") value = object->convPointX;
734     else if(variable == "convPointY") value = object->convPointY;
735     else if(variable == "convPointZ") value = object->convPointZ;
736     else if(variable == "eMax") value = object->eMax;
737     else if(variable == "eLeft") value = object->eLeft;
738     else if(variable == "eRight") value = object->eRight;
739     else if(variable == "eTop") value = object->eTop;
740     else if(variable == "eBottom") value = object->eBottom;
741     else if(variable == "e3x3") value = object->e3x3;
742     else if(variable == "swissCross") value = object->swissCross;
743     else if(variable == "seedEnergy") value = object->seedEnergy;
744     else if(variable == "seedTime") value = object->seedTime;
745     else if(variable == "swissCrossNoI85") value = object->swissCrossNoI85;
746     else if(variable == "swissCrossI85") value = object->swissCrossI85;
747     else if(variable == "E2overE9NoI85") value = object->E2overE9NoI85;
748     else if(variable == "E2overE9I85") value = object->E2overE9I85;
749     else if(variable == "correctedD0") value = object->correctedD0;
750     else if(variable == "correctedD0Vertex") value = object->correctedD0Vertex;
751     else if(variable == "correctedDZ") value = object->correctedDZ;
752     else if(variable == "particleIso") value = object->particleIso;
753     else if(variable == "chargedHadronIso") value = object->chargedHadronIso;
754     else if(variable == "neutralHadronIso") value = object->neutralHadronIso;
755     else if(variable == "photonIso") value = object->photonIso;
756     else if(variable == "puChargedHadronIso") value = object->puChargedHadronIso;
757     else if(variable == "chargedHadronIsoDR03") value = object->chargedHadronIsoDR03;
758     else if(variable == "neutralHadronIsoDR03") value = object->neutralHadronIsoDR03;
759     else if(variable == "photonIsoDR03") value = object->photonIsoDR03;
760     else if(variable == "puChargedHadronIsoDR03") value = object->puChargedHadronIsoDR03;
761     else if(variable == "chargedHadronIsoDR04") value = object->chargedHadronIsoDR04;
762     else if(variable == "neutralHadronIsoDR04") value = object->neutralHadronIsoDR04;
763     else if(variable == "photonIsoDR04") value = object->photonIsoDR04;
764     else if(variable == "puChargedHadronIsoDR04") value = object->puChargedHadronIsoDR04;
765     else if(variable == "rhoPrime") value = object->rhoPrime;
766     else if(variable == "AEffDr03") value = object->AEffDr03;
767     else if(variable == "AEffDr04") value = object->AEffDr04;
768     else if(variable == "IP") value = object->IP;
769     else if(variable == "IPError") value = object->IPError;
770     else if(variable == "charge") value = object->charge;
771     else if(variable == "classification") value = object->classification;
772     else if(variable == "genId") value = object->genId;
773     else if(variable == "genCharge") value = object->genCharge;
774     else if(variable == "genNumberOfMothers") value = object->genNumberOfMothers;
775     else if(variable == "genMotherId") value = object->genMotherId;
776     else if(variable == "genMotherCharge") value = object->genMotherCharge;
777     else if(variable == "genMother0Id") value = object->genMother0Id;
778     else if(variable == "genMother1Id") value = object->genMother1Id;
779     else if(variable == "genGrandMother00Id") value = object->genGrandMother00Id;
780     else if(variable == "genGrandMother01Id") value = object->genGrandMother01Id;
781     else if(variable == "genGrandMother10Id") value = object->genGrandMother10Id;
782     else if(variable == "genGrandMother11Id") value = object->genGrandMother11Id;
783     else if(variable == "numClusters") value = object->numClusters;
784     else if(variable == "tkNumValidHits") value = object->tkNumValidHits;
785     else if(variable == "tkCharge") value = object->tkCharge;
786     else if(variable == "gsfCharge") value = object->gsfCharge;
787     else if(variable == "isEB") value = object->isEB;
788     else if(variable == "isEE") value = object->isEE;
789     else if(variable == "isGap") value = object->isGap;
790     else if(variable == "isEBEEGap") value = object->isEBEEGap;
791     else if(variable == "isEBGap") value = object->isEBGap;
792     else if(variable == "isEEGap") value = object->isEEGap;
793     else if(variable == "isEcalDriven") value = object->isEcalDriven;
794     else if(variable == "isTrackerDriven") value = object->isTrackerDriven;
795     else if(variable == "numberOfLostHits") value = object->numberOfLostHits;
796     else if(variable == "numberOfExpectedInnerHits") value = object->numberOfExpectedInnerHits;
797     else if(variable == "numberOfValidPixelHits") value = object->numberOfValidPixelHits;
798     else if(variable == "numberOfValidPixelBarrelHits") value = object->numberOfValidPixelBarrelHits;
799     else if(variable == "numberOfValidPixelEndcapHits") value = object->numberOfValidPixelEndcapHits;
800     else if(variable == "isHEEP") value = object->isHEEP;
801     else if(variable == "isHEEPnoEt") value = object->isHEEPnoEt;
802     else if(variable == "seedRecoFlag") value = object->seedRecoFlag;
803     else if(variable == "eidRobustHighEnergy") value = object->eidRobustHighEnergy;
804     else if(variable == "eidRobustLoose") value = object->eidRobustLoose;
805     else if(variable == "eidRobustTight") value = object->eidRobustTight;
806     else if(variable == "eidLoose") value = object->eidLoose;
807     else if(variable == "eidTight") value = object->eidTight;
808     else if(variable == "eidVeryLooseMC") value = object->eidVeryLooseMC;
809     else if(variable == "eidLooseMC") value = object->eidLooseMC;
810     else if(variable == "eidMediumMC") value = object->eidMediumMC;
811     else if(variable == "eidTightMC") value = object->eidTightMC;
812     else if(variable == "eidSuperTightMC") value = object->eidSuperTightMC;
813     else if(variable == "eidHyperTight1MC") value = object->eidHyperTight1MC;
814     else if(variable == "eidHyperTight2MC") value = object->eidHyperTight2MC;
815     else if(variable == "eidHyperTight3MC") value = object->eidHyperTight3MC;
816     else if(variable == "eidHyperTight4MC") value = object->eidHyperTight4MC;
817     else if(variable == "passConvVeto") value = object->passConvVeto;
818    
819    
820     else{std::cout << "WARNING: invalid variable '" << variable << "'\n"; value = -999;}
821    
822    
823     return value;
824     }
825    
826    
827     double
828     OSUAnalysis::valueLookup (const BNevent* object, string variable){
829    
830     double value = 0.0;
831    
832     if(variable == "weight") value = object->weight;
833     else if(variable == "pthat") value = object->pthat;
834     else if(variable == "qScale") value = object->qScale;
835     else if(variable == "alphaQCD") value = object->alphaQCD;
836     else if(variable == "alphaQED") value = object->alphaQED;
837     else if(variable == "scalePDF") value = object->scalePDF;
838     else if(variable == "x1") value = object->x1;
839     else if(variable == "x2") value = object->x2;
840     else if(variable == "xPDF1") value = object->xPDF1;
841     else if(variable == "xPDF2") value = object->xPDF2;
842     else if(variable == "BSx") value = object->BSx;
843     else if(variable == "BSy") value = object->BSy;
844     else if(variable == "BSz") value = object->BSz;
845     else if(variable == "PVx") value = object->PVx;
846     else if(variable == "PVy") value = object->PVy;
847     else if(variable == "PVz") value = object->PVz;
848     else if(variable == "bField") value = object->bField;
849     else if(variable == "instLumi") value = object->instLumi;
850     else if(variable == "bxLumi") value = object->bxLumi;
851     else if(variable == "FilterOutScrapingFraction") value = object->FilterOutScrapingFraction;
852     else if(variable == "sumNVtx") value = object->sumNVtx;
853     else if(variable == "sumTrueNVtx") value = object->sumTrueNVtx;
854     else if(variable == "nm1_true") value = object->nm1_true;
855     else if(variable == "n0_true") value = object->n0_true;
856     else if(variable == "np1_true") value = object->np1_true;
857     else if(variable == "numTruePV") value = object->numTruePV;
858     else if(variable == "Q2ScaleUpWgt") value = object->Q2ScaleUpWgt;
859     else if(variable == "Q2ScaleDownWgt") value = object->Q2ScaleDownWgt;
860     else if(variable == "rho_kt6PFJets") value = object->rho_kt6PFJets;
861     else if(variable == "rho_kt6PFJetsCentralChargedPileUp") value = object->rho_kt6PFJetsCentralChargedPileUp;
862     else if(variable == "rho_kt6PFJetsCentralNeutral") value = object->rho_kt6PFJetsCentralNeutral;
863     else if(variable == "rho_kt6PFJetsCentralNeutralTight") value = object->rho_kt6PFJetsCentralNeutralTight;
864     else if(variable == "run") value = object->run;
865     else if(variable == "lumi") value = object->lumi;
866     else if(variable == "sample") value = object->sample;
867     else if(variable == "numPV") value = object->numPV;
868     else if(variable == "W0decay") value = object->W0decay;
869     else if(variable == "W1decay") value = object->W1decay;
870     else if(variable == "Z0decay") value = object->Z0decay;
871     else if(variable == "Z1decay") value = object->Z1decay;
872     else if(variable == "H0decay") value = object->H0decay;
873     else if(variable == "H1decay") value = object->H1decay;
874     else if(variable == "hcalnoiseLoose") value = object->hcalnoiseLoose;
875     else if(variable == "hcalnoiseTight") value = object->hcalnoiseTight;
876     else if(variable == "GoodVertex") value = object->GoodVertex;
877     else if(variable == "FilterOutScraping") value = object->FilterOutScraping;
878     else if(variable == "HBHENoiseFilter") value = object->HBHENoiseFilter;
879     else if(variable == "CSCLooseHaloId") value = object->CSCLooseHaloId;
880     else if(variable == "CSCTightHaloId") value = object->CSCTightHaloId;
881     else if(variable == "EcalLooseHaloId") value = object->EcalLooseHaloId;
882     else if(variable == "EcalTightHaloId") value = object->EcalTightHaloId;
883     else if(variable == "HcalLooseHaloId") value = object->HcalLooseHaloId;
884     else if(variable == "HcalTightHaloId") value = object->HcalTightHaloId;
885     else if(variable == "GlobalLooseHaloId") value = object->GlobalLooseHaloId;
886     else if(variable == "GlobalTightHaloId") value = object->GlobalTightHaloId;
887     else if(variable == "LooseId") value = object->LooseId;
888     else if(variable == "TightId") value = object->TightId;
889     else if(variable == "numGenPV") value = object->numGenPV;
890     else if(variable == "nm1") value = object->nm1;
891     else if(variable == "n0") value = object->n0;
892     else if(variable == "np1") value = object->np1;
893     else if(variable == "id1") value = object->id1;
894     else if(variable == "id2") value = object->id2;
895     else if(variable == "evt") value = object->evt;
896    
897     else{std::cout << "WARNING: invalid variable '" << variable << "'\n"; value = -999;}
898    
899    
900     return value;
901     }
902    
903     double
904     OSUAnalysis::valueLookup (const BNtau* object, string variable){
905    
906     double value = 0.0;
907    
908     if(variable == "px") value = object->px;
909     else if(variable == "py") value = object->py;
910     else if(variable == "pz") value = object->pz;
911     else if(variable == "energy") value = object->energy;
912     else if(variable == "et") value = object->et;
913     else if(variable == "pt") value = object->pt;
914     else if(variable == "eta") value = object->eta;
915     else if(variable == "phi") value = object->phi;
916     else if(variable == "emFraction") value = object->emFraction;
917     else if(variable == "leadingTrackPt") value = object->leadingTrackPt;
918     else if(variable == "leadingTrackIpVtdxy") value = object->leadingTrackIpVtdxy;
919     else if(variable == "leadingTrackIpVtdz") value = object->leadingTrackIpVtdz;
920     else if(variable == "leadingTrackIpVtdxyError") value = object->leadingTrackIpVtdxyError;
921     else if(variable == "leadingTrackIpVtdzError") value = object->leadingTrackIpVtdzError;
922     else if(variable == "leadingTrackVx") value = object->leadingTrackVx;
923     else if(variable == "leadingTrackVy") value = object->leadingTrackVy;
924     else if(variable == "leadingTrackVz") value = object->leadingTrackVz;
925     else if(variable == "leadingTrackValidHits") value = object->leadingTrackValidHits;
926     else if(variable == "leadingTrackNormChiSqrd") value = object->leadingTrackNormChiSqrd;
927     else if(variable == "numProngs") value = object->numProngs;
928     else if(variable == "numSignalGammas") value = object->numSignalGammas;
929     else if(variable == "numSignalNeutrals") value = object->numSignalNeutrals;
930     else if(variable == "numSignalPiZeros") value = object->numSignalPiZeros;
931     else if(variable == "decayMode") value = object->decayMode;
932     else if(variable == "charge") value = object->charge;
933     else if(variable == "inTheCracks") value = object->inTheCracks;
934     else if(variable == "HPSagainstElectronLoose") value = object->HPSagainstElectronLoose;
935     else if(variable == "HPSagainstElectronMVA") value = object->HPSagainstElectronMVA;
936     else if(variable == "HPSagainstElectronMedium") value = object->HPSagainstElectronMedium;
937     else if(variable == "HPSagainstElectronTight") value = object->HPSagainstElectronTight;
938     else if(variable == "HPSagainstMuonLoose") value = object->HPSagainstMuonLoose;
939     else if(variable == "HPSagainstMuonMedium") value = object->HPSagainstMuonMedium;
940     else if(variable == "HPSagainstMuonTight") value = object->HPSagainstMuonTight;
941     else if(variable == "HPSbyLooseCombinedIsolationDeltaBetaCorr") value = object->HPSbyLooseCombinedIsolationDeltaBetaCorr;
942     else if(variable == "HPSbyMediumCombinedIsolationDeltaBetaCorr") value = object->HPSbyMediumCombinedIsolationDeltaBetaCorr;
943     else if(variable == "HPSbyTightCombinedIsolationDeltaBetaCorr") value = object->HPSbyTightCombinedIsolationDeltaBetaCorr;
944     else if(variable == "HPSbyVLooseCombinedIsolationDeltaBetaCorr") value = object->HPSbyVLooseCombinedIsolationDeltaBetaCorr;
945     else if(variable == "HPSdecayModeFinding") value = object->HPSdecayModeFinding;
946     else if(variable == "leadingTrackValid") value = object->leadingTrackValid;
947    
948    
949     else{std::cout << "WARNING: invalid variable '" << variable << "'\n"; value = -999;}
950    
951    
952     return value;
953     }
954    
955     double
956     OSUAnalysis::valueLookup (const BNmet* object, string variable){
957    
958     double value = 0.0;
959    
960     if(variable == "et") value = object->et;
961     else if(variable == "pt") value = object->pt;
962     else if(variable == "px") value = object->px;
963     else if(variable == "py") value = object->py;
964     else if(variable == "phi") value = object->phi;
965     else if(variable == "Upt") value = object->Upt;
966     else if(variable == "Uphi") value = object->Uphi;
967     else if(variable == "NeutralEMFraction") value = object->NeutralEMFraction;
968     else if(variable == "NeutralHadEtFraction") value = object->NeutralHadEtFraction;
969     else if(variable == "ChargedEMEtFraction") value = object->ChargedEMEtFraction;
970     else if(variable == "ChargedHadEtFraction") value = object->ChargedHadEtFraction;
971     else if(variable == "MuonEtFraction") value = object->MuonEtFraction;
972     else if(variable == "Type6EtFraction") value = object->Type6EtFraction;
973     else if(variable == "Type7EtFraction") value = object->Type7EtFraction;
974     else if(variable == "genPT") value = object->genPT;
975     else if(variable == "genPhi") value = object->genPhi;
976     else if(variable == "muonCorEx") value = object->muonCorEx;
977     else if(variable == "muonCorEy") value = object->muonCorEy;
978     else if(variable == "jet20CorEx") value = object->jet20CorEx;
979     else if(variable == "jet20CorEy") value = object->jet20CorEy;
980     else if(variable == "jet1CorEx") value = object->jet1CorEx;
981     else if(variable == "jet1CorEy") value = object->jet1CorEy;
982     else if(variable == "sumET") value = object->sumET;
983     else if(variable == "corSumET") value = object->corSumET;
984     else if(variable == "mEtSig") value = object->mEtSig;
985     else if(variable == "metSignificance") value = object->metSignificance;
986     else if(variable == "significance") value = object->significance;
987     else if(variable == "sigmaX2") value = object->sigmaX2;
988     else if(variable == "sigmaY2") value = object->sigmaY2;
989     else if(variable == "sigmaXY") value = object->sigmaXY;
990     else if(variable == "sigmaYX") value = object->sigmaYX;
991     else if(variable == "maxEtInEmTowers") value = object->maxEtInEmTowers;
992     else if(variable == "emEtFraction") value = object->emEtFraction;
993     else if(variable == "emEtInEB") value = object->emEtInEB;
994     else if(variable == "emEtInEE") value = object->emEtInEE;
995     else if(variable == "emEtInHF") value = object->emEtInHF;
996     else if(variable == "maxEtInHadTowers") value = object->maxEtInHadTowers;
997     else if(variable == "hadEtFraction") value = object->hadEtFraction;
998     else if(variable == "hadEtInHB") value = object->hadEtInHB;
999     else if(variable == "hadEtInHE") value = object->hadEtInHE;
1000     else if(variable == "hadEtInHF") value = object->hadEtInHF;
1001     else if(variable == "hadEtInHO") value = object->hadEtInHO;
1002     else if(variable == "UDeltaPx") value = object->UDeltaPx;
1003     else if(variable == "UDeltaPy") value = object->UDeltaPy;
1004     else if(variable == "UDeltaP") value = object->UDeltaP;
1005     else if(variable == "Uscale") value = object->Uscale;
1006     else if(variable == "type2corPx") value = object->type2corPx;
1007     else if(variable == "type2corPy") value = object->type2corPy;
1008     else if(variable == "T2pt") value = object->T2pt;
1009     else if(variable == "T2px") value = object->T2px;
1010     else if(variable == "T2py") value = object->T2py;
1011     else if(variable == "T2phi") value = object->T2phi;
1012     else if(variable == "T2sumET") value = object->T2sumET;
1013     else if(variable == "pfT1jet1pt") value = object->pfT1jet1pt;
1014     else if(variable == "pfT1jet1phi") value = object->pfT1jet1phi;
1015     else if(variable == "pfT1jet6pt") value = object->pfT1jet6pt;
1016     else if(variable == "pfT1jet6phi") value = object->pfT1jet6phi;
1017     else if(variable == "pfT1jet10pt") value = object->pfT1jet10pt;
1018     else if(variable == "pfT1jet10phi") value = object->pfT1jet10phi;
1019    
1020     else{std::cout << "WARNING: invalid variable '" << variable << "'\n"; value = -999;}
1021    
1022    
1023     return value;
1024     }
1025    
1026     double
1027     OSUAnalysis::valueLookup (const BNtrack* object, string variable){
1028    
1029     double value = 0.0;
1030    
1031     if(variable == "pt") value = object->pt;
1032     else if(variable == "px") value = object->px;
1033     else if(variable == "py") value = object->py;
1034     else if(variable == "pz") value = object->pz;
1035     else if(variable == "phi") value = object->phi;
1036     else if(variable == "eta") value = object->eta;
1037     else if(variable == "theta") value = object->theta;
1038     else if(variable == "normChi2") value = object->normChi2;
1039     else if(variable == "dZ") value = object->dZ;
1040     else if(variable == "d0") value = object->d0;
1041     else if(variable == "d0err") value = object->d0err;
1042     else if(variable == "vx") value = object->vx;
1043     else if(variable == "vy") value = object->vy;
1044     else if(variable == "vz") value = object->vz;
1045     else if(variable == "charge") value = object->charge;
1046     else if(variable == "numValidHits") value = object->numValidHits;
1047     else if(variable == "isHighPurity") value = object->isHighPurity;
1048    
1049    
1050     else{std::cout << "WARNING: invalid variable '" << variable << "'\n"; value = -999;}
1051    
1052    
1053     return value;
1054     }
1055    
1056     double
1057     OSUAnalysis::valueLookup (const BNgenjet* object, string variable){
1058    
1059     double value = 0.0;
1060    
1061     if(variable == "pt") value = object->pt;
1062     else if(variable == "eta") value = object->eta;
1063     else if(variable == "phi") value = object->phi;
1064     else if(variable == "px") value = object->px;
1065     else if(variable == "py") value = object->py;
1066     else if(variable == "pz") value = object->pz;
1067     else if(variable == "et") value = object->et;
1068     else if(variable == "energy") value = object->energy;
1069     else if(variable == "mass") value = object->mass;
1070     else if(variable == "emEnergy") value = object->emEnergy;
1071     else if(variable == "hadEnergy") value = object->hadEnergy;
1072     else if(variable == "invisibleEnergy") value = object->invisibleEnergy;
1073     else if(variable == "auxiliaryEnergy") value = object->auxiliaryEnergy;
1074     else if(variable == "charge") value = object->charge;
1075    
1076    
1077     else{std::cout << "WARNING: invalid variable '" << variable << "'\n"; value = -999;}
1078    
1079    
1080     return value;
1081     }
1082    
1083     double
1084     OSUAnalysis::valueLookup (const BNmcparticle* object, string variable){
1085    
1086     double value = 0.0;
1087    
1088     if(variable == "energy") value = object->energy;
1089     else if(variable == "et") value = object->et;
1090     else if(variable == "pt") value = object->pt;
1091     else if(variable == "px") value = object->px;
1092     else if(variable == "py") value = object->py;
1093     else if(variable == "pz") value = object->pz;
1094     else if(variable == "phi") value = object->phi;
1095     else if(variable == "eta") value = object->eta;
1096     else if(variable == "theta") value = object->theta;
1097     else if(variable == "mass") value = object->mass;
1098     else if(variable == "vx") value = object->vx;
1099     else if(variable == "vy") value = object->vy;
1100     else if(variable == "vz") value = object->vz;
1101     else if(variable == "motherET") value = object->motherET;
1102     else if(variable == "motherPT") value = object->motherPT;
1103     else if(variable == "motherPhi") value = object->motherPhi;
1104     else if(variable == "motherEta") value = object->motherEta;
1105     else if(variable == "mother0ET") value = object->mother0ET;
1106     else if(variable == "mother0PT") value = object->mother0PT;
1107     else if(variable == "mother0Phi") value = object->mother0Phi;
1108     else if(variable == "mother0Eta") value = object->mother0Eta;
1109     else if(variable == "mother1ET") value = object->mother1ET;
1110     else if(variable == "mother1PT") value = object->mother1PT;
1111     else if(variable == "mother1Phi") value = object->mother1Phi;
1112     else if(variable == "mother1Eta") value = object->mother1Eta;
1113     else if(variable == "daughter0ET") value = object->daughter0ET;
1114     else if(variable == "daughter0PT") value = object->daughter0PT;
1115     else if(variable == "daughter0Phi") value = object->daughter0Phi;
1116     else if(variable == "daughter0Eta") value = object->daughter0Eta;
1117     else if(variable == "daughter1ET") value = object->daughter1ET;
1118     else if(variable == "daughter1PT") value = object->daughter1PT;
1119     else if(variable == "daughter1Phi") value = object->daughter1Phi;
1120     else if(variable == "daughter1Eta") value = object->daughter1Eta;
1121     else if(variable == "grandMotherET") value = object->grandMotherET;
1122     else if(variable == "grandMotherPT") value = object->grandMotherPT;
1123     else if(variable == "grandMotherPhi") value = object->grandMotherPhi;
1124     else if(variable == "grandMotherEta") value = object->grandMotherEta;
1125     else if(variable == "grandMother00ET") value = object->grandMother00ET;
1126     else if(variable == "grandMother00PT") value = object->grandMother00PT;
1127     else if(variable == "grandMother00Phi") value = object->grandMother00Phi;
1128     else if(variable == "grandMother00Eta") value = object->grandMother00Eta;
1129     else if(variable == "grandMother01ET") value = object->grandMother01ET;
1130     else if(variable == "grandMother01PT") value = object->grandMother01PT;
1131     else if(variable == "grandMother01Phi") value = object->grandMother01Phi;
1132     else if(variable == "grandMother01Eta") value = object->grandMother01Eta;
1133     else if(variable == "grandMother10ET") value = object->grandMother10ET;
1134     else if(variable == "grandMother10PT") value = object->grandMother10PT;
1135     else if(variable == "grandMother10Phi") value = object->grandMother10Phi;
1136     else if(variable == "grandMother10Eta") value = object->grandMother10Eta;
1137     else if(variable == "grandMother11ET") value = object->grandMother11ET;
1138     else if(variable == "grandMother11PT") value = object->grandMother11PT;
1139     else if(variable == "grandMother11Phi") value = object->grandMother11Phi;
1140     else if(variable == "grandMother11Eta") value = object->grandMother11Eta;
1141     else if(variable == "charge") value = object->charge;
1142     else if(variable == "id") value = object->id;
1143     else if(variable == "status") value = object->status;
1144     else if(variable == "motherId") value = object->motherId;
1145     else if(variable == "motherCharge") value = object->motherCharge;
1146     else if(variable == "mother0Id") value = object->mother0Id;
1147     else if(variable == "mother0Status") value = object->mother0Status;
1148     else if(variable == "mother0Charge") value = object->mother0Charge;
1149     else if(variable == "mother1Id") value = object->mother1Id;
1150     else if(variable == "mother1Status") value = object->mother1Status;
1151     else if(variable == "mother1Charge") value = object->mother1Charge;
1152     else if(variable == "daughter0Id") value = object->daughter0Id;
1153     else if(variable == "daughter0Status") value = object->daughter0Status;
1154     else if(variable == "daughter0Charge") value = object->daughter0Charge;
1155     else if(variable == "daughter1Id") value = object->daughter1Id;
1156     else if(variable == "daughter1Status") value = object->daughter1Status;
1157     else if(variable == "daughter1Charge") value = object->daughter1Charge;
1158     else if(variable == "grandMotherId") value = object->grandMotherId;
1159     else if(variable == "grandMotherCharge") value = object->grandMotherCharge;
1160     else if(variable == "grandMother00Id") value = object->grandMother00Id;
1161     else if(variable == "grandMother00Status") value = object->grandMother00Status;
1162     else if(variable == "grandMother00Charge") value = object->grandMother00Charge;
1163     else if(variable == "grandMother01Id") value = object->grandMother01Id;
1164     else if(variable == "grandMother01Status") value = object->grandMother01Status;
1165     else if(variable == "grandMother01Charge") value = object->grandMother01Charge;
1166     else if(variable == "grandMother10Id") value = object->grandMother10Id;
1167     else if(variable == "grandMother10Status") value = object->grandMother10Status;
1168     else if(variable == "grandMother10Charge") value = object->grandMother10Charge;
1169     else if(variable == "grandMother11Id") value = object->grandMother11Id;
1170     else if(variable == "grandMother11Status") value = object->grandMother11Status;
1171     else if(variable == "grandMother11Charge") value = object->grandMother11Charge;
1172    
1173     else{std::cout << "WARNING: invalid variable '" << variable << "'\n"; value = -999;}
1174    
1175    
1176     return value;
1177     }
1178    
1179     double
1180     OSUAnalysis::valueLookup (const BNprimaryvertex* object, string variable){
1181    
1182     double value = 0.0;
1183    
1184     if(variable == "x") value = object->x;
1185     else if(variable == "xError") value = object->xError;
1186     else if(variable == "y") value = object->y;
1187     else if(variable == "yError") value = object->yError;
1188     else if(variable == "z") value = object->z;
1189     else if(variable == "zError") value = object->zError;
1190     else if(variable == "rho") value = object->rho;
1191     else if(variable == "normalizedChi2") value = object->normalizedChi2;
1192     else if(variable == "ndof") value = object->ndof;
1193     else if(variable == "isFake") value = object->isFake;
1194     else if(variable == "isValid") value = object->isValid;
1195     else if(variable == "tracksSize") value = object->tracksSize;
1196     else if(variable == "isGood") value = object->isGood;
1197    
1198    
1199     else{std::cout << "WARNING: invalid variable '" << variable << "'\n"; value = -999;}
1200    
1201    
1202     return value;
1203     }
1204    
1205     double
1206     OSUAnalysis::valueLookup (const BNbxlumi* object, string variable){
1207    
1208     double value = 0.0;
1209    
1210     if(variable == "bx_B1_now") value = object->bx_B1_now;
1211     else if(variable == "bx_B2_now") value = object->bx_B2_now;
1212     else if(variable == "bx_LUMI_now") value = object->bx_LUMI_now;
1213    
1214    
1215     else{std::cout << "WARNING: invalid variable '" << variable << "'\n"; value = -999;}
1216    
1217    
1218     return value;
1219     }
1220    
1221     double
1222     OSUAnalysis::valueLookup (const BNphoton* object, string variable){
1223    
1224     double value = 0.0;
1225    
1226     if(variable == "energy") value = object->energy;
1227     else if(variable == "et") value = object->et;
1228     else if(variable == "pt") value = object->pt;
1229     else if(variable == "px") value = object->px;
1230     else if(variable == "py") value = object->py;
1231     else if(variable == "pz") value = object->pz;
1232     else if(variable == "phi") value = object->phi;
1233     else if(variable == "eta") value = object->eta;
1234     else if(variable == "theta") value = object->theta;
1235     else if(variable == "trackIso") value = object->trackIso;
1236     else if(variable == "ecalIso") value = object->ecalIso;
1237     else if(variable == "hcalIso") value = object->hcalIso;
1238     else if(variable == "caloIso") value = object->caloIso;
1239     else if(variable == "trackIsoHollowConeDR03") value = object->trackIsoHollowConeDR03;
1240     else if(variable == "trackIsoSolidConeDR03") value = object->trackIsoSolidConeDR03;
1241     else if(variable == "ecalIsoDR03") value = object->ecalIsoDR03;
1242     else if(variable == "hcalIsoDR03") value = object->hcalIsoDR03;
1243     else if(variable == "caloIsoDR03") value = object->caloIsoDR03;
1244     else if(variable == "trackIsoHollowConeDR04") value = object->trackIsoHollowConeDR04;
1245     else if(variable == "trackIsoSolidConeDR04") value = object->trackIsoSolidConeDR04;
1246     else if(variable == "ecalIsoDR04") value = object->ecalIsoDR04;
1247     else if(variable == "hcalIsoDR04") value = object->hcalIsoDR04;
1248     else if(variable == "caloIsoDR04") value = object->caloIsoDR04;
1249     else if(variable == "hadOverEm") value = object->hadOverEm;
1250     else if(variable == "sigmaEtaEta") value = object->sigmaEtaEta;
1251     else if(variable == "sigmaIetaIeta") value = object->sigmaIetaIeta;
1252     else if(variable == "r9") value = object->r9;
1253     else if(variable == "scEnergy") value = object->scEnergy;
1254     else if(variable == "scRawEnergy") value = object->scRawEnergy;
1255     else if(variable == "scSeedEnergy") value = object->scSeedEnergy;
1256     else if(variable == "scEta") value = object->scEta;
1257     else if(variable == "scPhi") value = object->scPhi;
1258     else if(variable == "scZ") value = object->scZ;
1259     else if(variable == "genET") value = object->genET;
1260     else if(variable == "genPT") value = object->genPT;
1261     else if(variable == "genPhi") value = object->genPhi;
1262     else if(variable == "genEta") value = object->genEta;
1263     else if(variable == "genMotherET") value = object->genMotherET;
1264     else if(variable == "genMotherPT") value = object->genMotherPT;
1265     else if(variable == "genMotherPhi") value = object->genMotherPhi;
1266     else if(variable == "genMotherEta") value = object->genMotherEta;
1267     else if(variable == "eMax") value = object->eMax;
1268     else if(variable == "eLeft") value = object->eLeft;
1269     else if(variable == "eRight") value = object->eRight;
1270     else if(variable == "eTop") value = object->eTop;
1271     else if(variable == "eBottom") value = object->eBottom;
1272     else if(variable == "e3x3") value = object->e3x3;
1273     else if(variable == "swissCross") value = object->swissCross;
1274     else if(variable == "seedEnergy") value = object->seedEnergy;
1275     else if(variable == "seedTime") value = object->seedTime;
1276     else if(variable == "swissCrossNoI85") value = object->swissCrossNoI85;
1277     else if(variable == "swissCrossI85") value = object->swissCrossI85;
1278     else if(variable == "E2overE9NoI85") value = object->E2overE9NoI85;
1279     else if(variable == "E2overE9I85") value = object->E2overE9I85;
1280     else if(variable == "IDTight") value = object->IDTight;
1281     else if(variable == "IDLoose") value = object->IDLoose;
1282     else if(variable == "IDLooseEM") value = object->IDLooseEM;
1283     else if(variable == "genId") value = object->genId;
1284     else if(variable == "genCharge") value = object->genCharge;
1285     else if(variable == "genMotherId") value = object->genMotherId;
1286     else if(variable == "genMotherCharge") value = object->genMotherCharge;
1287     else if(variable == "isEB") value = object->isEB;
1288     else if(variable == "isEE") value = object->isEE;
1289     else if(variable == "isGap") value = object->isGap;
1290     else if(variable == "isEBEEGap") value = object->isEBEEGap;
1291     else if(variable == "isEBGap") value = object->isEBGap;
1292     else if(variable == "isEEGap") value = object->isEEGap;
1293     else if(variable == "hasPixelSeed") value = object->hasPixelSeed;
1294     else if(variable == "seedRecoFlag") value = object->seedRecoFlag;
1295    
1296    
1297     else{std::cout << "WARNING: invalid variable '" << variable << "'\n"; value = -999;}
1298    
1299    
1300     return value;
1301     }
1302    
1303     double
1304     OSUAnalysis::valueLookup (const BNsupercluster* object, string variable){
1305    
1306     double value = 0.0;
1307    
1308     if(variable == "energy") value = object->energy;
1309     else if(variable == "et") value = object->et;
1310     else if(variable == "ex") value = object->ex;
1311     else if(variable == "ey") value = object->ey;
1312     else if(variable == "ez") value = object->ez;
1313     else if(variable == "phi") value = object->phi;
1314     else if(variable == "eta") value = object->eta;
1315     else if(variable == "theta") value = object->theta;
1316    
1317    
1318     else{std::cout << "WARNING: invalid variable '" << variable << "'\n"; value = -999;}
1319    
1320    
1321     return value;
1322     }
1323    
1324    
1325     template <class InputCollection>
1326     void OSUAnalysis::setObjectFlags(cut &currentCut, uint currentCutIndex, flagMap &individualFlags, flagMap &cumulativeFlags, InputCollection inputCollection, string inputType){
1327    
1328    
1329     for (uint object = 0; object != inputCollection->size(); object++){
1330    
1331     bool decision = true;//object passes if this cut doesn't cut on that type of object
1332    
1333     if(currentCut.inputCollection == inputType){
1334    
1335     double value = valueLookup(&inputCollection->at(object), currentCut.variable);
1336    
1337     decision = evaluateComparison(value,currentCut.comparativeOperator,currentCut.cutValue);
1338     }
1339     individualFlags[inputType].at(currentCutIndex).push_back(decision);
1340    
1341    
1342     //set flags for objects that pass each cut AND all the previous cuts
1343     bool previousCumulativeFlag = true;
1344     for(uint previousCutIndex = 0; previousCutIndex != currentCutIndex; previousCutIndex++){
1345     if(previousCumulativeFlag && individualFlags[inputType].at(previousCutIndex).at(object)) previousCumulativeFlag = true;
1346     else{ previousCumulativeFlag = false; break;}
1347     }
1348     cumulativeFlags[inputType].at(currentCutIndex).push_back(previousCumulativeFlag && decision);
1349    
1350     }
1351    
1352     }
1353    
1354    
1355    
1356    
1357    
1358     DEFINE_FWK_MODULE(OSUAnalysis);
1359    
1360