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")), |
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); |
189 |
|
for(uint currentObjectIndex = 0; currentObjectIndex != objectsToPlot.size(); currentObjectIndex++){ |
190 |
|
|
191 |
|
string currentObject = objectsToPlot.at(currentObjectIndex); |
192 |
< |
if(currentObject != "muons" && currentObject != "secondary muons" && currentObject != "secondary electrons" && currentObject != "electrons" && currentObject != "taus" && currentObject != "tracks" && currentObject != "photons" && currentObject != "secondary photons"&& currentObject != "superclusters") continue; |
192 |
> |
if(currentObject != "muons" && |
193 |
> |
currentObject != "secondary muons" && |
194 |
> |
currentObject != "secondary electrons" && |
195 |
> |
currentObject != "electrons" && |
196 |
> |
currentObject != "taus" && |
197 |
> |
currentObject != "tracks" && |
198 |
> |
currentObject != "photons" && |
199 |
> |
currentObject != "secondary photons"&& |
200 |
> |
currentObject != "superclusters") |
201 |
> |
continue; |
202 |
|
|
203 |
|
histogram tempIdHisto; |
204 |
|
histogram tempMomIdHisto; |
330 |
|
tempCut.inputCollection = tempInputCollection; |
331 |
|
if(tempInputCollection.find("pairs")==string::npos){ //just a single object |
332 |
|
if(tempInputCollection.find("secondary")!=string::npos){//secondary object |
333 |
< |
int spaceIndex = tempInputCollection.find(" "); |
334 |
< |
int secondWordLength = tempInputCollection.size() - spaceIndex; |
335 |
< |
objectsToGet.push_back(tempInputCollection.substr(spaceIndex+1,secondWordLength)); |
333 |
> |
if(tempInputCollection.find("secondary muons")!=string::npos){//treat secondary muons differently; allow for a different input collection |
334 |
> |
objectsToGet.push_back("secondary muons"); |
335 |
> |
} else { |
336 |
> |
int spaceIndex = tempInputCollection.find(" "); |
337 |
> |
int secondWordLength = tempInputCollection.size() - spaceIndex; |
338 |
> |
objectsToGet.push_back(tempInputCollection.substr(spaceIndex+1,secondWordLength)); |
339 |
> |
} |
340 |
|
} |
341 |
|
else{ |
342 |
|
objectsToGet.push_back(tempInputCollection); |
623 |
|
else if(currentObject == "track-event pairs") currentObject = "trackEventPairs"; |
624 |
|
else if(currentObject == "electron-track pairs") currentObject = "electronTrackPairs"; |
625 |
|
else if(currentObject == "muon-track pairs") currentObject = "muonTrackPairs"; |
626 |
+ |
else if(currentObject == "secondary muon-track pairs") currentObject = "secondaryMuonTrackPairs"; |
627 |
|
else if(currentObject == "muon-tau pairs") currentObject = "muonTauPairs"; |
628 |
|
else if(currentObject == "tau-tau pairs") currentObject = "ditauPairs"; |
629 |
|
else if(currentObject == "tau-track pairs") currentObject = "tauTrackPairs"; |
633 |
|
else if(currentObject == "secondary electrons") currentObject = "secondaryElectrons"; |
634 |
|
else if(currentObject == "electron-trigobj pairs") currentObject = "electronTrigobjPairs"; |
635 |
|
else if(currentObject == "muon-trigobj pairs") currentObject = "muonTrigobjPairs"; |
636 |
+ |
else if(currentObject == "electron-mcparticle pairs") currentObject = "electronMCparticlePairs"; |
637 |
+ |
|
638 |
|
|
639 |
|
currentObject.at(0) = toupper(currentObject.at(0)); |
640 |
|
string histoName = "num" + currentObject; |
789 |
|
|
790 |
|
if (verbose_) clog << "Beginning OSUAnalysis::produce." << endl; |
791 |
|
|
792 |
< |
if (find(objectsToGet.begin(), objectsToGet.end(), "triggers") != objectsToGet.end()) |
792 |
> |
if (find(objectsToGet.begin(), objectsToGet.end(), "triggers") != objectsToGet.end()) { |
793 |
|
event.getByLabel (triggers_, triggers); |
794 |
+ |
if (!triggers.product()) cout << "ERROR: could not get triggers input collection" << endl; |
795 |
+ |
} |
796 |
|
|
797 |
< |
if (find(objectsToGet.begin(), objectsToGet.end(), "trigobjs") != objectsToGet.end()) |
797 |
> |
if (find(objectsToGet.begin(), objectsToGet.end(), "trigobjs") != objectsToGet.end()) { |
798 |
|
event.getByLabel (trigobjs_, trigobjs); |
799 |
+ |
if (!trigobjs.product()) cout << "ERROR: could not get trigobjs input collection" << endl; |
800 |
+ |
} |
801 |
|
|
802 |
< |
if (find(objectsToGet.begin(), objectsToGet.end(), "jets") != objectsToGet.end()) |
802 |
> |
if (find(objectsToGet.begin(), objectsToGet.end(), "jets") != objectsToGet.end()) { |
803 |
|
event.getByLabel (jets_, jets); |
804 |
+ |
if (!jets.product()) cout << "ERROR: could not get jets input collection" << endl; |
805 |
+ |
} |
806 |
|
|
807 |
< |
if (find(objectsToGet.begin(), objectsToGet.end(), "muons") != objectsToGet.end()) |
807 |
> |
if (find(objectsToGet.begin(), objectsToGet.end(), "muons") != objectsToGet.end()) { |
808 |
|
event.getByLabel (muons_, muons); |
809 |
+ |
if (!muons.product()) cout << "ERROR: could not get muons input collection" << endl; |
810 |
+ |
} |
811 |
+ |
|
812 |
+ |
if (find(objectsToGet.begin(), objectsToGet.end(), "secondary muons") != objectsToGet.end()) { |
813 |
+ |
event.getByLabel (secMuons_, secMuons); |
814 |
+ |
if (!secMuons.product()) cout << "ERROR: could not get secMuons input collection" << endl; |
815 |
+ |
} |
816 |
|
|
817 |
< |
if (find(objectsToGet.begin(), objectsToGet.end(), "electrons") != objectsToGet.end()) |
817 |
> |
if (find(objectsToGet.begin(), objectsToGet.end(), "electrons") != objectsToGet.end()) { |
818 |
|
event.getByLabel (electrons_, electrons); |
819 |
+ |
if (!electrons.product()) cout << "ERROR: could not get electrons input collection" << endl; |
820 |
+ |
} |
821 |
|
|
822 |
< |
if (find(objectsToGet.begin(), objectsToGet.end(), "events") != objectsToGet.end()) |
822 |
> |
if (find(objectsToGet.begin(), objectsToGet.end(), "events") != objectsToGet.end()) { |
823 |
|
event.getByLabel (events_, events); |
824 |
+ |
if (!events.product()) cout << "ERROR: could not get events input collection" << endl; |
825 |
+ |
} |
826 |
|
|
827 |
< |
if (find(objectsToGet.begin(), objectsToGet.end(), "taus") != objectsToGet.end()) |
827 |
> |
if (find(objectsToGet.begin(), objectsToGet.end(), "taus") != objectsToGet.end()) { |
828 |
|
event.getByLabel (taus_, taus); |
829 |
+ |
if (!taus.product()) cout << "ERROR: could not get taus input collection" << endl; |
830 |
+ |
} |
831 |
|
|
832 |
< |
if (find(objectsToGet.begin(), objectsToGet.end(), "mets") != objectsToGet.end()) |
832 |
> |
if (find(objectsToGet.begin(), objectsToGet.end(), "mets") != objectsToGet.end()) { |
833 |
|
event.getByLabel (mets_, mets); |
834 |
+ |
if (!mets.product()) cout << "ERROR: could not get mets input collection" << endl; |
835 |
+ |
} |
836 |
|
|
837 |
< |
if (find(objectsToGet.begin(), objectsToGet.end(), "tracks") != objectsToGet.end()) |
837 |
> |
if (find(objectsToGet.begin(), objectsToGet.end(), "tracks") != objectsToGet.end()) { |
838 |
|
event.getByLabel (tracks_, tracks); |
839 |
+ |
if (!tracks.product()) cout << "ERROR: could not get tracks input collection" << endl; |
840 |
+ |
} |
841 |
|
|
842 |
< |
if (find(objectsToGet.begin(), objectsToGet.end(), "genjets") != objectsToGet.end()) |
842 |
> |
if (find(objectsToGet.begin(), objectsToGet.end(), "genjets") != objectsToGet.end()) { |
843 |
|
event.getByLabel (genjets_, genjets); |
844 |
+ |
if (!genjets.product()) cout << "ERROR: could not get genjets input collection" << endl; |
845 |
+ |
} |
846 |
|
|
847 |
< |
if (find(objectsToGet.begin(), objectsToGet.end(), "mcparticles") != objectsToGet.end()) |
847 |
> |
if (find(objectsToGet.begin(), objectsToGet.end(), "mcparticles") != objectsToGet.end()) { |
848 |
|
event.getByLabel (mcparticles_, mcparticles); |
849 |
+ |
if (!mcparticles.product()) cout << "ERROR: could not get mcparticles input collection" << endl; |
850 |
+ |
} |
851 |
|
|
852 |
< |
if (find(objectsToGet.begin(), objectsToGet.end(), "primaryvertexs") != objectsToGet.end()) |
852 |
> |
if (find(objectsToGet.begin(), objectsToGet.end(), "primaryvertexs") != objectsToGet.end()) { |
853 |
|
event.getByLabel (primaryvertexs_, primaryvertexs); |
854 |
+ |
if (!primaryvertexs.product()) cout << "ERROR: could not get primaryvertexs input collection" << endl; |
855 |
+ |
} |
856 |
|
|
857 |
< |
if (find(objectsToGet.begin(), objectsToGet.end(), "bxlumis") != objectsToGet.end()) |
857 |
> |
if (find(objectsToGet.begin(), objectsToGet.end(), "bxlumis") != objectsToGet.end()) { |
858 |
|
event.getByLabel (bxlumis_, bxlumis); |
859 |
+ |
if (!bxlumis.product()) cout << "ERROR: could not get bxlumis input collection" << endl; |
860 |
+ |
} |
861 |
|
|
862 |
< |
if (find(objectsToGet.begin(), objectsToGet.end(), "photons") != objectsToGet.end()) |
862 |
> |
if (find(objectsToGet.begin(), objectsToGet.end(), "photons") != objectsToGet.end()) { |
863 |
|
event.getByLabel (photons_, photons); |
864 |
+ |
if (!photons.product()) cout << "ERROR: could not get photons input collection" << endl; |
865 |
+ |
} |
866 |
|
|
867 |
< |
if (find(objectsToGet.begin(), objectsToGet.end(), "superclusters") != objectsToGet.end()) |
867 |
> |
if (find(objectsToGet.begin(), objectsToGet.end(), "superclusters") != objectsToGet.end()) { |
868 |
|
event.getByLabel (superclusters_, superclusters); |
869 |
+ |
if (!superclusters.product()) cout << "ERROR: could not get superclusters input collection" << endl; |
870 |
+ |
} |
871 |
|
|
872 |
|
if (datasetType_ == "signalMC"){ |
873 |
< |
if (find(objectsToGet.begin(), objectsToGet.end(), "stops") != objectsToGet.end()) |
873 |
> |
if (find(objectsToGet.begin(), objectsToGet.end(), "stops") != objectsToGet.end()) { |
874 |
|
event.getByLabel (stops_, stops); |
875 |
+ |
if (!stops.product()) cout << "ERROR: could not get stops input collection" << endl; |
876 |
+ |
} |
877 |
|
} |
878 |
|
|
879 |
|
if (useTrackCaloRhoCorr_) { |
882 |
|
// For description of rho values for different jet reconstruction algorithms, see |
883 |
|
// https://twiki.cern.ch/twiki/bin/view/CMS/JetAlgorithms#Algorithms |
884 |
|
event.getByLabel ("kt6CaloJets","rho", rhokt6CaloJetsHandle_); |
885 |
+ |
if (!rhokt6CaloJetsHandle_.product()) cout << "ERROR: could not get kt6CaloJets input collection" << endl; |
886 |
|
} |
887 |
|
|
888 |
|
double masterScaleFactor = 1.0; |
947 |
|
else if(currentObject == "secondary jets") setObjectFlags(currentCut,currentCutIndex,individualFlags,cumulativeFlags,jets.product(),"secondary jets"); |
948 |
|
else if(currentObject == "secondary photons") setObjectFlags(currentCut,currentCutIndex,individualFlags,cumulativeFlags,photons.product(),"secondary photons"); |
949 |
|
else if(currentObject == "muons") setObjectFlags(currentCut,currentCutIndex,individualFlags,cumulativeFlags,muons.product(),"muons"); |
950 |
< |
else if(currentObject == "secondary muons") setObjectFlags(currentCut,currentCutIndex,individualFlags,cumulativeFlags,muons.product(),"secondary muons"); |
950 |
> |
else if(currentObject == "secondary muons") setObjectFlags(currentCut,currentCutIndex,individualFlags,cumulativeFlags,secMuons.product(),"secondary muons"); |
951 |
|
else if(currentObject == "secondary electrons") setObjectFlags(currentCut,currentCutIndex,individualFlags,cumulativeFlags,electrons.product(),"secondary electrons"); |
952 |
|
else if(currentObject == "electrons") setObjectFlags(currentCut,currentCutIndex,individualFlags,cumulativeFlags,electrons.product(),"electrons"); |
953 |
|
else if(currentObject == "events") setObjectFlags(currentCut,currentCutIndex,individualFlags,cumulativeFlags,events.product(),"events"); |
965 |
|
|
966 |
|
// paired object collections |
967 |
|
else if(currentObject == "muon-muon pairs") setObjectFlags(currentCut,currentCutIndex,individualFlags,cumulativeFlags,muons.product(),muons.product(), "muon-muon pairs"); |
968 |
< |
else if(currentObject == "muon-secondary muon pairs") setObjectFlags(currentCut,currentCutIndex,individualFlags,cumulativeFlags,muons.product(),muons.product(), "muon-secondary muon pairs"); |
968 |
> |
else if(currentObject == "muon-secondary muon pairs") setObjectFlags(currentCut,currentCutIndex,individualFlags,cumulativeFlags,muons.product(),secMuons.product(), "muon-secondary muon pairs"); |
969 |
|
|
970 |
|
else if(currentObject == "muon-secondary photon pairs") setObjectFlags(currentCut,currentCutIndex,individualFlags,cumulativeFlags,muons.product(),photons.product(), "muon-secondary photon pairs"); |
971 |
|
else if(currentObject == "muon-secondary jet pairs") setObjectFlags(currentCut,currentCutIndex,individualFlags,cumulativeFlags,muons.product(),jets.product(), "muon-secondary jet pairs"); |
988 |
|
else if(currentObject == "track-event pairs") setObjectFlags(currentCut,currentCutIndex,individualFlags,cumulativeFlags,tracks.product(),events.product(), "track-event pairs"); |
989 |
|
else if(currentObject == "electron-track pairs") setObjectFlags(currentCut,currentCutIndex,individualFlags,cumulativeFlags,electrons.product(),tracks.product(),"electron-track pairs"); |
990 |
|
else if(currentObject == "muon-track pairs") setObjectFlags(currentCut,currentCutIndex,individualFlags,cumulativeFlags,muons.product(),tracks.product(),"muon-track pairs"); |
991 |
+ |
else if(currentObject == "secondary muon-track pairs") setObjectFlags(currentCut,currentCutIndex,individualFlags,cumulativeFlags,secMuons.product(),tracks.product(),"secondary muon-track pairs"); |
992 |
|
else if(currentObject == "muon-tau pairs") setObjectFlags(currentCut,currentCutIndex,individualFlags,cumulativeFlags,muons.product(),taus.product(),"muon-tau pairs"); |
993 |
|
else if(currentObject == "tau-tau pairs") setObjectFlags(currentCut,currentCutIndex,individualFlags,cumulativeFlags,taus.product(),taus.product(),"tau-tau pairs"); |
994 |
|
else if(currentObject == "tau-track pairs") setObjectFlags(currentCut,currentCutIndex,individualFlags,cumulativeFlags,taus .product(),tracks.product(),"tau-track pairs"); |
995 |
|
else if(currentObject == "electron-trigobj pairs") setObjectFlags(currentCut,currentCutIndex,individualFlags,cumulativeFlags,electrons.product(),trigobjs.product(),"electron-trigobj pairs"); |
996 |
|
else if(currentObject == "muon-trigobj pairs") setObjectFlags(currentCut,currentCutIndex,individualFlags,cumulativeFlags,muons.product(),trigobjs.product(),"muon-trigobj pairs"); |
997 |
+ |
else if(currentObject == "electron-mcparticle pairs") setObjectFlags(currentCut,currentCutIndex,individualFlags,cumulativeFlags,electrons.product(),mcparticles.product(),"electron-mcparticle pairs"); |
998 |
|
|
999 |
|
if(currentObject == "stops" && datasetType_ == "signalMC") setObjectFlags(currentCut,currentCutIndex,individualFlags,cumulativeFlags,stops.product(),"stops"); |
1000 |
|
} |
1158 |
|
else if(currentHistogram.inputCollection == "secondary jets") fill1DHistogram(histo,currentHistogram,jets.product(),cumulativeFlags.at("secondary jets").at(currentDir),scaleFactor); |
1159 |
|
else if(currentHistogram.inputCollection == "secondary photons") fill1DHistogram(histo,currentHistogram,photons.product(),cumulativeFlags.at("secondary photons").at(currentDir),scaleFactor); |
1160 |
|
else if(currentHistogram.inputCollection == "muons") fill1DHistogram(histo,currentHistogram,muons.product(),cumulativeFlags.at("muons").at(currentDir),scaleFactor); |
1161 |
< |
else if(currentHistogram.inputCollection == "secondary muons") fill1DHistogram(histo,currentHistogram,muons.product(),cumulativeFlags.at("secondary muons").at(currentDir),scaleFactor); |
1161 |
> |
else if(currentHistogram.inputCollection == "secondary muons") fill1DHistogram(histo,currentHistogram,secMuons.product(),cumulativeFlags.at("secondary muons").at(currentDir),scaleFactor); |
1162 |
|
else if(currentHistogram.inputCollection == "secondary electrons") fill1DHistogram(histo,currentHistogram,electrons.product(),cumulativeFlags.at("secondary electrons").at(currentDir),scaleFactor); |
1163 |
|
else if(currentHistogram.inputCollection == "muon-muon pairs") fill1DHistogram(histo,currentHistogram,muons.product(),muons.product(), |
1164 |
|
cumulativeFlags.at("muon-muon pairs").at(currentDir),scaleFactor); |
1165 |
< |
else if(currentHistogram.inputCollection == "muon-secondary muon pairs") fill1DHistogram(histo,currentHistogram,muons.product(),muons.product(), |
1165 |
> |
else if(currentHistogram.inputCollection == "muon-secondary muon pairs") fill1DHistogram(histo,currentHistogram,muons.product(),secMuons.product(), |
1166 |
|
cumulativeFlags.at("muon-secondary muon pairs").at(currentDir),scaleFactor); |
1167 |
|
else if(currentHistogram.inputCollection == "muon-secondary photon pairs") fill1DHistogram(histo,currentHistogram,muons.product(),photons.product(), |
1168 |
|
cumulativeFlags.at("muon-secondary photon pairs").at(currentDir),scaleFactor); |
1205 |
|
cumulativeFlags.at("electron-track pairs").at(currentDir),scaleFactor); |
1206 |
|
else if(currentHistogram.inputCollection == "muon-track pairs") fill1DHistogram(histo,currentHistogram, muons.product(),tracks.product(), |
1207 |
|
cumulativeFlags.at("muon-track pairs").at(currentDir),scaleFactor); |
1208 |
+ |
else if(currentHistogram.inputCollection == "secondary muon-track pairs") fill1DHistogram(histo,currentHistogram, secMuons.product(),tracks.product(), |
1209 |
+ |
cumulativeFlags.at("secondary muon-track pairs").at(currentDir),scaleFactor); |
1210 |
|
else if(currentHistogram.inputCollection == "muon-tau pairs") fill1DHistogram(histo,currentHistogram, muons.product(),taus.product(), |
1211 |
|
cumulativeFlags.at("muon-tau pairs").at(currentDir),scaleFactor); |
1212 |
|
else if(currentHistogram.inputCollection == "tau-tau pairs") fill1DHistogram(histo,currentHistogram, taus.product(),taus.product(), |
1238 |
|
else if(currentHistogram.inputCollection == "secondary jets") fill2DHistogram(histo,currentHistogram,jets.product(),cumulativeFlags.at("secondary jets").at(currentDir),scaleFactor); |
1239 |
|
else if(currentHistogram.inputCollection == "secondary photons") fill2DHistogram(histo,currentHistogram,photons.product(),cumulativeFlags.at("secondary photons").at(currentDir),scaleFactor); |
1240 |
|
else if(currentHistogram.inputCollection == "muons") fill2DHistogram(histo,currentHistogram,muons.product(),cumulativeFlags.at("muons").at(currentDir),scaleFactor); |
1241 |
< |
else if(currentHistogram.inputCollection == "secondary muons") fill2DHistogram(histo,currentHistogram,muons.product(),cumulativeFlags.at("secondary muons").at(currentDir),scaleFactor); |
1241 |
> |
else if(currentHistogram.inputCollection == "secondary muons") fill2DHistogram(histo,currentHistogram,secMuons.product(),cumulativeFlags.at("secondary muons").at(currentDir),scaleFactor); |
1242 |
|
else if(currentHistogram.inputCollection == "muon-muon pairs") fill2DHistogram(histo,currentHistogram,muons.product(),muons.product(), |
1243 |
|
cumulativeFlags.at("muon-muon pairs").at(currentDir),scaleFactor); |
1244 |
< |
else if(currentHistogram.inputCollection == "muon-secondary muon pairs") fill2DHistogram(histo,currentHistogram,muons.product(),muons.product(), |
1244 |
> |
else if(currentHistogram.inputCollection == "muon-secondary muon pairs") fill2DHistogram(histo,currentHistogram,muons.product(),secMuons.product(), |
1245 |
|
cumulativeFlags.at("muon-secondary muon pairs").at(currentDir),scaleFactor); |
1246 |
|
else if(currentHistogram.inputCollection == "muon-secondary photon pairs") fill2DHistogram(histo,currentHistogram,muons.product(),photons.product(), |
1247 |
|
cumulativeFlags.at("muon-secondary photon pairs").at(currentDir),scaleFactor); |
1281 |
|
cumulativeFlags.at("electron-track pairs").at(currentDir),scaleFactor); |
1282 |
|
else if(currentHistogram.inputCollection == "muon-track pairs") fill2DHistogram(histo,currentHistogram,muons.product(),tracks.product(), |
1283 |
|
cumulativeFlags.at("muon-track pairs").at(currentDir),scaleFactor); |
1284 |
+ |
else if(currentHistogram.inputCollection == "secondary muon-track pairs") fill2DHistogram(histo,currentHistogram,secMuons.product(),tracks.product(), |
1285 |
+ |
cumulativeFlags.at("muon-track pairs").at(currentDir),scaleFactor); |
1286 |
|
else if(currentHistogram.inputCollection == "muon-tau pairs") fill2DHistogram(histo,currentHistogram,muons.product(),taus.product(), |
1287 |
|
cumulativeFlags.at("muon-tau pairs").at(currentDir),scaleFactor); |
1288 |
|
else if(currentHistogram.inputCollection == "tau-tau pairs") fill2DHistogram(histo,currentHistogram,taus.product(),taus.product(), |
1338 |
|
else if(currentObject == "secondary photons") objectToPlot = "secondaryPhotons"; |
1339 |
|
else if(currentObject == "electron-track pairs") objectToPlot = "electronTrackPairs"; |
1340 |
|
else if(currentObject == "muon-track pairs") objectToPlot = "muonTrackPairs"; |
1341 |
+ |
else if(currentObject == "secondary muon-track pairs") objectToPlot = "secondaryMuonTrackPairs"; |
1342 |
|
else if(currentObject == "muon-tau pairs") objectToPlot = "muonTauPairs"; |
1343 |
|
else if(currentObject == "tau-tau pairs") objectToPlot = "ditauPairs"; |
1344 |
|
else if(currentObject == "tau-track pairs") objectToPlot = "tauTrackPairs"; |
1353 |
|
else if(currentObject == "secondary electrons") objectToPlot = "secondaryElectrons"; |
1354 |
|
else if(currentObject == "electron-trigobj pairs") objectToPlot = "electronTrigobjPairs"; |
1355 |
|
else if(currentObject == "muon-trigobj pairs") objectToPlot = "muonTrigobjPairs"; |
1356 |
+ |
else if(currentObject == "electron-mcparticle pairs") objectToPlot = "electronMCparticlePairs"; |
1357 |
|
else objectToPlot = currentObject; |
1358 |
|
|
1359 |
|
string tempCurrentObject = objectToPlot; |
1396 |
|
|
1397 |
|
if (coll == "jets") assignTreeBranch(brSpecs,jets.product(), cumulativeFlags.at(coll).back()); |
1398 |
|
else if(coll == "secondary jets") assignTreeBranch(brSpecs,jets.product(), cumulativeFlags.at(coll).back()); |
1399 |
< |
else if(coll == "secondary photons") assignTreeBranch(brSpecs,photons.product(), cumulativeFlags.at(coll).back()); |
1399 |
> |
else if(coll == "secondary photons") assignTreeBranch(brSpecs,photons.product(), cumulativeFlags.at(coll).back()); |
1400 |
|
else if(coll == "muons") assignTreeBranch(brSpecs,muons.product(), cumulativeFlags.at(coll).back()); |
1401 |
< |
else if(coll == "secondary muons") assignTreeBranch(brSpecs,muons.product(), cumulativeFlags.at(coll).back()); |
1401 |
> |
else if(coll == "secondary muons") assignTreeBranch(brSpecs,secMuons.product(), cumulativeFlags.at(coll).back()); |
1402 |
|
else if(coll == "electrons") assignTreeBranch(brSpecs,electrons.product(), cumulativeFlags.at(coll).back()); |
1403 |
|
else if(coll == "secondary electrons") assignTreeBranch(brSpecs,electrons.product(), cumulativeFlags.at(coll).back()); |
1404 |
|
else if(coll == "events") assignTreeBranch(brSpecs,events.product(), cumulativeFlags.at(coll).back()); |
1869 |
|
(object->isGlobalMuon > 0 || |
1870 |
|
object->isTrackerMuon > 0); |
1871 |
|
} |
1872 |
+ |
else if(variable == "looseIDGlobalMuon") { |
1873 |
+ |
value = object->pt > 10 && |
1874 |
+ |
object->isGlobalMuon > 0; |
1875 |
+ |
} |
1876 |
|
else if(variable == "correctedD0VertexErr") value = hypot (object->tkD0err, hypot (chosenVertex ()->xError, chosenVertex ()->yError)); |
1877 |
|
else if(variable == "correctedD0VertexSig") value = object->correctedD0Vertex / hypot (object->tkD0err, hypot (chosenVertex ()->xError, chosenVertex ()->yError)); |
1878 |
|
else if(variable == "detIso") value = (object->trackIsoDR03) / object->pt; |
1888 |
|
else |
1889 |
|
value = -999; |
1890 |
|
} |
1891 |
< |
|
1892 |
< |
|
1891 |
> |
else if(variable == "ptPlusMet") { |
1892 |
> |
// Calculate the magnitude of the vector sum of the muon pT and the Met. |
1893 |
> |
if (const BNmet *met = chosenMET ()) |
1894 |
> |
{ |
1895 |
> |
TVector2 p2Met; |
1896 |
> |
TVector2 p2Muon; |
1897 |
> |
p2Met. SetMagPhi( met->pt, met->phi); |
1898 |
> |
p2Muon.SetMagPhi(object->pt, object->phi); |
1899 |
> |
TVector2 p2MetElec = p2Met + p2Muon; |
1900 |
> |
value = p2MetElec.Mod(); |
1901 |
> |
} |
1902 |
> |
else |
1903 |
> |
value = -999; |
1904 |
> |
} |
1905 |
|
|
1906 |
|
else if(variable == "correctedD0VertexInEBPlus"){ |
1907 |
|
if(fabs(object->eta) < 0.8 && object->eta > 0) value = object->correctedD0Vertex; |
2273 |
|
value = -999; |
2274 |
|
} |
2275 |
|
|
2276 |
+ |
else if(variable == "ptPlusMet") { |
2277 |
+ |
// Calculate the magnitude of the vector sum of the electron pT and the Met. |
2278 |
+ |
if (const BNmet *met = chosenMET ()) |
2279 |
+ |
{ |
2280 |
+ |
TVector2 p2Met; |
2281 |
+ |
TVector2 p2Elec; |
2282 |
+ |
p2Met. SetMagPhi( met->pt, met->phi); |
2283 |
+ |
p2Elec.SetMagPhi(object->pt, object->phi); |
2284 |
+ |
TVector2 p2MetElec = p2Met + p2Elec; |
2285 |
+ |
value = p2MetElec.Mod(); |
2286 |
+ |
} |
2287 |
+ |
else |
2288 |
+ |
value = -999; |
2289 |
+ |
} |
2290 |
+ |
|
2291 |
|
else if(variable == "correctedD0VertexEEPositiveChargeLowPt"){ |
2292 |
|
if(fabs(object->eta) > 1.479 && object->charge > 0 && object->pt > 45) value = object->correctedD0Vertex; |
2293 |
|
else value = -999; |
2551 |
|
else if(variable == "pthat") value = object->pthat; |
2552 |
|
else if(variable == "qScale") value = object->qScale; |
2553 |
|
else if(variable == "alphaQCD") value = object->alphaQCD; |
2457 |
– |
else if(variable == "Ht") value = getHt(jets.product()); |
2554 |
|
else if(variable == "alphaQED") value = object->alphaQED; |
2555 |
|
else if(variable == "scalePDF") value = object->scalePDF; |
2556 |
|
else if(variable == "x1") value = object->x1; |
2621 |
|
else if(variable == "electronScaleFactor") value = electronScaleFactor_; |
2622 |
|
else if(variable == "stopCTauScaleFactor") value = stopCTauScaleFactor_; |
2623 |
|
else if(variable == "bTagScaleFactor") value = bTagScaleFactor_; |
2624 |
+ |
|
2625 |
+ |
else if(variable == "unfilteredHt") value = getHt(jets.product()); |
2626 |
|
else if(variable == "ht") value = chosenHT (); |
2627 |
+ |
|
2628 |
|
else if(variable == "leadMuPairInvMass"){ |
2629 |
|
pair<const BNmuon *, const BNmuon *> muPair = leadMuonPair (); |
2630 |
|
TLorentzVector p0 (muPair.first->px, muPair.first->py, muPair.first->pz, muPair.first->energy), |
2982 |
|
value = trkJetDeltaRMin; |
2983 |
|
} |
2984 |
|
|
2985 |
+ |
else if(variable == "deltaRMinElecLooseMvaId") { |
2986 |
+ |
// calculate minimum deltaR between track and any other electron passing loose mva ID, i.e., mvaNonTrigV0 > 0 |
2987 |
+ |
double trkElecDeltaRMin = 99.; |
2988 |
+ |
for (uint ielec = 0; ielec<electrons->size(); ielec++) { |
2989 |
+ |
string empty = ""; |
2990 |
+ |
double mvaNonTrigV0 = valueLookup(&electrons->at(ielec), "mvaNonTrigV0", "", empty); |
2991 |
+ |
if (mvaNonTrigV0 < 0) continue; // only consider electrons with mvaNonTrigV0 > 0 |
2992 |
+ |
double elecEta = valueLookup(&electrons->at(ielec), "eta", "", empty); |
2993 |
+ |
double elecPhi = valueLookup(&electrons->at(ielec), "phi", "", empty); |
2994 |
+ |
double trkElecDeltaR = deltaR(object->eta, object->phi, elecEta, elecPhi); |
2995 |
+ |
if (trkElecDeltaR < trkElecDeltaRMin) trkElecDeltaRMin = trkElecDeltaR; |
2996 |
+ |
} |
2997 |
+ |
value = trkElecDeltaRMin; |
2998 |
+ |
} |
2999 |
+ |
|
3000 |
+ |
else if(variable == "deltaRMinMuonLooseId") { |
3001 |
+ |
// calculate minimum deltaR between track and any other loose-Id muon |
3002 |
+ |
double trkMuonDeltaRMin = 99.; |
3003 |
+ |
// if (!muons) cout << "ERROR: could not find muon collection for calculation of deltaRMinMuonLooseId" << endl; |
3004 |
+ |
for (uint imuon = 0; imuon<muons->size(); imuon++) { |
3005 |
+ |
string empty = ""; |
3006 |
+ |
double isLooseIdMuon = valueLookup(&muons->at(imuon), "looseID", "", empty); |
3007 |
+ |
if (!isLooseIdMuon) continue; // only consider muons that pass the looseID criteria |
3008 |
+ |
double muonEta = valueLookup(&muons->at(imuon), "eta", "", empty); |
3009 |
+ |
double muonPhi = valueLookup(&muons->at(imuon), "phi", "", empty); |
3010 |
+ |
double trkMuonDeltaR = deltaR(object->eta, object->phi, muonEta, muonPhi); |
3011 |
+ |
if (trkMuonDeltaR < trkMuonDeltaRMin) trkMuonDeltaRMin = trkMuonDeltaR; |
3012 |
+ |
} |
3013 |
+ |
value = trkMuonDeltaRMin; |
3014 |
+ |
} |
3015 |
+ |
|
3016 |
+ |
else if(variable == "deltaRMinSecMuonLooseIdGlobal") { |
3017 |
+ |
// calculate minimum deltaR between track and any other loose-Id muon |
3018 |
+ |
double trkMuonDeltaRMin = 99.; |
3019 |
+ |
// if (!secMuons) cout << "ERROR: could not find secondary muon collection for calculation of deltaRMinSecMuonLooseIdGlobal" << endl; |
3020 |
+ |
for (uint imuon = 0; imuon<secMuons->size(); imuon++) { |
3021 |
+ |
string empty = ""; |
3022 |
+ |
double isLooseIdMuon = valueLookup(&secMuons->at(imuon), "looseIDGlobalMuon", "", empty); |
3023 |
+ |
if (!isLooseIdMuon) continue; // only consider muons that pass the looseIDGlobal criteria |
3024 |
+ |
double muonEta = valueLookup(&secMuons->at(imuon), "eta", "", empty); |
3025 |
+ |
double muonPhi = valueLookup(&secMuons->at(imuon), "phi", "", empty); |
3026 |
+ |
double trkMuonDeltaR = deltaR(object->eta, object->phi, muonEta, muonPhi); |
3027 |
+ |
if (trkMuonDeltaR < trkMuonDeltaRMin) trkMuonDeltaRMin = trkMuonDeltaR; |
3028 |
+ |
} |
3029 |
+ |
value = trkMuonDeltaRMin; |
3030 |
+ |
} |
3031 |
+ |
|
3032 |
+ |
else if(variable == "deltaRMinTauLooseHadronicId") { |
3033 |
+ |
// calculate minimum deltaR between track and any other tau passing loose hadronic ID |
3034 |
+ |
double trkTauDeltaRMin = 99.; |
3035 |
+ |
// if (!taus) cout << "ERROR: could not find tau collection for calculation of deltaRMinTauLooseHadronicId" << endl; |
3036 |
+ |
for (uint itau = 0; itau<taus->size(); itau++) { |
3037 |
+ |
string empty = ""; |
3038 |
+ |
double isIdTau = valueLookup(&taus->at(itau), "looseHadronicID", "", empty); |
3039 |
+ |
if (!isIdTau) continue; // only consider taus that pass the loose hadronic ID criteria |
3040 |
+ |
double tauEta = valueLookup(&taus->at(itau), "eta", "", empty); |
3041 |
+ |
double tauPhi = valueLookup(&taus->at(itau), "phi", "", empty); |
3042 |
+ |
double trkTauDeltaR = deltaR(object->eta, object->phi, tauEta, tauPhi); |
3043 |
+ |
if (trkTauDeltaR < trkTauDeltaRMin) trkTauDeltaRMin = trkTauDeltaR; |
3044 |
+ |
} |
3045 |
+ |
value = trkTauDeltaRMin; |
3046 |
+ |
} |
3047 |
+ |
|
3048 |
|
else if(variable == "genDeltaRLowest") value = getGenDeltaRLowest(object); |
3049 |
|
|
3050 |
|
else if(variable == "genMatchedPdgId"){ |
3787 |
|
return value; |
3788 |
|
} // end electron-muon pair valueLookup |
3789 |
|
|
3790 |
< |
|
3790 |
> |
|
3791 |
|
//!electron-jet pair valueLookup |
3792 |
|
double |
3793 |
|
OSUAnalysis::valueLookup (const BNelectron* object1, const BNjet* object2, string variable, string function, string &stringValue){ |
3827 |
|
return value; |
3828 |
|
} |
3829 |
|
|
3830 |
+ |
//!electron-mcparticle pair valueLookup |
3831 |
+ |
double |
3832 |
+ |
OSUAnalysis::valueLookup (const BNelectron* object1, const BNmcparticle* object2, string variable, string function, string &stringValue){ |
3833 |
+ |
|
3834 |
+ |
double value = 0.0; |
3835 |
+ |
|
3836 |
+ |
if(variable == "deltaPhi") value = fabs(deltaPhi(object1->phi,object2->phi)); |
3837 |
+ |
else if(variable == "deltaEta") value = fabs(object1->eta - object2->eta); |
3838 |
+ |
else if(variable == "deltaR") value = deltaR(object1->eta,object1->phi,object2->eta,object2->phi); |
3839 |
+ |
else if(variable == "threeDAngle") |
3840 |
+ |
{ |
3841 |
+ |
TVector3 threeVector1(object1->px, object1->py, object1->pz); |
3842 |
+ |
TVector3 threeVector2(object2->px, object2->py, object2->pz); |
3843 |
+ |
value = (threeVector1.Angle(threeVector2)); |
3844 |
+ |
} |
3845 |
+ |
else if(variable == "chargeProduct"){ |
3846 |
+ |
value = object1->charge*object2->charge; |
3847 |
+ |
} |
3848 |
+ |
|
3849 |
+ |
else{clog << "WARNING: invalid variable '" << variable << "'\n"; value = -999;} |
3850 |
+ |
value = applyFunction(function, value); |
3851 |
+ |
|
3852 |
+ |
return value; |
3853 |
+ |
} |
3854 |
+ |
|
3855 |
+ |
|
3856 |
|
//!photon-jet pair valueLookup |
3857 |
|
double |
3858 |
|
OSUAnalysis::valueLookup (const BNphoton* object1, const BNjet* object2, string variable, string function, string &stringValue){ |
4030 |
|
if(variable == "deltaPhi") value = fabs(deltaPhi(object1->phi,object2->phi)); |
4031 |
|
else if(variable == "deltaEta") value = fabs(object1->eta - object2->eta); |
4032 |
|
else if(variable == "deltaR") value = deltaR(object1->eta,object1->phi,object2->eta,object2->phi); |
4033 |
+ |
else if(variable == "deltaRLooseMvaId") { |
4034 |
+ |
// only consider electrons that pass "loose MVA id", i.e., mvaNonTrigV0 > 0; |
4035 |
+ |
// otherwise return very large value (99) |
4036 |
+ |
if (object1->mvaNonTrigV0>0) value = deltaR(object1->eta,object1->phi,object2->eta,object2->phi); |
4037 |
+ |
else value = 99.; |
4038 |
+ |
} |
4039 |
|
else if(variable == "invMass"){ |
4040 |
|
fourVector1.SetPtEtaPhiM(object1->pt, object1->eta, object1->phi, electronMass); |
4041 |
|
fourVector2.SetPtEtaPhiM(object2->pt, object2->eta, object2->phi, electronMass ); |
4063 |
|
if(variable == "deltaPhi") value = fabs(deltaPhi(object1->phi,object2->phi)); |
4064 |
|
else if(variable == "deltaEta") value = fabs(object1->eta - object2->eta); |
4065 |
|
else if(variable == "deltaR") value = deltaR(object1->eta,object1->phi,object2->eta,object2->phi); |
4066 |
+ |
else if(variable == "deltaRLooseID") { |
4067 |
+ |
// only consider muons that pass looseId criteria; otherwise return very large value (99.) |
4068 |
+ |
string empty = ""; |
4069 |
+ |
double isLooseId = valueLookup(object1, "looseID", "", empty); |
4070 |
+ |
if (isLooseId) value = deltaR(object1->eta,object1->phi,object2->eta,object2->phi); |
4071 |
+ |
else value = 99.; |
4072 |
+ |
} |
4073 |
+ |
else if(variable == "deltaRGlobalMuon") { |
4074 |
+ |
// only consider muons that pass looseId criteria; otherwise return very large value (99.) |
4075 |
+ |
if (object1->isGlobalMuon) value = deltaR(object1->eta,object1->phi,object2->eta,object2->phi); |
4076 |
+ |
else value = 99.; |
4077 |
+ |
} |
4078 |
|
else if(variable == "invMass"){ |
4079 |
|
fourVector1.SetPtEtaPhiM(object1->pt, object1->eta, object1->phi, muonMass); |
4080 |
|
fourVector2.SetPtEtaPhiM(object2->pt, object2->eta, object2->phi, pionMass ); |
4140 |
|
double value = 0.0; |
4141 |
|
if(variable == "deltaPhi") value = fabs(deltaPhi(object1->phi,object2->phi)); |
4142 |
|
else if(variable == "deltaR") value = deltaR(object1->eta,object1->phi,object2->eta,object2->phi); |
4143 |
+ |
else if(variable == "deltaRLooseHadronicID") { |
4144 |
+ |
// only consider tau's that pass the loose hadronic ID criteria; otherwise return very large value (99) |
4145 |
+ |
string empty = ""; |
4146 |
+ |
double isLooseHadronicID = valueLookup(object1, "looseHadronicID", "", empty); |
4147 |
+ |
|
4148 |
+ |
if (isLooseHadronicID) value = deltaR(object1->eta,object1->phi,object2->eta,object2->phi); |
4149 |
+ |
else value = 99.; |
4150 |
+ |
} |
4151 |
|
else if(variable == "chargeProduct"){ |
4152 |
|
value = object1->charge*object2->charge; |
4153 |
|
} |
4527 |
|
if (currentCut.inputCollection.find("pair")!=string::npos) { |
4528 |
|
string obj1, obj2; |
4529 |
|
getTwoObjs(currentCut.inputCollection, obj1, obj2); |
4530 |
+ |
if (verbose_>2) clog << " Two object types: " << obj1 << ", " << obj2 << endl; |
4531 |
|
if (inputType==obj1 || |
4532 |
|
inputType==obj2) { |
4533 |
|
// Do not add a cut to individualFlags or cumulativeFlags, if the cut is on a paired collection, |
4539 |
|
} |
4540 |
|
} |
4541 |
|
|
4542 |
+ |
if (!inputCollection) cout << "ERROR: invalid input collection for inputType=" << inputType << endl; |
4543 |
+ |
|
4544 |
+ |
if (verbose_>3) clog << " Collection size: " << inputCollection->size() << endl; |
4545 |
+ |
|
4546 |
|
for (uint object = 0; object != inputCollection->size(); object++){ |
4547 |
|
|
4548 |
+ |
if (verbose_>4) clog << " Setting flags for object " << object << endl; |
4549 |
+ |
|
4550 |
|
bool cutDecision = true;//object passes if this cut doesn't cut on that type of object |
4551 |
|
bool plotDecision = true; |
4552 |
|
|
4594 |
|
|
4595 |
|
cumulativeFlags.at(inputType).at(currentCutIndex).push_back(make_pair(previousCumulativeCutFlag,previousCumulativePlotFlag)); |
4596 |
|
|
4597 |
< |
} |
4597 |
> |
} // for (uint object = 0; object != inputCollection->size(); object++){ |
4598 |
|
|
4599 |
|
} // end void OSUAnalysis::setObjectFlags |
4600 |
|
|