45 using namespace trigger;
46 using namespace l1extra;
64 : mySelection(inputSelection), selectedValidTriggers(validTriggers)
68 LogTrace (
"HLTMuonVal") <<
"\n\n Inside HLTMuonMatchAndPlot Constructor";
69 LogTrace (
"HLTMuonVal") <<
"The trigger name is " << triggerName
70 <<
" and the module names are listed";
72 for (vector<string>::iterator iMod = moduleNames.begin();
73 iMod != moduleNames.end(); iMod++){
78 theHltProcessName = pset.
getParameter<
string>(
"HltProcessName");
80 LogTrace (
"HLTMuonVal") <<
"HLTMuonMatchAndPlot: Constructor: Initializing HLTConfigProvider with HLT process name: " << theHltProcessName << endl;
84 bool hltConfigChanged;
85 bool hltConfigInitSuccess = hltConfig.
init(currentRun, currentEventSetup, theHltProcessName, hltConfigChanged);
87 theNumberOfObjects = ( TString(triggerName).Contains(
"Double") ) ? 2 : 1;
88 theTriggerName = triggerName;
100 theHltCollectionLabels.clear();
103 useOldLabels =
false;
104 useFullDebugInformation =
false;
106 if (useFullDebugInformation) {
121 if (TString(triggerName).Contains(
"L1")) {
126 if (TString(triggerName).Contains(
"L2")) {
130 if (TString(triggerName).Contains(
"L3")) {
137 LogTrace (
"HLTMuonVal") <<
"Parsing Module names... useOldLabels? "
139 <<
", useFullDebugInformation? "
140 << useFullDebugInformation
144 TPRegexp l1Regexp(
"L1.*Filtered");
145 TPRegexp l2Regexp(
"L2.*Filtered");
147 string theLastHltFilter =
"";
149 theL1SeedModuleForHLTPath =
"" ;
152 for (
size_t i = 0;
i < moduleNames.size();
i++ ) {
153 string module = moduleNames[
i];
155 if (hltConfigInitSuccess) {
156 LogTrace (
"HLTMuonVal") <<
"Considering Module named "
158 <<
" which has type = "
161 if ( hltConfig.
moduleType(module) ==
"HLTLevel1GTSeed" ) {
162 LogTrace (
"HLTMuonVal") <<
"Module = " << module
163 <<
" is a HLTLevel1GTSeed!!"
165 <<
"Storing it as L1Seed"
167 theL1SeedModuleForHLTPath =
module;
172 if ( TString(module).Contains(l1Regexp) ) {
175 theL1CollectionLabel =
module;
176 LogTrace (
"HLTMuonVal") <<
"... module is L1 collection";
179 }
else if ( TString(module).Contains(l2Regexp) ) {
183 if (useFullDebugInformation) {
184 theHltCollectionLabels.push_back(module);
185 LogTrace (
"HLTMuonVal") <<
"... module added to HLT collection list";
186 }
else if (isL2Path) {
187 LogTrace (
"HLTMuonVal") <<
"... module saved for later";
188 theLastHltFilter =
module;
192 }
else if (TString(module).Contains(
"Filtered") ) {
198 if (useFullDebugInformation) {
199 LogTrace (
"HLTMuonVal") <<
"... module added to HLT collection list" << endl;
200 theHltCollectionLabels.push_back(module);
201 }
else if (isL3Path) {
202 LogTrace (
"HLTMuonVal") <<
"... module saved for later" << endl;
203 theLastHltFilter =
module;
209 if (!useFullDebugInformation && theLastHltFilter !=
"" ) {
211 LogTrace(
"HLTMuonVal") <<
"\nAfter running over labels, we find hlt label coll size = "
212 << theHltCollectionLabels.size() << endl
213 <<
"\n\nwill only use the final hlt label = "
214 << theLastHltFilter << endl;
216 theHltCollectionLabels.push_back (theLastHltFilter);
220 numHltLabels = theHltCollectionLabels.size();
221 isIsolatedPath = ( numHltLabels == 4 ) ?
true :
false;
236 useMuonFromReco =
true;
240 vector <double> etaDefault;
241 etaDefault.push_back(15);
242 etaDefault.push_back(-2.1);
243 etaDefault.push_back(2.1);
247 vector <double> phiDefault;
248 phiDefault.push_back(15);
249 phiDefault.push_back(-3.2);
250 phiDefault.push_back(3.2);
255 vector <double> ptDefault;
263 vector <double> resDefault;
264 resDefault.push_back(10);
265 resDefault.push_back(-0.1);
266 resDefault.push_back(0.1);
269 vector <double> d0Default;
270 d0Default.push_back(10);
271 d0Default.push_back(-2.0);
272 d0Default.push_back(2.0);
276 vector <double> z0Default;
277 z0Default.push_back(10);
278 z0Default.push_back(-25);
279 z0Default.push_back(25);
285 int numPtBinEdge = 0;
286 if ( thePtParameters.size() > 100) {
287 LogInfo (
"HLTMuonVal") <<
"Warning!!! You specified a list of pt bin edges that is > 100 bins"
288 <<
"This is too many bins!! Truncating the list!!! " << endl;
290 }
else if (thePtParameters.size() < 1) {
293 numBinsInPtHisto = numPtBinEdge - 1;
301 numPtBinEdge = thePtParameters.size();
304 numBinsInPtHisto = numPtBinEdge - 1;
306 for (
int iBin = 0; iBin < numPtBinEdge; iBin++){
307 ptBins[iBin] = (float) thePtParameters[iBin];
400 thePhiEtaParameters2d.push_back(10);
401 thePhiEtaParameters2d.push_back(-2.2);
402 thePhiEtaParameters2d.push_back(2.2);
404 thePhiEtaParameters2d.push_back(10);
405 thePhiEtaParameters2d.push_back(-3.15);
406 thePhiEtaParameters2d.push_back(3.15);
417 theChargeParameters.push_back(3);
418 theChargeParameters.push_back(-1.5);
419 theChargeParameters.push_back(1.5);
421 theDRParameters.push_back(10);
422 theDRParameters.push_back(0.0);
423 theDRParameters.push_back(theL2DrCut);
425 theChargeFlipParameters.push_back(2);
426 theChargeFlipParameters.push_back(-1.0);
427 theChargeFlipParameters.push_back(1.0);
428 theChargeFlipParameters.push_back(2);
429 theChargeFlipParameters.push_back(-1.0);
430 theChargeFlipParameters.push_back(1.0);
432 theIsolationParameters.push_back(10);
433 theIsolationParameters.push_back(0.0);
434 theIsolationParameters.push_back(1.0);
436 thePhiParameters0Pi.push_back(10);
437 thePhiParameters0Pi.push_back(0);
438 thePhiParameters0Pi.push_back(3.2);
472 LogInfo (
"HLTMuonVal") <<
"===WARNING=== Couldn't find DQMStore..."
473 <<
"Won't be able to book ME's..."
474 <<
"The rest of the run will probably not be useful..."
481 LogTrace (
"HLTMuonVal") <<
"exiting constructor\n\n";
490 LogTrace (
"HLTMuonVal") <<
"\n\nInside HLTMuonMatchAndPlot endRun()";
497 vector<MonitorElement*>::iterator iMonitorEl;
499 for ( iMonitorEl = booked1DMonitorElements.begin();
500 iMonitorEl != booked1DMonitorElements.end();
503 moveOverflow((*iMonitorEl));
514 LogTrace (
"HLTMuonVal") <<
"\n\nInside HLTMuonMatchAndPlot finish()" << endl;
526 LogTrace(
"HLTMuonVal" ) <<
"\n\nIn analyze for trigger path " <<
527 theTriggerName <<
", Event:" << eventNumber <<
"\n\n\n";
531 bool validSelection = selectAndMatchMuons (iEvent, recMatches, hltFakeCands, mySelection);
532 if (validSelection) fillPlots (recMatches, hltFakeCands);
539 std::vector< std::vector<HltFakeStruct> > & myHltFakeCands
542 LogTrace (
"HLTMuonVal") <<
"\n\nInside selectAndMatchMuons, called with no selection argument"
544 <<
"Calling function using mySelection"
547 return selectAndMatchMuons (iEvent, myRecMatches, myHltFakeCands, mySelection);
553 std::vector< std::vector<HltFakeStruct> > & myHltFakeCands,
557 myRecMatches.clear();
563 myHltFakeCands.clear();
564 for (
unsigned iLabel = 0; iLabel < numHltLabels; iLabel++){
566 std::vector<HltFakeStruct> tempFake;
568 myHltFakeCands.push_back(tempFake);
583 LogTrace(
"HLTMuonVal") <<
"Checking trigger result for "
584 <<
"trigger information stored in the following block "
585 << TriggerResultLabel;
587 bool passedRequiredTrigger = applyTriggerSelection ( muonSelection, iEvent);
589 if (!passedRequiredTrigger) {
590 LogTrace (
"HLTMuonVal") <<
"You didn't pass the required trigger"
600 double genMuonPt = -1;
601 double recMuonPt = -1;
604 LogTrace (
"HLTMuonVal") <<
"\n\nStarting to look for gen muons\n\n";
610 LogTrace (
"HLTMuonVal") <<
"\n\n\n\nDone getting gen, now getting reco\n\n\n";
617 foundBeamSpot =
false;
619 if ( useMuonFromReco ) {
622 iEvent.
getByLabel(RecoMuonInputTag, muTracks);
624 MuonCollection::const_iterator
muon;
626 LogWarning(
"HLTMuonVal") <<
"WARNING: failed to get the RECO Muon collection named " << RecoMuonInputTag
627 <<
"\nYou have tracks to compare to... ignoring RECO muons"
628 <<
" for the rest of this job";
629 useMuonFromReco =
false;
632 LogTrace (
"HLTMuonVal") <<
"Beginning loop over reco muons" << endl;
634 for ( muon = muTracks->begin(); muon != muTracks->end(); ++
muon ) {
639 LogTrace (
"HLTMuonVal") <<
"... Applying selection" << endl;
643 LogTrace (
"HLTMuonVal") <<
"Passed selection!" << endl;
645 if ( applyTrackSelection( muonSelection, (*muon) ) ){
649 float pt = muon->pt();
650 float eta = muon->eta();
653 myRecMatches.push_back(newMatchStruct);
656 <<
" with pt = " << pt
657 <<
", eta = " <<
eta;
673 for (
unsigned iMatch = 0; iMatch < myRecMatches.size(); iMatch++) {
674 LogTrace (
"HLTMuonVal") <<
"Cand #" << iMatch <<
" ";
675 LogTrace (
"HLTMuonVal") <<
"Pt = " << myRecMatches[iMatch].recCand->pt()
680 iEvent.
getByLabel(BeamSpotInputTag,recoBeamSpotHandle);
684 foundBeamSpot =
true;
686 LogTrace (
"HLTMuonVal") <<
"\n\n\nSUCESS finding beamspot\n\n\n" << endl;
689 LogWarning (
"HLTMuonVal") <<
"FAILED to get the beamspot for this event";
695 LogTrace(
"HLTMuonVal") <<
"\n\n\n\ngenMuonPt: " << genMuonPt <<
", "
696 <<
"recMuonPt: " << recMuonPt
697 <<
"\nCustom name = " << muonSelection.
customLabel << endl
698 <<
"\nNow preparing to get trigger objects"
706 vector<TriggerObject> l1Particles;
707 vector<TriggerObject> l1RawParticles;
708 vector<TriggerObject> l1Seeds;
713 vector< vector<TriggerObject> > hltParticles(numHltLabels);
716 vector< vector<RecoChargedCandidateRef> > hltCands(numHltLabels);
719 vector<L1MuonParticleRef> l1Cands;
790 LogTrace (
"HLTMuonVal") <<
"\n\n\nLooking for AOD branch named "
791 <<
"hltTriggerSummaryAOD\n\n\n";
793 iEvent.
getByLabel(HltAodInputTag, aodTriggerEvent);
794 if ( !aodTriggerEvent.
isValid() ) {
795 LogInfo(
"HLTMuonVal") <<
"No AOD trigger summary found! Returning...";
799 LogTrace (
"HLTMuonVal") <<
"\n\n\nFound a branch! Getting objects\n\n\n";
806 LogTrace (
"HLTMuonVal") <<
"\n\n\nFound a collection with size "
807 << objects.size() <<
"\n\n\n";
809 if (objects.size() < 1) {
811 <<
"You found the collection, but doesn't have any entries";
822 collectionTag =
InputTag( theL1CollectionLabel,
"", theHltProcessName );
824 LogTrace (
"HLTMuonVal") <<
"Trigger Name is " << theTriggerName;
826 LogTrace (
"HLTMuonVal") <<
"\n\n L1Collection tag is "
827 << collectionTag << endl
828 <<
" and size filters is "
829 << aodTriggerEvent->sizeFilters()
830 <<
"Looking up L1 information in trigSummaryAod";
833 getAodTriggerObjectsForModule ( collectionTag, aodTriggerEvent, objects, l1Particles, muonSelection);
835 int indexHltColl = 0;
836 vector<string>::const_iterator iHltColl;
837 for (iHltColl = theHltCollectionLabels.begin();
838 iHltColl != theHltCollectionLabels.end();
840 collectionTag =
InputTag((*iHltColl) ,
"",
844 getAodTriggerObjectsForModule ( collectionTag, aodTriggerEvent, objects, hltParticles[indexHltColl] , muonSelection);
853 LogTrace (
"HLTMuonVal") <<
"At the end of parsing the L2/L3 filters, you have found "
854 <<
"L2 = " << ((hltParticles.size() > 0) ? hltParticles[0].
size() : 0)
855 <<
"L3 = " << ((hltParticles.size() > 1) ? hltParticles[1].
size() : 0)
864 collectionTag =
InputTag( theL1SeedModuleForHLTPath,
"", theHltProcessName );
866 LogTrace (
"HLTMuonVal") <<
"\n\n L1Seed colelction tag is "
867 << collectionTag << endl
868 <<
" and size filters is "
869 << aodTriggerEvent->sizeFilters()
870 <<
"Looking up L1 Seed information in trigSummaryAod";
873 getAodTriggerObjectsForModule ( collectionTag, aodTriggerEvent, objects, l1Seeds, muonSelection);
875 LogTrace (
"HLTMuonVal") <<
"At the end of parsing the L1 filter, you have found "
876 << l1Particles.size() <<
" objects: ";
891 for (
size_t i = 0;
i < myRecMatches.size();
i++ ) {
892 myRecMatches[
i].l1Cand = nullTriggerObject;
893 myRecMatches[
i].l1Seed = nullTriggerObject;
894 myRecMatches[
i].hltCands.
assign( numHltLabels, nullTriggerObject );
897 myRecMatches[
i].hltRawCands.assign(numHltLabels, nullLorentzVector);
898 myRecMatches[
i].l1RawCand = nullLorentzVector;
911 for (
size_t i = 0;
i < l1Particles.size();
i++ ) {
914 double eta = l1Cand.
eta();
915 double phi = l1Cand.
phi();
919 double maxDeltaR = theL1DrCut;
923 if ( useMuonFromReco ){
924 int match = findRecMatch( eta, phi, maxDeltaR, myRecMatches );
925 if ( match != -1 && myRecMatches[match].l1Cand.
pt() < 0 ) {
926 myRecMatches[
match].l1Cand = l1Cand;
927 LogTrace (
"HLTMuonVal") <<
"Found a rec match to L1 particle (aod) "
928 <<
" rec pt = " << myRecMatches[
match].recCand->pt()
929 <<
", l1 pt = " << myRecMatches[
match].l1Cand.pt();
942 for (
size_t i = 0;
i < l1Seeds.size();
i++ ) {
945 double eta = l1Cand.
eta();
946 double phi = l1Cand.
phi();
950 double maxDeltaR = theL1DrCut;
954 if ( useMuonFromReco ){
955 int match = findRecMatch( eta, phi, maxDeltaR, myRecMatches );
956 if ( match != -1 && myRecMatches[match].l1Seed.pt() < 0 ) {
957 myRecMatches[
match].l1Seed = l1Cand;
958 LogTrace (
"HLTMuonVal") <<
"Found a rec match to L1 particle (aod) "
959 <<
" rec pt = " << myRecMatches[
match].recCand->pt()
960 <<
", l1 pt = " << myRecMatches[
match].l1Seed.pt();
975 for (
size_t i = 0;
i < l1Cands.size();
i++ ) {
979 double eta = l1Cand.eta();
980 double phi = l1Cand.phi();
984 double maxDeltaR = theL1DrCut;
988 if ( useMuonFromReco ){
989 int match = findRecMatch( eta, phi, maxDeltaR, myRecMatches );
990 if ( match != -1 && myRecMatches[match].l1RawCand.energy() < 0 ) {
991 myRecMatches[
match].l1RawCand = l1Cand;
992 LogTrace (
"HLTMuonVal") <<
"Found an L1 match to a RAW object";
1002 LogTrace(
"HLTMuonVal") <<
"Number of L1 Cands: " << numL1Cands;
1007 vector<unsigned int> numHltCands( numHltLabels, 0) ;
1009 LogTrace (
"HLTMuonVal") <<
"Looking for HLT matches for numHltLabels = "
1012 for (
size_t i = 0;
i < numHltLabels;
i++ ) {
1014 int triggerLevel = (
i < ( numHltLabels / 2 ) ) ? 2 : 3;
1015 double maxDeltaR = ( triggerLevel == 2 ) ? theL2DrCut : theL3DrCut;
1017 LogTrace (
"HLTMuonVal") <<
"Looking at 4-vectors for " << theHltCollectionLabels[
i];
1019 for (
size_t candNum = 0; candNum < hltParticles[
i].size(); candNum++ ) {
1022 double eta = hltCand.
eta();
1023 double phi = hltCand.
phi();
1028 if ( useMuonFromReco ){
1033 int match = findRecMatch( eta, phi, maxDeltaR, myRecMatches );
1037 if ( match != -1 && myRecMatches[match].hltCands[
i].
pt() < 0 ) {
1038 myRecMatches[
match].hltCands[
i] = hltCand;
1040 LogTrace (
"HLTMuonVal") <<
"Found a HLT cand match! "
1041 <<
" rec pt = " << myRecMatches[
match].recCand->pt()
1042 <<
", hlt pt = " << myRecMatches[
match].hltCands[
i].pt();
1053 }
else if (match == -1){
1059 myHltFakeCands[
i].push_back(tempFakeCand);
1060 LogTrace (
"HLTMuonVal") <<
"\n\nWas this a fake hlt cand? "
1067 LogTrace(
"HLTMuonVal") <<
"Number of HLT Cands: " << numHltCands[
i];
1072 LogTrace (
"HLTMuonVal") <<
"Looking at RAW Candidates for "
1073 << theHltCollectionLabels[
i];
1076 for (
size_t candNum = 0; candNum < hltCands[
i].size(); candNum++ ) {
1079 double eta = hltCand.eta();
1080 double phi = hltCand.phi();
1085 if ( useMuonFromReco ){
1090 int match = findRecMatch( eta, phi, maxDeltaR, myRecMatches );
1094 if ( match != -1 && myRecMatches[match].hltCands[
i].
pt() < 0 ) {
1095 myRecMatches[
match].hltRawCands[
i] = hltCand;
1096 LogTrace (
"HLTMuonVal") <<
"Found a RAW hlt match to reco";
1130 std::vector< std::vector<HltFakeStruct> > & myHltFakeCands) {
1136 <<
"===Warning=== You've tried to call fill plots, "
1137 <<
"but no DQMStore object exists... refusing to fill plots"
1144 int numRecMatches = myRecMatches.size();
1158 if ((theNumberOfObjects == 2) && (myRecMatches.size() < 2))
return;
1169 double maxMatchPtRec = -10.0;
1175 for (
size_t i = 0;
i < myRecMatches.size();
i++ ) {
1177 LogTrace(
"HLTMuonVal") <<
"Reco Candidate loop:"
1178 <<
"looking at cand " <<
i
1179 <<
" out of " << myRecMatches.size()
1183 if ((isL3Path || isL2Path) && requireL1SeedForHLTPaths) {
1185 LogTrace (
"HLTMuonVal") <<
"Checking to see if your RECO muon matched to an L1 seed"
1188 if (myRecMatches[
i].l1Seed.pt() < 0) {
1189 LogTrace (
"HLTMuonVal") <<
"No match to L1 seed, skipping this RECO muon" << endl;
1196 double pt = myRecMatches[
i].recCand->pt();
1197 double eta = myRecMatches[
i].recCand->eta();
1198 double phi = myRecMatches[
i].recCand->phi();
1199 int recPdgId = myRecMatches[
i].recCand->pdgId();
1201 LogTrace (
"HLTMuonVal") <<
"trying to get a global track for this muon" << endl;
1206 TrackRef theMuonTrack = getCandTrackRef (mySelection, (*myRecMatches[
i].recCand));
1211 int plottedCharge = -99999;
1213 double d0beam = -9e20;
1214 double z0beam = -9e20;
1217 d0 = theMuonTrack->d0();
1218 z0 = theMuonTrack->dz();
1222 charge = theMuonTrack->charge();
1223 plottedCharge = getCharge (recPdgId);
1226 if (foundBeamSpot) {
1227 d0beam = theMuonTrack->dxy(
beamSpot.position());
1228 z0beam = theMuonTrack->dz(
beamSpot.position());
1230 hBeamSpotZ0Rec[0]->Fill(
beamSpot.z0());
1235 LogTrace (
"HLTMuonVal") <<
"... oops! that wasn't a global muon" << endl;
1248 hPassEtaRec[0]->Fill(eta);
1249 hPassPhiRec[0]->Fill(phi);
1250 hPassPtRec[0]->Fill(pt);
1251 hPhiVsEtaRec[0]->Fill(eta,phi);
1252 hPassD0Rec[0]->Fill(d0);
1253 hPassD0BeamRec[0]->Fill(d0beam);
1254 hPassZ0Rec[0]->Fill(z0);
1255 hPassZ0BeamRec[0]->Fill(z0beam);
1256 hPassCharge[0]->Fill(charge);
1259 double emEnergy = thisIso.
emEt;
1260 double hadEnergy = thisIso.
hadEt;
1261 double myMuonIso = (emEnergy + hadEnergy) / pt;
1263 hIsolationRec[0]->Fill(myMuonIso);
1265 if (numRecMatches == 1) {
1266 hPassPtRecExactlyOne[0]->Fill(pt);
1272 if ( (myRecMatches[
i].l1Cand.pt() > 0) && ((useFullDebugInformation) || (isL1Path)) ) {
1273 hPassEtaRec[1]->Fill(eta);
1274 hPassPhiRec[1]->Fill(phi);
1275 hPassPtRec[1]->Fill(pt);
1276 hPhiVsEtaRec[1]->Fill(eta,phi);
1277 hPassD0Rec[1]->Fill(d0);
1278 hPassD0BeamRec[1]->Fill(d0beam);
1279 hPassZ0Rec[1]->Fill(z0);
1280 hPassZ0BeamRec[1]->Fill(z0beam);
1281 hPassCharge[1]->Fill(charge);
1282 hIsolationRec[1]->Fill(myMuonIso);
1284 double l1eta = myRecMatches[
i].l1Cand.eta();
1285 double l1phi = myRecMatches[
i].l1Cand.phi();
1286 double l1pt = myRecMatches[
i].l1Cand.energy();
1290 int l1plottedCharge = getCharge (myRecMatches[
i].l1Cand.id());
1291 LogTrace (
"HLTMuonVal") <<
"The pdg id is (L1) "
1292 << myRecMatches[
i].l1Cand.id()
1293 <<
" and the L1 plotted charge is "
1305 hDeltaRMatched[0]->Fill(deltaR);
1306 hPassMatchPtRec[0]->Fill(pt);
1310 hMatchedDeltaPhi[0]->Fill(deltaPhi);
1316 hResoPtAodRec[0]->Fill((pt - l1pt)/pt);
1317 hResoEtaAodRec[0]->Fill((eta - l1eta)/fabs(eta));
1318 hResoPhiAodRec[0]->Fill((phi - l1phi)/fabs(phi));
1321 hChargeFlipMatched[0]->Fill(l1plottedCharge, plottedCharge);
1323 if (numRecMatches == 1) {
1324 hPassExaclyOneMuonMaxPtRec[1]->Fill(pt);
1325 hPassPtRecExactlyOne[1]->Fill(pt);
1334 for (
size_t j = 0;
j < myRecMatches[
i].hltCands.size();
j++ ) {
1335 if ( myRecMatches[
i].hltCands[
j].
pt() > 0 ) {
1336 double hltCand_pt = myRecMatches[
i].hltCands[
j].pt();
1337 double hltCand_eta = myRecMatches[
i].hltCands[
j].eta();
1338 double hltCand_phi = myRecMatches[
i].hltCands[
j].phi();
1339 int hltCand_plottedCharge = getCharge(myRecMatches[
i].hltCands[
j].
id());
1342 if (theHltCollectionLabels.size() >
j) {
1343 TString tempString = theHltCollectionLabels[
j];
1344 if (tempString.Contains(
"L3")) {
1346 maxMatchPtRec = (pt > maxMatchPtRec)? pt : maxMatchPtRec;
1354 hPassEtaRec[
j+HLT_PLOT_OFFSET]->Fill(eta);
1355 hPassPhiRec[
j+HLT_PLOT_OFFSET]->Fill(phi);
1356 hPassPtRec[
j+HLT_PLOT_OFFSET]->Fill(pt);
1357 hPhiVsEtaRec[
j+HLT_PLOT_OFFSET]->Fill(eta,phi);
1358 hPassD0Rec[
j+HLT_PLOT_OFFSET]->Fill(d0);
1359 hPassD0BeamRec[
j+HLT_PLOT_OFFSET]->Fill(d0beam);
1360 hPassZ0Rec[
j+HLT_PLOT_OFFSET]->Fill(z0);
1361 hPassZ0BeamRec[
j+HLT_PLOT_OFFSET]->Fill(z0beam);
1362 hPassCharge[
j+HLT_PLOT_OFFSET]->Fill(charge);
1363 hIsolationRec[
j+HLT_PLOT_OFFSET]->Fill(myMuonIso);
1376 hDeltaRMatched[
j+HLT_PLOT_OFFSET-1]->Fill(deltaR);
1377 hPassMatchPtRec[
j+HLT_PLOT_OFFSET-1]->Fill(pt);
1381 hMatchedDeltaPhi[
j+HLT_PLOT_OFFSET-1]->Fill(deltaPhi);
1387 LogTrace (
"HLTMuonVal") <<
"The pdg id is (hlt [" <<
j <<
"]) "
1388 << myRecMatches[
i].hltCands[
j].id()
1389 <<
" and the plotted charge is "
1390 << hltCand_plottedCharge
1391 <<
", w/ rec charge "
1393 <<
", and plotted charge "
1396 <<
"and rec pdg id = "
1401 hChargeFlipMatched[
j+HLT_PLOT_OFFSET-1]->Fill( hltCand_plottedCharge, plottedCharge);
1406 hResoPtAodRec[
j+HLT_PLOT_OFFSET-1]->Fill((pt - hltCand_pt)/pt);
1407 hResoEtaAodRec[
j+HLT_PLOT_OFFSET-1]->Fill((eta - hltCand_eta)/fabs(eta));
1408 hResoPhiAodRec[
j+HLT_PLOT_OFFSET-1]->Fill((phi - hltCand_phi)/fabs(phi));
1410 if (numRecMatches == 1 && (myRecMatches[
i].hltCands.size()== 1)) {
1411 hPassExaclyOneMuonMaxPtRec[
j+HLT_PLOT_OFFSET]->Fill(pt);
1412 hPassPtRecExactlyOne[
j+HLT_PLOT_OFFSET]->Fill(pt);
1420 if (useFullDebugInformation) {
1421 LogTrace (
"HLTMuonVal") <<
"\n.... now Filling Raw Histos";
1422 if ( myRecMatches[
i].l1RawCand.energy() > 0 ) {
1425 rawMatchHltCandPt[1]->Fill(pt);
1426 rawMatchHltCandEta[1]->Fill(eta);
1427 rawMatchHltCandPhi[1]->Fill(phi);
1430 LogTrace (
"HLTMuonVal") <<
"There are " << myRecMatches[
i].hltCands.size()
1431 <<
" hltRaw candidates that could match, starting loop"
1434 for (
size_t j = 0;
j < myRecMatches[
i].hltCands.size();
j++ ) {
1435 if ( myRecMatches[
i].hltCands[
j].
pt() > 0 ) {
1436 rawMatchHltCandPt[
j+HLT_PLOT_OFFSET]->Fill(pt);
1437 rawMatchHltCandEta[
j+HLT_PLOT_OFFSET]->Fill(eta);
1438 rawMatchHltCandPhi[
j+HLT_PLOT_OFFSET]->Fill(phi);
1451 LogTrace (
"HLTMuonVal") <<
"\n.... now looping over fake cands";
1452 for (
unsigned int iHltModule = 0; iHltModule < numHltLabels; iHltModule++) {
1453 for(
size_t iCand = 0; iCand < myHltFakeCands[iHltModule].size() ; iCand ++){
1454 LogTrace (
"HLTMuonVal") <<
"Label number : " << iHltModule
1455 <<
"(max = " << numHltLabels <<
")\n"
1456 <<
"Candidate number: " << iCand
1457 <<
"(max = " << myHltFakeCands[iHltModule].size()
1461 TriggerObject candVect = myHltFakeCands[iHltModule][iCand].myHltCand;
1462 bool candIsFake = myHltFakeCands[iHltModule][iCand].isAFake;
1464 allHltCandPt[iHltModule]->Fill(candVect.
pt());
1465 allHltCandEta[iHltModule]->Fill(candVect.
eta());
1466 allHltCandPhi[iHltModule]->Fill(candVect.
phi());
1469 fakeHltCandPt[iHltModule]->Fill(candVect.
pt());
1470 fakeHltCandEta[iHltModule]->Fill(candVect.
eta());
1471 fakeHltCandPhi[iHltModule]->Fill(candVect.
phi());
1491 LogTrace (
"HLTMuonVal") <<
"There are " << myRecMatches.size()
1492 <<
" RECO muons in this event"
1495 LogTrace (
"HLTMuonVal") <<
"The max pt found by looking at candiates is "
1511 if ( maxMatchPtRec > 0 ) hPassMaxPtRec[0]->Fill( maxMatchPtRec );
1517 if (numRecMatches == 1) {
1518 if (maxMatchPtRec >0) hPassExaclyOneMuonMaxPtRec[0]->Fill(maxMatchPtRec);
1522 if (useFullDebugInformation || isL1Path) {
1523 if ( numL1Cands >= theNumberOfObjects ) {
1525 if ( maxMatchPtRec > 0 ) hPassMaxPtRec[1]->Fill( maxMatchPtRec );
1526 if (numRecMatches == 1 && numL1Cands == 1) {
1527 if (maxMatchPtRec >0) hPassExaclyOneMuonMaxPtRec[1]->Fill(maxMatchPtRec);
1534 for (
size_t i = 0;
i < numHltLabels;
i++ ) {
1538 if (maxMatchPtRec > 0) hPassMaxPtRec[
i+HLT_PLOT_OFFSET]->Fill(maxMatchPtRec);
1554 if ( mother->
pdgId() == p->
pdgId() )
return findMother(mother);
1567 (
double eta,
double phi,
double maxDeltaR, vector<MatchStruct> matches )
1569 double bestDeltaR = maxDeltaR;
1571 for (
size_t i = 0;
i < matches.size();
i++ ) {
1579 if ( dR < bestDeltaR ) {
1590 (
double eta,
double phi,
double maxDeltaR, vector<MatchStruct> matches)
1592 double bestDeltaR = maxDeltaR;
1597 if (matchType !=
"cosmic" || matchType ==
"dr" ) {
1598 for (
size_t i = 0;
i < matches.size();
i++ ) {
1600 matches[
i].recCand->eta(),
1601 matches[
i].recCand->phi() );
1602 if ( dR < bestDeltaR ) {
1610 if (matchType ==
"cosmic") {
1619 double bestDphi = 100.0;
1620 for (
size_t i = 0;
i < matches.size();
i++ ) {
1622 double recCandPhi = matches[
i].recCand->phi();
1625 if (recCandPhi < 0 && phi < 0) {
1633 if (recCandPhi > 0 && phi > 0) {
1649 LogWarning (
"HLTMuonVal") <<
"WARNING: You have improperly set matchType" << endl
1650 <<
"valid choices are 'dr' and 'cosmic', " <<endl
1651 <<
"but you provided " << matchType << endl;
1660 LogTrace (
"HLTMuonVal") <<
"Applying track selection to your muon"
1664 TrackRef theMuonTrack = getCandTrackRef (mySelection, candMuon);
1666 bool passedSelection =
false;
1669 double d0 = theMuonTrack->d0();
1670 double z0 = theMuonTrack->dz();
1673 LogTrace (
"HLTMuonVal") <<
"d0 = " << d0
1674 <<
", d0 cut = " << mySelection.
d0cut << endl
1676 <<
", z0 cut = " << mySelection.
z0cut << endl;
1680 if (fabs(d0) < mySelection.
d0cut &&
1681 fabs(z0) < mySelection.
z0cut ) {
1682 passedSelection =
true;
1685 LogTrace (
"HLTMuonVal") <<
"This event didn't have a valid track of type "
1689 return passedSelection;
1695 bool passedAnyTrigger =
false;
1701 LogTrace (
"HLTMuonVal") <<
"Checking to see if you have non-empty triggers to match"
1707 vector<string>::const_iterator iTargetTrig;
1709 bool everythingIsEmpty =
true;
1714 if ( (*iTargetTrig) !=
"" ) {
1715 everythingIsEmpty =
false;
1720 if (everythingIsEmpty) {
1721 LogTrace (
"HLTMuonVal") <<
"Only empty triggers, skipping match";
1739 event.getByLabel(TriggerResultLabel, trigRes);
1741 edm::InputTag triggerResultsLabelFU(TriggerResultLabel.label(),TriggerResultLabel.instance(),
"FU");
1742 event.getByLabel(triggerResultsLabelFU,trigRes);
1744 LogTrace(
"HLTMuonVal")<<
"Trigger Results WARNING: No trigger Results in event info, but you wanted to check a trigger";
1751 unsigned size = trigRes->size();
1753 unsigned int Ntp = 0;
1755 LogTrace(
"HLTMuonVal")<<
"Ntp=" << Ntp <<
" Size of trigger results="<<
size;
1760 map<string,bool> firedTrigger;
1766 std::string targetName = (*iTargetTrig);
1768 LogTrace(
"HLTMuonVal") <<
"Looking to see if " << targetName <<
" has fired... ";
1770 firedTrigger[targetName] =
false;
1771 vector<string>::const_iterator iValidTrig;
1772 unsigned int trigIndex = 0;
1773 for ( iValidTrig = selectedValidTriggers.begin();
1774 iValidTrig != selectedValidTriggers.end();
1777 if ( targetName == (*iValidTrig)){
1779 LogTrace (
"HLTMuonVal") <<
"Trigger " << targetName
1780 <<
" was part of the hlt configuration at index"
1784 firedTrigger[targetName] = trigRes->accept(trigIndex);
1786 LogTrace (
"HLTMuonVal") <<
"Did the trigger fire? "
1787 << ((firedTrigger[targetName]) ?
"PASSED" :
"FAILED")
1797 map<string,bool>::const_iterator iResult;
1799 passedAnyTrigger =
false;
1801 LogTrace (
"HLTMuonVal") <<
"OR-ing trigger results together" <<endl;
1804 for (iResult = firedTrigger.begin();
1805 iResult != firedTrigger.end();
1808 passedAnyTrigger = passedAnyTrigger || iResult->second;
1812 LogTrace (
"HLTMuonVal") <<
"Returning " << passedAnyTrigger;
1814 return passedAnyTrigger;
1825 LogTrace (
"HLTMuonVal") <<
"Getting the track reference for coll "
1829 LogTrace (
"HLTMuonVal") <<
"Muon information" << endl
1830 <<
"pt = " << candMuon.
pt()
1831 <<
", phi = " << candMuon.
phi()
1832 <<
", eta = " << candMuon.
eta()
1838 if (trackCollection ==
"innerTrack") {
1845 }
else if ( trackCollection ==
"outerTrack" ) {
1853 }
else if ( trackCollection ==
"globalTrack") {
1862 LogTrace (
"HLTMuonVal") <<
"Found the desired track";
1864 LogTrace (
"HLTMuonVal") <<
"No track for this candidate";
1873 LogTrace (
"HLTMuonVal") <<
"\n\nInside HLTMuonMatchAndPlot begin()";
1875 TString myLabel, newFolder;
1888 myLabel = theL1CollectionLabel;
1889 myLabel = myLabel(myLabel.Index(
"L1"),myLabel.Length());
1890 myLabel = myLabel(0,myLabel.Index(
"Filtered")+8);
1892 myLabel =
"L1Filtered";
1896 newFolder =
"HLT/Muon/Distributions/" + theTriggerName +
"/" + mySelection.customLabel;
1908 vector<string> binLabels;
1909 binLabels.push_back( theL1CollectionLabel.c_str() );
1910 for (
size_t i = 0;
i < theHltCollectionLabels.size();
i++ )
1911 binLabels.push_back( theHltCollectionLabels[
i].c_str() );
1921 if ( useMuonFromReco ){
1932 hPassMaxPtRec.push_back( bookIt(
"recPassMaxPt_All",
"pt of Leading Reco Muon" , numBinsInPtHisto,
ptBins) );
1934 if (useFullDebugInformation || isL1Path) hPassMaxPtRec.push_back( bookIt(
"recPassMaxPt_" + myLabel,
"pt of Leading Reco Muon, if matched to " + myLabel, numBinsInPtHisto,
ptBins) );
1936 hPassEtaRec.push_back( bookIt(
"recPassEta_All",
"#eta of Reco Muons", theEtaParameters) );
1937 if (useFullDebugInformation || isL1Path) hPassEtaRec.push_back( bookIt(
"recPassEta_" + myLabel,
"#eta of Reco Muons matched to " + myLabel, theEtaParameters) );
1939 hPassPhiRec.push_back( bookIt(
"recPassPhi_All",
"#phi of Reco Muons", thePhiParameters) );
1940 if (useFullDebugInformation || isL1Path) hPassPhiRec.push_back( bookIt(
"recPassPhi_" + myLabel,
"#phi of Reco Muons matched to " + myLabel, thePhiParameters) );
1944 hPassPtRec.push_back( bookIt(
"recPassPt_All",
"Pt of Reco Muon" , numBinsInPtHisto,
ptBins) );
1945 if (useFullDebugInformation || isL1Path) hPassPtRec.push_back( bookIt(
"recPassPt_" + myLabel,
"pt Reco Muon, if matched to " + myLabel, numBinsInPtHisto,
ptBins) );
1947 hPassPtRecExactlyOne.push_back( bookIt(
"recPassPtExactlyOne_All",
"pt of Leading Reco Muon (==1 muon)" , numBinsInPtHisto,
ptBins) );
1948 if (useFullDebugInformation || isL1Path) hPassPtRecExactlyOne.push_back( bookIt(
"recPassPtExactlyOne_" + myLabel,
"pt of Leading Reco Muon (==1 muon), if matched to " + myLabel, numBinsInPtHisto,
ptBins) );
1950 hPassExaclyOneMuonMaxPtRec.push_back( bookIt(
"recPassExactlyOneMuonMaxPt_All",
"pt of Leading Reco Muon in events with exactly one muon" , numBinsInPtHisto,
ptBins) );
1951 if (useFullDebugInformation || isL1Path) hPassExaclyOneMuonMaxPtRec.push_back( bookIt(
"recPassExactlyOneMuonMaxPt_" + myLabel,
"pt of Leading Reco Muon in events with exactly one muon match to " + myLabel , numBinsInPtHisto,
ptBins) );
1953 hPassD0Rec.push_back( bookIt(
"recPassD0_All",
"Track 2-D impact parameter wrt (0,0,0)(d0) ALL", theD0Parameters));
1954 if (useFullDebugInformation || isL1Path) hPassD0Rec.push_back( bookIt(
"recPassD0_" + myLabel,
"Track 2-D impact parameter (0,0,0)(d0) " + myLabel, theD0Parameters));
1955 hPassD0BeamRec.push_back( bookIt(
"recPassD0Beam_All",
"Track 2-D impact parameter wrt (beam)(d0) ALL", theD0Parameters));
1956 if (useFullDebugInformation || isL1Path) hPassD0BeamRec.push_back( bookIt(
"recPassD0Beam_" + myLabel,
"Track 2-D impact parameter (beam)(d0) " + myLabel, theD0Parameters));
1958 hPassZ0Rec.push_back( bookIt(
"recPassZ0_All",
"Track Z0 wrt (0,0,0) ALL", theZ0Parameters));
1959 if (useFullDebugInformation || isL1Path) hPassZ0Rec.push_back( bookIt(
"recPassZ0_" + myLabel,
"Track Z0 (0,0,0) " + myLabel, theZ0Parameters));
1960 hPassZ0BeamRec.push_back( bookIt(
"recPassZ0Beam_All",
"Track Z0 wrt (beam) ALL", theZ0Parameters));
1961 if (useFullDebugInformation || isL1Path) hPassZ0BeamRec.push_back( bookIt(
"recPassZ0Beam_" + myLabel,
"Track Z0 (beam) " + myLabel, theZ0Parameters));
1963 hPassCharge.push_back( bookIt(
"recPassCharge_All",
"Track Charge ALL", theChargeParameters));
1964 if (useFullDebugInformation || isL1Path) hPassCharge.push_back( bookIt(
"recPassCharge_" + myLabel,
"Track Charge " + myLabel, theChargeParameters));
1966 hIsolationRec.push_back ( bookIt(
"recPassIsolation_ALL",
"Muon Isolation cone 0.3", theIsolationParameters));
1967 if (useFullDebugInformation || isL1Path) hIsolationRec.push_back ( bookIt(
"recPassIsolation_" + myLabel,
"Muon Isolation cone 0.3 " + myLabel, theIsolationParameters));
1970 hBeamSpotZ0Rec.push_back ( bookIt(
"recBeamSpotZ0_All",
"Z0 of beamspot for this event", theZ0Parameters));
1980 if (useFullDebugInformation || isL1Path) hDeltaRMatched.push_back ( bookIt(
"recDeltaRMatched_" + myLabel,
"#Delta R between matched HLTCand", theDRParameters));
1983 if (useFullDebugInformation || isL1Path) hChargeFlipMatched.push_back ( bookIt(
"recChargeFlipMatched_" + myLabel,
"Charge Flip from hlt to RECO;HLT Charge (-,+);Reco (-,+)", theChargeFlipParameters));
1985 if (useFullDebugInformation || isL1Path) hPassMatchPtRec.push_back( bookIt(
"recPassMatchPt_" + myLabel,
"Pt of Reco Muon that is matched to Trigger Muon " + myLabel, numBinsInPtHisto,
ptBins) );
1990 if (useFullDebugInformation || isL1Path) hResoPtAodRec.push_back ( bookIt (
"recResoPt_" + myLabel,
"TrigSumAOD to RECO P_T resolution", theResParameters));
1991 if (useFullDebugInformation || isL1Path) hResoEtaAodRec.push_back ( bookIt (
"recResoEta_" + myLabel,
"TrigSumAOD to RECO #eta resolution", theResParameters));
1992 if (useFullDebugInformation || isL1Path) hResoPhiAodRec.push_back ( bookIt (
"recResoPhi_" + myLabel,
"TrigSumAOD to RECO #phi resolution", theResParameters));
1995 if (useFullDebugInformation || isL1Path) hMatchedDeltaPhi.push_back ( bookIt(
"recDeltaPhiMatched_" + myLabel,
"Reco #phi vs HLT #phi " + myLabel, thePhiParameters0Pi) );
2004 if (useFullDebugInformation) {
2005 rawMatchHltCandPt.push_back( bookIt(
"rawPassPt_All",
"Pt of Reco Muon" , numBinsInPtHisto,
ptBins) );
2006 rawMatchHltCandPt.push_back( bookIt(
"rawPassPt_" + myLabel,
"pt Reco Muon, if matched to " + myLabel, numBinsInPtHisto,
ptBins) );
2008 rawMatchHltCandEta.push_back( bookIt(
"rawPassEta_All",
"#eta of Reco Muons", theEtaParameters) );
2009 rawMatchHltCandEta.push_back( bookIt(
"rawPassEta_" + myLabel,
"#eta of Reco Muons matched to " + myLabel, theEtaParameters) );
2011 rawMatchHltCandPhi.push_back( bookIt(
"rawPassPhi_All",
"#phi of Reco Muons", thePhiParameters) );
2012 rawMatchHltCandPhi.push_back( bookIt(
"rawPassPhi_" + myLabel,
"#phi of Reco Muons matched to " + myLabel, thePhiParameters) );
2019 hPhiVsEtaRec.push_back ( bookIt (
"recPhiVsRecEta_All",
"Reco #phi vs Reco #eta ", thePhiEtaParameters2d));
2020 if (useFullDebugInformation || isL1Path) hPhiVsEtaRec.push_back ( bookIt (
"recPhiVsRecEta_" + myLabel,
"Reco #phi vs Reco #eta " +myLabel, thePhiEtaParameters2d));
2026 for (
unsigned int i = 0;
i < theHltCollectionLabels.size();
i++ ) {
2029 myLabel = theHltCollectionLabels[
i];
2030 TString
level = ( myLabel.Contains(
"L2") ) ?
"L2" :
"L3";
2031 myLabel = myLabel(myLabel.Index(level),myLabel.Length());
2032 myLabel = myLabel(0,myLabel.Index(
"Filtered")+8);
2034 TString tempString = theHltCollectionLabels[
i];
2035 TString
level = ( tempString.Contains(
"L2") ) ?
"L2" :
"L3";
2036 myLabel = level +
"Filtered";
2039 if ( useMuonFromReco ) {
2042 hPassMaxPtRec.push_back( bookIt(
"recPassMaxPt_" + myLabel,
"pt of Leading Reco Muon, if matched to " + myLabel, numBinsInPtHisto,
ptBins) );
2043 hPassEtaRec.push_back( bookIt(
"recPassEta_" + myLabel,
"#eta of Reco Muons matched to " + myLabel, theEtaParameters) );
2044 hPassPhiRec.push_back( bookIt(
"recPassPhi_" + myLabel,
"#phi of Reco Muons matched to " + myLabel, thePhiParameters) );
2046 hPassPtRec.push_back ( bookIt(
"recPassPt_" + myLabel,
"Pt of Reco Muon, if matched to " + myLabel, numBinsInPtHisto,
ptBins) );
2047 hPassPtRecExactlyOne.push_back (bookIt(
"recPassPtExactlyOne__" + myLabel,
"pt of Leading Reco Muon (==1 muon), if matched to " + myLabel, numBinsInPtHisto,
ptBins) );
2049 hPassExaclyOneMuonMaxPtRec.push_back( bookIt(
"recPassExactlyOneMuonMaxPt_" + myLabel,
"pt of Leading Reco Muon in events with exactly one muon match to " + myLabel , numBinsInPtHisto,
ptBins) );
2050 hPhiVsEtaRec.push_back ( bookIt (
"recPhiVsRecEta_" + myLabel,
"Reco #phi vs Reco #eta " +myLabel, thePhiEtaParameters2d));
2053 hPassD0Rec.push_back( bookIt(
"recPassD0_" + myLabel,
"Track 2-D impact parameter (Z0) " + myLabel, theD0Parameters));
2054 hPassD0BeamRec.push_back( bookIt(
"recPassD0Beam_" + myLabel,
"Track 2-D impact parameter (beam)(d0) " + myLabel, theD0Parameters));
2055 hPassZ0Rec.push_back( bookIt(
"recPassZ0_" + myLabel,
"Track Z0 " + myLabel, theZ0Parameters));
2056 hPassZ0BeamRec.push_back( bookIt(
"recPassZ0Beam_" + myLabel,
"Track Z0 (0,0,0) " + myLabel, theZ0Parameters));
2057 hPassCharge.push_back( bookIt(
"recPassCharge_" + myLabel,
"Track Charge " + myLabel, theChargeParameters));
2059 hIsolationRec.push_back ( bookIt(
"recPassIsolation_" + myLabel,
"Muon Isolation cone 0.3 " + myLabel, theIsolationParameters));
2062 hPassMatchPtRec.push_back( bookIt(
"recPassMatchPt_" + myLabel,
"Pt of Reco Muon that is matched to Trigger Muon " + myLabel, numBinsInPtHisto,
ptBins) );
2068 hResoPtAodRec.push_back ( bookIt (
"recResoPt_" + myLabel,
"TrigSumAOD to RECO P_T resolution", theResParameters));
2069 hResoEtaAodRec.push_back ( bookIt (
"recResoEta_" + myLabel,
"TrigSumAOD to RECO #eta resolution", theResParameters));
2070 hResoPhiAodRec.push_back ( bookIt (
"recResoPhi_" + myLabel,
"TrigSumAOD to RECO #phi resolution", theResParameters));
2072 hDeltaRMatched.push_back ( bookIt(
"recDeltaRMatched_" + myLabel,
"#Delta R between matched HLTCand", theDRParameters));
2073 hChargeFlipMatched.push_back ( bookIt(
"recChargeFlipMatched_" + myLabel,
"Charge Flip from hlt to RECO;HLT (-,+);Reco (-,+)", theChargeFlipParameters));
2077 hMatchedDeltaPhi.push_back ( bookIt(
"recDeltaPhiMatched_" + myLabel,
"Reco #phi vs HLT #phi " + myLabel, thePhiParameters0Pi) );
2084 allHltCandPt.push_back( bookIt(
"allHltCandPt_" + myLabel,
"Pt of all HLT Muon Cands, for HLT " + myLabel, numBinsInPtHisto,
ptBins));
2085 allHltCandEta.push_back( bookIt(
"allHltCandEta_" + myLabel,
"Eta of all HLT Muon Cands, for HLT " + myLabel, theEtaParameters));
2086 allHltCandPhi.push_back( bookIt(
"allHltCandPhi_" + myLabel,
"Phi of all HLT Muon Cands, for HLT " + myLabel, thePhiParameters));
2088 fakeHltCandPt.push_back( bookIt(
"fakeHltCandPt_" + myLabel,
"Pt of fake HLT Muon Cands, for HLT " + myLabel, numBinsInPtHisto,
ptBins));
2089 fakeHltCandEta.push_back( bookIt(
"fakeHltCandEta_" + myLabel,
"Eta of fake HLT Muon Cands, for HLT " + myLabel, theEtaParameters));
2090 fakeHltCandPhi.push_back( bookIt(
"fakeHltCandPhi_" + myLabel,
"Phi of fake HLT Muon Cands, for HLT " + myLabel, thePhiParameters));
2096 if (useFullDebugInformation) {
2097 rawMatchHltCandPt.push_back( bookIt(
"rawPassPt_" + myLabel,
"pt Reco Muon, if matched to " + myLabel, numBinsInPtHisto,
ptBins) );
2098 rawMatchHltCandEta.push_back( bookIt(
"rawPassEta_" + myLabel,
"#eta of Reco Muons matched to " + myLabel, theEtaParameters) );
2099 rawMatchHltCandPhi.push_back( bookIt(
"rawPassPhi_" + myLabel,
"#phi of Reco Muons matched to " + myLabel, thePhiParameters) );
2114 name <<
" Title:" <<
title;
2115 int nBins = (int)parameters[0];
2116 double min = parameters[1];
2117 double max = parameters[2];
2120 if (parameters.size() == 3) {
2121 TH1F *
h =
new TH1F( name, title, nBins, min, max );
2125 booked1DMonitorElements.push_back(returnedME);
2129 }
else if (parameters.size() == 6) {
2131 int nBins2 = (int)parameters[3];
2132 double min2 = parameters[4];
2133 double max2 = parameters[5];
2135 TH2F *
h =
new TH2F (name, title, nBins, min, max, nBins2, min2, max2);
2143 << name <<
" had an invalid number of paramters";
2150 ( TString name, TString title,
int nbins,
float * xBinLowEdges )
2153 name <<
" Title:" <<
title;
2155 TH1F *tempHist =
new TH1F(name, title, nbins, xBinLowEdges);
2160 booked1DMonitorElements.push_back(returnedME);
2170 int resultCharge = (pdgId > 0) ? POS_CHARGE : NEG_CHARGE;
2172 return resultCharge;
2178 TString
level =
"L3";
2179 TString myLabel = moduleName;
2182 if ( myLabel.Contains(
"L1") ) {
2184 }
else if (myLabel.Contains(
"L2")) {
2186 }
else if (myLabel.Contains(
"L3")) {
2191 myLabel = myLabel(myLabel.Index(level),myLabel.Length());
2192 myLabel = myLabel(0,myLabel.Index(
"Filtered")+8);
2195 myLabel = level +
"Filtered";
2204 LogTrace (
"HLTMuonVal") <<
"MOVEOVERFLOW" << endl;
2213 double originalEntries = myElement->
getEntries();
2215 LogTrace (
"HLTMuonVal") <<
"==MOVEOVERFLOW== "
2216 <<
"maxBin = " << maxBin
2217 <<
", calling underflow"
2222 LogTrace (
"HLTMuonVal") <<
"reseting underflow to zero" << endl;
2224 LogTrace (
"HLTMuonVal") <<
"calling overflow" << endl;
2226 LogTrace (
"HLTMuonVal") <<
"seting overflow to zero" << endl;
2237 std::vector<TriggerObject> & foundObjects,
2243 size_t filterIndex = aodTriggerEvent->filterIndex( collectionTag );
2245 LogTrace (
"HLTMuonVal") <<
"\n\n filterIndex is "
2248 if ( filterIndex < aodTriggerEvent->sizeFilters() ) {
2249 const Keys &
keys = aodTriggerEvent->filterKeys( filterIndex );
2251 LogTrace (
"HLTMuonVal") <<
"\n\nGot keys";
2252 LogTrace (
"HLTMuonVal") <<
"Key size is " << keys.size();
2259 for (
size_t j = 0;
j < keys.size();
j++ ){
2263 LogTrace (
"HLTMuonVal") <<
"Testing to see if object in key passes selection"
2268 LogTrace (
"HLTMuonVal") <<
"OBJECT FOUND!!! - Storing a trigger object with id = "
2270 <<
", eta = " << foundObject.
eta()
2271 <<
", pt = " << foundObject.
pt()
2272 <<
", custom name = " << muonSelection.
customLabel
2275 foundObjects.push_back( foundObject );
virtual MonitorElement * bookIt(TString name, TString title, std::vector< double >)
T getParameter(std::string const &) const
trigger::TriggerObject myHltCand
T getUntrackedParameter(std::string const &, T const &) const
void setBinContent(int binx, double content)
set content of bin (1-D)
const std::string moduleType(const std::string &module) const
C++ class name of module.
static const int POS_CHARGE
virtual const Candidate * mother(size_type i=0) const =0
return pointer to mother
reco::TrackRef getCandTrackRef(MuonSelectionStruct mySelection, reco::Muon candMuon)
TString calcHistoSuffix(std::string moduleName)
MonitorElement * book1D(const char *name, const char *title, int nchX, double lowX, double highX)
Book 1D histogram.
virtual TrackRef innerTrack() const
virtual bool applyTriggerSelection(MuonSelectionStruct mySelection, const edm::Event &event)
double deltaPhi(float phi1, float phi2)
void cd(void)
go to top directory (ie. root)
bool isTrackerMuon() const
void save(const std::string &filename, const std::string &path="", const std::string &pattern="", const std::string &rewrite="", SaveReferenceTag ref=SaveWithReference, int minStatus=dqm::qstatus::STATUS_OK, const std::string &fileupdate="RECREATE")
const reco::Muon * recCand
virtual bool selectAndMatchMuons(const edm::Event &iEvent, std::vector< MatchStruct > &myRecMatches, std::vector< std::vector< HltFakeStruct > > &myHltFakeCands)
const reco::Candidate * findMother(const reco::Candidate *)
bool isGlobalMuon() const
bool isStandAloneMuon() const
double getEntries(void) const
get # of entries
virtual double eta() const
momentum pseudorapidity
math::XYZTLorentzVector LorentzVector
std::vector< Muon > MuonCollection
collection of Muon objects
void moveOverflow(MonitorElement *myElement)
virtual void endRun(const edm::Run &r, const edm::EventSetup &c)
double deltaR(double eta1, double phi1, double eta2, double phi2)
Single trigger physics object (e.g., an isolated muon)
bool isNonnull() const
Checks for non-null.
int findRecMatch(double eta, double phi, double maxdeltaR, std::vector< MatchStruct > matches)
std::string trackCollection
const T & max(const T &a, const T &b)
static const int NEG_CHARGE
void setVerbose(unsigned level)
void setEntries(double nentries)
set # of entries
How EventSelector::AcceptEvent() decides whether to accept an event for output otherwise it is excluding the probing of A single or multiple positive and the trigger will pass if any such matching triggers are PASS or EXCEPTION[A criterion thatmatches no triggers at all is detected and causes a throw.] A single negative with an expectation of appropriate bit checking in the decision and the trigger will pass if any such matching triggers are FAIL or EXCEPTION A wildcarded negative criterion that matches more than one trigger in the trigger but the state exists so we define the behavior If all triggers are the negative crieriion will lead to accepting the event(this again matches the behavior of"!*"before the partial wildcard feature was incorporated).The per-event"cost"of each negative criterion with multiple relevant triggers is about the same as!*was in the past
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
virtual void analyze(const edm::Event &iEvent)
virtual TrackRef outerTrack() const
reference to Track reconstructed in the muon detector only
double deltaR(double eta1, double eta2, double phi1, double phi2)
HLTMuonMatchAndPlot(const edm::ParameterSet &pset, std::string triggerName, std::vector< std::string > moduleNames, MuonSelectionStruct inputSelection, std::string customName, std::vector< std::string > validTriggers, const edm::Run ¤tRun, const edm::EventSetup ¤tEventSetup)
Constructor.
virtual int pdgId() const =0
PDG identifier.
std::vector< TriggerObject > TriggerObjectCollection
collection of trigger physics objects (e.g., all isolated muons)
double deltaPhi(double phi1, double phi2)
virtual double pt() const
transverse momentum
std::vector< size_type > Keys
StringCutObjectSelector< trigger::TriggerObject > hltMuonSelector
bool init(const edm::Run &iRun, const edm::EventSetup &iSetup, const std::string &processName, bool &changed)
StringCutObjectSelector< reco::Muon > recoMuonSelector
virtual void fillPlots(std::vector< MatchStruct > &myRecMatches, std::vector< std::vector< HltFakeStruct > > &myHltFakeCands)
std::vector< AlignmentParameters * > Parameters
int findGenMatch(double eta, double phi, double maxDeltaR, std::vector< MatchStruct > matches)
double getBinContent(int binx) const
get content of bin (1-D)
int getNbinsX(void) const
get # of bins in X-axis
void getAodTriggerObjectsForModule(edm::InputTag collectionTag, edm::Handle< trigger::TriggerEvent > aodTriggerEvent, trigger::TriggerObjectCollection trigObjs, std::vector< trigger::TriggerObject > &foundObjects, MuonSelectionStruct muonSelection)
std::pair< typename Association::data_type::first_type, double > match(Reference key, Association association, bool bestMatchByMaxValue)
Generic matching function.
virtual bool applyTrackSelection(MuonSelectionStruct mySelection, reco::Muon candMuon)
std::vector< std::string > requiredTriggers
MonitorElement * book2D(const char *name, const char *title, int nchX, double lowX, double highX, int nchY, double lowY, double highY)
Book 2D histogram.
The Signals That Services Can Subscribe To This is based on ActivityRegistry h
Helper function to determine trigger accepts.
virtual double phi() const
momentum azimuthal angle
tuple size
Write out results.
void setCurrentFolder(const std::string &fullpath)
const std::string & pwd(void) const
virtual TrackRef globalTrack() const
reference to Track reconstructed in both tracked and muon detector