3 |
|
// Retrieve parameters from the configuration file. |
4 |
|
jets_ (cfg.getParameter<edm::InputTag> ("jets")), |
5 |
|
muons_ (cfg.getParameter<edm::InputTag> ("muons")), |
6 |
+ |
secMuons_ (cfg.getParameter<edm::InputTag> ("secMuons")), |
7 |
|
electrons_ (cfg.getParameter<edm::InputTag> ("electrons")), |
8 |
|
events_ (cfg.getParameter<edm::InputTag> ("events")), |
9 |
|
taus_ (cfg.getParameter<edm::InputTag> ("taus")), |
39 |
|
printAllTriggers_ (cfg.getParameter<bool> ("printAllTriggers")), |
40 |
|
useTrackCaloRhoCorr_ (cfg.getParameter<bool> ("useTrackCaloRhoCorr")), |
41 |
|
stopCTau_ (cfg.getParameter<vector<double> > ("stopCTau")), |
42 |
< |
GetPlotsAfterEachCut_ (cfg.getParameter<bool> ("GetPlotsAfterEachCut")) |
42 |
> |
GetPlotsAfterEachCut_ (cfg.getParameter<bool> ("GetPlotsAfterEachCut")), |
43 |
> |
verbose_ (cfg.getParameter<int> ("verbose")) |
44 |
|
{ |
45 |
|
|
46 |
< |
TH1::SetDefaultSumw2 (); |
46 |
> |
if (verbose_) printEventInfo_ = true; |
47 |
> |
if (verbose_) clog << "Beginning OSUAnalysis::OSUAnalysis constructor." << endl; |
48 |
> |
|
49 |
> |
TH1::SetDefaultSumw2(); |
50 |
|
|
51 |
|
//create pile-up reweighting object, if necessary |
52 |
|
if(datasetType_ != "data") { |
60 |
|
} |
61 |
|
} |
62 |
|
if (datasetType_ == "signalMC" && regex_match (dataset_, regex ("stop.*to.*_.*mm.*"))) |
63 |
< |
stopCTauWeight_ = new StopCTauWeight (stopCTau_.at (0), stopCTau_.at (1), stops_); |
63 |
> |
stopCTauWeight_ = new StopCTauWeight (stopCTau_.at(0), stopCTau_.at(1), stops_); |
64 |
|
|
65 |
|
|
66 |
|
// Construct Cutflow Objects. These store the results of cut decisions and |
96 |
|
TString newName = TString(br.inputCollection) + "_" + TString(br.inputVariable); |
97 |
|
br.name = string(newName.Data()); |
98 |
|
treeBranches_.push_back(br); |
99 |
+ |
if (verbose_>3) clog << " Adding branch to BNTree: " << br.name << endl; |
100 |
|
} |
101 |
|
|
102 |
|
} // end for (uint iBranchSet = 0; iBranchSet<treeBranchSets_.size(); iBranchSet++) |
127 |
|
if(tempInputCollection == "trigobj-muon pairs") tempInputCollection = "muon-trigobj pairs"; |
128 |
|
if(tempInputCollection.find("pairs")==string::npos){ //just a single object |
129 |
|
if(tempInputCollection.find("secondary")!=string::npos){//secondary object |
130 |
< |
int spaceIndex = tempInputCollection.find(" "); |
131 |
< |
int secondWordLength = tempInputCollection.size() - spaceIndex; |
132 |
< |
objectsToGet.push_back(tempInputCollection.substr(spaceIndex+1,secondWordLength)); |
133 |
< |
} |
134 |
< |
else{ |
130 |
> |
if(tempInputCollection.find("secondary muons")!=string::npos){//treat secondary muons differently; allow for a different input collection |
131 |
> |
objectsToGet.push_back("secondary muons"); |
132 |
> |
} else { |
133 |
> |
int spaceIndex = tempInputCollection.find(" "); |
134 |
> |
int secondWordLength = tempInputCollection.size() - spaceIndex; |
135 |
> |
objectsToGet.push_back(tempInputCollection.substr(spaceIndex+1,secondWordLength)); |
136 |
> |
} |
137 |
> |
} else{ |
138 |
|
objectsToGet.push_back(tempInputCollection); |
139 |
|
} |
140 |
|
objectsToPlot.push_back(tempInputCollection); |
154 |
|
objectsToGet.push_back(obj1); |
155 |
|
objectsToGet.push_back(obj2ToGet); |
156 |
|
} // end else |
157 |
< |
if (find(objectsToPlot.begin(), objectsToPlot.end(), "events") != objectsToPlot.end()) |
158 |
< |
objectsToGet.push_back("jets"); |
159 |
< |
|
160 |
< |
|
157 |
> |
if (find(objectsToPlot.begin(), objectsToPlot.end(), "events") != objectsToPlot.end()) |
158 |
> |
objectsToGet.push_back("jets"); |
159 |
> |
|
160 |
> |
|
161 |
|
vector<edm::ParameterSet> histogramList_ (histogramSets_.at(currentHistogramSet).getParameter<vector<edm::ParameterSet> >("histograms")); |
162 |
|
|
163 |
|
for(uint currentHistogram = 0; currentHistogram != histogramList_.size(); currentHistogram++){ |
174 |
|
tempHistogram.variableBinsY = histogramList_.at(currentHistogram).getUntrackedParameter<vector<double> >("variableBinsY", defaultValue); |
175 |
|
tempHistogram.inputVariables = histogramList_.at(currentHistogram).getParameter<vector<string> >("inputVariables"); |
176 |
|
|
177 |
< |
histograms.push_back(tempHistogram); |
177 |
> |
bool histExists = false; |
178 |
> |
for (uint i=0; i<histograms.size(); i++) { |
179 |
> |
if (histograms.at(i).name == tempHistogram.name) { histExists = true; break; } |
180 |
> |
} |
181 |
> |
if (histExists) { |
182 |
> |
clog << "Warning: histogram " << tempHistogram.name << " already exists; will not book an additional instance." << endl; |
183 |
> |
} else { |
184 |
> |
histograms.push_back(tempHistogram); |
185 |
> |
} |
186 |
|
|
187 |
|
} |
188 |
|
} // for(uint currentHistogramSet = 0; currentHistogramSet != histogramSets_.size(); currentHistogramSet++) |
197 |
|
for(uint currentObjectIndex = 0; currentObjectIndex != objectsToPlot.size(); currentObjectIndex++){ |
198 |
|
|
199 |
|
string currentObject = objectsToPlot.at(currentObjectIndex); |
200 |
< |
if(currentObject != "muons" && currentObject != "secondary muons" && currentObject != "secondary electrons" && currentObject != "electrons" && currentObject != "taus" && currentObject != "tracks" && currentObject != "photons" && currentObject != "secondary photons"&& currentObject != "superclusters") continue; |
200 |
> |
if(currentObject != "muons" && |
201 |
> |
currentObject != "secondary muons" && |
202 |
> |
currentObject != "secondary electrons" && |
203 |
> |
currentObject != "electrons" && |
204 |
> |
currentObject != "taus" && |
205 |
> |
currentObject != "tracks" && |
206 |
> |
currentObject != "photons" && |
207 |
> |
currentObject != "secondary photons"&& |
208 |
> |
currentObject != "superclusters") |
209 |
> |
continue; |
210 |
|
|
211 |
|
histogram tempIdHisto; |
212 |
|
histogram tempMomIdHisto; |
277 |
|
string channelName (channels_.at(currentChannel).getParameter<string>("name")); |
278 |
|
tempChannel.name = channelName; |
279 |
|
TString channelLabel = channelName; |
280 |
+ |
if (verbose_) clog << "Processing channel: " << channelName << endl; |
281 |
|
|
282 |
|
//set triggers for this channel |
283 |
|
vector<string> triggerNames; |
338 |
|
tempCut.inputCollection = tempInputCollection; |
339 |
|
if(tempInputCollection.find("pairs")==string::npos){ //just a single object |
340 |
|
if(tempInputCollection.find("secondary")!=string::npos){//secondary object |
341 |
< |
int spaceIndex = tempInputCollection.find(" "); |
342 |
< |
int secondWordLength = tempInputCollection.size() - spaceIndex; |
343 |
< |
objectsToGet.push_back(tempInputCollection.substr(spaceIndex+1,secondWordLength)); |
341 |
> |
if(tempInputCollection.find("secondary muons")!=string::npos){//treat secondary muons differently; allow for a different input collection |
342 |
> |
objectsToGet.push_back("secondary muons"); |
343 |
> |
} else { |
344 |
> |
int spaceIndex = tempInputCollection.find(" "); |
345 |
> |
int secondWordLength = tempInputCollection.size() - spaceIndex; |
346 |
> |
objectsToGet.push_back(tempInputCollection.substr(spaceIndex+1,secondWordLength)); |
347 |
> |
} |
348 |
|
} |
349 |
|
else{ |
350 |
|
objectsToGet.push_back(tempInputCollection); |
432 |
|
} |
433 |
|
subSubDirNames.push_back(subSubDirName); |
434 |
|
tempCut.name = tempCutName; |
435 |
+ |
if (verbose_) clog << "Setting up cut, index: " << currentCut << ", input collection: " << tempInputCollection<< ", name: " << tempCut.name << endl; |
436 |
|
|
437 |
|
tempChannel.cuts.push_back(tempCut); |
438 |
|
|
473 |
|
for(uint currentDir = 0; !useEDMFormat_ && currentDir != treeDirectories.size(); currentDir++){ |
474 |
|
TTree* newTree = treeDirectories.at(currentDir).make<TTree> (TString("BNTree_"+channelLabel), TString("BNTree_"+channelLabel)); |
475 |
|
BNTrees_.push_back(newTree); |
476 |
+ |
BNTrees_.back()->Branch("event_runInt", &BNTreeBranchVals_runInt_, "event_runInt/I"); |
477 |
+ |
BNTrees_.back()->Branch("event_lumiInt", &BNTreeBranchVals_lumiInt_, "event_lumiInt/I"); |
478 |
+ |
BNTrees_.back()->Branch("event_evtLong", &BNTreeBranchVals_evtLong_, "event_evtLong/L"); |
479 |
|
for (uint iBranch = 0; iBranch < treeBranches_.size(); iBranch++){ |
480 |
|
BranchSpecs currentVar = treeBranches_.at(iBranch); |
481 |
|
vector<float> newVec; |
631 |
|
else if(currentObject == "track-event pairs") currentObject = "trackEventPairs"; |
632 |
|
else if(currentObject == "electron-track pairs") currentObject = "electronTrackPairs"; |
633 |
|
else if(currentObject == "muon-track pairs") currentObject = "muonTrackPairs"; |
634 |
+ |
else if(currentObject == "secondary muon-track pairs") currentObject = "secondaryMuonTrackPairs"; |
635 |
|
else if(currentObject == "muon-tau pairs") currentObject = "muonTauPairs"; |
636 |
|
else if(currentObject == "tau-tau pairs") currentObject = "ditauPairs"; |
637 |
|
else if(currentObject == "tau-track pairs") currentObject = "tauTrackPairs"; |
641 |
|
else if(currentObject == "secondary electrons") currentObject = "secondaryElectrons"; |
642 |
|
else if(currentObject == "electron-trigobj pairs") currentObject = "electronTrigobjPairs"; |
643 |
|
else if(currentObject == "muon-trigobj pairs") currentObject = "muonTrigobjPairs"; |
644 |
+ |
else if(currentObject == "electron-mcparticle pairs") currentObject = "electronMCparticlePairs"; |
645 |
+ |
|
646 |
|
|
647 |
|
currentObject.at(0) = toupper(currentObject.at(0)); |
648 |
|
string histoName = "num" + currentObject; |
656 |
|
else |
657 |
|
oneDHists_.at(currentChannel).at(currentDir)[histoName] = directories.at(currentDir).make<TH1D> (TString(histoName),channelLabel+" channel: Number of Selected "+currentObject+"; # "+currentObject, maxNum, 0, maxNum); |
658 |
|
} |
659 |
+ |
|
660 |
+ |
if (verbose_) { |
661 |
+ |
clog << "List of 1D histograms booked for channel " << channelName << " and directory " << currentDir << ":" << endl; |
662 |
+ |
for(map<string, TH1D*>::iterator |
663 |
+ |
iter = oneDHists_.at(currentChannel).at(currentDir).begin(); |
664 |
+ |
iter != oneDHists_.at(currentChannel).at(currentDir).end(); |
665 |
+ |
iter++) { |
666 |
+ |
clog << " " << iter->first |
667 |
+ |
<< ": name=" << iter->second->GetName() |
668 |
+ |
<< ", title=" << iter->second->GetTitle() |
669 |
+ |
<< ", bins=(" << iter->second->GetNbinsX() |
670 |
+ |
<< "," << iter->second->GetXaxis()->GetXmin() |
671 |
+ |
<< "," << iter->second->GetXaxis()->GetXmax() |
672 |
+ |
<< ")" << endl; |
673 |
+ |
} |
674 |
+ |
clog << "List of 2D histograms booked for channel " << channelName << " and directory " << currentDir << ":" << endl; |
675 |
+ |
for(map<string, TH2D*>::iterator |
676 |
+ |
iter = twoDHists_.at(currentChannel).at(currentDir).begin(); |
677 |
+ |
iter != twoDHists_.at(currentChannel).at(currentDir).end(); |
678 |
+ |
iter++) { |
679 |
+ |
clog << " " << iter->first |
680 |
+ |
<< ": name=" << iter->second->GetName() |
681 |
+ |
<< ", title=" << iter->second->GetTitle() |
682 |
+ |
<< ", binsX=(" << iter->second->GetNbinsX() |
683 |
+ |
<< "," << iter->second->GetXaxis()->GetXmin() |
684 |
+ |
<< "," << iter->second->GetXaxis()->GetXmax() |
685 |
+ |
<< ")" |
686 |
+ |
<< ", binsY=(" << iter->second->GetNbinsY() |
687 |
+ |
<< "," << iter->second->GetYaxis()->GetXmin() |
688 |
+ |
<< "," << iter->second->GetYaxis()->GetXmax() |
689 |
+ |
<< ")" |
690 |
+ |
<< endl; |
691 |
+ |
} |
692 |
+ |
} |
693 |
+ |
|
694 |
|
}//end of loop over directories |
695 |
|
channels.push_back(tempChannel); |
696 |
|
tempChannel.cuts.clear(); |
697 |
|
}//end loop over channels |
698 |
|
|
699 |
|
|
700 |
+ |
// Create the cutflow histogram and fill with 0 weight, in case no events are found in the input file. |
701 |
+ |
for(uint currentChannelIndex = 0; currentChannelIndex != channels.size(); currentChannelIndex++){ |
702 |
+ |
channel currentChannel = channels.at(currentChannelIndex); |
703 |
+ |
if(currentChannel.triggers.size() != 0 || currentChannel.triggersToVeto.size() != 0){ //triggers specified |
704 |
+ |
cutFlows_.at(currentChannelIndex)->at("trigger") = true; |
705 |
+ |
} |
706 |
+ |
for(uint currentCutIndex = 0; currentCutIndex != currentChannel.cuts.size(); currentCutIndex++){ |
707 |
+ |
cut currentCut = currentChannel.cuts.at(currentCutIndex); |
708 |
+ |
cutFlows_.at(currentChannelIndex)->at (currentCut.name) = true; |
709 |
+ |
} |
710 |
+ |
cutFlows_.at(currentChannelIndex)->fillCutFlow(0); // fill cutflow with 0 weight, just to create the cutflow histograms |
711 |
+ |
} |
712 |
+ |
|
713 |
|
//make unique vector of objects we need to get from the event |
714 |
|
sort( objectsToGet.begin(), objectsToGet.end() ); |
715 |
|
objectsToGet.erase( unique( objectsToGet.begin(), objectsToGet.end() ), objectsToGet.end() ); |
720 |
|
sort( objectsToFlag.begin(), objectsToFlag.end() ); |
721 |
|
objectsToFlag.erase( unique( objectsToFlag.begin(), objectsToFlag.end() ), objectsToFlag.end() ); |
722 |
|
|
723 |
+ |
// Move all paired objects to the end of the list, so that the flags for single objects are always set before those of paired objects. |
724 |
+ |
for (uint i=0; i<objectsToFlag.size(); i++) { |
725 |
+ |
if (objectsToFlag.at(i).find("pairs")!=string::npos) { // if it contains "pairs" |
726 |
+ |
objectsToFlag.push_back(objectsToFlag.at(i)); |
727 |
+ |
objectsToFlag.erase(objectsToFlag.begin()+i); |
728 |
+ |
} |
729 |
+ |
} |
730 |
+ |
|
731 |
+ |
if (verbose_) { |
732 |
+ |
clog << "List of channels:" << endl; |
733 |
+ |
for (uint i=0; i<channels.size(); i++) { |
734 |
+ |
clog << " " << channels.at(i).name << endl; |
735 |
+ |
} |
736 |
+ |
clog << "List of objects to get:" << endl; |
737 |
+ |
for (uint i=0; i<objectsToGet.size(); i++) { |
738 |
+ |
clog << " " << objectsToGet.at(i) << endl; |
739 |
+ |
} |
740 |
+ |
clog << "List of objects to plot:" << endl; |
741 |
+ |
for (uint i=0; i<objectsToPlot.size(); i++) { |
742 |
+ |
clog << " " << objectsToPlot.at(i) << endl; |
743 |
+ |
} |
744 |
+ |
clog << "List of objects to cut:" << endl; |
745 |
+ |
for (uint i=0; i<objectsToCut.size(); i++) { |
746 |
+ |
clog << " " << objectsToCut.at(i) << endl; |
747 |
+ |
} |
748 |
+ |
clog << "List of objects to flag:" << endl; |
749 |
+ |
for (uint i=0; i<objectsToFlag.size(); i++) { |
750 |
+ |
clog << " " << objectsToFlag.at(i) << endl; |
751 |
+ |
} |
752 |
+ |
} |
753 |
+ |
|
754 |
|
produces<map<string, bool> > ("channelDecisions"); |
755 |
|
|
756 |
|
if (printEventInfo_) { |
757 |
|
findEventsLog = new ofstream(); |
758 |
|
findEventsLog->open("findEvents.txt"); |
759 |
|
clog << "Listing run:lumi:event in file findEvents.txt for events that pass full selection (of any channel)." << endl; |
760 |
< |
} |
760 |
> |
} else { |
761 |
> |
findEventsLog = 0; |
762 |
> |
} |
763 |
> |
|
764 |
> |
isFirstEvent_ = true; |
765 |
|
|
766 |
< |
} // end constructor OSUAnalysis::OSUAnalysis() |
766 |
> |
if (verbose_) clog << "Finished OSUAnalysis::OSUAnalysis constructor." << endl; |
767 |
> |
|
768 |
> |
|
769 |
> |
} // end constructor OSUAnalysis::OSUAnalysis() |
770 |
|
|
771 |
|
|
772 |
|
OSUAnalysis::~OSUAnalysis () |
773 |
|
{ |
774 |
|
|
775 |
+ |
if (verbose_) clog << "Beginning OSUAnalysis::OSUAnalysis destructor." << endl; |
776 |
+ |
|
777 |
|
// Destroying the CutFlow objects causes the cut flow numbers and time |
778 |
|
// information to be printed to standard output. |
779 |
|
for(uint currentChannel = 0; currentChannel != channels_.size(); currentChannel++){ |
780 |
|
delete cutFlows_.at(currentChannel); |
781 |
|
} |
782 |
|
|
783 |
< |
if (findEventsLog) findEventsLog->close(); |
783 |
> |
if (printEventInfo_ && findEventsLog) findEventsLog->close(); |
784 |
|
|
785 |
|
clog << "=============================================" << endl; |
786 |
|
clog << "Successfully completed OSUAnalysis." << endl; |
787 |
|
clog << "=============================================" << endl; |
788 |
|
|
789 |
+ |
if (verbose_) clog << "Finished OSUAnalysis::OSUAnalysis destructor." << endl; |
790 |
+ |
|
791 |
|
} |
792 |
|
|
793 |
|
void |
795 |
|
{ |
796 |
|
// Retrieve necessary collections from the event. |
797 |
|
|
798 |
< |
if (find(objectsToGet.begin(), objectsToGet.end(), "triggers") != objectsToGet.end()) |
798 |
> |
if (verbose_) clog << "Beginning OSUAnalysis::produce." << endl; |
799 |
> |
|
800 |
> |
if (find(objectsToGet.begin(), objectsToGet.end(), "triggers") != objectsToGet.end()) { |
801 |
|
event.getByLabel (triggers_, triggers); |
802 |
+ |
if (!triggers.product()) clog << "ERROR: could not get triggers input collection" << endl; |
803 |
+ |
} |
804 |
|
|
805 |
< |
if (find(objectsToGet.begin(), objectsToGet.end(), "trigobjs") != objectsToGet.end()) |
805 |
> |
if (find(objectsToGet.begin(), objectsToGet.end(), "trigobjs") != objectsToGet.end()) { |
806 |
|
event.getByLabel (trigobjs_, trigobjs); |
807 |
+ |
if (!trigobjs.product()) clog << "ERROR: could not get trigobjs input collection" << endl; |
808 |
+ |
} |
809 |
|
|
810 |
< |
if (find(objectsToGet.begin(), objectsToGet.end(), "jets") != objectsToGet.end()) |
810 |
> |
if (find(objectsToGet.begin(), objectsToGet.end(), "jets") != objectsToGet.end()) { |
811 |
|
event.getByLabel (jets_, jets); |
812 |
+ |
if (!jets.product()) clog << "ERROR: could not get jets input collection" << endl; |
813 |
+ |
} |
814 |
|
|
815 |
< |
if (find(objectsToGet.begin(), objectsToGet.end(), "muons") != objectsToGet.end()) |
815 |
> |
if (find(objectsToGet.begin(), objectsToGet.end(), "muons") != objectsToGet.end()) { |
816 |
|
event.getByLabel (muons_, muons); |
817 |
+ |
if (!muons.product()) clog << "ERROR: could not get muons input collection" << endl; |
818 |
+ |
} |
819 |
|
|
820 |
< |
if (find(objectsToGet.begin(), objectsToGet.end(), "electrons") != objectsToGet.end()) |
820 |
> |
if (find(objectsToGet.begin(), objectsToGet.end(), "secondary muons") != objectsToGet.end()) { |
821 |
> |
event.getByLabel (secMuons_, secMuons); |
822 |
> |
if (!secMuons.product()) clog << "ERROR: could not get secMuons input collection" << endl; |
823 |
> |
} |
824 |
> |
|
825 |
> |
if (find(objectsToGet.begin(), objectsToGet.end(), "electrons") != objectsToGet.end()) { |
826 |
|
event.getByLabel (electrons_, electrons); |
827 |
+ |
if (!electrons.product()) clog << "ERROR: could not get electrons input collection" << endl; |
828 |
+ |
} |
829 |
|
|
830 |
< |
if (find(objectsToGet.begin(), objectsToGet.end(), "events") != objectsToGet.end()) |
830 |
> |
if (find(objectsToGet.begin(), objectsToGet.end(), "events") != objectsToGet.end()) { |
831 |
|
event.getByLabel (events_, events); |
832 |
+ |
if (!events.product()) clog << "ERROR: could not get events input collection" << endl; |
833 |
+ |
} |
834 |
|
|
835 |
< |
if (find(objectsToGet.begin(), objectsToGet.end(), "taus") != objectsToGet.end()) |
835 |
> |
if (find(objectsToGet.begin(), objectsToGet.end(), "taus") != objectsToGet.end()) { |
836 |
|
event.getByLabel (taus_, taus); |
837 |
+ |
if (!taus.product()) clog << "ERROR: could not get taus input collection" << endl; |
838 |
+ |
} |
839 |
|
|
840 |
< |
if (find(objectsToGet.begin(), objectsToGet.end(), "mets") != objectsToGet.end()) |
840 |
> |
if (find(objectsToGet.begin(), objectsToGet.end(), "mets") != objectsToGet.end()) { |
841 |
|
event.getByLabel (mets_, mets); |
842 |
+ |
if (!mets.product()) clog << "ERROR: could not get mets input collection" << endl; |
843 |
+ |
} |
844 |
|
|
845 |
< |
if (find(objectsToGet.begin(), objectsToGet.end(), "tracks") != objectsToGet.end()) |
845 |
> |
if (find(objectsToGet.begin(), objectsToGet.end(), "tracks") != objectsToGet.end()) { |
846 |
|
event.getByLabel (tracks_, tracks); |
847 |
+ |
if (!tracks.product()) clog << "ERROR: could not get tracks input collection" << endl; |
848 |
+ |
} |
849 |
|
|
850 |
< |
if (find(objectsToGet.begin(), objectsToGet.end(), "genjets") != objectsToGet.end()) |
850 |
> |
if (find(objectsToGet.begin(), objectsToGet.end(), "genjets") != objectsToGet.end()) { |
851 |
|
event.getByLabel (genjets_, genjets); |
852 |
+ |
if (!genjets.product()) clog << "ERROR: could not get genjets input collection" << endl; |
853 |
+ |
} |
854 |
|
|
855 |
< |
if (find(objectsToGet.begin(), objectsToGet.end(), "mcparticles") != objectsToGet.end()) |
855 |
> |
if (find(objectsToGet.begin(), objectsToGet.end(), "mcparticles") != objectsToGet.end()) { |
856 |
|
event.getByLabel (mcparticles_, mcparticles); |
857 |
+ |
if (!mcparticles.product()) clog << "ERROR: could not get mcparticles input collection" << endl; |
858 |
+ |
} |
859 |
|
|
860 |
< |
if (find(objectsToGet.begin(), objectsToGet.end(), "primaryvertexs") != objectsToGet.end()) |
860 |
> |
if (find(objectsToGet.begin(), objectsToGet.end(), "primaryvertexs") != objectsToGet.end()) { |
861 |
|
event.getByLabel (primaryvertexs_, primaryvertexs); |
862 |
+ |
if (!primaryvertexs.product()) clog << "ERROR: could not get primaryvertexs input collection" << endl; |
863 |
+ |
} |
864 |
|
|
865 |
< |
if (find(objectsToGet.begin(), objectsToGet.end(), "bxlumis") != objectsToGet.end()) |
865 |
> |
if (find(objectsToGet.begin(), objectsToGet.end(), "bxlumis") != objectsToGet.end()) { |
866 |
|
event.getByLabel (bxlumis_, bxlumis); |
867 |
+ |
if (!bxlumis.product()) clog << "ERROR: could not get bxlumis input collection" << endl; |
868 |
+ |
} |
869 |
|
|
870 |
< |
if (find(objectsToGet.begin(), objectsToGet.end(), "photons") != objectsToGet.end()) |
870 |
> |
if (find(objectsToGet.begin(), objectsToGet.end(), "photons") != objectsToGet.end()) { |
871 |
|
event.getByLabel (photons_, photons); |
872 |
+ |
if (!photons.product()) clog << "ERROR: could not get photons input collection" << endl; |
873 |
+ |
} |
874 |
|
|
875 |
< |
if (find(objectsToGet.begin(), objectsToGet.end(), "superclusters") != objectsToGet.end()) |
875 |
> |
if (find(objectsToGet.begin(), objectsToGet.end(), "superclusters") != objectsToGet.end()) { |
876 |
|
event.getByLabel (superclusters_, superclusters); |
877 |
+ |
if (!superclusters.product()) clog << "ERROR: could not get superclusters input collection" << endl; |
878 |
+ |
} |
879 |
|
|
880 |
|
if (datasetType_ == "signalMC"){ |
881 |
< |
if (find(objectsToGet.begin(), objectsToGet.end(), "stops") != objectsToGet.end()) |
881 |
> |
if (find(objectsToGet.begin(), objectsToGet.end(), "stops") != objectsToGet.end()) { |
882 |
|
event.getByLabel (stops_, stops); |
883 |
+ |
if (!stops.product()) clog << "ERROR: could not get stops input collection" << endl; |
884 |
+ |
} |
885 |
|
} |
886 |
|
|
887 |
|
if (useTrackCaloRhoCorr_) { |
890 |
|
// For description of rho values for different jet reconstruction algorithms, see |
891 |
|
// https://twiki.cern.ch/twiki/bin/view/CMS/JetAlgorithms#Algorithms |
892 |
|
event.getByLabel ("kt6CaloJets","rho", rhokt6CaloJetsHandle_); |
893 |
+ |
if (!rhokt6CaloJetsHandle_.product()) clog << "ERROR: could not get kt6CaloJets input collection" << endl; |
894 |
|
} |
895 |
|
|
896 |
|
double masterScaleFactor = 1.0; |
898 |
|
//get pile-up event weight |
899 |
|
if (doPileupReweighting_ && datasetType_ != "data") { |
900 |
|
//for "data" datasets, the numTruePV is always set to -1 |
901 |
< |
if (events->at(0).numTruePV < 0) clog << "WARNING[OSUAnalysis::analyze]: Event has numTruePV<0. Turning off pile-up reweighting." << endl; |
901 |
> |
if (events->at(0).numTruePV < 0 && isFirstEvent_) clog << "WARNING[OSUAnalysis::analyze]: Event has numTruePV<0. Turning off pile-up reweighting." << endl; |
902 |
|
else masterScaleFactor *= puWeight_->at (events->at (0).numTruePV); |
903 |
|
} |
904 |
|
|
912 |
|
auto_ptr<map<string, bool> > channelDecisions (new map<string, bool>); |
913 |
|
for(uint currentChannelIndex = 0; currentChannelIndex != channels.size(); currentChannelIndex++){ |
914 |
|
channel currentChannel = channels.at(currentChannelIndex); |
915 |
+ |
if (verbose_>1) clog << " Processing channel " << currentChannel.name << endl; |
916 |
|
|
917 |
|
flagMap individualFlags; |
918 |
|
counterMap passingCounter; |
932 |
|
//loop over all cuts |
933 |
|
for(uint currentCutIndex = 0; currentCutIndex != currentChannel.cuts.size(); currentCutIndex++){ |
934 |
|
cut currentCut = currentChannel.cuts.at(currentCutIndex); |
935 |
+ |
if (verbose_>2) clog << " Processing cut, index: " << currentCutIndex << ", input collection: " << currentCut.inputCollection << ", name: " << currentCut.name << endl; |
936 |
|
|
937 |
|
for(uint currentObjectIndex = 0; currentObjectIndex != objectsToFlag.size(); currentObjectIndex++){ |
938 |
|
string currentObject = objectsToFlag.at(currentObjectIndex); |
944 |
|
} |
945 |
|
|
946 |
|
//set flags for all relevant objects |
947 |
< |
for(uint currentObjectIndex = 0; currentObjectIndex != objectsToFlag.size(); currentObjectIndex++){ |
948 |
< |
string currentObject = objectsToFlag.at(currentObjectIndex); |
949 |
< |
|
950 |
< |
int flagsForPairCutsIndex = max(int(currentCutIndex-1),0); |
951 |
< |
|
952 |
< |
|
953 |
< |
if (currentObject == "jets") setObjectFlags(currentCut,currentCutIndex,individualFlags,cumulativeFlags,jets.product(),"jets"); |
954 |
< |
else if(currentObject == "secondary jets") setObjectFlags(currentCut,currentCutIndex,individualFlags,cumulativeFlags,jets.product(),"secondary jets"); |
955 |
< |
else if(currentObject == "secondary photons") setObjectFlags(currentCut,currentCutIndex,individualFlags,cumulativeFlags,photons.product(),"secondary photons"); |
956 |
< |
else if(currentObject == "muons") setObjectFlags(currentCut,currentCutIndex,individualFlags,cumulativeFlags,muons.product(),"muons"); |
957 |
< |
else if(currentObject == "secondary muons") setObjectFlags(currentCut,currentCutIndex,individualFlags,cumulativeFlags,muons.product(),"secondary muons"); |
947 |
> |
for(int currentObjectIndex = -1; currentObjectIndex != int(objectsToFlag.size()); currentObjectIndex++){ |
948 |
> |
string currentObject; |
949 |
> |
if (currentObjectIndex < 0) currentObject = currentCut.inputCollection; // In the first loop, set the flags for the collection that the cut is acting on. That way other paired collections can access the correct flag for the current cut. |
950 |
> |
else currentObject = objectsToFlag.at(currentObjectIndex); |
951 |
> |
if (currentObjectIndex >= 0 && currentObject == currentCut.inputCollection) continue; // Flags have already been set for the inputCollection object, so should not be set again. |
952 |
> |
|
953 |
> |
// single object collections |
954 |
> |
if (currentObject == "jets") setObjectFlags(currentCut,currentCutIndex,individualFlags,cumulativeFlags,jets.product(),"jets"); |
955 |
> |
else if(currentObject == "secondary jets") setObjectFlags(currentCut,currentCutIndex,individualFlags,cumulativeFlags,jets.product(),"secondary jets"); |
956 |
> |
else if(currentObject == "secondary photons") setObjectFlags(currentCut,currentCutIndex,individualFlags,cumulativeFlags,photons.product(),"secondary photons"); |
957 |
> |
else if(currentObject == "muons") setObjectFlags(currentCut,currentCutIndex,individualFlags,cumulativeFlags,muons.product(),"muons"); |
958 |
> |
else if(currentObject == "secondary muons") setObjectFlags(currentCut,currentCutIndex,individualFlags,cumulativeFlags,secMuons.product(),"secondary muons"); |
959 |
|
else if(currentObject == "secondary electrons") setObjectFlags(currentCut,currentCutIndex,individualFlags,cumulativeFlags,electrons.product(),"secondary electrons"); |
960 |
< |
else if(currentObject == "electrons") setObjectFlags(currentCut,currentCutIndex,individualFlags,cumulativeFlags,electrons.product(),"electrons"); |
961 |
< |
else if(currentObject == "events") setObjectFlags(currentCut,currentCutIndex,individualFlags,cumulativeFlags,events.product(),"events"); |
962 |
< |
else if(currentObject == "taus") setObjectFlags(currentCut,currentCutIndex,individualFlags,cumulativeFlags,taus.product(),"taus"); |
963 |
< |
else if(currentObject == "mets") setObjectFlags(currentCut,currentCutIndex,individualFlags,cumulativeFlags,mets.product(),"mets"); |
964 |
< |
else if(currentObject == "tracks") setObjectFlags(currentCut,currentCutIndex,individualFlags,cumulativeFlags,tracks.product(),"tracks"); |
965 |
< |
else if(currentObject == "genjets") setObjectFlags(currentCut,currentCutIndex,individualFlags,cumulativeFlags,genjets.product(),"genjets"); |
966 |
< |
else if(currentObject == "mcparticles") setObjectFlags(currentCut,currentCutIndex,individualFlags,cumulativeFlags,mcparticles.product(),"mcparticles"); |
967 |
< |
else if(currentObject == "primaryvertexs") setObjectFlags(currentCut,currentCutIndex,individualFlags,cumulativeFlags,primaryvertexs.product(),"primaryvertexs"); |
968 |
< |
else if(currentObject == "bxlumis") setObjectFlags(currentCut,currentCutIndex,individualFlags,cumulativeFlags,bxlumis.product(),"bxlumis"); |
969 |
< |
else if(currentObject == "photons") setObjectFlags(currentCut,currentCutIndex,individualFlags,cumulativeFlags,photons.product(),"photons"); |
970 |
< |
else if(currentObject == "superclusters") setObjectFlags(currentCut,currentCutIndex,individualFlags,cumulativeFlags,superclusters.product(),"superclusters"); |
971 |
< |
else if(currentObject == "trigobjs") setObjectFlags(currentCut,currentCutIndex,individualFlags,cumulativeFlags,trigobjs.product(),"trigobjs"); |
972 |
< |
|
973 |
< |
|
974 |
< |
|
975 |
< |
else if(currentObject == "muon-muon pairs") setObjectFlags(currentCut,currentCutIndex,individualFlags,cumulativeFlags,muons.product(),muons.product(), \ |
976 |
< |
cumulativeFlags.at("muons").at(flagsForPairCutsIndex), \ |
977 |
< |
cumulativeFlags.at("muons").at(flagsForPairCutsIndex), \ |
978 |
< |
"muon-muon pairs"); |
979 |
< |
|
980 |
< |
else if(currentObject == "muon-secondary muon pairs") setObjectFlags(currentCut,currentCutIndex,individualFlags,cumulativeFlags,muons.product(),muons.product(), \ |
981 |
< |
cumulativeFlags.at("muons").at(flagsForPairCutsIndex), \ |
982 |
< |
cumulativeFlags.at("secondary muons").at(flagsForPairCutsIndex), \ |
983 |
< |
"muon-secondary muon pairs"); |
984 |
< |
|
985 |
< |
else if(currentObject == "muon-secondary photon pairs") setObjectFlags(currentCut,currentCutIndex,individualFlags,cumulativeFlags,muons.product(),photons.product(), \ |
986 |
< |
cumulativeFlags.at("muons").at(flagsForPairCutsIndex), \ |
987 |
< |
cumulativeFlags.at("secondary photons").at(flagsForPairCutsIndex), \ |
988 |
< |
"muon-secondary photon pairs"); |
989 |
< |
else if(currentObject == "muon-secondary jet pairs") setObjectFlags(currentCut,currentCutIndex,individualFlags,cumulativeFlags,muons.product(),jets.product(), \ |
990 |
< |
cumulativeFlags.at("muons").at(flagsForPairCutsIndex), \ |
991 |
< |
cumulativeFlags.at("secondary jets").at(flagsForPairCutsIndex), \ |
992 |
< |
"muon-secondary jet pairs"); |
993 |
< |
else if(currentObject == "photon-secondary jet pairs") setObjectFlags(currentCut,currentCutIndex,individualFlags,cumulativeFlags,photons.product(),jets.product(), \ |
994 |
< |
cumulativeFlags.at("photons").at(flagsForPairCutsIndex), \ |
995 |
< |
cumulativeFlags.at("secondary jets").at(flagsForPairCutsIndex), \ |
996 |
< |
"photon-secondary jet pairs"); |
997 |
< |
|
998 |
< |
else if(currentObject == "electron-secondary jet pairs") setObjectFlags(currentCut,currentCutIndex,individualFlags,cumulativeFlags,electrons.product(),jets.product(), \ |
999 |
< |
cumulativeFlags.at("electrons").at(flagsForPairCutsIndex), \ |
1000 |
< |
cumulativeFlags.at("secondary jets").at(flagsForPairCutsIndex), \ |
1001 |
< |
"electron-secondary jet pairs"); |
1002 |
< |
|
1003 |
< |
else if(currentObject == "electron-secondary electron pairs") setObjectFlags(currentCut,currentCutIndex,individualFlags,cumulativeFlags,electrons.product(),electrons.product(), \ |
1004 |
< |
cumulativeFlags.at("electrons").at(flagsForPairCutsIndex), \ |
1005 |
< |
cumulativeFlags.at("secondary electrons").at(flagsForPairCutsIndex), \ |
835 |
< |
"electron-secondary electron pairs"); |
836 |
< |
|
837 |
< |
else if(currentObject == "electron-electron pairs") setObjectFlags(currentCut,currentCutIndex,individualFlags,cumulativeFlags,electrons.product(),electrons.product(), \ |
838 |
< |
cumulativeFlags.at("electrons").at(flagsForPairCutsIndex), \ |
839 |
< |
cumulativeFlags.at("electrons").at(flagsForPairCutsIndex), \ |
840 |
< |
"electron-electron pairs"); |
841 |
< |
else if(currentObject == "electron-muon pairs") setObjectFlags(currentCut,currentCutIndex,individualFlags,cumulativeFlags,electrons.product(),muons.product(), \ |
842 |
< |
cumulativeFlags.at("electrons").at(flagsForPairCutsIndex), \ |
843 |
< |
cumulativeFlags.at("muons").at(flagsForPairCutsIndex), \ |
844 |
< |
"electron-muon pairs"); |
845 |
< |
else if(currentObject == "jet-jet pairs") setObjectFlags(currentCut,currentCutIndex,individualFlags,cumulativeFlags,jets.product(),jets.product(), \ |
846 |
< |
cumulativeFlags.at("jets").at(flagsForPairCutsIndex), \ |
847 |
< |
cumulativeFlags.at("jets").at(flagsForPairCutsIndex), \ |
848 |
< |
"jet-jet pairs"); |
849 |
< |
else if(currentObject == "jet-secondary jet pairs") setObjectFlags(currentCut,currentCutIndex,individualFlags,cumulativeFlags,jets.product(),jets.product(), \ |
850 |
< |
cumulativeFlags.at("jets").at(flagsForPairCutsIndex), \ |
851 |
< |
cumulativeFlags.at("secondary jets").at(flagsForPairCutsIndex),\ |
852 |
< |
"jet-secondary jet pairs"); |
853 |
< |
else if(currentObject == "electron-jet pairs") setObjectFlags(currentCut,currentCutIndex,individualFlags,cumulativeFlags,electrons.product(),jets.product(), \ |
854 |
< |
cumulativeFlags.at("electrons").at(flagsForPairCutsIndex), \ |
855 |
< |
cumulativeFlags.at("jets").at(flagsForPairCutsIndex), \ |
856 |
< |
"electron-jet pairs"); |
857 |
< |
else if(currentObject == "electron-photon pairs") setObjectFlags(currentCut,currentCutIndex,individualFlags,cumulativeFlags,electrons.product(),photons.product(), \ |
858 |
< |
cumulativeFlags.at("electrons").at(flagsForPairCutsIndex), \ |
859 |
< |
cumulativeFlags.at("photons").at(flagsForPairCutsIndex), \ |
860 |
< |
"electron-photon pairs"); |
861 |
< |
else if(currentObject == "photon-jet pairs") setObjectFlags(currentCut,currentCutIndex,individualFlags,cumulativeFlags,photons.product(),jets.product(), \ |
862 |
< |
cumulativeFlags.at("photons").at(flagsForPairCutsIndex), \ |
863 |
< |
cumulativeFlags.at("jets").at(flagsForPairCutsIndex), \ |
864 |
< |
"photon-jet pairs"); |
865 |
< |
else if(currentObject == "muon-jet pairs") setObjectFlags(currentCut,currentCutIndex,individualFlags,cumulativeFlags,muons.product(),jets.product(), \ |
866 |
< |
cumulativeFlags.at("muons").at(flagsForPairCutsIndex), \ |
867 |
< |
cumulativeFlags.at("jets").at(flagsForPairCutsIndex), \ |
868 |
< |
"muon-jet pairs"); |
869 |
< |
else if(currentObject == "muon-event pairs") setObjectFlags(currentCut,currentCutIndex,individualFlags,cumulativeFlags,muons.product(),events.product(), \ |
870 |
< |
cumulativeFlags.at("muons").at(flagsForPairCutsIndex), \ |
871 |
< |
cumulativeFlags.at("events").at(flagsForPairCutsIndex), \ |
872 |
< |
"muon-event pairs"); |
873 |
< |
else if(currentObject == "met-jet pairs") setObjectFlags(currentCut,currentCutIndex,individualFlags,cumulativeFlags,mets.product(),jets.product(), \ |
874 |
< |
cumulativeFlags.at("mets").at(flagsForPairCutsIndex), \ |
875 |
< |
cumulativeFlags.at("jets").at(flagsForPairCutsIndex), \ |
876 |
< |
"met-jet pairs"); |
877 |
< |
else if(currentObject == "track-jet pairs") setObjectFlags(currentCut,currentCutIndex,individualFlags,cumulativeFlags,tracks.product(),jets.product(), \ |
878 |
< |
cumulativeFlags.at("tracks").at(flagsForPairCutsIndex), \ |
879 |
< |
cumulativeFlags.at("jets").at(flagsForPairCutsIndex), \ |
880 |
< |
"track-jet pairs"); |
881 |
< |
else if(currentObject == "muon-photon pairs") setObjectFlags(currentCut,currentCutIndex,individualFlags,cumulativeFlags,muons.product(),photons.product(), \ |
882 |
< |
cumulativeFlags.at("muons").at(flagsForPairCutsIndex), \ |
883 |
< |
cumulativeFlags.at("photons").at(flagsForPairCutsIndex), \ |
884 |
< |
"muon-photon pairs"); |
885 |
< |
else if(currentObject == "track-event pairs") setObjectFlags(currentCut,currentCutIndex,individualFlags,cumulativeFlags,tracks.product(),events.product(), |
886 |
< |
cumulativeFlags.at("tracks").at(flagsForPairCutsIndex), |
887 |
< |
cumulativeFlags.at("events").at(flagsForPairCutsIndex), |
888 |
< |
"track-event pairs"); |
889 |
< |
else if(currentObject == "electron-track pairs") setObjectFlags(currentCut,currentCutIndex,individualFlags,cumulativeFlags,electrons.product(),tracks.product(), |
890 |
< |
cumulativeFlags.at("electrons").at(flagsForPairCutsIndex), |
891 |
< |
cumulativeFlags.at("tracks").at(flagsForPairCutsIndex), |
892 |
< |
"electron-track pairs"); |
893 |
< |
else if(currentObject == "muon-track pairs") setObjectFlags(currentCut,currentCutIndex,individualFlags,cumulativeFlags,muons.product(),tracks.product(), |
894 |
< |
cumulativeFlags.at("muons").at(flagsForPairCutsIndex), |
895 |
< |
cumulativeFlags.at("tracks").at(flagsForPairCutsIndex), |
896 |
< |
"muon-track pairs"); |
897 |
< |
else if(currentObject == "muon-tau pairs") setObjectFlags(currentCut,currentCutIndex,individualFlags,cumulativeFlags,muons.product(),taus.product(), |
898 |
< |
cumulativeFlags.at("muons").at(flagsForPairCutsIndex), |
899 |
< |
cumulativeFlags.at("taus").at(flagsForPairCutsIndex), |
900 |
< |
"muon-tau pairs"); |
901 |
< |
else if(currentObject == "tau-tau pairs") setObjectFlags(currentCut,currentCutIndex,individualFlags,cumulativeFlags,taus.product(),taus.product(), |
902 |
< |
cumulativeFlags.at("taus").at(flagsForPairCutsIndex), |
903 |
< |
cumulativeFlags.at("taus").at(flagsForPairCutsIndex), |
904 |
< |
"tau-tau pairs"); |
905 |
< |
else if(currentObject == "tau-track pairs") setObjectFlags(currentCut,currentCutIndex,individualFlags,cumulativeFlags,taus .product(),tracks.product(), |
906 |
< |
cumulativeFlags.at("taus").at(flagsForPairCutsIndex), |
907 |
< |
cumulativeFlags.at("tracks").at(flagsForPairCutsIndex), |
908 |
< |
"tau-track pairs"); |
909 |
< |
else if(currentObject == "electron-trigobj pairs") setObjectFlags(currentCut,currentCutIndex,individualFlags,cumulativeFlags,electrons.product(),trigobjs.product(), |
910 |
< |
cumulativeFlags.at("electrons").at(flagsForPairCutsIndex), |
911 |
< |
cumulativeFlags.at("trigobjs").at(flagsForPairCutsIndex), |
912 |
< |
"electron-trigobj pairs"); |
913 |
< |
else if(currentObject == "muon-trigobj pairs") setObjectFlags(currentCut,currentCutIndex,individualFlags,cumulativeFlags,muons.product(),trigobjs.product(), |
914 |
< |
cumulativeFlags.at("muons").at(flagsForPairCutsIndex), |
915 |
< |
cumulativeFlags.at("trigobjs").at(flagsForPairCutsIndex), |
916 |
< |
"muon-trigobj pairs"); |
960 |
> |
else if(currentObject == "electrons") setObjectFlags(currentCut,currentCutIndex,individualFlags,cumulativeFlags,electrons.product(),"electrons"); |
961 |
> |
else if(currentObject == "events") setObjectFlags(currentCut,currentCutIndex,individualFlags,cumulativeFlags,events.product(),"events"); |
962 |
> |
else if(currentObject == "taus") setObjectFlags(currentCut,currentCutIndex,individualFlags,cumulativeFlags,taus.product(),"taus"); |
963 |
> |
else if(currentObject == "mets") setObjectFlags(currentCut,currentCutIndex,individualFlags,cumulativeFlags,mets.product(),"mets"); |
964 |
> |
else if(currentObject == "tracks") setObjectFlags(currentCut,currentCutIndex,individualFlags,cumulativeFlags,tracks.product(),"tracks"); |
965 |
> |
else if(currentObject == "genjets") setObjectFlags(currentCut,currentCutIndex,individualFlags,cumulativeFlags,genjets.product(),"genjets"); |
966 |
> |
else if(currentObject == "mcparticles") setObjectFlags(currentCut,currentCutIndex,individualFlags,cumulativeFlags,mcparticles.product(),"mcparticles"); |
967 |
> |
else if(currentObject == "primaryvertexs") setObjectFlags(currentCut,currentCutIndex,individualFlags,cumulativeFlags,primaryvertexs.product(),"primaryvertexs"); |
968 |
> |
else if(currentObject == "bxlumis") setObjectFlags(currentCut,currentCutIndex,individualFlags,cumulativeFlags,bxlumis.product(),"bxlumis"); |
969 |
> |
else if(currentObject == "photons") setObjectFlags(currentCut,currentCutIndex,individualFlags,cumulativeFlags,photons.product(),"photons"); |
970 |
> |
else if(currentObject == "superclusters") setObjectFlags(currentCut,currentCutIndex,individualFlags,cumulativeFlags,superclusters.product(),"superclusters"); |
971 |
> |
else if(currentObject == "trigobjs") setObjectFlags(currentCut,currentCutIndex,individualFlags,cumulativeFlags,trigobjs.product(),"trigobjs"); |
972 |
> |
|
973 |
> |
|
974 |
> |
// paired object collections |
975 |
> |
else if(currentObject == "muon-muon pairs") setObjectFlags(currentCut,currentCutIndex,individualFlags,cumulativeFlags,muons.product(),muons.product(), "muon-muon pairs"); |
976 |
> |
else if(currentObject == "muon-secondary muon pairs") setObjectFlags(currentCut,currentCutIndex,individualFlags,cumulativeFlags,muons.product(),secMuons.product(), "muon-secondary muon pairs"); |
977 |
> |
|
978 |
> |
else if(currentObject == "muon-secondary photon pairs") setObjectFlags(currentCut,currentCutIndex,individualFlags,cumulativeFlags,muons.product(),photons.product(), "muon-secondary photon pairs"); |
979 |
> |
else if(currentObject == "muon-secondary jet pairs") setObjectFlags(currentCut,currentCutIndex,individualFlags,cumulativeFlags,muons.product(),jets.product(), "muon-secondary jet pairs"); |
980 |
> |
else if(currentObject == "photon-secondary jet pairs") setObjectFlags(currentCut,currentCutIndex,individualFlags,cumulativeFlags,photons.product(),jets.product(), "photon-secondary jet pairs"); |
981 |
> |
else if(currentObject == "electron-secondary jet pairs") setObjectFlags(currentCut,currentCutIndex,individualFlags,cumulativeFlags,electrons.product(),jets.product(), "electron-secondary jet pairs"); |
982 |
> |
else if(currentObject == "electron-secondary electron pairs") setObjectFlags(currentCut,currentCutIndex,individualFlags,cumulativeFlags,electrons.product(),electrons.product(), "electron-secondary electron pairs"); |
983 |
> |
|
984 |
> |
else if(currentObject == "electron-electron pairs") setObjectFlags(currentCut,currentCutIndex,individualFlags,cumulativeFlags,electrons.product(),electrons.product(), "electron-electron pairs"); |
985 |
> |
else if(currentObject == "electron-muon pairs") setObjectFlags(currentCut,currentCutIndex,individualFlags,cumulativeFlags,electrons.product(),muons.product(), "electron-muon pairs"); |
986 |
> |
else if(currentObject == "jet-jet pairs") setObjectFlags(currentCut,currentCutIndex,individualFlags,cumulativeFlags,jets.product(),jets.product(), "jet-jet pairs"); |
987 |
> |
else if(currentObject == "jet-secondary jet pairs") setObjectFlags(currentCut,currentCutIndex,individualFlags,cumulativeFlags,jets.product(),jets.product(), "jet-secondary jet pairs"); |
988 |
> |
else if(currentObject == "electron-jet pairs") setObjectFlags(currentCut,currentCutIndex,individualFlags,cumulativeFlags,electrons.product(),jets.product(), "electron-jet pairs"); |
989 |
> |
else if(currentObject == "electron-photon pairs") setObjectFlags(currentCut,currentCutIndex,individualFlags,cumulativeFlags,electrons.product(),photons.product(), "electron-photon pairs"); |
990 |
> |
else if(currentObject == "photon-jet pairs") setObjectFlags(currentCut,currentCutIndex,individualFlags,cumulativeFlags,photons.product(),jets.product(), "photon-jet pairs"); |
991 |
> |
else if(currentObject == "muon-jet pairs") setObjectFlags(currentCut,currentCutIndex,individualFlags,cumulativeFlags,muons.product(),jets.product(), "muon-jet pairs"); |
992 |
> |
else if(currentObject == "muon-event pairs") setObjectFlags(currentCut,currentCutIndex,individualFlags,cumulativeFlags,muons.product(),events.product(), "muon-event pairs"); |
993 |
> |
else if(currentObject == "met-jet pairs") setObjectFlags(currentCut,currentCutIndex,individualFlags,cumulativeFlags,mets.product(),jets.product(), "met-jet pairs"); |
994 |
> |
else if(currentObject == "track-jet pairs") setObjectFlags(currentCut,currentCutIndex,individualFlags,cumulativeFlags,tracks.product(),jets.product(), "track-jet pairs"); |
995 |
> |
else if(currentObject == "muon-photon pairs") setObjectFlags(currentCut,currentCutIndex,individualFlags,cumulativeFlags,muons.product(),photons.product(), "muon-photon pairs"); |
996 |
> |
else if(currentObject == "track-event pairs") setObjectFlags(currentCut,currentCutIndex,individualFlags,cumulativeFlags,tracks.product(),events.product(), "track-event pairs"); |
997 |
> |
else if(currentObject == "electron-track pairs") setObjectFlags(currentCut,currentCutIndex,individualFlags,cumulativeFlags,electrons.product(),tracks.product(),"electron-track pairs"); |
998 |
> |
else if(currentObject == "muon-track pairs") setObjectFlags(currentCut,currentCutIndex,individualFlags,cumulativeFlags,muons.product(),tracks.product(),"muon-track pairs"); |
999 |
> |
else if(currentObject == "secondary muon-track pairs") setObjectFlags(currentCut,currentCutIndex,individualFlags,cumulativeFlags,secMuons.product(),tracks.product(),"secondary muon-track pairs"); |
1000 |
> |
else if(currentObject == "muon-tau pairs") setObjectFlags(currentCut,currentCutIndex,individualFlags,cumulativeFlags,muons.product(),taus.product(),"muon-tau pairs"); |
1001 |
> |
else if(currentObject == "tau-tau pairs") setObjectFlags(currentCut,currentCutIndex,individualFlags,cumulativeFlags,taus.product(),taus.product(),"tau-tau pairs"); |
1002 |
> |
else if(currentObject == "tau-track pairs") setObjectFlags(currentCut,currentCutIndex,individualFlags,cumulativeFlags,taus .product(),tracks.product(),"tau-track pairs"); |
1003 |
> |
else if(currentObject == "electron-trigobj pairs") setObjectFlags(currentCut,currentCutIndex,individualFlags,cumulativeFlags,electrons.product(),trigobjs.product(),"electron-trigobj pairs"); |
1004 |
> |
else if(currentObject == "muon-trigobj pairs") setObjectFlags(currentCut,currentCutIndex,individualFlags,cumulativeFlags,muons.product(),trigobjs.product(),"muon-trigobj pairs"); |
1005 |
> |
else if(currentObject == "electron-mcparticle pairs") setObjectFlags(currentCut,currentCutIndex,individualFlags,cumulativeFlags,electrons.product(),mcparticles.product(),"electron-mcparticle pairs"); |
1006 |
|
|
1007 |
|
if(currentObject == "stops" && datasetType_ == "signalMC") setObjectFlags(currentCut,currentCutIndex,individualFlags,cumulativeFlags,stops.product(),"stops"); |
1008 |
|
} |
1009 |
|
|
1010 |
+ |
}//end loop over all cuts |
1011 |
|
|
1012 |
|
|
923 |
– |
}//end loop over all cuts |
924 |
– |
//use cumulative flags to apply cuts at event level |
1013 |
|
|
1014 |
< |
//a vector to store cumulative cut descisions after each cut. |
1015 |
< |
vector<bool> eventPassedPreviousCuts; |
1014 |
> |
//use cumulative flags to apply cuts at event level |
1015 |
> |
vector<bool> eventPassedPreviousCuts; //a vector to store cumulative cut descisions after each cut. |
1016 |
|
bool eventPassedAllCuts = true; |
1017 |
< |
//apply trigger (true if none were specified) |
930 |
< |
eventPassedAllCuts = eventPassedAllCuts && triggerDecision; |
1017 |
> |
eventPassedAllCuts = eventPassedAllCuts && triggerDecision; //apply trigger (true if none were specified) |
1018 |
|
|
1019 |
|
for(uint currentCutIndex = 0; currentCutIndex != currentChannel.cuts.size(); currentCutIndex++){ |
1020 |
|
|
1021 |
|
//loop over all objects and count how many passed the cumulative selection up to this point |
1022 |
|
cut currentCut = currentChannel.cuts.at(currentCutIndex); |
1023 |
|
int numberPassing = 0; |
1024 |
+ |
int numberPassingPrev = 0; // number of objects that pass cuts up to the previous one |
1025 |
|
|
1026 |
|
for (uint object = 0; object != cumulativeFlags.at(currentCut.inputCollection).at(currentCutIndex).size() ; object++){ |
1027 |
|
if(cumulativeFlags.at(currentCut.inputCollection).at(currentCutIndex).at(object).first) numberPassing++; |
1028 |
|
} |
1029 |
< |
bool cutDecision = evaluateComparison(numberPassing,currentCut.eventComparativeOperator,currentCut.numberRequired); |
1029 |
> |
bool cutDecision; |
1030 |
> |
if (!currentCut.isVeto) { |
1031 |
> |
cutDecision = evaluateComparison(numberPassing,currentCut.eventComparativeOperator,currentCut.numberRequired); |
1032 |
> |
} else { |
1033 |
> |
int prevCutIndex = currentCutIndex - 1; |
1034 |
> |
if (prevCutIndex<0) { |
1035 |
> |
numberPassingPrev = cumulativeFlags.at(currentCut.inputCollection).at(currentCutIndex).size(); // count all objects in collection if cut is the first |
1036 |
> |
} else { |
1037 |
> |
for (uint object = 0; object != cumulativeFlags.at(currentCut.inputCollection).at(prevCutIndex).size() ; object++){ |
1038 |
> |
if (cumulativeFlags.at(currentCut.inputCollection).at(prevCutIndex).at(object).first) { |
1039 |
> |
numberPassingPrev++; |
1040 |
> |
if (verbose_>1) clog << " object passed previous cut" << endl; |
1041 |
> |
} |
1042 |
> |
} |
1043 |
> |
} |
1044 |
> |
int numberFailCut = numberPassingPrev - numberPassing; |
1045 |
> |
cutDecision = evaluateComparison(numberFailCut,currentCut.eventComparativeOperator,currentCut.numberRequired); |
1046 |
> |
} |
1047 |
> |
|
1048 |
|
cutFlows_.at(currentChannelIndex)->at (currentCut.name) = cutDecision; |
1049 |
|
eventPassedAllCuts = eventPassedAllCuts && cutDecision; |
1050 |
|
eventPassedPreviousCuts.push_back(eventPassedAllCuts); |
1051 |
+ |
if (verbose_>1) clog << " Event passed cuts up to cut index " << currentCutIndex << endl; |
1052 |
+ |
|
1053 |
|
} |
1054 |
|
//applying all appropriate scale factors |
1055 |
|
double scaleFactor = masterScaleFactor; |
1114 |
|
scaleFactor *= electronScaleFactor_; |
1115 |
|
scaleFactor *= bTagScaleFactor_; |
1116 |
|
cutFlows_.at(currentChannelIndex)->fillCutFlow(scaleFactor); |
1117 |
+ |
if (verbose_>1) clog << " Scale factors applied: " |
1118 |
+ |
<< " muonScaleFactor_ = " << muonScaleFactor_ |
1119 |
+ |
<< ", electronScaleFactor_ = " << electronScaleFactor_ |
1120 |
+ |
<< ", bTagScaleFactor_ = " << bTagScaleFactor_ |
1121 |
+ |
<< ", total scale factor = " << scaleFactor |
1122 |
+ |
<< endl; |
1123 |
+ |
|
1124 |
|
|
1125 |
|
if (printEventInfo_ && eventPassedAllCuts) { |
1126 |
|
// Write information about event to screen, for testing purposes. |
1139 |
|
|
1140 |
|
|
1141 |
|
//filling histograms |
1142 |
< |
for(uint currentCut = 0; currentCut != oneDHists_.at(currentChannelIndex).size(); currentCut++){//loop over all the directories in each channel. |
1142 |
> |
for(uint currentCut = 0; currentCut != oneDHists_.at(currentChannelIndex).size(); currentCut++){//loop over all the cuts in each channel; if GetPlotsAfterEachCut_ is false, only the last cut will be used. |
1143 |
> |
|
1144 |
> |
if (verbose_>2) clog << " Filling histograms for currentcut = " << currentCut << endl; |
1145 |
> |
|
1146 |
|
uint currentDir; |
1147 |
|
if (!GetPlotsAfterEachCut_) { currentDir = currentChannel.cuts.size() - oneDHists_.at(currentChannelIndex).size(); } //if GetPlotsAfterEachCut_ is false, set currentDir point to the last cut. |
1148 |
|
else{ |
1157 |
|
|
1158 |
|
if (cumulativeFlags.count(currentHistogram.inputCollection) == 0) clog << "Error: no flags found for collection: " << currentHistogram.inputCollection << ", will cause a seg fault" << endl; |
1159 |
|
|
1160 |
+ |
if (verbose_>1) clog << " Filling histogram " << currentHistogram.name << " for collection " << currentHistogram.inputCollection << endl; |
1161 |
+ |
|
1162 |
|
if(currentHistogram.inputVariables.size() == 1){ |
1163 |
|
TH1D* histo; |
1164 |
|
histo = oneDHists_.at(currentChannelIndex).at(currentCut).at(currentHistogram.name); |
1165 |
< |
if (currentHistogram.inputCollection == "jets") fill1DHistogram(histo,currentHistogram,jets.product(),cumulativeFlags.at("jets").at(currentDir),scaleFactor); |
1165 |
> |
if (currentHistogram.inputCollection == "jets") fill1DHistogram(histo,currentHistogram,jets.product(),cumulativeFlags.at("jets").at(currentDir),scaleFactor); |
1166 |
|
else if(currentHistogram.inputCollection == "secondary jets") fill1DHistogram(histo,currentHistogram,jets.product(),cumulativeFlags.at("secondary jets").at(currentDir),scaleFactor); |
1167 |
|
else if(currentHistogram.inputCollection == "secondary photons") fill1DHistogram(histo,currentHistogram,photons.product(),cumulativeFlags.at("secondary photons").at(currentDir),scaleFactor); |
1168 |
|
else if(currentHistogram.inputCollection == "muons") fill1DHistogram(histo,currentHistogram,muons.product(),cumulativeFlags.at("muons").at(currentDir),scaleFactor); |
1169 |
< |
else if(currentHistogram.inputCollection == "secondary muons") fill1DHistogram(histo,currentHistogram,muons.product(),cumulativeFlags.at("secondary muons").at(currentDir),scaleFactor); |
1169 |
> |
else if(currentHistogram.inputCollection == "secondary muons") fill1DHistogram(histo,currentHistogram,secMuons.product(),cumulativeFlags.at("secondary muons").at(currentDir),scaleFactor); |
1170 |
|
else if(currentHistogram.inputCollection == "secondary electrons") fill1DHistogram(histo,currentHistogram,electrons.product(),cumulativeFlags.at("secondary electrons").at(currentDir),scaleFactor); |
1171 |
< |
else if(currentHistogram.inputCollection == "muon-muon pairs") fill1DHistogram(histo,currentHistogram,muons.product(),muons.product(), \ |
1052 |
< |
cumulativeFlags.at("muons").at(currentDir),cumulativeFlags.at("muons").at(currentDir), \ |
1171 |
> |
else if(currentHistogram.inputCollection == "muon-muon pairs") fill1DHistogram(histo,currentHistogram,muons.product(),muons.product(), |
1172 |
|
cumulativeFlags.at("muon-muon pairs").at(currentDir),scaleFactor); |
1173 |
< |
else if(currentHistogram.inputCollection == "muon-secondary muon pairs") fill1DHistogram(histo,currentHistogram,muons.product(),muons.product(), \ |
1055 |
< |
cumulativeFlags.at("muons").at(currentDir),cumulativeFlags.at("secondary muons").at(currentDir), \ |
1173 |
> |
else if(currentHistogram.inputCollection == "muon-secondary muon pairs") fill1DHistogram(histo,currentHistogram,muons.product(),secMuons.product(), |
1174 |
|
cumulativeFlags.at("muon-secondary muon pairs").at(currentDir),scaleFactor); |
1175 |
< |
else if(currentHistogram.inputCollection == "muon-secondary photon pairs") fill1DHistogram(histo,currentHistogram,muons.product(),photons.product(), \ |
1058 |
< |
cumulativeFlags.at("muons").at(currentDir),cumulativeFlags.at("secondary photons").at(currentDir), \ |
1175 |
> |
else if(currentHistogram.inputCollection == "muon-secondary photon pairs") fill1DHistogram(histo,currentHistogram,muons.product(),photons.product(), |
1176 |
|
cumulativeFlags.at("muon-secondary photon pairs").at(currentDir),scaleFactor); |
1177 |
< |
else if(currentHistogram.inputCollection == "muon-secondary jet pairs") fill1DHistogram(histo,currentHistogram,muons.product(),jets.product(), \ |
1061 |
< |
cumulativeFlags.at("muons").at(currentDir),cumulativeFlags.at("secondary jets").at(currentDir), \ |
1177 |
> |
else if(currentHistogram.inputCollection == "muon-secondary jet pairs") fill1DHistogram(histo,currentHistogram,muons.product(),jets.product(), |
1178 |
|
cumulativeFlags.at("muon-secondary jet pairs").at(currentDir),scaleFactor); |
1179 |
< |
else if(currentHistogram.inputCollection == "photon-secondary jet pairs") fill1DHistogram(histo,currentHistogram,photons.product(),jets.product(), \ |
1064 |
< |
cumulativeFlags.at("photons").at(currentDir),cumulativeFlags.at("secondary jets").at(currentDir), \ |
1179 |
> |
else if(currentHistogram.inputCollection == "photon-secondary jet pairs") fill1DHistogram(histo,currentHistogram,photons.product(),jets.product(), |
1180 |
|
cumulativeFlags.at("photon-secondary jet pairs").at(currentDir),scaleFactor); |
1181 |
< |
else if(currentHistogram.inputCollection == "electron-secondary jet pairs") fill1DHistogram(histo,currentHistogram,electrons.product(),jets.product(), \ |
1067 |
< |
cumulativeFlags.at("electrons").at(currentDir),cumulativeFlags.at("secondary jets").at(currentDir), \ |
1181 |
> |
else if(currentHistogram.inputCollection == "electron-secondary jet pairs") fill1DHistogram(histo,currentHistogram,electrons.product(),jets.product(), |
1182 |
|
cumulativeFlags.at("electron-secondary jet pairs").at(currentDir),scaleFactor); |
1183 |
|
|
1184 |
|
else if(currentHistogram.inputCollection == "electrons") fill1DHistogram(histo,currentHistogram,electrons.product(),cumulativeFlags.at("electrons").at(currentDir),scaleFactor); |
1185 |
< |
else if(currentHistogram.inputCollection == "electron-electron pairs") fill1DHistogram(histo,currentHistogram,electrons.product(),electrons.product(),\ |
1072 |
< |
cumulativeFlags.at("electrons").at(currentDir),cumulativeFlags.at("electrons").at(currentDir),\ |
1185 |
> |
else if(currentHistogram.inputCollection == "electron-electron pairs") fill1DHistogram(histo,currentHistogram,electrons.product(),electrons.product(), |
1186 |
|
cumulativeFlags.at("electron-electron pairs").at(currentDir),scaleFactor); |
1187 |
< |
else if(currentHistogram.inputCollection == "jet-jet pairs") fill1DHistogram(histo,currentHistogram,jets.product(),jets.product(),\ |
1075 |
< |
cumulativeFlags.at("jets").at(currentDir),cumulativeFlags.at("jets").at(currentDir),\ |
1187 |
> |
else if(currentHistogram.inputCollection == "jet-jet pairs") fill1DHistogram(histo,currentHistogram,jets.product(),jets.product(), |
1188 |
|
cumulativeFlags.at("jet-jet pairs").at(currentDir),scaleFactor); |
1189 |
< |
else if(currentHistogram.inputCollection == "jet-secondary jet pairs") fill1DHistogram(histo,currentHistogram,jets.product(),jets.product(), \ |
1078 |
< |
cumulativeFlags.at("jets").at(currentDir),cumulativeFlags.at("secondary jets").at(currentDir), \ |
1189 |
> |
else if(currentHistogram.inputCollection == "jet-secondary jet pairs") fill1DHistogram(histo,currentHistogram,jets.product(),jets.product(), |
1190 |
|
cumulativeFlags.at("jet-secondary jet pairs").at(currentDir),scaleFactor); |
1191 |
|
|
1192 |
< |
else if(currentHistogram.inputCollection == "electron-secondary electron pairs") fill1DHistogram(histo,currentHistogram,electrons.product(),electrons.product(), \ |
1082 |
< |
cumulativeFlags.at("electrons").at(currentDir),cumulativeFlags.at("secondary electrons").at(currentDir), \ |
1192 |
> |
else if(currentHistogram.inputCollection == "electron-secondary electron pairs") fill1DHistogram(histo,currentHistogram,electrons.product(),electrons.product(), |
1193 |
|
cumulativeFlags.at("electron-secondary electron pairs").at(currentDir),scaleFactor); |
1194 |
< |
else if(currentHistogram.inputCollection == "electron-muon pairs") fill1DHistogram(histo,currentHistogram, electrons.product(),muons.product(), \ |
1085 |
< |
cumulativeFlags.at("electrons").at(currentDir),cumulativeFlags.at("muons").at(currentDir), |
1194 |
> |
else if(currentHistogram.inputCollection == "electron-muon pairs") fill1DHistogram(histo,currentHistogram, electrons.product(),muons.product(), |
1195 |
|
cumulativeFlags.at("electron-muon pairs").at(currentDir),scaleFactor); |
1196 |
< |
else if(currentHistogram.inputCollection == "electron-jet pairs") fill1DHistogram(histo,currentHistogram, electrons.product(),jets.product(), \ |
1088 |
< |
cumulativeFlags.at("electrons").at(currentDir),cumulativeFlags.at("jets").at(currentDir), |
1196 |
> |
else if(currentHistogram.inputCollection == "electron-jet pairs") fill1DHistogram(histo,currentHistogram, electrons.product(),jets.product(), |
1197 |
|
cumulativeFlags.at("electron-jet pairs").at(currentDir),scaleFactor); |
1198 |
< |
else if(currentHistogram.inputCollection == "photon-jet pairs") fill1DHistogram(histo,currentHistogram, photons.product(),jets.product(), \ |
1091 |
< |
cumulativeFlags.at("photons").at(currentDir),cumulativeFlags.at("jets").at(currentDir), |
1198 |
> |
else if(currentHistogram.inputCollection == "photon-jet pairs") fill1DHistogram(histo,currentHistogram, photons.product(),jets.product(), |
1199 |
|
cumulativeFlags.at("photon-jet pairs").at(currentDir),scaleFactor); |
1200 |
< |
else if(currentHistogram.inputCollection == "muon-jet pairs") fill1DHistogram(histo,currentHistogram, muons.product(),jets.product(), \ |
1094 |
< |
cumulativeFlags.at("muons").at(currentDir),cumulativeFlags.at("jets").at(currentDir), |
1200 |
> |
else if(currentHistogram.inputCollection == "muon-jet pairs") fill1DHistogram(histo,currentHistogram, muons.product(),jets.product(), |
1201 |
|
cumulativeFlags.at("muon-jet pairs").at(currentDir),scaleFactor); |
1202 |
< |
else if(currentHistogram.inputCollection == "muon-event pairs") fill1DHistogram(histo,currentHistogram, muons.product(),events.product(), \ |
1097 |
< |
cumulativeFlags.at("muons").at(currentDir),cumulativeFlags.at("events").at(currentDir), |
1202 |
> |
else if(currentHistogram.inputCollection == "muon-event pairs") fill1DHistogram(histo,currentHistogram, muons.product(),events.product(), |
1203 |
|
cumulativeFlags.at("muon-event pairs").at(currentDir),scaleFactor); |
1204 |
< |
else if(currentHistogram.inputCollection == "met-jet pairs") fill1DHistogram(histo,currentHistogram, mets.product(),jets.product(), \ |
1100 |
< |
cumulativeFlags.at("mets").at(currentDir),cumulativeFlags.at("jets").at(currentDir), |
1204 |
> |
else if(currentHistogram.inputCollection == "met-jet pairs") fill1DHistogram(histo,currentHistogram, mets.product(),jets.product(), |
1205 |
|
cumulativeFlags.at("met-jet pairs").at(currentDir),scaleFactor); |
1206 |
< |
else if(currentHistogram.inputCollection == "track-jet pairs") fill1DHistogram(histo,currentHistogram,tracks.product(),jets.product(), \ |
1103 |
< |
cumulativeFlags.at("tracks").at(currentDir),cumulativeFlags.at("jets").at(currentDir), |
1206 |
> |
else if(currentHistogram.inputCollection == "track-jet pairs") fill1DHistogram(histo,currentHistogram,tracks.product(),jets.product(), |
1207 |
|
cumulativeFlags.at("track-jet pairs").at(currentDir),scaleFactor); |
1208 |
< |
else if(currentHistogram.inputCollection == "muon-photon pairs") fill1DHistogram(histo,currentHistogram, muons.product(),photons.product(), \ |
1106 |
< |
cumulativeFlags.at("muons").at(currentDir),cumulativeFlags.at("photons").at(currentDir), |
1208 |
> |
else if(currentHistogram.inputCollection == "muon-photon pairs") fill1DHistogram(histo,currentHistogram, muons.product(),photons.product(), |
1209 |
|
cumulativeFlags.at("muon-photon pairs").at(currentDir),scaleFactor); |
1210 |
< |
else if(currentHistogram.inputCollection == "electron-photon pairs") fill1DHistogram(histo,currentHistogram, electrons.product(),photons.product(), \ |
1109 |
< |
cumulativeFlags.at("electrons").at(currentDir),cumulativeFlags.at("photons").at(currentDir), |
1210 |
> |
else if(currentHistogram.inputCollection == "electron-photon pairs") fill1DHistogram(histo,currentHistogram, electrons.product(),photons.product(), |
1211 |
|
cumulativeFlags.at("electron-photon pairs").at(currentDir),scaleFactor); |
1212 |
|
else if(currentHistogram.inputCollection == "electron-track pairs") fill1DHistogram(histo,currentHistogram, electrons.product(),tracks.product(), |
1112 |
– |
cumulativeFlags.at("electrons").at(currentDir),cumulativeFlags.at("tracks").at(currentDir), |
1213 |
|
cumulativeFlags.at("electron-track pairs").at(currentDir),scaleFactor); |
1214 |
|
else if(currentHistogram.inputCollection == "muon-track pairs") fill1DHistogram(histo,currentHistogram, muons.product(),tracks.product(), |
1115 |
– |
cumulativeFlags.at("muons").at(currentDir),cumulativeFlags.at("tracks").at(currentDir), |
1215 |
|
cumulativeFlags.at("muon-track pairs").at(currentDir),scaleFactor); |
1216 |
+ |
else if(currentHistogram.inputCollection == "secondary muon-track pairs") fill1DHistogram(histo,currentHistogram, secMuons.product(),tracks.product(), |
1217 |
+ |
cumulativeFlags.at("secondary muon-track pairs").at(currentDir),scaleFactor); |
1218 |
|
else if(currentHistogram.inputCollection == "muon-tau pairs") fill1DHistogram(histo,currentHistogram, muons.product(),taus.product(), |
1118 |
– |
cumulativeFlags.at("muons").at(currentDir),cumulativeFlags.at("taus").at(currentDir), |
1219 |
|
cumulativeFlags.at("muon-tau pairs").at(currentDir),scaleFactor); |
1220 |
|
else if(currentHistogram.inputCollection == "tau-tau pairs") fill1DHistogram(histo,currentHistogram, taus.product(),taus.product(), |
1121 |
– |
cumulativeFlags.at("taus").at(currentDir),cumulativeFlags.at("taus").at(currentDir), |
1221 |
|
cumulativeFlags.at("tau-tau pairs").at(currentDir),scaleFactor); |
1222 |
|
else if(currentHistogram.inputCollection == "tau-track pairs") fill1DHistogram(histo,currentHistogram, taus.product(),tracks.product(), |
1124 |
– |
cumulativeFlags.at("taus").at(currentDir),cumulativeFlags.at("tracks").at(currentDir), |
1223 |
|
cumulativeFlags.at("tau-track pairs").at(currentDir),scaleFactor); |
1224 |
|
else if(currentHistogram.inputCollection == "electron-trigobj pairs") fill1DHistogram(histo,currentHistogram, electrons.product(),trigobjs.product(), |
1127 |
– |
cumulativeFlags.at("electrons").at(currentDir),cumulativeFlags.at("trigobjs").at(currentDir), |
1225 |
|
cumulativeFlags.at("electron-trigobj pairs").at(currentDir),scaleFactor); |
1226 |
|
else if(currentHistogram.inputCollection == "muon-trigobj pairs") fill1DHistogram(histo,currentHistogram, muons.product(),trigobjs.product(), |
1130 |
– |
cumulativeFlags.at("muons").at(currentDir),cumulativeFlags.at("trigobjs").at(currentDir), |
1227 |
|
cumulativeFlags.at("muon-trigobj pairs").at(currentDir),scaleFactor); |
1228 |
|
|
1229 |
|
else if(currentHistogram.inputCollection == "events") fill1DHistogram(histo,currentHistogram,events.product(),cumulativeFlags.at("events").at(currentDir),scaleFactor); |
1246 |
|
else if(currentHistogram.inputCollection == "secondary jets") fill2DHistogram(histo,currentHistogram,jets.product(),cumulativeFlags.at("secondary jets").at(currentDir),scaleFactor); |
1247 |
|
else if(currentHistogram.inputCollection == "secondary photons") fill2DHistogram(histo,currentHistogram,photons.product(),cumulativeFlags.at("secondary photons").at(currentDir),scaleFactor); |
1248 |
|
else if(currentHistogram.inputCollection == "muons") fill2DHistogram(histo,currentHistogram,muons.product(),cumulativeFlags.at("muons").at(currentDir),scaleFactor); |
1249 |
< |
else if(currentHistogram.inputCollection == "secondary muons") fill2DHistogram(histo,currentHistogram,muons.product(),cumulativeFlags.at("secondary muons").at(currentDir),scaleFactor); |
1250 |
< |
else if(currentHistogram.inputCollection == "muon-muon pairs") fill2DHistogram(histo,currentHistogram,muons.product(),muons.product(), \ |
1155 |
< |
cumulativeFlags.at("muons").at(currentDir),cumulativeFlags.at("muons").at(currentDir), \ |
1249 |
> |
else if(currentHistogram.inputCollection == "secondary muons") fill2DHistogram(histo,currentHistogram,secMuons.product(),cumulativeFlags.at("secondary muons").at(currentDir),scaleFactor); |
1250 |
> |
else if(currentHistogram.inputCollection == "muon-muon pairs") fill2DHistogram(histo,currentHistogram,muons.product(),muons.product(), |
1251 |
|
cumulativeFlags.at("muon-muon pairs").at(currentDir),scaleFactor); |
1252 |
< |
else if(currentHistogram.inputCollection == "muon-secondary muon pairs") fill2DHistogram(histo,currentHistogram,muons.product(),muons.product(), \ |
1158 |
< |
cumulativeFlags.at("muons").at(currentDir),cumulativeFlags.at("secondary muons").at(currentDir), \ |
1252 |
> |
else if(currentHistogram.inputCollection == "muon-secondary muon pairs") fill2DHistogram(histo,currentHistogram,muons.product(),secMuons.product(), |
1253 |
|
cumulativeFlags.at("muon-secondary muon pairs").at(currentDir),scaleFactor); |
1254 |
< |
else if(currentHistogram.inputCollection == "muon-secondary photon pairs") fill2DHistogram(histo,currentHistogram,muons.product(),photons.product(), \ |
1161 |
< |
cumulativeFlags.at("muons").at(currentDir),cumulativeFlags.at("secondary photons").at(currentDir), \ |
1254 |
> |
else if(currentHistogram.inputCollection == "muon-secondary photon pairs") fill2DHistogram(histo,currentHistogram,muons.product(),photons.product(), |
1255 |
|
cumulativeFlags.at("muon-secondary photon pairs").at(currentDir),scaleFactor); |
1256 |
< |
else if(currentHistogram.inputCollection == "muon-secondary jet pairs") fill2DHistogram(histo,currentHistogram,muons.product(),jets.product(), \ |
1164 |
< |
cumulativeFlags.at("muons").at(currentDir),cumulativeFlags.at("secondary jets").at(currentDir), \ |
1256 |
> |
else if(currentHistogram.inputCollection == "muon-secondary jet pairs") fill2DHistogram(histo,currentHistogram,muons.product(),jets.product(), |
1257 |
|
cumulativeFlags.at("muon-secondary jet pairs").at(currentDir),scaleFactor); |
1258 |
< |
else if(currentHistogram.inputCollection == "electron-secondary jet pairs") fill2DHistogram(histo,currentHistogram,electrons.product(),jets.product(), \ |
1167 |
< |
cumulativeFlags.at("electrons").at(currentDir),cumulativeFlags.at("secondary jets").at(currentDir), \ |
1258 |
> |
else if(currentHistogram.inputCollection == "electron-secondary jet pairs") fill2DHistogram(histo,currentHistogram,electrons.product(),jets.product(), |
1259 |
|
cumulativeFlags.at("electron-secondary jet pairs").at(currentDir),scaleFactor); |
1260 |
< |
else if(currentHistogram.inputCollection == "photon-secondary jet pairs") fill2DHistogram(histo,currentHistogram,photons.product(),jets.product(), \ |
1170 |
< |
cumulativeFlags.at("photons").at(currentDir),cumulativeFlags.at("secondary jets").at(currentDir), \ |
1260 |
> |
else if(currentHistogram.inputCollection == "photon-secondary jet pairs") fill2DHistogram(histo,currentHistogram,photons.product(),jets.product(), |
1261 |
|
cumulativeFlags.at("photon-secondary jet pairs").at(currentDir),scaleFactor); |
1262 |
|
else if(currentHistogram.inputCollection == "electrons") fill2DHistogram(histo,currentHistogram,electrons.product(),cumulativeFlags.at("electrons").at(currentDir),scaleFactor); |
1263 |
|
else if(currentHistogram.inputCollection == "secondary electrons") fill2DHistogram(histo,currentHistogram,electrons.product(),cumulativeFlags.at("secondary electrons").at(currentDir),scaleFactor); |
1264 |
< |
else if(currentHistogram.inputCollection == "electron-electron pairs") fill2DHistogram(histo,currentHistogram,electrons.product(),electrons.product(), \ |
1175 |
< |
cumulativeFlags.at("electrons").at(currentDir),cumulativeFlags.at("electrons").at(currentDir), \ |
1264 |
> |
else if(currentHistogram.inputCollection == "electron-electron pairs") fill2DHistogram(histo,currentHistogram,electrons.product(),electrons.product(), |
1265 |
|
cumulativeFlags.at("electron-electron pairs").at(currentDir),scaleFactor); |
1266 |
< |
else if(currentHistogram.inputCollection == "jet-jet pairs") fill2DHistogram(histo,currentHistogram,jets.product(),jets.product(), \ |
1178 |
< |
cumulativeFlags.at("jets").at(currentDir),cumulativeFlags.at("jets").at(currentDir), \ |
1266 |
> |
else if(currentHistogram.inputCollection == "jet-jet pairs") fill2DHistogram(histo,currentHistogram,jets.product(),jets.product(), |
1267 |
|
cumulativeFlags.at("jet-jet pairs").at(currentDir),scaleFactor); |
1268 |
< |
else if(currentHistogram.inputCollection == "electron-secondary electron pairs") fill2DHistogram(histo,currentHistogram,electrons.product(),electrons.product(), \ |
1181 |
< |
cumulativeFlags.at("electrons").at(currentDir),cumulativeFlags.at("secondary electrons").at(currentDir), \ |
1268 |
> |
else if(currentHistogram.inputCollection == "electron-secondary electron pairs") fill2DHistogram(histo,currentHistogram,electrons.product(),electrons.product(), |
1269 |
|
cumulativeFlags.at("electron-secondary electron pairs").at(currentDir),scaleFactor); |
1270 |
< |
else if(currentHistogram.inputCollection == "electron-muon pairs") fill2DHistogram(histo,currentHistogram,electrons.product(),muons.product(), \ |
1184 |
< |
cumulativeFlags.at("electrons").at(currentDir),cumulativeFlags.at("muons").at(currentDir), \ |
1270 |
> |
else if(currentHistogram.inputCollection == "electron-muon pairs") fill2DHistogram(histo,currentHistogram,electrons.product(),muons.product(), |
1271 |
|
cumulativeFlags.at("electron-muon pairs").at(currentDir),scaleFactor); |
1272 |
< |
else if(currentHistogram.inputCollection == "electron-jet pairs") fill2DHistogram(histo,currentHistogram,electrons.product(),jets.product(), \ |
1187 |
< |
cumulativeFlags.at("electrons").at(currentDir),cumulativeFlags.at("jets").at(currentDir), \ |
1272 |
> |
else if(currentHistogram.inputCollection == "electron-jet pairs") fill2DHistogram(histo,currentHistogram,electrons.product(),jets.product(), |
1273 |
|
cumulativeFlags.at("electron-jet pairs").at(currentDir),scaleFactor); |
1274 |
< |
else if(currentHistogram.inputCollection == "electron-photon pairs") fill2DHistogram(histo,currentHistogram,electrons.product(),photons.product(), \ |
1190 |
< |
cumulativeFlags.at("electrons").at(currentDir),cumulativeFlags.at("photons").at(currentDir), \ |
1274 |
> |
else if(currentHistogram.inputCollection == "electron-photon pairs") fill2DHistogram(histo,currentHistogram,electrons.product(),photons.product(), |
1275 |
|
cumulativeFlags.at("electron-photon pairs").at(currentDir),scaleFactor); |
1276 |
< |
else if(currentHistogram.inputCollection == "muon-jet pairs") fill2DHistogram(histo,currentHistogram,muons.product(),jets.product(), \ |
1193 |
< |
cumulativeFlags.at("muons").at(currentDir),cumulativeFlags.at("jets").at(currentDir), \ |
1276 |
> |
else if(currentHistogram.inputCollection == "muon-jet pairs") fill2DHistogram(histo,currentHistogram,muons.product(),jets.product(), |
1277 |
|
cumulativeFlags.at("muon-jet pairs").at(currentDir),scaleFactor); |
1278 |
< |
else if(currentHistogram.inputCollection == "muon-event pairs") fill2DHistogram(histo,currentHistogram,muons.product(),events.product(), \ |
1196 |
< |
cumulativeFlags.at("muons").at(currentDir),cumulativeFlags.at("events").at(currentDir), \ |
1278 |
> |
else if(currentHistogram.inputCollection == "muon-event pairs") fill2DHistogram(histo,currentHistogram,muons.product(),events.product(), |
1279 |
|
cumulativeFlags.at("muon-event pairs").at(currentDir),scaleFactor); |
1280 |
< |
else if(currentHistogram.inputCollection == "met-jet pairs") fill2DHistogram(histo,currentHistogram,mets.product(),jets.product(), \ |
1199 |
< |
cumulativeFlags.at("mets").at(currentDir),cumulativeFlags.at("jets").at(currentDir), \ |
1280 |
> |
else if(currentHistogram.inputCollection == "met-jet pairs") fill2DHistogram(histo,currentHistogram,mets.product(),jets.product(), |
1281 |
|
cumulativeFlags.at("met-jet pairs").at(currentDir),scaleFactor); |
1282 |
|
else if(currentHistogram.inputCollection == "track-jet pairs") fill2DHistogram(histo,currentHistogram,tracks.product(),jets.product(), |
1202 |
– |
cumulativeFlags.at("tracks").at(currentDir),cumulativeFlags.at("jets").at(currentDir), \ |
1283 |
|
cumulativeFlags.at("track-jet pairs").at(currentDir),scaleFactor); |
1284 |
< |
else if(currentHistogram.inputCollection == "photon-jet pairs") fill2DHistogram(histo,currentHistogram,photons.product(),jets.product(), \ |
1205 |
< |
cumulativeFlags.at("photons").at(currentDir),cumulativeFlags.at("jets").at(currentDir), \ |
1284 |
> |
else if(currentHistogram.inputCollection == "photon-jet pairs") fill2DHistogram(histo,currentHistogram,photons.product(),jets.product(), |
1285 |
|
cumulativeFlags.at("photon-jet pairs").at(currentDir),scaleFactor); |
1286 |
< |
else if(currentHistogram.inputCollection == "muon-photon pairs") fill2DHistogram(histo,currentHistogram,muons.product(),photons.product(), \ |
1208 |
< |
cumulativeFlags.at("muons").at(currentDir),cumulativeFlags.at("photons").at(currentDir), \ |
1286 |
> |
else if(currentHistogram.inputCollection == "muon-photon pairs") fill2DHistogram(histo,currentHistogram,muons.product(),photons.product(), |
1287 |
|
cumulativeFlags.at("muon-photon pairs").at(currentDir),scaleFactor); |
1288 |
|
else if(currentHistogram.inputCollection == "electron-track pairs") fill2DHistogram(histo,currentHistogram,electrons.product(),tracks.product(), |
1211 |
– |
cumulativeFlags.at("electrons").at(currentDir),cumulativeFlags.at("tracks").at(currentDir), |
1289 |
|
cumulativeFlags.at("electron-track pairs").at(currentDir),scaleFactor); |
1290 |
|
else if(currentHistogram.inputCollection == "muon-track pairs") fill2DHistogram(histo,currentHistogram,muons.product(),tracks.product(), |
1291 |
< |
cumulativeFlags.at("muons").at(currentDir),cumulativeFlags.at("tracks").at(currentDir), |
1291 |
> |
cumulativeFlags.at("muon-track pairs").at(currentDir),scaleFactor); |
1292 |
> |
else if(currentHistogram.inputCollection == "secondary muon-track pairs") fill2DHistogram(histo,currentHistogram,secMuons.product(),tracks.product(), |
1293 |
|
cumulativeFlags.at("muon-track pairs").at(currentDir),scaleFactor); |
1294 |
|
else if(currentHistogram.inputCollection == "muon-tau pairs") fill2DHistogram(histo,currentHistogram,muons.product(),taus.product(), |
1217 |
– |
cumulativeFlags.at("muons").at(currentDir),cumulativeFlags.at("taus").at(currentDir), |
1295 |
|
cumulativeFlags.at("muon-tau pairs").at(currentDir),scaleFactor); |
1296 |
|
else if(currentHistogram.inputCollection == "tau-tau pairs") fill2DHistogram(histo,currentHistogram,taus.product(),taus.product(), |
1220 |
– |
cumulativeFlags.at("taus").at(currentDir),cumulativeFlags.at("taus").at(currentDir), |
1297 |
|
cumulativeFlags.at("tau-tau pairs").at(currentDir),scaleFactor); |
1298 |
|
else if(currentHistogram.inputCollection == "tau-track pairs") fill2DHistogram(histo,currentHistogram,taus.product(),tracks.product(), |
1223 |
– |
cumulativeFlags.at("taus").at(currentDir),cumulativeFlags.at("tracks").at(currentDir), |
1299 |
|
cumulativeFlags.at("tau-track pairs").at(currentDir),scaleFactor); |
1300 |
|
else if(currentHistogram.inputCollection == "electron-trigobj pairs") fill2DHistogram(histo,currentHistogram,electrons.product(),trigobjs.product(), |
1226 |
– |
cumulativeFlags.at("electrons").at(currentDir),cumulativeFlags.at("trigobjs").at(currentDir), |
1301 |
|
cumulativeFlags.at("electron-trigobj pairs").at(currentDir),scaleFactor); |
1302 |
|
else if(currentHistogram.inputCollection == "muon-trigobj pairs") fill2DHistogram(histo,currentHistogram,muons.product(),trigobjs.product(), |
1229 |
– |
cumulativeFlags.at("muons").at(currentDir),cumulativeFlags.at("trigobjs").at(currentDir), |
1303 |
|
cumulativeFlags.at("muon-trigobj pairs").at(currentDir),scaleFactor); |
1304 |
|
else if(currentHistogram.inputCollection == "events") fill2DHistogram(histo,currentHistogram,events.product(),cumulativeFlags.at("events").at(currentDir),scaleFactor); |
1305 |
|
else if(currentHistogram.inputCollection == "taus") fill2DHistogram(histo,currentHistogram,taus.product(),cumulativeFlags.at("taus").at(currentDir),scaleFactor); |
1306 |
|
else if(currentHistogram.inputCollection == "mets") fill2DHistogram(histo,currentHistogram,mets.product(),cumulativeFlags.at("mets").at(currentDir),scaleFactor); |
1307 |
|
else if(currentHistogram.inputCollection == "tracks") fill2DHistogram(histo,currentHistogram,tracks.product(),cumulativeFlags.at("tracks").at(currentDir),scaleFactor); |
1308 |
|
else if(currentHistogram.inputCollection == "track-event pairs") fill2DHistogram(histo,currentHistogram,tracks.product(),events.product(), |
1236 |
– |
cumulativeFlags.at("tracks").at(currentDir),cumulativeFlags.at("events").at(currentDir), |
1309 |
|
cumulativeFlags.at("track-event pairs").at(currentDir),scaleFactor); |
1310 |
|
else if(currentHistogram.inputCollection == "genjets") fill2DHistogram(histo,currentHistogram,genjets.product(),cumulativeFlags.at("genjets").at(currentDir),scaleFactor); |
1311 |
|
else if(currentHistogram.inputCollection == "mcparticles") fill2DHistogram(histo,currentHistogram,mcparticles.product(),cumulativeFlags.at("mcparticles").at(currentDir),scaleFactor); |
1326 |
|
string currentObject = objectsToPlot.at(currentObjectIndex); |
1327 |
|
string objectToPlot = ""; |
1328 |
|
|
1329 |
+ |
if (verbose_) clog << "Filling histogram of number of selected objects in collection: " << currentObject << endl; |
1330 |
+ |
|
1331 |
|
// Name of objectToPlot here must match the name specified in OSUAnalysis::OSUAnalysis(). |
1332 |
|
if(currentObject == "muon-muon pairs") objectToPlot = "dimuonPairs"; |
1333 |
|
else if(currentObject == "electron-electron pairs") objectToPlot = "dielectronPairs"; |
1335 |
|
else if(currentObject == "electron-photon pairs") objectToPlot = "electronPhotonPairs"; |
1336 |
|
else if(currentObject == "electron-jet pairs") objectToPlot = "electronJetPairs"; |
1337 |
|
else if(currentObject == "muon-jet pairs") objectToPlot = "muonJetPairs"; |
1338 |
< |
else if(currentObject == "muon-event pairs") objectToPlot = "muonEventPairs"; |
1339 |
< |
else if(currentObject == "muon-photon pairs") objectToPlot = "muonPhotonPairs"; |
1340 |
< |
else if(currentObject == "photon-jet pairs") objectToPlot = "photonJetPairs"; |
1338 |
> |
else if(currentObject == "muon-event pairs") objectToPlot = "muonEventPairs"; |
1339 |
> |
else if(currentObject == "muon-photon pairs") objectToPlot = "muonPhotonPairs"; |
1340 |
> |
else if(currentObject == "photon-jet pairs") objectToPlot = "photonJetPairs"; |
1341 |
|
else if(currentObject == "met-jet pairs") objectToPlot = "metJetPairs"; |
1342 |
|
else if(currentObject == "track-jet pairs") objectToPlot = "trackJetPairs"; |
1343 |
|
else if(currentObject == "jet-jet pairs") objectToPlot = "dijetPairs"; |
1344 |
|
else if(currentObject == "jet-secondary jet pairs") objectToPlot = "jetSecondaryJetPairs"; |
1345 |
|
else if(currentObject == "secondary jets") objectToPlot = "secondaryJets"; |
1346 |
< |
else if(currentObject == "secondary photons") objectToPlot = "secondaryPhotons"; |
1346 |
> |
else if(currentObject == "secondary photons") objectToPlot = "secondaryPhotons"; |
1347 |
|
else if(currentObject == "electron-track pairs") objectToPlot = "electronTrackPairs"; |
1348 |
|
else if(currentObject == "muon-track pairs") objectToPlot = "muonTrackPairs"; |
1349 |
+ |
else if(currentObject == "secondary muon-track pairs") objectToPlot = "secondaryMuonTrackPairs"; |
1350 |
|
else if(currentObject == "muon-tau pairs") objectToPlot = "muonTauPairs"; |
1351 |
|
else if(currentObject == "tau-tau pairs") objectToPlot = "ditauPairs"; |
1352 |
|
else if(currentObject == "tau-track pairs") objectToPlot = "tauTrackPairs"; |
1354 |
|
else if(currentObject == "muon-secondary muon pairs") objectToPlot = "muonSecondaryMuonPairs"; |
1355 |
|
else if(currentObject == "secondary muons") objectToPlot = "secondaryMuons"; |
1356 |
|
else if(currentObject == "muon-secondary jet pairs") objectToPlot = "muonSecondaryJetPairs"; |
1357 |
< |
else if(currentObject == "muon-secondary photon pairs") objectToPlot = "muonSecondaryJetPairs"; |
1357 |
> |
else if(currentObject == "muon-secondary photon pairs") objectToPlot = "muonSecondaryJetPairs"; |
1358 |
|
else if(currentObject == "electron-secondary jet pairs") objectToPlot = "electronSecondaryJetPairs"; |
1359 |
|
else if(currentObject == "photon-secondary jet pairs") objectToPlot = "photonSecondaryJetPairs"; |
1360 |
|
else if(currentObject == "electron-secondary electron pairs") objectToPlot = "electronSecondaryElectronPairs"; |
1361 |
|
else if(currentObject == "secondary electrons") objectToPlot = "secondaryElectrons"; |
1362 |
|
else if(currentObject == "electron-trigobj pairs") objectToPlot = "electronTrigobjPairs"; |
1363 |
|
else if(currentObject == "muon-trigobj pairs") objectToPlot = "muonTrigobjPairs"; |
1364 |
+ |
else if(currentObject == "electron-mcparticle pairs") objectToPlot = "electronMCparticlePairs"; |
1365 |
|
else objectToPlot = currentObject; |
1366 |
|
|
1367 |
|
string tempCurrentObject = objectToPlot; |
1369 |
|
string histoName = "num" + tempCurrentObject; |
1370 |
|
|
1371 |
|
|
1372 |
< |
if(find(objectsToCut.begin(), objectsToCut.end(), currentObject) != objectsToCut.end()) { |
1372 |
> |
if(find(objectsToPlot.begin(), objectsToPlot.end(), currentObject) != objectsToPlot.end()) { |
1373 |
|
flagPair lastCutFlags = cumulativeFlags.at(currentObject).at(currentDir); |
1374 |
|
int numToPlot = 0; |
1375 |
< |
for (uint currentFlag = 0; currentFlag != lastCutFlags.size(); currentFlag++){ |
1376 |
< |
if(lastCutFlags.at(currentFlag).second) numToPlot++; |
1375 |
> |
for (uint iObj = 0; iObj != lastCutFlags.size(); iObj++){ // loop over all the objects |
1376 |
> |
if(lastCutFlags.at(iObj).second) { |
1377 |
> |
numToPlot++; |
1378 |
> |
if (verbose_>3) clog << " Found object " << iObj << " in collection " << currentObject << " to plot." << endl; |
1379 |
> |
} |
1380 |
|
} |
1381 |
|
|
1382 |
|
if(objectToPlot == "primaryvertexs"){ |
1384 |
|
oneDHists_.at(currentChannelIndex).at(currentCut).at(histoName+"AfterPileupCorrection")->Fill(primaryvertexs->size(),scaleFactor); |
1385 |
|
} |
1386 |
|
else { |
1387 |
+ |
if (printEventInfo_) clog << "Number of selected " << objectToPlot << " to plot: " << numToPlot << endl; |
1388 |
|
oneDHists_.at(currentChannelIndex).at(currentCut).at(histoName)->Fill(numToPlot,scaleFactor); |
1389 |
|
} |
1390 |
|
} |
1391 |
+ |
|
1392 |
|
} // end for (uint currentObjectIndex = 0; currentObjectIndex != objectsToPlot.size(); currentObjectIndex++) |
1393 |
|
|
1394 |
|
|
1404 |
|
|
1405 |
|
if (coll == "jets") assignTreeBranch(brSpecs,jets.product(), cumulativeFlags.at(coll).back()); |
1406 |
|
else if(coll == "secondary jets") assignTreeBranch(brSpecs,jets.product(), cumulativeFlags.at(coll).back()); |
1407 |
< |
else if(coll == "secondary photons") assignTreeBranch(brSpecs,photons.product(), cumulativeFlags.at(coll).back()); |
1407 |
> |
else if(coll == "secondary photons") assignTreeBranch(brSpecs,photons.product(), cumulativeFlags.at(coll).back()); |
1408 |
|
else if(coll == "muons") assignTreeBranch(brSpecs,muons.product(), cumulativeFlags.at(coll).back()); |
1409 |
< |
else if(coll == "secondary muons") assignTreeBranch(brSpecs,muons.product(), cumulativeFlags.at(coll).back()); |
1409 |
> |
else if(coll == "secondary muons") assignTreeBranch(brSpecs,secMuons.product(), cumulativeFlags.at(coll).back()); |
1410 |
|
else if(coll == "electrons") assignTreeBranch(brSpecs,electrons.product(), cumulativeFlags.at(coll).back()); |
1411 |
|
else if(coll == "secondary electrons") assignTreeBranch(brSpecs,electrons.product(), cumulativeFlags.at(coll).back()); |
1412 |
|
else if(coll == "events") assignTreeBranch(brSpecs,events.product(), cumulativeFlags.at(coll).back()); |
1423 |
|
else if(coll == "stops" |
1424 |
|
&& datasetType_ == "signalMC") assignTreeBranch(brSpecs,stops.product(), cumulativeFlags.at(coll).back()); |
1425 |
|
} // end loop over branches |
1426 |
+ |
// set the evtLong, runInt, and lumiInt variables separately, since they are not type float |
1427 |
+ |
BNTreeBranchVals_evtLong_ = events->at(0).evt; |
1428 |
+ |
BNTreeBranchVals_runInt_ = events->at(0).run; |
1429 |
+ |
BNTreeBranchVals_lumiInt_ = events->at(0).lumi; |
1430 |
|
|
1431 |
|
if (!BNTrees_.at(currentChannelIndex)) { clog << "ERROR: Undefined BNTree. Will likely seg fault." << endl; } |
1432 |
|
BNTrees_.at(currentChannelIndex)->Fill(); // only fill if event has passed cuts |
1440 |
|
|
1441 |
|
event.put (channelDecisions, "channelDecisions"); |
1442 |
|
|
1443 |
< |
} // end void OSUAnalysis::analyze (const edm::Event &event, const edm::EventSetup &setup) |
1443 |
> |
isFirstEvent_ = false; |
1444 |
> |
|
1445 |
> |
if (verbose_) clog << "Finished OSUAnalysis::produce." << endl; |
1446 |
> |
|
1447 |
> |
} // end void OSUAnalysis::produce (const edm::Event &event, const edm::EventSetup &setup) |
1448 |
|
|
1449 |
|
|
1450 |
|
|
1472 |
|
else if(comparison == "<") return testValue < cutValue; |
1473 |
|
else if(comparison == "<=") return testValue <= cutValue; |
1474 |
|
else if(comparison == "==") return testValue == cutValue; |
1475 |
< |
else if(comparison == "=") return testValue == cutValue; |
1475 |
> |
else if(comparison == "=") return testValue == cutValue; |
1476 |
|
else if(comparison == "!=") return testValue != cutValue; |
1477 |
|
else {clog << "WARNING: invalid comparison operator '" << comparison << "'\n"; return false;} |
1478 |
|
|
1698 |
|
} |
1699 |
|
|
1700 |
|
|
1701 |
< |
else{clog << "WARNING: invalid variable '" << variable << "'\n"; value = -999;} |
1701 |
> |
else{clog << "WARNING: invalid jet variable '" << variable << "'\n"; value = -999;} |
1702 |
|
|
1703 |
|
value = applyFunction(function, value); |
1704 |
|
|
1873 |
|
|
1874 |
|
//user-defined variables |
1875 |
|
else if(variable == "looseID") { |
1876 |
< |
value = object->pt > 10 && |
1876 |
> |
value = object->pt > 10 && |
1877 |
|
(object->isGlobalMuon > 0 || |
1878 |
|
object->isTrackerMuon > 0); |
1879 |
|
} |
1880 |
+ |
|
1881 |
+ |
else if(variable == "looseIDGlobalMuon") { |
1882 |
+ |
value = object->pt > 10 && |
1883 |
+ |
object->isGlobalMuon > 0; |
1884 |
+ |
} |
1885 |
|
else if(variable == "correctedD0VertexErr") value = hypot (object->tkD0err, hypot (chosenVertex ()->xError, chosenVertex ()->yError)); |
1886 |
|
else if(variable == "correctedD0VertexSig") value = object->correctedD0Vertex / hypot (object->tkD0err, hypot (chosenVertex ()->xError, chosenVertex ()->yError)); |
1887 |
|
else if(variable == "detIso") value = (object->trackIsoDR03) / object->pt; |
1897 |
|
else |
1898 |
|
value = -999; |
1899 |
|
} |
1900 |
< |
|
1901 |
< |
|
1900 |
> |
else if(variable == "ptPlusMet") { |
1901 |
> |
// Calculate the magnitude of the vector sum of the muon pT and the Met. |
1902 |
> |
if (const BNmet *met = chosenMET ()) |
1903 |
> |
{ |
1904 |
> |
TVector2 p2Met; |
1905 |
> |
TVector2 p2Muon; |
1906 |
> |
p2Met. SetMagPhi( met->pt, met->phi); |
1907 |
> |
p2Muon.SetMagPhi(object->pt, object->phi); |
1908 |
> |
TVector2 p2MetElec = p2Met + p2Muon; |
1909 |
> |
value = p2MetElec.Mod(); |
1910 |
> |
} |
1911 |
> |
else |
1912 |
> |
value = -999; |
1913 |
> |
} |
1914 |
|
|
1915 |
|
else if(variable == "correctedD0VertexInEBPlus"){ |
1916 |
|
if(fabs(object->eta) < 0.8 && object->eta > 0) value = object->correctedD0Vertex; |
2095 |
|
|
2096 |
|
|
2097 |
|
|
2098 |
< |
else{clog << "WARNING: invalid variable '" << variable << "'\n"; value = -999;} |
2098 |
> |
else{clog << "WARNING: invalid muon variable '" << variable << "'\n"; value = -999;} |
2099 |
|
|
2100 |
|
value = applyFunction(function, value); |
2101 |
|
|
2282 |
|
value = -999; |
2283 |
|
} |
2284 |
|
|
2285 |
+ |
else if(variable == "ptPlusMet") { |
2286 |
+ |
// Calculate the magnitude of the vector sum of the electron pT and the Met. |
2287 |
+ |
if (const BNmet *met = chosenMET ()) |
2288 |
+ |
{ |
2289 |
+ |
TVector2 p2Met; |
2290 |
+ |
TVector2 p2Elec; |
2291 |
+ |
p2Met. SetMagPhi( met->pt, met->phi); |
2292 |
+ |
p2Elec.SetMagPhi(object->pt, object->phi); |
2293 |
+ |
TVector2 p2MetElec = p2Met + p2Elec; |
2294 |
+ |
value = p2MetElec.Mod(); |
2295 |
+ |
} |
2296 |
+ |
else |
2297 |
+ |
value = -999; |
2298 |
+ |
} |
2299 |
+ |
|
2300 |
|
else if(variable == "correctedD0VertexEEPositiveChargeLowPt"){ |
2301 |
|
if(fabs(object->eta) > 1.479 && object->charge > 0 && object->pt > 45) value = object->correctedD0Vertex; |
2302 |
|
else value = -999; |
2408 |
|
} |
2409 |
|
} |
2410 |
|
|
2411 |
< |
else if(variable == "looseID"){ |
2411 |
> |
else if(variable == "looseID_MVA"){ |
2412 |
|
value = object->pt > 10 |
2413 |
|
&& object->mvaNonTrigV0 > 0; |
2414 |
|
} |
2542 |
|
|
2543 |
|
|
2544 |
|
|
2545 |
< |
else{clog << "WARNING: invalid variable '" << variable << "'\n"; value = -999;} |
2545 |
> |
else{clog << "WARNING: invalid electron variable '" << variable << "'\n"; value = -999;} |
2546 |
|
|
2547 |
|
value = applyFunction(function, value); |
2548 |
|
|
2560 |
|
else if(variable == "pthat") value = object->pthat; |
2561 |
|
else if(variable == "qScale") value = object->qScale; |
2562 |
|
else if(variable == "alphaQCD") value = object->alphaQCD; |
2442 |
– |
else if(variable == "Ht") value = getHt(jets.product()); |
2563 |
|
else if(variable == "alphaQED") value = object->alphaQED; |
2564 |
|
else if(variable == "scalePDF") value = object->scalePDF; |
2565 |
|
else if(variable == "x1") value = object->x1; |
2630 |
|
else if(variable == "electronScaleFactor") value = electronScaleFactor_; |
2631 |
|
else if(variable == "stopCTauScaleFactor") value = stopCTauScaleFactor_; |
2632 |
|
else if(variable == "bTagScaleFactor") value = bTagScaleFactor_; |
2633 |
+ |
|
2634 |
+ |
else if(variable == "unfilteredHt") value = getHt(jets.product()); |
2635 |
|
else if(variable == "ht") value = chosenHT (); |
2636 |
+ |
|
2637 |
|
else if(variable == "leadMuPairInvMass"){ |
2638 |
|
pair<const BNmuon *, const BNmuon *> muPair = leadMuonPair (); |
2639 |
|
TLorentzVector p0 (muPair.first->px, muPair.first->py, muPair.first->pz, muPair.first->energy), |
2660 |
|
pt0 += pt1; |
2661 |
|
value = pt0.Mod (); |
2662 |
|
} |
2663 |
< |
else{clog << "WARNING: invalid variable '" << variable << "'\n"; value = -999;} |
2663 |
> |
else{clog << "WARNING: invalid event variable '" << variable << "'\n"; value = -999;} |
2664 |
|
|
2665 |
|
value = applyFunction(function, value); |
2666 |
|
|
2715 |
|
else if(variable == "leadingTrackValid") value = object->leadingTrackValid; |
2716 |
|
|
2717 |
|
else if (variable == "looseHadronicID") { |
2718 |
< |
value = object->pt > 10 |
2719 |
< |
&& object->eta < 2.3 |
2718 |
> |
//criteria taken from http://cms.cern.ch/iCMS/jsp/db_notes/showNoteDetails.jsp?noteID=CMS%20AN-2011/019 |
2719 |
> |
value = object->pt > 30 |
2720 |
> |
&& fabs(object->eta) < 2.3 |
2721 |
|
&& object->HPSbyLooseCombinedIsolationDeltaBetaCorr > 0 |
2722 |
|
&& object->HPSdecayModeFinding > 0 |
2723 |
|
&& object->HPSagainstElectronLoose > 0 |
2769 |
|
} |
2770 |
|
|
2771 |
|
|
2772 |
< |
else{clog << "WARNING: invalid variable '" << variable << "'\n"; value = -999;} |
2772 |
> |
else{clog << "WARNING: invalid tau variable '" << variable << "'\n"; value = -999;} |
2773 |
|
|
2774 |
|
value = applyFunction(function, value); |
2775 |
|
|
2843 |
|
else if(variable == "pfT1jet10pt") value = object->pfT1jet10pt; |
2844 |
|
else if(variable == "pfT1jet10phi") value = object->pfT1jet10phi; |
2845 |
|
|
2846 |
< |
else{clog << "WARNING: invalid variable '" << variable << "'\n"; value = -999;} |
2846 |
> |
else{clog << "WARNING: invalid met variable '" << variable << "'\n"; value = -999;} |
2847 |
|
|
2848 |
|
value = applyFunction(function, value); |
2849 |
|
|
2888 |
|
else if(variable == "nHitsMissingInner") value = object->nHitsMissingInner; |
2889 |
|
else if(variable == "nHitsMissingMiddle") value = object->nHitsMissingMiddle; |
2890 |
|
else if(variable == "depTrkRp3") value = object->depTrkRp3; |
2891 |
< |
else if(variable == "trkRelIsoRp3") value = (object->depTrkRp3 - object->pt) / object->pt; |
2892 |
< |
else if(variable == "trkRelIsoRp5") value = (object->depTrkRp5 - object->pt) / object->pt; |
2891 |
> |
else if(variable == "trkRelIsoRp3") { value = (object->depTrkRp3 - object->pt) / object->pt; if (value<0) value = 0; } |
2892 |
> |
else if(variable == "trkRelIsoRp5") { value = (object->depTrkRp5 - object->pt) / object->pt; if (value<0) value = 0; } |
2893 |
|
else if(variable == "depEcalRp3") value = object->depEcalRp3; |
2894 |
|
else if(variable == "depHcalRp3") value = object->depHcalRp3; |
2895 |
|
else if(variable == "depHoRp3") value = object->depHoRp3; |
2913 |
|
else if(variable == "dZwrtBS") value = object->dZ - events->at(0).BSz; |
2914 |
|
else if(variable == "depTrkRp5MinusPt"){ |
2915 |
|
if ( (object->depTrkRp5 - object->pt) < 0 ) { |
2916 |
+ |
// clog << "Warning: found track with depTrkRp5 < pt: depTrkRp5=" << object->depTrkRp5 |
2917 |
+ |
// << "; pt=" << object->pt |
2918 |
+ |
// << "; object->depTrkRp5 - object->pt = " << object->depTrkRp5 - object->pt |
2919 |
+ |
// << endl; |
2920 |
|
value = 0; |
2921 |
|
} |
2922 |
|
else value = (object->depTrkRp5 - object->pt); |
2939 |
|
else if(variable == "caloTotDeltaRp5ByP") value = ((object->caloHadDeltaRp5 + object->caloEMDeltaRp5)/pMag); |
2940 |
|
else if(variable == "caloTotDeltaRp5RhoCorr") value = getTrkCaloTotRhoCorr(object); |
2941 |
|
else if(variable == "caloTotDeltaRp5ByPRhoCorr") value = getTrkCaloTotRhoCorr(object) / pMag; |
2942 |
+ |
else if(variable == "depTrkRp5RhoCorr") value = getTrkDepTrkRp5RhoCorr(object); |
2943 |
+ |
else if(variable == "depTrkRp3RhoCorr") value = getTrkDepTrkRp3RhoCorr(object); |
2944 |
+ |
|
2945 |
+ |
else if(variable == "depTrkRp5MinusPtRhoCorr") { |
2946 |
+ |
if ( (getTrkDepTrkRp5RhoCorr(object) - object->pt) < 0 ) value = 0; |
2947 |
+ |
else {value = (getTrkDepTrkRp5RhoCorr(object) - object->pt );} |
2948 |
+ |
} |
2949 |
+ |
|
2950 |
+ |
else if(variable == "depTrkRp3MinusPtRhoCorr") |
2951 |
+ |
{ |
2952 |
+ |
if ( (getTrkDepTrkRp3RhoCorr(object) - object->pt) < 0 ) value = 0; |
2953 |
+ |
else {value = (getTrkDepTrkRp3RhoCorr(object) - object->pt );} |
2954 |
+ |
} |
2955 |
+ |
|
2956 |
|
else if(variable == "isIso") value = getTrkIsIso(object, tracks.product()); |
2957 |
|
else if(variable == "isMatchedDeadEcal") value = getTrkIsMatchedDeadEcal(object); |
2958 |
|
else if(variable == "ptErrorByPt") value = (object->ptError/object->pt); |
2977 |
|
value = vz - (vx * px + vy * py)/pt * (pz/pt); |
2978 |
|
} |
2979 |
|
|
2980 |
+ |
else if(variable == "deltaRMinSubLeadJet") { |
2981 |
+ |
// calculate minimum deltaR between track and any other subleading jet |
2982 |
+ |
double trkJetDeltaRMin = 99.; |
2983 |
+ |
if (!jets.product()) clog << "ERROR: cannot find deltaRMinSubLeadJet because jets collection is not initialized." << endl; |
2984 |
+ |
for (uint ijet = 0; ijet<jets->size(); ijet++) { |
2985 |
+ |
string empty = ""; |
2986 |
+ |
double isSubLeadingJet = valueLookup(&jets->at(ijet), "disappTrkSubLeadingJetID", "", empty); |
2987 |
+ |
if (!isSubLeadingJet) continue; // only consider jets that pass the subleading jet ID criteria |
2988 |
+ |
double jetEta = valueLookup(&jets->at(ijet), "eta", "", empty); |
2989 |
+ |
double jetPhi = valueLookup(&jets->at(ijet), "phi", "", empty); |
2990 |
+ |
double trkJetDeltaR = deltaR(object->eta, object->phi, jetEta, jetPhi); |
2991 |
+ |
if (trkJetDeltaR < trkJetDeltaRMin) trkJetDeltaRMin = trkJetDeltaR; |
2992 |
+ |
} |
2993 |
+ |
value = trkJetDeltaRMin; |
2994 |
+ |
} |
2995 |
+ |
|
2996 |
+ |
else if(variable == "deltaRMinElecLooseMvaId") { |
2997 |
+ |
// calculate minimum deltaR between track and any other electron passing loose mva ID, i.e., mvaNonTrigV0 > 0 |
2998 |
+ |
double trkElecDeltaRMin = 99.; |
2999 |
+ |
if (!electrons.product()) clog << "ERROR: cannot find deltaRMinElecLooseMvaId because electrons collection is not initialized." << endl; |
3000 |
+ |
for (uint ielec = 0; ielec<electrons->size(); ielec++) { |
3001 |
+ |
string empty = ""; |
3002 |
+ |
double mvaNonTrigV0 = valueLookup(&electrons->at(ielec), "mvaNonTrigV0", "", empty); |
3003 |
+ |
if (mvaNonTrigV0 < 0) continue; // only consider electrons with mvaNonTrigV0 > 0 |
3004 |
+ |
double elecEta = valueLookup(&electrons->at(ielec), "eta", "", empty); |
3005 |
+ |
double elecPhi = valueLookup(&electrons->at(ielec), "phi", "", empty); |
3006 |
+ |
double trkElecDeltaR = deltaR(object->eta, object->phi, elecEta, elecPhi); |
3007 |
+ |
if (trkElecDeltaR < trkElecDeltaRMin) trkElecDeltaRMin = trkElecDeltaR; |
3008 |
+ |
} |
3009 |
+ |
value = trkElecDeltaRMin; |
3010 |
+ |
} |
3011 |
+ |
|
3012 |
+ |
else if(variable == "deltaRMinMuonLooseId") { |
3013 |
+ |
// calculate minimum deltaR between track and any other loose-Id muon |
3014 |
+ |
double trkMuonDeltaRMin = 99.; |
3015 |
+ |
if (!muons.product()) clog << "ERROR: cannot find deltaRMinMuonLooseId because muons collection is not initialized." << endl; |
3016 |
+ |
for (uint imuon = 0; imuon<muons->size(); imuon++) { |
3017 |
+ |
string empty = ""; |
3018 |
+ |
double isLooseIdMuon = valueLookup(&muons->at(imuon), "looseID", "", empty); |
3019 |
+ |
if (!isLooseIdMuon) continue; // only consider muons that pass the looseID criteria |
3020 |
+ |
double muonEta = valueLookup(&muons->at(imuon), "eta", "", empty); |
3021 |
+ |
double muonPhi = valueLookup(&muons->at(imuon), "phi", "", empty); |
3022 |
+ |
double trkMuonDeltaR = deltaR(object->eta, object->phi, muonEta, muonPhi); |
3023 |
+ |
if (trkMuonDeltaR < trkMuonDeltaRMin) trkMuonDeltaRMin = trkMuonDeltaR; |
3024 |
+ |
} |
3025 |
+ |
value = trkMuonDeltaRMin; |
3026 |
+ |
} |
3027 |
+ |
|
3028 |
+ |
else if(variable == "isPassMuonLooseIDVeto") { |
3029 |
+ |
|
3030 |
+ |
// calculate minimum deltaR between track and any other loose-Id |
3031 |
+ |
double trkMuonDeltaRMin = 99.; |
3032 |
+ |
if (!muons.product()) clog << "ERROR: cannot find deltaRMinMuonLooseId because muons collection is not initialized." << endl; |
3033 |
+ |
for (uint imuon = 0; imuon<muons->size(); imuon++) { |
3034 |
+ |
string empty = ""; |
3035 |
+ |
double isLooseIdMuon = valueLookup(&muons->at(imuon), "looseID", "", empty); |
3036 |
+ |
if (!isLooseIdMuon) continue; // only consider muons that pass the looseID |
3037 |
+ |
double muonEta = valueLookup(&muons->at(imuon), "eta", "", empty); |
3038 |
+ |
double muonPhi = valueLookup(&muons->at(imuon), "phi", "", empty); |
3039 |
+ |
double trkMuonDeltaR = deltaR(object->eta, object->phi, muonEta, muonPhi); |
3040 |
+ |
if (trkMuonDeltaR < trkMuonDeltaRMin) trkMuonDeltaRMin = trkMuonDeltaR; |
3041 |
+ |
} |
3042 |
+ |
if (trkMuonDeltaRMin < 0.15) value = 1; |
3043 |
+ |
if (trkMuonDeltaRMin > 0.15) value = 0; |
3044 |
+ |
} |
3045 |
+ |
|
3046 |
+ |
|
3047 |
+ |
|
3048 |
+ |
else if(variable == "deltaRMinSecMuonLooseIdGlobal") { |
3049 |
+ |
// calculate minimum deltaR between track and any other loose-Id muon |
3050 |
+ |
double trkMuonDeltaRMin = 99.; |
3051 |
+ |
if (!secMuons.product()) clog << "ERROR: cannot find deltaRMinSecMuonLooseIdGlobal because secMuons collection is not initialized." << endl; |
3052 |
+ |
for (uint imuon = 0; imuon<secMuons->size(); imuon++) { |
3053 |
+ |
string empty = ""; |
3054 |
+ |
double isLooseIdMuon = valueLookup(&secMuons->at(imuon), "looseIDGlobalMuon", "", empty); |
3055 |
+ |
if (!isLooseIdMuon) continue; // only consider muons that pass the looseIDGlobal criteria |
3056 |
+ |
double muonEta = valueLookup(&secMuons->at(imuon), "eta", "", empty); |
3057 |
+ |
double muonPhi = valueLookup(&secMuons->at(imuon), "phi", "", empty); |
3058 |
+ |
double trkMuonDeltaR = deltaR(object->eta, object->phi, muonEta, muonPhi); |
3059 |
+ |
if (trkMuonDeltaR < trkMuonDeltaRMin) trkMuonDeltaRMin = trkMuonDeltaR; |
3060 |
+ |
} |
3061 |
+ |
value = trkMuonDeltaRMin; |
3062 |
+ |
} |
3063 |
+ |
|
3064 |
+ |
else if(variable == "deltaRMinTauLooseHadronicId") { |
3065 |
+ |
// calculate minimum deltaR between track and any other tau passing loose hadronic ID |
3066 |
+ |
double trkTauDeltaRMin = 99.; |
3067 |
+ |
if (!taus.product()) clog << "ERROR: cannot find deltaRMinTauLooseHadronicId because taus collection is not initialized." << endl; |
3068 |
+ |
for (uint itau = 0; itau<taus->size(); itau++) { |
3069 |
+ |
string empty = ""; |
3070 |
+ |
double isIdTau = valueLookup(&taus->at(itau), "looseHadronicID", "", empty); |
3071 |
+ |
if (!isIdTau) continue; // only consider taus that pass the loose hadronic ID criteria |
3072 |
+ |
double tauEta = valueLookup(&taus->at(itau), "eta", "", empty); |
3073 |
+ |
double tauPhi = valueLookup(&taus->at(itau), "phi", "", empty); |
3074 |
+ |
double trkTauDeltaR = deltaR(object->eta, object->phi, tauEta, tauPhi); |
3075 |
+ |
if (trkTauDeltaR < trkTauDeltaRMin) trkTauDeltaRMin = trkTauDeltaR; |
3076 |
+ |
} |
3077 |
+ |
value = trkTauDeltaRMin; |
3078 |
+ |
} |
3079 |
|
|
3080 |
|
else if(variable == "genDeltaRLowest") value = getGenDeltaRLowest(object); |
3081 |
|
|
3124 |
|
|
3125 |
|
|
3126 |
|
|
3127 |
< |
else{clog << "WARNING: invalid variable '" << variable << "'\n"; value = -999;} |
3127 |
> |
else{clog << "WARNING: invalid track variable '" << variable << "'\n"; value = -999;} |
3128 |
|
|
3129 |
|
value = applyFunction(function, value); |
3130 |
|
|
3154 |
|
else if(variable == "charge") value = object->charge; |
3155 |
|
|
3156 |
|
|
3157 |
< |
else{clog << "WARNING: invalid variable '" << variable << "'\n"; value = -999;} |
3157 |
> |
else{clog << "WARNING: invalid genjet variable '" << variable << "'\n"; value = -999;} |
3158 |
|
|
3159 |
|
value = applyFunction(function, value); |
3160 |
|
|
3288 |
|
} |
3289 |
|
|
3290 |
|
|
3291 |
< |
else{clog << "WARNING: invalid variable '" << variable << "'\n"; value = -999;} |
3291 |
> |
else{clog << "WARNING: invalid mcparticle variable '" << variable << "'\n"; value = -999;} |
3292 |
|
|
3293 |
|
value = applyFunction(function, value); |
3294 |
|
|
3317 |
|
else if(variable == "isGood") value = object->isGood; |
3318 |
|
|
3319 |
|
|
3320 |
< |
else{clog << "WARNING: invalid variable '" << variable << "'\n"; value = -999;} |
3320 |
> |
else{clog << "WARNING: invalid primaryvertex variable '" << variable << "'\n"; value = -999;} |
3321 |
|
|
3322 |
|
value = applyFunction(function, value); |
3323 |
|
|
3335 |
|
else if(variable == "bx_LUMI_now") value = object->bx_LUMI_now; |
3336 |
|
|
3337 |
|
|
3338 |
< |
else{clog << "WARNING: invalid variable '" << variable << "'\n"; value = -999;} |
3338 |
> |
else{clog << "WARNING: invalid bxlumi variable '" << variable << "'\n"; value = -999;} |
3339 |
|
|
3340 |
|
value = applyFunction(function, value); |
3341 |
|
|
3468 |
|
} |
3469 |
|
|
3470 |
|
|
3471 |
< |
else{clog << "WARNING: invalid variable '" << variable << "'\n"; value = -999;} |
3471 |
> |
else{clog << "WARNING: invalid photon variable '" << variable << "'\n"; value = -999;} |
3472 |
|
|
3473 |
|
value = applyFunction(function, value); |
3474 |
|
|
3492 |
|
else if(variable == "theta") value = object->theta; |
3493 |
|
|
3494 |
|
|
3495 |
< |
else{clog << "WARNING: invalid variable '" << variable << "'\n"; value = -999;} |
3495 |
> |
else{clog << "WARNING: invalid supercluster variable '" << variable << "'\n"; value = -999;} |
3496 |
|
|
3497 |
|
value = applyFunction(function, value); |
3498 |
|
|
3526 |
|
stringValue = "none"; // stringValue should only be empty if value is filled |
3527 |
|
} |
3528 |
|
|
3529 |
< |
else{clog << "WARNING: invalid variable '" << variable << "'\n"; value = -999;} |
3529 |
> |
else{clog << "WARNING: invalid trigobj variable '" << variable << "'\n"; value = -999;} |
3530 |
|
|
3531 |
|
value = applyFunction(function, value); |
3532 |
|
|
3597 |
|
value = object2->correctedD0; |
3598 |
|
} |
3599 |
|
|
3600 |
< |
else{clog << "WARNING: invalid variable '" << variable << "'\n"; value = -999;} |
3600 |
> |
else{clog << "WARNING: invalid muon-muon pair variable '" << variable << "'\n"; value = -999;} |
3601 |
|
|
3602 |
|
value = applyFunction(function, value); |
3603 |
|
|
3644 |
|
TVector3 threeVector2(object2->px, object2->py, object2->pz); |
3645 |
|
value = (pi-threeVector1.Angle(threeVector2)); |
3646 |
|
} |
3647 |
< |
else{clog << "WARNING: invalid variable '" << variable << "'\n"; value = -999;} |
3647 |
> |
else{clog << "WARNING: invalid muon-photon pair variable '" << variable << "'\n"; value = -999;} |
3648 |
|
|
3649 |
|
value = applyFunction(function, value); |
3650 |
|
|
3651 |
|
return value; |
3652 |
< |
} |
3652 |
> |
} // end muon-photon pair valueLookup |
3653 |
> |
|
3654 |
|
|
3655 |
|
//!electron-photon pair valueLookup |
3656 |
|
double |
3691 |
|
TVector3 threeVector2(object2->px, object2->py, object2->pz); |
3692 |
|
value = (pi-threeVector1.Angle(threeVector2)); |
3693 |
|
} |
3694 |
< |
else{clog << "WARNING: invalid variable '" << variable << "'\n"; value = -999;} |
3694 |
> |
else{clog << "WARNING: invalid electron-photon pair variable '" << variable << "'\n"; value = -999;} |
3695 |
|
|
3696 |
|
value = applyFunction(function, value); |
3697 |
|
|
3698 |
|
return value; |
3699 |
< |
} |
3699 |
> |
} // end electron-photon pair valueLookup |
3700 |
> |
|
3701 |
|
|
3702 |
|
//!electron-electron pair valueLookup |
3703 |
|
double |
3748 |
|
value = object2->correctedD0; |
3749 |
|
} |
3750 |
|
|
3751 |
< |
else{clog << "WARNING: invalid variable '" << variable << "'\n"; value = -999;} |
3751 |
> |
else{clog << "WARNING: invalid electron-electron pair variable '" << variable << "'\n"; value = -999;} |
3752 |
|
|
3753 |
|
value = applyFunction(function, value); |
3754 |
|
|
3755 |
|
return value; |
3756 |
< |
} |
3756 |
> |
} // end electron-electron pair valueLookup |
3757 |
> |
|
3758 |
|
|
3759 |
|
//!electron-muon pair valueLookup |
3760 |
|
double |
3816 |
|
else if(variable == "muonRelPFdBetaIso"){ |
3817 |
|
value = (object2->pfIsoR04SumChargedHadronPt + max(0.0, object2->pfIsoR04SumNeutralHadronEt + object2->pfIsoR04SumPhotonEt - 0.5*object2->pfIsoR04SumPUPt)) / object2->pt; |
3818 |
|
} |
3819 |
< |
else{clog << "WARNING: invalid variable '" << variable << "'\n"; value = -999;} |
3819 |
> |
else{clog << "WARNING: invalid electron-muon pair variable '" << variable << "'\n"; value = -999;} |
3820 |
|
value = applyFunction(function, value); |
3821 |
|
|
3822 |
|
return value; |
3823 |
|
} // end electron-muon pair valueLookup |
3824 |
|
|
3825 |
< |
|
3825 |
> |
|
3826 |
|
//!electron-jet pair valueLookup |
3827 |
|
double |
3828 |
|
OSUAnalysis::valueLookup (const BNelectron* object1, const BNjet* object2, string variable, string function, string &stringValue){ |
3856 |
|
value = object1->charge*object2->charge; |
3857 |
|
} |
3858 |
|
|
3859 |
< |
else{clog << "WARNING: invalid variable '" << variable << "'\n"; value = -999;} |
3859 |
> |
else{clog << "WARNING: invalid electron-jet pair variable '" << variable << "'\n"; value = -999;} |
3860 |
> |
value = applyFunction(function, value); |
3861 |
> |
|
3862 |
> |
return value; |
3863 |
> |
} |
3864 |
> |
|
3865 |
> |
//!electron-mcparticle pair valueLookup |
3866 |
> |
double |
3867 |
> |
OSUAnalysis::valueLookup (const BNelectron* object1, const BNmcparticle* object2, string variable, string function, string &stringValue){ |
3868 |
> |
|
3869 |
> |
double value = 0.0; |
3870 |
> |
|
3871 |
> |
if(variable == "deltaPhi") value = fabs(deltaPhi(object1->phi,object2->phi)); |
3872 |
> |
else if(variable == "deltaEta") value = fabs(object1->eta - object2->eta); |
3873 |
> |
else if(variable == "deltaR") value = deltaR(object1->eta,object1->phi,object2->eta,object2->phi); |
3874 |
> |
else if(variable == "threeDAngle") |
3875 |
> |
{ |
3876 |
> |
TVector3 threeVector1(object1->px, object1->py, object1->pz); |
3877 |
> |
TVector3 threeVector2(object2->px, object2->py, object2->pz); |
3878 |
> |
value = (threeVector1.Angle(threeVector2)); |
3879 |
> |
} |
3880 |
> |
else if(variable == "chargeProduct"){ |
3881 |
> |
value = object1->charge*object2->charge; |
3882 |
> |
} |
3883 |
> |
|
3884 |
> |
else{clog << "WARNING: invalid electron-mcparticle variable '" << variable << "'\n"; value = -999;} |
3885 |
|
value = applyFunction(function, value); |
3886 |
|
|
3887 |
|
return value; |
3888 |
|
} |
3889 |
|
|
3890 |
+ |
|
3891 |
|
//!photon-jet pair valueLookup |
3892 |
|
double |
3893 |
|
OSUAnalysis::valueLookup (const BNphoton* object1, const BNjet* object2, string variable, string function, string &stringValue){ |
3918 |
|
TVector3 threeVector2(object2->px, object2->py, object2->pz); |
3919 |
|
value = (threeVector1.Angle(threeVector2)); |
3920 |
|
} |
3921 |
< |
else{clog << "WARNING: invalid variable '" << variable << "'\n"; value = -999;} |
3921 |
> |
else{clog << "WARNING: invalid photon-jet pair variable '" << variable << "'\n"; value = -999;} |
3922 |
|
value = applyFunction(function, value); |
3923 |
|
|
3924 |
|
return value; |
3933 |
|
if(variable == "deltaPhi") value = fabs(deltaPhi(object1->phi,object2->phi)); |
3934 |
|
else if(variable == "deltaR") value = deltaR(object1->eta,object1->phi,object2->eta,object2->phi); |
3935 |
|
|
3936 |
< |
else{clog << "WARNING: invalid variable '" << variable << "'\n"; value = -999;} |
3936 |
> |
else{clog << "WARNING: invalid track-jet pair variable '" << variable << "'\n"; value = -999;} |
3937 |
|
value = applyFunction(function, value); |
3938 |
|
|
3939 |
|
return value; |
3950 |
|
|
3951 |
|
if(variable == "deltaPhi") value = fabs(deltaPhi(object1->phi,object2->phi)); |
3952 |
|
|
3953 |
< |
else{clog << "WARNING: invalid variable '" << variable << "'\n"; value = -999;} |
3953 |
> |
else{clog << "WARNING: invalid met-jet pair variable '" << variable << "'\n"; value = -999;} |
3954 |
|
value = applyFunction(function, value); |
3955 |
|
|
3956 |
|
return value; |
3996 |
|
value = object1->charge*object2->charge; |
3997 |
|
} |
3998 |
|
|
3999 |
< |
else{clog << "WARNING: invalid variable '" << variable << "'\n"; value = -999;} |
3999 |
> |
else{clog << "WARNING: invalid muon-jet pair variable '" << variable << "'\n"; value = -999;} |
4000 |
|
value = applyFunction(function, value); |
4001 |
|
|
4002 |
|
return value; |
4003 |
< |
} |
4003 |
> |
} // end muon-jet pair valueLookup |
4004 |
> |
|
4005 |
|
|
4006 |
|
//!muon-event valueLookup |
4007 |
|
double |
4015 |
|
else if(variable == "Ht") value = getHt(jets.product()); |
4016 |
|
else if(variable == "pthat") value = object2->pthat; |
4017 |
|
else if(variable == "relPFdBetaIso") value = (object1->pfIsoR04SumChargedHadronPt + max(0.0, object1->pfIsoR04SumNeutralHadronEt + object1->pfIsoR04SumPhotonEt - 0.5*object1->pfIsoR04SumPUPt)) / object1->pt; |
4018 |
< |
else{clog << "WARNING: invalid variable '" << variable << "'\n"; value = -999;} |
4018 |
> |
else{clog << "WARNING: invalid muon-event pair variable '" << variable << "'\n"; value = -999;} |
4019 |
|
value = applyFunction(function, value); |
4020 |
|
|
4021 |
|
return value; |
4050 |
|
value = object1->charge*object2->charge; |
4051 |
|
} |
4052 |
|
|
4053 |
< |
else{clog << "WARNING: invalid variable '" << variable << "'\n"; value = -999;} |
4053 |
> |
else{clog << "WARNING: invalid jet-jet pair variable '" << variable << "'\n"; value = -999;} |
4054 |
|
value = applyFunction(function, value); |
4055 |
|
|
4056 |
|
return value; |
4066 |
|
if(variable == "deltaPhi") value = fabs(deltaPhi(object1->phi,object2->phi)); |
4067 |
|
else if(variable == "deltaEta") value = fabs(object1->eta - object2->eta); |
4068 |
|
else if(variable == "deltaR") value = deltaR(object1->eta,object1->phi,object2->eta,object2->phi); |
4069 |
+ |
else if(variable == "deltaRLooseMvaId") { |
4070 |
+ |
// only consider electrons that pass "loose MVA id", i.e., mvaNonTrigV0 > 0; |
4071 |
+ |
// otherwise return very large value (99) |
4072 |
+ |
if (object1->mvaNonTrigV0>0) value = deltaR(object1->eta,object1->phi,object2->eta,object2->phi); |
4073 |
+ |
else value = 99.; |
4074 |
+ |
} |
4075 |
|
else if(variable == "invMass"){ |
4076 |
|
fourVector1.SetPtEtaPhiM(object1->pt, object1->eta, object1->phi, electronMass); |
4077 |
|
fourVector2.SetPtEtaPhiM(object2->pt, object2->eta, object2->phi, electronMass ); |
4081 |
|
else if(variable == "chargeProduct"){ |
4082 |
|
value = object1->charge*object2->charge; |
4083 |
|
} |
4084 |
< |
else{clog << "WARNING: invalid variable '" << variable << "'\n"; value = -999;} |
4084 |
> |
else{clog << "WARNING: invalid electron-track pair variable '" << variable << "'\n"; value = -999;} |
4085 |
|
value = applyFunction(function, value); |
4086 |
|
return value; |
4087 |
|
|
4091 |
|
//!muon-track pair valueLookup |
4092 |
|
double |
4093 |
|
OSUAnalysis::valueLookup (const BNmuon* object1, const BNtrack* object2, string variable, string function, string &stringValue){ |
3817 |
– |
double pionMass = 0.140; |
3818 |
– |
double muonMass = 0.106; |
4094 |
|
double value = 0.0; |
3820 |
– |
TLorentzVector fourVector1(0, 0, 0, 0); |
3821 |
– |
TLorentzVector fourVector2(0, 0, 0, 0); |
4095 |
|
if(variable == "deltaPhi") value = fabs(deltaPhi(object1->phi,object2->phi)); |
4096 |
|
else if(variable == "deltaEta") value = fabs(object1->eta - object2->eta); |
4097 |
|
else if(variable == "deltaR") value = deltaR(object1->eta,object1->phi,object2->eta,object2->phi); |
4098 |
+ |
else if(variable == "deltaRLooseID") { |
4099 |
+ |
// only consider muons that pass looseId criteria; otherwise return very large value (99.) |
4100 |
+ |
string empty = ""; |
4101 |
+ |
double isLooseId = valueLookup(object1, "looseID", "", empty); |
4102 |
+ |
if (isLooseId) value = deltaR(object1->eta,object1->phi,object2->eta,object2->phi); |
4103 |
+ |
else value = 99.; |
4104 |
+ |
} |
4105 |
+ |
else if(variable == "deltaRGlobalMuon") { |
4106 |
+ |
// only consider muons that pass looseId criteria; otherwise return very large value (99.) |
4107 |
+ |
if (object1->isGlobalMuon) value = deltaR(object1->eta,object1->phi,object2->eta,object2->phi); |
4108 |
+ |
else value = 99.; |
4109 |
+ |
} |
4110 |
|
else if(variable == "invMass"){ |
4111 |
+ |
double pionMass = 0.140; |
4112 |
+ |
double muonMass = 0.106; |
4113 |
+ |
TLorentzVector fourVector1(0, 0, 0, 0); |
4114 |
+ |
TLorentzVector fourVector2(0, 0, 0, 0); |
4115 |
|
fourVector1.SetPtEtaPhiM(object1->pt, object1->eta, object1->phi, muonMass); |
4116 |
|
fourVector2.SetPtEtaPhiM(object2->pt, object2->eta, object2->phi, pionMass ); |
3828 |
– |
|
4117 |
|
value = (fourVector1 + fourVector2).M(); |
4118 |
|
} |
4119 |
|
else if(variable == "chargeProduct"){ |
4120 |
|
value = object1->charge*object2->charge; |
4121 |
|
} |
4122 |
|
|
4123 |
< |
else{clog << "WARNING: invalid variable '" << variable << "'\n"; value = -999;} |
4123 |
> |
else{clog << "WARNING: invalid muon-track pair variable '" << variable << "'\n"; value = -999;} |
4124 |
|
value = applyFunction(function, value); |
4125 |
|
return value; |
4126 |
|
} |
4142 |
|
value = object1->charge*object2->charge; |
4143 |
|
} |
4144 |
|
|
4145 |
< |
else{clog << "WARNING: invalid variable '" << variable << "'\n"; value = -999;} |
4145 |
> |
else{clog << "WARNING: invalid tau-tau pair variable '" << variable << "'\n"; value = -999;} |
4146 |
|
value = applyFunction(function, value); |
4147 |
|
return value; |
4148 |
|
} |
4164 |
|
value = object1->charge*object2->charge; |
4165 |
|
} |
4166 |
|
|
4167 |
< |
else{clog << "WARNING: invalid variable '" << variable << "'\n"; value = -999;} |
4167 |
> |
else{clog << "WARNING: invalid muon-tau pair variable '" << variable << "'\n"; value = -999;} |
4168 |
|
value = applyFunction(function, value); |
4169 |
|
return value; |
4170 |
|
} |
4175 |
|
double value = 0.0; |
4176 |
|
if(variable == "deltaPhi") value = fabs(deltaPhi(object1->phi,object2->phi)); |
4177 |
|
else if(variable == "deltaR") value = deltaR(object1->eta,object1->phi,object2->eta,object2->phi); |
4178 |
+ |
else if(variable == "deltaRLooseHadronicID") { |
4179 |
+ |
// only consider tau's that pass the loose hadronic ID criteria; otherwise return very large value (99) |
4180 |
+ |
string empty = ""; |
4181 |
+ |
double isLooseHadronicID = valueLookup(object1, "looseHadronicID", "", empty); |
4182 |
+ |
|
4183 |
+ |
if (isLooseHadronicID) value = deltaR(object1->eta,object1->phi,object2->eta,object2->phi); |
4184 |
+ |
else value = 99.; |
4185 |
+ |
} |
4186 |
+ |
else if(variable == "deltaEta") value = fabs(object1->eta - object2->eta); |
4187 |
+ |
else if(variable == "invMass"){ |
4188 |
+ |
double tauMass = 1.777; // PDG 2010 |
4189 |
+ |
double pionMass = 0.140; // PDG 2010 |
4190 |
+ |
TLorentzVector fourVector1(0, 0, 0, 0); |
4191 |
+ |
TLorentzVector fourVector2(0, 0, 0, 0); |
4192 |
+ |
fourVector1.SetPtEtaPhiM(object1->pt, object1->eta, object1->phi, tauMass); |
4193 |
+ |
fourVector2.SetPtEtaPhiM(object2->pt, object2->eta, object2->phi, pionMass ); |
4194 |
+ |
value = (fourVector1 + fourVector2).M(); |
4195 |
+ |
} |
4196 |
|
else if(variable == "chargeProduct"){ |
4197 |
|
value = object1->charge*object2->charge; |
4198 |
|
} |
4199 |
|
|
4200 |
< |
else{clog << "WARNING: invalid variable '" << variable << "'\n"; value = -999;} |
4200 |
> |
else{clog << "WARNING: invalid tau-track pair variable '" << variable << "'\n"; value = -999;} |
4201 |
|
value = applyFunction(function, value); |
4202 |
|
return value; |
4203 |
|
} |
4217 |
|
else if (variable == "caloTotDeltaRp5_RhoCorr") value = getTrkCaloTotRhoCorr(object1); |
4218 |
|
else if (variable == "caloTotDeltaRp5ByP_RhoCorr") value = getTrkCaloTotRhoCorr(object1) / pMag; |
4219 |
|
|
4220 |
< |
else { clog << "WARNING: invalid variable '" << variable << "'\n"; value = -999; } |
4220 |
> |
else { clog << "WARNING: invalid track-event pair variable '" << variable << "'\n"; value = -999; } |
4221 |
|
|
4222 |
|
value = applyFunction(function, value); |
4223 |
|
|
4239 |
|
stringValue = "none"; |
4240 |
|
} |
4241 |
|
|
4242 |
< |
else { clog << "WARNING: invalid variable '" << variable << "'\n"; value = -999; } |
4242 |
> |
else { clog << "WARNING: invalid electron-trigobj variable '" << variable << "'\n"; value = -999; } |
4243 |
|
|
4244 |
|
value = applyFunction(function, value); |
4245 |
|
|
4255 |
|
|
4256 |
|
if (variable == "deltaR") value = deltaR(object1->eta,object1->phi,object2->eta,object2->phi); |
4257 |
|
|
4258 |
< |
else { clog << "WARNING: invalid variable '" << variable << "'\n"; value = -999; } |
4258 |
> |
else { clog << "WARNING: invalid muon-trigobj variable '" << variable << "'\n"; value = -999; } |
4259 |
|
|
4260 |
|
value = applyFunction(function, value); |
4261 |
|
|
4375 |
|
|
4376 |
|
|
4377 |
|
|
4378 |
< |
else { clog << "WARNING: invalid variable '" << variable << "'\n"; value = -999; } |
4378 |
> |
else { clog << "WARNING: invalid stop variable '" << variable << "'\n"; value = -999; } |
4379 |
|
|
4380 |
|
value = applyFunction(function, value); |
4381 |
|
|
4457 |
|
|
4458 |
|
} |
4459 |
|
|
4460 |
+ |
double |
4461 |
+ |
OSUAnalysis::getTrkDepTrkRp5RhoCorr(const BNtrack* track) { |
4462 |
+ |
// Return the pile-up (rho) corrected isolation energy, i.e., the total calorimeter energy around the candidate track. |
4463 |
+ |
if (!useTrackCaloRhoCorr_) return -99; |
4464 |
+ |
// if (!rhokt6CaloJetsHandle_) { |
4465 |
+ |
// clog << "ERROR [getTrkCaloTotRhoCorr]: The collection rhokt6CaloJetsHandle is not available!" << endl; |
4466 |
+ |
// return -99; |
4467 |
+ |
// } |
4468 |
+ |
double radDeltaRCone = 0.5; |
4469 |
+ |
double rhoCorr_kt6CaloJets = *rhokt6CaloJetsHandle_ * TMath::Pi() * pow(radDeltaRCone, 2); // Define effective area as pi*r^2, where r is radius of DeltaR cone. |
4470 |
+ |
double rawDepTrkRp5 = track->depTrkRp5; |
4471 |
+ |
double depTrkRp5RhoCorr = TMath::Max(0., rawDepTrkRp5 - rhoCorr_kt6CaloJets); |
4472 |
+ |
return depTrkRp5RhoCorr; |
4473 |
+ |
|
4474 |
+ |
} |
4475 |
+ |
|
4476 |
+ |
double |
4477 |
+ |
OSUAnalysis::getTrkDepTrkRp3RhoCorr(const BNtrack* track) { |
4478 |
+ |
// Return the pile-up (rho) corrected isolation energy, i.e., the total calorimeter energy around the candidate track. |
4479 |
+ |
if (!useTrackCaloRhoCorr_) return -99; |
4480 |
+ |
// if (!rhokt6CaloJetsHandle_) { |
4481 |
+ |
// clog << "ERROR [getTrkCaloTotRhoCorr]: The collection rhokt6CaloJetsHandle is not available!" << endl; |
4482 |
+ |
// return -99; |
4483 |
+ |
// } |
4484 |
+ |
double radDeltaRCone = 0.3; |
4485 |
+ |
// Define effective area as pi*r^2, where r is radius of DeltaR cone |
4486 |
+ |
double rhoCorr_kt6CaloJets = *rhokt6CaloJetsHandle_ * TMath::Pi() * pow(radDeltaRCone, 2); |
4487 |
+ |
double rawDepTrkRp3 = track->depTrkRp3; |
4488 |
+ |
double depTrkRp3RhoCorr = TMath::Max(0., rawDepTrkRp3 - rhoCorr_kt6CaloJets); |
4489 |
+ |
return depTrkRp3RhoCorr; |
4490 |
+ |
|
4491 |
+ |
} |
4492 |
+ |
|
4493 |
|
|
4494 |
|
|
4495 |
|
|
4566 |
|
template <class InputCollection> |
4567 |
|
void OSUAnalysis::setObjectFlags(cut ¤tCut, uint currentCutIndex, flagMap &individualFlags, flagMap &cumulativeFlags, InputCollection inputCollection, string inputType){ |
4568 |
|
|
4569 |
+ |
if (verbose_>2) clog << " Beginning setObjectFlags for cut " << currentCutIndex << ": " << currentCut.name |
4570 |
+ |
<< ", inputType=" << inputType |
4571 |
+ |
<< endl; |
4572 |
|
if (currentCut.inputCollection.find("pair")!=string::npos) { |
4573 |
|
string obj1, obj2; |
4574 |
|
getTwoObjs(currentCut.inputCollection, obj1, obj2); |
4575 |
+ |
if (verbose_>2) clog << " Two object types: " << obj1 << ", " << obj2 << endl; |
4576 |
|
if (inputType==obj1 || |
4577 |
|
inputType==obj2) { |
4578 |
|
// Do not add a cut to individualFlags or cumulativeFlags, if the cut is on a paired collection, |
4584 |
|
} |
4585 |
|
} |
4586 |
|
|
4587 |
+ |
if (!inputCollection) clog << "ERROR: invalid input collection for inputType=" << inputType << endl; |
4588 |
+ |
|
4589 |
+ |
if (verbose_>3) clog << " Collection size: " << inputCollection->size() << endl; |
4590 |
+ |
|
4591 |
|
for (uint object = 0; object != inputCollection->size(); object++){ |
4592 |
|
|
4593 |
+ |
if (verbose_>4) clog << " Setting flags for object " << object << endl; |
4594 |
+ |
|
4595 |
|
bool cutDecision = true;//object passes if this cut doesn't cut on that type of object |
4596 |
|
bool plotDecision = true; |
4597 |
|
|
4616 |
|
} |
4617 |
|
cutDecision = tempDecision; |
4618 |
|
} |
4619 |
< |
//invert the cut for plotting if this cut is a veto |
4620 |
< |
if(currentCut.isVeto) plotDecision = !cutDecision; |
4621 |
< |
else plotDecision = cutDecision; |
4619 |
> |
//invert the cut if this cut is a veto |
4620 |
> |
if(currentCut.isVeto) cutDecision = !cutDecision; |
4621 |
> |
plotDecision = cutDecision; |
4622 |
|
} |
4623 |
|
|
4624 |
|
individualFlags.at(inputType).at(currentCutIndex).push_back(make_pair(cutDecision,plotDecision)); |
4639 |
|
|
4640 |
|
cumulativeFlags.at(inputType).at(currentCutIndex).push_back(make_pair(previousCumulativeCutFlag,previousCumulativePlotFlag)); |
4641 |
|
|
4642 |
< |
} |
4642 |
> |
} // for (uint object = 0; object != inputCollection->size(); object++){ |
4643 |
|
|
4644 |
< |
} |
4644 |
> |
} // end void OSUAnalysis::setObjectFlags |
4645 |
|
|
4646 |
|
|
4647 |
|
template <class InputCollection1, class InputCollection2> |
4648 |
< |
void OSUAnalysis::setObjectFlags(cut ¤tCut, uint currentCutIndex, flagMap &individualFlags, flagMap &cumulativeFlags, \ |
4649 |
< |
InputCollection1 inputCollection1, InputCollection2 inputCollection2, flagPair flags1, flagPair flags2, string inputType){ |
4650 |
< |
|
4648 |
> |
void OSUAnalysis::setObjectFlags(cut ¤tCut, uint currentCutIndex, flagMap &individualFlags, flagMap &cumulativeFlags, |
4649 |
> |
InputCollection1 inputCollection1, InputCollection2 inputCollection2, string inputType){ |
4650 |
> |
// This function sets the flags for the paired object collection. |
4651 |
> |
// If the cut is applying on the given paired object collection, then the flags for the single object collections are also set. |
4652 |
> |
// If not, then the flags for the paired object collection are taken as the AND of the flags for each single object collection. |
4653 |
> |
|
4654 |
> |
if (verbose_>2) clog << " Beginning setObjectFlags for cut=" << currentCut.name |
4655 |
> |
<< ", inputType=" << inputType |
4656 |
> |
<< endl; |
4657 |
|
|
4658 |
|
bool sameObjects = false; |
4659 |
< |
if(typeid(InputCollection1).name() == typeid(InputCollection2).name()) sameObjects = true; |
4659 |
> |
if(typeid(InputCollection1).name() == typeid(InputCollection2).name()) sameObjects = true; // FIXME: is sameObjects just the not of isTwoTypesOfObject? If so, it's redundant. |
4660 |
|
|
4661 |
|
// Get the strings for the two objects that make up the pair. |
4662 |
|
string obj1Type, obj2Type; |
4687 |
|
if(sameObjects && object1 >= object2) continue;//account for duplicate pairs if both collections are the same |
4688 |
|
|
4689 |
|
|
4690 |
< |
bool cutDecision = true;//object passes if this cut doesn't cut on that type of object |
4690 |
> |
bool cutDecision = true;//object passes if this cut doesn't cut on that type of object |
4691 |
|
bool plotDecision = true; |
4692 |
|
|
4693 |
+ |
// Determine whether each pair passes the cut, only if inputCollection is the same as the inputType. |
4694 |
|
if(currentCut.inputCollection == inputType){ |
4695 |
|
|
4696 |
|
vector<bool> subcutDecisions; |
4697 |
|
for( int subcutIndex = 0; subcutIndex != currentCut.numSubcuts; subcutIndex++){ |
4698 |
|
string stringValue = ""; |
4699 |
|
double value = valueLookup(&inputCollection1->at(object1), &inputCollection2->at(object2), currentCut.variables.at(subcutIndex), currentCut.functions.at(subcutIndex), stringValue); |
4700 |
+ |
if (verbose_>1) clog << currentCut.variables.at(subcutIndex) << " = " << value |
4701 |
+ |
<< endl; |
4702 |
|
if (stringValue == "") subcutDecisions.push_back(evaluateComparison(value,currentCut.comparativeOperators.at(subcutIndex),currentCut.cutValues.at(subcutIndex))); |
4703 |
|
else subcutDecisions.push_back(evaluateComparison(stringValue,currentCut.comparativeOperators.at(subcutIndex),currentCut.cutStringValues.at(subcutIndex))); |
4704 |
|
} |
4714 |
|
} |
4715 |
|
cutDecision = tempDecision; |
4716 |
|
} |
4717 |
< |
//invert the cut for plotting if this cut is a veto |
4718 |
< |
if(currentCut.isVeto) plotDecision = !cutDecision; |
4719 |
< |
else plotDecision = cutDecision; |
4720 |
< |
} |
4721 |
< |
individualFlags.at(inputType).at(currentCutIndex).push_back(make_pair(cutDecision,plotDecision)); |
4722 |
< |
if (cutDecision && currentCut.inputCollection == inputType) { // only set the flags for the individual objects if the pair object is being cut on |
4723 |
< |
individualFlags.at(obj1Type).at(currentCutIndex).at(object1).first = true; |
4724 |
< |
individualFlags.at(obj2Type).at(currentCutIndex).at(object2).first = true; |
4725 |
< |
} |
4726 |
< |
if (plotDecision && currentCut.inputCollection == inputType) { // only set the flags for the individual objects if the pair object is being cut on |
4727 |
< |
individualFlags.at(obj1Type).at(currentCutIndex).at(object1).second = true; |
4728 |
< |
individualFlags.at(obj2Type).at(currentCutIndex).at(object2).second = true; |
4729 |
< |
} |
4717 |
> |
//invert the cut if this cut is a veto |
4718 |
> |
if (currentCut.isVeto) cutDecision = !cutDecision; |
4719 |
> |
plotDecision = cutDecision; |
4720 |
> |
|
4721 |
> |
if (verbose_>1) clog << " cutDecision = " << cutDecision |
4722 |
> |
<< "; for currentCut.inputCollection = " << currentCut.inputCollection |
4723 |
> |
<< "; object1 (" << obj1Type << ") = " << object1 |
4724 |
> |
<< "; object2 (" << obj2Type << ") = " << object2 |
4725 |
> |
<< endl; |
4726 |
> |
|
4727 |
> |
if (cutDecision) { // only set the flags for the individual objects if the pair object is being cut on |
4728 |
> |
individualFlags.at(obj1Type).at(currentCutIndex).at(object1).first = true; |
4729 |
> |
individualFlags.at(obj2Type).at(currentCutIndex).at(object2).first = true; |
4730 |
> |
} |
4731 |
> |
if (plotDecision) { // only set the flags for the individual objects if the pair object is being cut on |
4732 |
> |
individualFlags.at(obj1Type).at(currentCutIndex).at(object1).second = true; |
4733 |
> |
individualFlags.at(obj2Type).at(currentCutIndex).at(object2).second = true; |
4734 |
> |
} |
4735 |
> |
|
4736 |
> |
|
4737 |
> |
} // if(currentCut.inputCollection == inputType){ |
4738 |
> |
|
4739 |
> |
// The individualFlags will be true if the inputCollection is not the same as the inputType. |
4740 |
> |
// They are also independent of the previous flags on the single objects. |
4741 |
> |
individualFlags.at(inputType).at(currentCutIndex).push_back(make_pair(cutDecision,plotDecision)); |
4742 |
> |
|
4743 |
> |
|
4744 |
|
|
4745 |
< |
//set flags for objects that pass this cut AND all the previous cuts |
4745 |
> |
// ************************************ |
4746 |
> |
// Determine cumulative flags |
4747 |
> |
// ************************************ |
4748 |
> |
// determine whether this paired object passes this cut AND all previous cuts |
4749 |
|
bool previousCumulativeCutFlag = true; |
4750 |
|
for(uint previousCutIndex = 0; previousCutIndex != currentCutIndex; previousCutIndex++){ |
4751 |
< |
if(previousCumulativeCutFlag && individualFlags.at(inputType).at(previousCutIndex).at(counter).first) previousCumulativeCutFlag = true; |
4752 |
< |
else{ previousCumulativeCutFlag = false; break;} |
4751 |
> |
if(previousCumulativeCutFlag && individualFlags.at(inputType).at(previousCutIndex).at(counter).first) previousCumulativeCutFlag = true; |
4752 |
> |
else{ previousCumulativeCutFlag = false; break;} |
4753 |
|
} |
4754 |
|
previousCumulativeCutFlag = previousCumulativeCutFlag && cutDecision; |
4755 |
|
|
4760 |
|
} |
4761 |
|
previousCumulativePlotFlag = previousCumulativePlotFlag && plotDecision; |
4762 |
|
|
4763 |
< |
//apply flags for the components of the composite object as well |
4763 |
> |
// Get the index for the flags of each of the single objects in the pair. Usually this is the index of the previous cut, i.e., currentCutIndex-1. |
4764 |
> |
int cutIdxFlagsObj1 = max(int(currentCutIndex-1),0); |
4765 |
> |
int cutIdxFlagsObj2 = max(int(currentCutIndex-1),0); |
4766 |
> |
// If the inputCollection of the cut is not equal to the inputType but the inputCollection includes objects that are contained in inputType, then use the currentCutIndex for those collections. |
4767 |
> |
// For example, if the inputType is jet-jet pairs, and the inputCollection is track-jet pairs, then use currentCutIndex for cutIdxFlagsObj{1,2}, i.e., for both jets. |
4768 |
> |
// For example, if the inputType is jets, and the inputCollection is track-jet pairs, then use currentCutIndex for cutIdxFlagsObj2 (jets) and currentCutIndex-1 for cutIdxFlagsObj1 (tracks). |
4769 |
> |
if (currentCut.inputCollection != inputType) { |
4770 |
> |
if (currentCut.inputCollection.find(obj1Type)!=string::npos) cutIdxFlagsObj1 = currentCutIndex; |
4771 |
> |
if (currentCut.inputCollection.find(obj2Type)!=string::npos) cutIdxFlagsObj2 = currentCutIndex; |
4772 |
> |
} |
4773 |
> |
flagPair flags1 = cumulativeFlags.at(obj1Type).at(cutIdxFlagsObj1); // flag for input collection 1 |
4774 |
> |
flagPair flags2 = cumulativeFlags.at(obj2Type).at(cutIdxFlagsObj2); // flag for input collection 2 |
4775 |
> |
|
4776 |
> |
// The cumulative flag is only true if the paired object cumulative flag is true, and if the single object cumulative flags are true. |
4777 |
|
bool currentCumulativeCutFlag = true; |
4778 |
|
bool currentCumulativePlotFlag = true; |
4391 |
– |
|
4779 |
|
if(flags1.size() == 0 && flags2.size() == 0) currentCumulativeCutFlag = previousCumulativeCutFlag; |
4780 |
|
else if(flags1.size() == 0) currentCumulativeCutFlag = previousCumulativeCutFlag && flags2.at(object2).first; |
4781 |
|
else if(flags2.size() == 0) currentCumulativeCutFlag = previousCumulativeCutFlag && flags1.at(object1).first; |
4786 |
|
else if(flags2.size() == 0) currentCumulativePlotFlag = previousCumulativePlotFlag && flags1.at(object1).second; |
4787 |
|
else currentCumulativePlotFlag = previousCumulativePlotFlag && flags1.at(object1).first && flags2.at(object2).second; |
4788 |
|
|
4789 |
< |
cumulativeFlags.at(inputType).at(currentCutIndex).push_back(make_pair(currentCumulativeCutFlag,currentCumulativePlotFlag)); |
4789 |
> |
cumulativeFlags.at(inputType).at(currentCutIndex).push_back(make_pair(currentCumulativeCutFlag,currentCumulativePlotFlag)); // Set the flag for the paired object |
4790 |
|
|
4404 |
– |
if (currentCumulativeCutFlag && currentCut.inputCollection == inputType) { // only set the flags for the individual objects if the pair object is being cut on |
4405 |
– |
cumulativeFlags.at(obj1Type).at(currentCutIndex).at(object1).first = true && getPreviousCumulativeFlags(currentCutIndex, individualFlags, obj1Type, object1, "cut"); |
4406 |
– |
cumulativeFlags.at(obj2Type).at(currentCutIndex).at(object2).first = true && getPreviousCumulativeFlags(currentCutIndex, individualFlags, obj2Type, object2, "cut"); |
4407 |
– |
} |
4791 |
|
|
4792 |
< |
if (currentCumulativePlotFlag && currentCut.inputCollection == inputType) { // only set the flags for the individual objects if the pair object is being cut on |
4792 |
> |
if (currentCumulativeCutFlag && currentCut.inputCollection == inputType) { // Set the flags for the individual objects if the paired object is being cut on. |
4793 |
> |
cumulativeFlags.at(obj1Type).at(currentCutIndex).at(object1).first = true && getPreviousCumulativeFlags(currentCutIndex, individualFlags, obj1Type, object1, "cut"); |
4794 |
> |
cumulativeFlags.at(obj2Type).at(currentCutIndex).at(object2).first = true && getPreviousCumulativeFlags(currentCutIndex, individualFlags, obj2Type, object2, "cut"); |
4795 |
|
cumulativeFlags.at(obj1Type).at(currentCutIndex).at(object1).second = true && getPreviousCumulativeFlags(currentCutIndex, individualFlags, obj1Type, object1, "plot"); |
4796 |
|
cumulativeFlags.at(obj2Type).at(currentCutIndex).at(object2).second = true && getPreviousCumulativeFlags(currentCutIndex, individualFlags, obj2Type, object2, "plot"); |
4797 |
+ |
|
4798 |
+ |
if (verbose_>1) clog << " previousCumulativeCutFlag for object1 = " << getPreviousCumulativeFlags(currentCutIndex, individualFlags, obj2Type, object1, "cut") << endl; |
4799 |
+ |
if (verbose_>1) clog << " previousCumulativeCutFlag for object2 = " << getPreviousCumulativeFlags(currentCutIndex, individualFlags, obj2Type, object2, "cut") << endl; |
4800 |
+ |
|
4801 |
|
} |
4802 |
|
|
4803 |
|
counter++; |
4805 |
|
} // end for (uint object2 = 0; object2 != inputCollection2->size(); object2++) |
4806 |
|
} // end for (uint object1 = 0; object1 != inputCollection1->size(); object1++) |
4807 |
|
|
4808 |
< |
} |
4808 |
> |
} // end void OSUAnalysis::setObjectFlags |
4809 |
|
|
4810 |
|
|
4811 |
|
bool OSUAnalysis::getPreviousCumulativeFlags(uint currentCutIndex, flagMap &individualFlags, string obj1Type, uint object1, string flagType) { |
4850 |
|
template <class InputCollection> |
4851 |
|
void OSUAnalysis::fill1DHistogram(TH1* histo, histogram parameters, InputCollection inputCollection, flagPair flags, double scaleFactor){ |
4852 |
|
|
4853 |
+ |
if (verbose_>2) clog << " Filling histogram for " << parameters.name << endl; |
4854 |
|
|
4855 |
|
for (uint object = 0; object != inputCollection->size(); object++){ |
4856 |
|
|
4874 |
|
|
4875 |
|
if (printEventInfo_) { |
4876 |
|
// Write information about event to screen, for testing purposes. |
4877 |
< |
clog << " Info for event: value for histogram " << histo->GetName() << ": " << value << endl; |
4877 |
> |
clog << " Info for event: value for histogram " << histo->GetName() << ": " << value << " (object number " << object << ")" << endl; |
4878 |
|
} |
4879 |
|
|
4880 |
|
} |
4881 |
|
} |
4882 |
|
|
4883 |
|
template <class InputCollection1, class InputCollection2> |
4884 |
< |
void OSUAnalysis::fill1DHistogram(TH1* histo, histogram parameters, InputCollection1 inputCollection1, InputCollection2 inputCollection2, flagPair flags1, flagPair flags2, flagPair pairFlags, double scaleFactor){ |
4884 |
> |
void OSUAnalysis::fill1DHistogram(TH1* histo, histogram parameters, InputCollection1 inputCollection1, InputCollection2 inputCollection2, |
4885 |
> |
flagPair pairFlags, double scaleFactor){ |
4886 |
|
|
4887 |
|
bool sameObjects = false; |
4888 |
|
if(typeid(InputCollection1).name() == typeid(InputCollection2).name()) sameObjects = true; |
4894 |
|
if(sameObjects && object1 >= object2) continue;//account for duplicate pairs if both collections are the same |
4895 |
|
|
4896 |
|
pairCounter++; |
4506 |
– |
//only take objects which have passed all cuts and pairs which have passed all cuts |
4507 |
– |
if(!plotAllObjectsInPassingEvents_ && !flags1.at(object1).second) continue; |
4508 |
– |
if(!plotAllObjectsInPassingEvents_ && !flags2.at(object2).second) continue; |
4897 |
|
if(!plotAllObjectsInPassingEvents_ && !pairFlags.at(pairCounter).second) continue; |
4898 |
|
|
4899 |
|
string currentString = parameters.inputVariables.at(0); |
4912 |
|
double value = valueLookup(&inputCollection1->at(object1), &inputCollection2->at(object2), inputVariable, function, stringValue); |
4913 |
|
histo->Fill(value,scaleFactor); |
4914 |
|
|
4915 |
+ |
if (printEventInfo_) { |
4916 |
+ |
// Write information about event to screen, for testing purposes. |
4917 |
+ |
clog << " Info for event: value for histogram " << histo->GetName() << ": " << value |
4918 |
+ |
<< " (object1 number " << object1 << "), " |
4919 |
+ |
<< " (object2 number " << object2 << ")" |
4920 |
+ |
<< endl; |
4921 |
+ |
} |
4922 |
+ |
|
4923 |
|
} |
4924 |
|
} |
4925 |
|
|
4968 |
|
} |
4969 |
|
|
4970 |
|
template <class InputCollection1, class InputCollection2> |
4971 |
< |
void OSUAnalysis::fill2DHistogram(TH2* histo, histogram parameters, InputCollection1 inputCollection1, InputCollection2 inputCollection2, flagPair flags1, flagPair flags2, flagPair pairFlags, double scaleFactor){ |
4971 |
> |
void OSUAnalysis::fill2DHistogram(TH2* histo, histogram parameters, InputCollection1 inputCollection1, InputCollection2 inputCollection2, |
4972 |
> |
flagPair pairFlags, double scaleFactor){ |
4973 |
|
|
4974 |
|
bool sameObjects = false; |
4975 |
|
if(typeid(InputCollection1).name() == typeid(InputCollection2).name()) sameObjects = true; |
4982 |
|
|
4983 |
|
pairCounter++; |
4984 |
|
|
4588 |
– |
//only take objects which have passed all cuts and pairs which have passed all cuts |
4589 |
– |
if(!plotAllObjectsInPassingEvents_ && !flags1.at(object1).second) continue; |
4590 |
– |
if(!plotAllObjectsInPassingEvents_ && !flags2.at(object2).second) continue; |
4985 |
|
if(!plotAllObjectsInPassingEvents_ && !pairFlags.at(pairCounter).second) continue; |
4986 |
|
|
4987 |
|
string stringValue = ""; |