CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Classes | Public Member Functions | Public Attributes | Protected Member Functions | Protected Attributes | Static Protected Attributes
HLTMuonMatchAndPlot Class Reference

#include <HLTMuonMatchAndPlot.h>

Inheritance diagram for HLTMuonMatchAndPlot:
HLTMuonBPAG HLTTopPlotter

Classes

struct  HltFakeStruct
 
struct  MatchStruct
 

Public Member Functions

virtual void analyze (const edm::Event &iEvent)
 
virtual void begin ()
 
virtual MonitorElementbookIt (TString name, TString title, std::vector< double >)
 
virtual MonitorElementbookIt (TString name, TString title, int nbins, float *xBinLowEdges)
 
TString calcHistoSuffix (std::string moduleName)
 
virtual void endRun (const edm::Run &r, const edm::EventSetup &c)
 
virtual void fillPlots (std::vector< MatchStruct > &myRecMatches, std::vector< std::vector< HltFakeStruct > > &myHltFakeCands)
 
virtual void finish ()
 
 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 &currentRun, const edm::EventSetup &currentEventSetup)
 Constructor. More...
 
virtual bool selectAndMatchMuons (const edm::Event &iEvent, std::vector< MatchStruct > &myRecMatches, std::vector< std::vector< HltFakeStruct > > &myHltFakeCands)
 
bool selectAndMatchMuons (const edm::Event &iEvent, std::vector< MatchStruct > &myRecMatches, std::vector< std::vector< HltFakeStruct > > &myHltFakeCands, MuonSelectionStruct muonSelection)
 
virtual ~HLTMuonMatchAndPlot ()
 

Public Attributes

std::vector< std::vector
< HltFakeStruct > > 
hltFakeCands
 
std::vector< MatchStructrecMatches
 

Protected Member Functions

virtual bool applyTrackSelection (MuonSelectionStruct mySelection, reco::Muon candMuon)
 
virtual bool applyTriggerSelection (MuonSelectionStruct mySelection, const edm::Event &event)
 
int findGenMatch (double eta, double phi, double maxDeltaR, std::vector< MatchStruct > matches)
 
const reco::CandidatefindMother (const reco::Candidate *)
 
int findRecMatch (double eta, double phi, double maxdeltaR, std::vector< MatchStruct > matches)
 
void getAodTriggerObjectsForModule (edm::InputTag collectionTag, edm::Handle< trigger::TriggerEvent > aodTriggerEvent, trigger::TriggerObjectCollection trigObjs, std::vector< trigger::TriggerObject > &foundObjects, MuonSelectionStruct muonSelection)
 
reco::TrackRef getCandTrackRef (MuonSelectionStruct mySelection, reco::Muon candMuon)
 
int getCharge (int pdgId)
 
void moveOverflow (MonitorElement *myElement)
 

Protected Attributes

std::vector< MonitorElement * > allHltCandEta
 
std::vector< MonitorElement * > allHltCandPhi
 
std::vector< MonitorElement * > allHltCandPt
 
reco::BeamSpot beamSpot
 
edm::InputTag BeamSpotInputTag
 
std::vector< MonitorElement * > booked1DMonitorElements
 
bool createStandAloneHistos
 
DQMStoredbe_
 
int eventNumber
 
std::vector< MonitorElement * > fakeHltCandEta
 
std::vector< MonitorElement * > fakeHltCandPhi
 
std::vector< MonitorElement * > fakeHltCandPt
 
bool foundBeamSpot
 
std::vector< MonitorElement * > hBeamSpotZ0Rec
 
std::vector< MonitorElement * > hChargeFlipMatched
 
std::vector< MonitorElement * > hDeltaRMatched
 
std::vector< MonitorElement * > hIsolationRec
 
std::string histoFileName
 
int HLT_PLOT_OFFSET
 
edm::InputTag HltAodInputTag
 
edm::InputTag HltRawInputTag
 
std::vector< MonitorElement * > hMatchedDeltaPhi
 
MonitorElementhNumObjects
 
MonitorElementhNumOrphansRec
 
std::vector< MonitorElement * > hPassCharge
 
std::vector< MonitorElement * > hPassD0BeamRec
 
std::vector< MonitorElement * > hPassD0Rec
 
std::vector< MonitorElement * > hPassEtaRec
 
std::vector< MonitorElement * > hPassExaclyOneMuonMaxPtRec
 
std::vector< MonitorElement * > hPassMatchPtRec
 
std::vector< MonitorElement * > hPassMaxPtRec
 
std::vector< MonitorElement * > hPassPhiRec
 
std::vector< MonitorElement * > hPassPtRec
 
std::vector< MonitorElement * > hPassPtRecExactlyOne
 
std::vector< MonitorElement * > hPassZ0BeamRec
 
std::vector< MonitorElement * > hPassZ0Rec
 
std::vector< MonitorElement * > hPhiVsEtaRec
 
std::vector< MonitorElement * > hResoEtaAodRec
 
std::vector< MonitorElement * > hResoPhiAodRec
 
std::vector< MonitorElement * > hResoPtAodRec
 
bool includeOverflow
 
bool isIsolatedPath
 
bool isL1Path
 
bool isL2Path
 
bool isL3Path
 
bool makeNtuple
 
std::string matchType
 
MonitorElementmeNumberOfEvents
 
MuonSelectionStruct mySelection
 
int numBinsInPtHisto
 
unsigned int numHltLabels
 
unsigned int numL1Cands
 
float ptBins [100]
 
std::vector< MonitorElement * > rawMatchHltCandEta
 
std::vector< MonitorElement * > rawMatchHltCandPhi
 
std::vector< MonitorElement * > rawMatchHltCandPt
 
edm::InputTag RecoMuonInputTag
 
bool requireL1SeedForHLTPaths
 
std::vector< std::string > selectedValidTriggers
 
std::string theAodL1Label
 
std::string theAodL2Label
 
std::vector< double > theChargeFlipParameters
 
std::vector< double > theChargeParameters
 
std::vector< double > theD0Parameters
 
std::vector< double > theDRParameters
 
std::vector< double > theEtaParameters
 
TFile * theFile
 
std::vector< std::string > theHltCollectionLabels
 
std::string theHltProcessName
 
std::vector< double > theIsolationParameters
 
std::string theL1CollectionLabel
 
double theL1DrCut
 
std::string theL1SeedModuleForHLTPath
 
double theL2DrCut
 
double theL3DrCut
 
double theMaxEtaCut
 
std::vector< double > theMaxPtParameters
 
double theMinPtCut
 
int theMotherParticleId
 
std::vector< double > theNSigmas
 
TNtuple * theNtuple
 
std::string theNtupleFileName
 
float theNtuplePars [100]
 
std::string theNtuplePath
 
unsigned int theNumberOfObjects
 
std::vector< double > thePhiEtaParameters2d
 
std::vector< double > thePhiParameters
 
std::vector< double > thePhiParameters0Pi
 
std::vector< double > thePtParameters
 
std::vector< double > theResParameters
 
std::string theTriggerName
 
std::vector< double > theZ0Parameters
 
edm::InputTag TriggerResultLabel
 
bool useAod
 
bool useFullDebugInformation
 
bool useMuonFromReco
 
bool useOldLabels
 

Static Protected Attributes

static const int NEG_CHARGE = -1
 
static const int POS_CHARGE = 1
 

Detailed Description

Get L1/HLT efficiency/rate plots Documentation available on the CMS TWiki: https://twiki.cern.ch/twiki/bin/view/CMS/MuonHLTOfflinePerformance

Date:
2010/03/16 14:36:39
Revision:
1.12
Author
J. Slaunwhite, based on code from Jeff Klukas

Definition at line 98 of file HLTMuonMatchAndPlot.h.

Constructor & Destructor Documentation

HLTMuonMatchAndPlot::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 currentRun,
const edm::EventSetup currentEventSetup 
)

Constructor.

Definition at line 61 of file HLTMuonMatchAndPlot.cc.

References dbe_, edm::ParameterSet::getParameter(), edm::ParameterSet::getUntrackedParameter(), diJetCalib::histoFileName, HltComparatorCreateWorkflow::hltConfig, i, HLTConfigProvider::init(), LogTrace, module(), HLTConfigProvider::moduleType(), cmsCodeRules.cppFunctionSkipper::operator, jptDQMConfig_cff::ptBins, and DQMStore::setVerbose().

64  : mySelection(inputSelection), selectedValidTriggers(validTriggers)
65 {
66 
67 
68  LogTrace ("HLTMuonVal") << "\n\n Inside HLTMuonMatchAndPlot Constructor";
69  LogTrace ("HLTMuonVal") << "The trigger name is " << triggerName
70  << " and the module names are listed";
71 
72  for (vector<string>::iterator iMod = moduleNames.begin();
73  iMod != moduleNames.end(); iMod++){
74  LogTrace ("HLTMuonVal") << (*iMod);
75  }
76 
77 
78  theHltProcessName = pset.getParameter<string>("HltProcessName");
79 
80  LogTrace ("HLTMuonVal") << "HLTMuonMatchAndPlot: Constructor: Initializing HLTConfigProvider with HLT process name: " << theHltProcessName << endl;
81 
82 
84  bool hltConfigChanged;
85  bool hltConfigInitSuccess = hltConfig.init(currentRun, currentEventSetup, theHltProcessName, hltConfigChanged);
86 
87  theNumberOfObjects = ( TString(triggerName).Contains("Double") ) ? 2 : 1;
88  theTriggerName = triggerName;
89 
90  useAod = true;
91 
92  requireL1SeedForHLTPaths = pset.getUntrackedParameter<bool>("RequireRecoToMatchL1Seed", false);
93 
94  matchType = pset.getUntrackedParameter<string>("matchType");
95 
96  // JMS Added a method to make standalone histogram output
97  createStandAloneHistos = pset.getUntrackedParameter<bool>("createStandAloneHistos");
98  histoFileName = pset.getUntrackedParameter<string> ("histoFileName");
99 
100  theHltCollectionLabels.clear();
101 
102  // make these config file inputs eventually
103  useOldLabels = false;
104  useFullDebugInformation = false;
105 
107  // if you're filling all plots
108  // then you'll have (All, L1, HLT)
109  HLT_PLOT_OFFSET = 2;
110  } else {
111  // if you're only filling
112  // the plots for one trigger
113  // then have (All, HLT)
114  HLT_PLOT_OFFSET = 1;
115  }
116 
117  isL1Path = false;
118  isL2Path = false;
119  isL3Path = true;
120 
121  if (TString(triggerName).Contains("L1")) {
122  isL1Path = true;
123  isL3Path = false;
124  }
125 
126  if (TString(triggerName).Contains("L2")) {
127  isL2Path = true;
128  isL3Path = false;
129  }
130  if (TString(triggerName).Contains("L3")) {
131  isL3Path = true;
132  isL3Path = false;
133  }
134 
135 
136 
137  LogTrace ("HLTMuonVal") << "Parsing Module names... useOldLabels? "
138  << useOldLabels
139  << ", useFullDebugInformation? "
141  << endl;
142 
143 
144  TPRegexp l1Regexp("L1.*Filtered");
145  TPRegexp l2Regexp("L2.*Filtered");
146 
147  string theLastHltFilter = "";
148 
150 
151 
152  for ( size_t i = 0; i < moduleNames.size(); i++ ) {
153  string module = moduleNames[i];
154 
155  if (hltConfigInitSuccess) {
156  LogTrace ("HLTMuonVal") << "Considering Module named "
157  << module
158  << " which has type = "
159  << hltConfig.moduleType(module);
160 
161  if ( hltConfig.moduleType(module) == "HLTLevel1GTSeed" ) {
162  LogTrace ("HLTMuonVal") << "Module = " << module
163  << " is a HLTLevel1GTSeed!!"
164  << endl
165  << "Storing it as L1Seed"
166  << endl;
168  }
169  }
170 
171 
172  if ( TString(module).Contains(l1Regexp) ) {
173  // this will be used to look up info
174  // in the AOD information
176  LogTrace ("HLTMuonVal") << "... module is L1 collection";
177 
178 
179  } else if ( TString(module).Contains(l2Regexp) ) {
180  // this is a l2 module, only consider it if the trigger
181  // is an L2 passthrough or if we want to use debug trigger info
182 
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;
189  }
190 
191 
192  } else if (TString(module).Contains("Filtered") ) {
193  // must be L3 filtered here
194  // potential to have Pre vs Iso filtered
195  // In AOD, I think there is only information
196  // for the *final* filter
197 
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;
204  }
205 
206  }
207  }
208 
209  if (!useFullDebugInformation && theLastHltFilter != "" ) {
210 
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;
215 
216  theHltCollectionLabels.push_back (theLastHltFilter);
217  }
218 
219 
221  isIsolatedPath = ( numHltLabels == 4 ) ? true : false;
222 
223  // -- Right now the new way is to hard-code it
224  // -- this uses the most generic kind of muon
225  // -- selectors will handle other cuts
226  //theRecoLabel = "muons";
227 
228  RecoMuonInputTag = pset.getParameter<edm::InputTag>("RecoMuonInputTag");
229  BeamSpotInputTag = pset.getParameter<edm::InputTag>("BeamSpotInputTag");
230  HltRawInputTag = pset.getParameter<edm::InputTag>("HltRawInputTag");
231  HltAodInputTag = pset.getParameter<edm::InputTag>("HltAodInputTag");
232 
233  TriggerResultLabel = pset.getParameter<edm::InputTag>("TriggerResultLabel");
234 
235  //useMuonFromGenerator = false; // = ( theGenLabel == "" ) ? false : true;
236  useMuonFromReco = true; // = ( theRecoLabel == "" ) ? false : true;
237 
238  //define default parameters so that you don't crash
239 
240  vector <double> etaDefault;
241  etaDefault.push_back(15);
242  etaDefault.push_back(-2.1);
243  etaDefault.push_back(2.1);
244 
245  theEtaParameters = pset.getUntrackedParameter< vector<double> >("EtaParameters", etaDefault);
246 
247  vector <double> phiDefault;
248  phiDefault.push_back(15);
249  phiDefault.push_back(-3.2);
250  phiDefault.push_back(3.2);
251 
252  thePhiParameters = pset.getUntrackedParameter< vector<double> >("PhiParameters", phiDefault);
253 
254  // leave this vector of size 0
255  vector <double> ptDefault;
256 
257  // pt parameters are a different story
258  // it's a vector of doubles but it unpacked
259  // as bin low edges
260  thePtParameters = pset.getUntrackedParameter< vector<double> >("PtParameters", ptDefault);
261 
262 
263  vector <double> resDefault;
264  resDefault.push_back(10);
265  resDefault.push_back(-0.1);
266  resDefault.push_back(0.1);
267  theResParameters = pset.getUntrackedParameter < vector<double> >("ResParameters", resDefault);
268 
269  vector <double> d0Default;
270  d0Default.push_back(10);
271  d0Default.push_back(-2.0);
272  d0Default.push_back(2.0);
273 
274  theD0Parameters = pset.getUntrackedParameter <vector<double> > ("D0Parameters", d0Default);
275 
276  vector <double> z0Default;
277  z0Default.push_back(10);
278  z0Default.push_back(-25);
279  z0Default.push_back(25);
280 
281  theZ0Parameters = pset.getUntrackedParameter < vector<double> > ("Z0Parameters", z0Default);
282 
283 
284 
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;
289  numPtBinEdge = 100;
290  } else if (thePtParameters.size() < 1) {
291 
292  numPtBinEdge = 5;
293  numBinsInPtHisto = numPtBinEdge - 1;
294  ptBins[0] = 0;
295  ptBins[1] = 20;
296  ptBins[2] = 50;
297  ptBins[3] = 100;
298  ptBins[4] = 150;
299 
300  } else {
301  numPtBinEdge = thePtParameters.size();
302  // the number of bins in the histo is one
303  // less than the number of edges
304  numBinsInPtHisto = numPtBinEdge - 1;
305 
306  for (int iBin = 0; iBin < numPtBinEdge; iBin++){
307  ptBins[iBin] = (float) thePtParameters[iBin];
308  //LogTrace ("HLTMuonVal") << the
309  }
310 
311  }
312 
313 
314 
315  // Duplicate the pt parameters for some 2D histos
316 // for(int i =0; i < 2; i++){
317 // for (std::vector<double>::const_iterator iNum = theMaxPtParameters.begin();
318 // iNum != theMaxPtParameters.end();
319 // iNum++){
320 
321 // // if this is the # of bins, then
322 // // halve the number of bins.
323 // if (iNum == theMaxPtParameters.begin()){
324 // theMaxPtParameters2d.push_back(floor((*iNum)/2));
325 // } else {
326 // theMaxPtParameters2d.push_back((*iNum));
327 // }
328 // }
329 // }
330 
331 // // Duplicate the eta parameters for some 2D histos
332 // for(int i =0; i < 2; i++){
333 // for (std::vector<double>::const_iterator iNum = theEtaParameters.begin();
334 // iNum != theEtaParameters.end();
335 // iNum++){
336 // // if this is the nBins param, halve it
337 // if (iNum == theEtaParameters.begin()){
338 // theEtaParameters2d.push_back(floor((*iNum)/2));
339 // } else {
340 // theEtaParameters2d.push_back(*iNum);
341 // }
342 
343 // // also fill the eta/phi plot parameters
344 // // but don't worry about doubleing bins
345 // // if (i < 1){
346 // // if (iNum == theEtaParameters.begin()){
347 // // thePhiEtaParameters2d.push_back(floor((*iNum)/2));
348 // // } else {
349 // // thePhiEtaParameters2d.push_back(*iNum);
350 
351 // // }
352 
353 // // }
354 // }
355 // }
356 
357 // // Duplicate the pt parameters for some 2D histos
358 // for(int i =0; i < 2; i++){
359 // for (std::vector<double>::const_iterator iNum = thePhiParameters.begin();
360 // iNum != thePhiParameters.end();
361 // iNum++){
362 
363 // if (iNum == thePhiParameters.begin()) {
364 // thePhiParameters2d.push_back(floor((*iNum)/2));
365 // } else {
366 // thePhiParameters2d.push_back(*iNum);
367 // }
368 
369 // // if (i < 1){
370 
371 // // // if (iNum == theEtaParameters.begin()){
372 // // // thePhiEtaParameters2d.push_back(floor((*iNum)/2));
373 // // // } else {
374 // // // thePhiEtaParameters2d.push_back(*iNum);
375 
376 // // // }
377 
378 // // }
379 // }
380 // }
381 
382 
383 
384  //=======================================
385 
386 
387 
388  theL1DrCut = pset.getUntrackedParameter<double>("L1DrCut", 0.4);
389  theL2DrCut = pset.getUntrackedParameter<double>("L2DrCut", 0.1);
390  theL3DrCut = pset.getUntrackedParameter<double>("L3DrCut", 0.05);
391 
392 
393  //==========================================
394  // Hard-coded parameters
395  // Make modifibly from script later
396  //==========================================
397 
398 
399  // put in the phi parameters
400  thePhiEtaParameters2d.push_back(10);
401  thePhiEtaParameters2d.push_back(-2.2);
402  thePhiEtaParameters2d.push_back(2.2);
403 
404  thePhiEtaParameters2d.push_back(10);
405  thePhiEtaParameters2d.push_back(-3.15);
406  thePhiEtaParameters2d.push_back(3.15);
407 
408 
409  // theD0Parameters.push_back(25);
410  // theD0Parameters.push_back(-50.0);
411  // theD0Parameters.push_back(50.0);
412 
413  // theZ0Parameters.push_back(25);
414  // theZ0Parameters.push_back(-100);
415  // theZ0Parameters.push_back(100);
416 
417  theChargeParameters.push_back(3);
418  theChargeParameters.push_back(-1.5);
419  theChargeParameters.push_back(1.5);
420 
421  theDRParameters.push_back(10);
422  theDRParameters.push_back(0.0);
423  theDRParameters.push_back(theL2DrCut);
424 
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);
431 
432  theIsolationParameters.push_back(10);
433  theIsolationParameters.push_back(0.0);
434  theIsolationParameters.push_back(1.0);
435 
436  thePhiParameters0Pi.push_back(10);
437  thePhiParameters0Pi.push_back(0);
438  thePhiParameters0Pi.push_back(3.2);
439 
440  // theDeltaPhiVsPhiParameters.push_back(50);
441  // theDeltaPhiVsPhiParameters.push_back(-3.15);
442  // theDeltaPhiVsPhiParameters.push_back(3.15);
443  // theDeltaPhiVsPhiParameters.push_back(50);
444  // theDeltaPhiVsPhiParameters.push_back(0);
445  // theDeltaPhiVsPhiParameters.push_back(3.2);
446 
447 // theDeltaPhiVsZ0Parameters.push_back(theZ0Parameters[0]);
448 // theDeltaPhiVsZ0Parameters.push_back(theZ0Parameters[1]);
449 // theDeltaPhiVsZ0Parameters.push_back(theZ0Parameters[2]);
450 // theDeltaPhiVsZ0Parameters.push_back(50);
451 // theDeltaPhiVsZ0Parameters.push_back(0);
452 // theDeltaPhiVsZ0Parameters.push_back(3.2);
453 
454 // theDeltaPhiVsD0Parameters.push_back(theD0Parameters[0]);
455 // theDeltaPhiVsD0Parameters.push_back(theD0Parameters[1]);
456 // theDeltaPhiVsD0Parameters.push_back(theD0Parameters[2]);
457 // theDeltaPhiVsD0Parameters.push_back(50);
458 // theDeltaPhiVsD0Parameters.push_back(0);
459 // theDeltaPhiVsD0Parameters.push_back(3.2);
460 
461 
462 
463 
464  dbe_ = 0 ;
465  if ( pset.getUntrackedParameter<bool>("DQMStore", false) ) {
467  dbe_->setVerbose(0);
468  }
469 
470  if (!dbe_) {
471 
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..."
475  << endl;
476 
477  }
478 
479  eventNumber = 0;
480 
481  LogTrace ("HLTMuonVal") << "exiting constructor\n\n";
482 
483 }
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
int i
Definition: DBlmapReader.cc:9
int module() const
Definition: HLTadd.h:12
const std::string moduleType(const std::string &module) const
C++ class name of module.
std::vector< double > theDRParameters
edm::InputTag HltAodInputTag
std::vector< std::string > selectedValidTriggers
edm::InputTag RecoMuonInputTag
std::vector< double > theD0Parameters
std::vector< double > theZ0Parameters
edm::InputTag HltRawInputTag
std::vector< double > theEtaParameters
std::vector< double > theChargeFlipParameters
unsigned int theNumberOfObjects
std::string theL1CollectionLabel
std::vector< double > thePtParameters
std::vector< double > thePhiEtaParameters2d
std::vector< double > thePhiParameters
void setVerbose(unsigned level)
Definition: DQMStore.cc:201
#define LogTrace(id)
std::vector< double > theIsolationParameters
bool init(const edm::Run &iRun, const edm::EventSetup &iSetup, const std::string &processName, bool &changed)
std::vector< std::string > theHltCollectionLabels
std::vector< double > theResParameters
MuonSelectionStruct mySelection
std::vector< double > thePhiParameters0Pi
std::vector< double > theChargeParameters
edm::InputTag BeamSpotInputTag
Definition: vlib.h:209
std::string theL1SeedModuleForHLTPath
edm::InputTag TriggerResultLabel
virtual HLTMuonMatchAndPlot::~HLTMuonMatchAndPlot ( )
inlinevirtual

Definition at line 171 of file HLTMuonMatchAndPlot.h.

171 {} ;

Member Function Documentation

void HLTMuonMatchAndPlot::analyze ( const edm::Event iEvent)
virtual

Reimplemented in HLTMuonBPAG, and HLTTopPlotter.

Definition at line 523 of file HLTMuonMatchAndPlot.cc.

References LogTrace.

Referenced by HLTTopPlotter::analyze().

524 {
525 
526  LogTrace( "HLTMuonVal" ) << "\n\nIn analyze for trigger path " <<
527  theTriggerName << ", Event:" << eventNumber <<"\n\n\n";
528 
529 
530  // Call the selection method with the default selection
531  bool validSelection = selectAndMatchMuons (iEvent, recMatches, hltFakeCands, mySelection);
532  if (validSelection) fillPlots (recMatches, hltFakeCands);
533 
534  eventNumber++;
535 
536 }// end analyze
virtual bool selectAndMatchMuons(const edm::Event &iEvent, std::vector< MatchStruct > &myRecMatches, std::vector< std::vector< HltFakeStruct > > &myHltFakeCands)
std::vector< MatchStruct > recMatches
#define LogTrace(id)
std::vector< std::vector< HltFakeStruct > > hltFakeCands
MuonSelectionStruct mySelection
virtual void fillPlots(std::vector< MatchStruct > &myRecMatches, std::vector< std::vector< HltFakeStruct > > &myHltFakeCands)
bool HLTMuonMatchAndPlot::applyTrackSelection ( MuonSelectionStruct  mySelection,
reco::Muon  candMuon 
)
protectedvirtual

Definition at line 1658 of file HLTMuonMatchAndPlot.cc.

References debug_cff::d0, MuonSelectionStruct::d0cut, edm::Ref< C, T, F >::isNonnull(), LogTrace, MuonSelectionStruct::trackCollection, and MuonSelectionStruct::z0cut.

1658  {
1659 
1660  LogTrace ("HLTMuonVal") << "Applying track selection to your muon"
1661  << endl;
1662  // get the track
1663  // you should have specified the track using the collection names
1664  TrackRef theMuonTrack = getCandTrackRef (mySelection, candMuon);
1665 
1666  bool passedSelection = false;
1667 
1668  if ( theMuonTrack.isNonnull() ) {
1669  double d0 = theMuonTrack->d0();
1670  double z0 = theMuonTrack->dz();
1671 
1672 
1673  LogTrace ("HLTMuonVal") << "d0 = " << d0
1674  << ", d0 cut = " << mySelection.d0cut << endl
1675  << "z0 = " << z0
1676  << ", z0 cut = " << mySelection.z0cut << endl;
1677 
1678 
1679 
1680  if (fabs(d0) < mySelection.d0cut &&
1681  fabs(z0) < mySelection.z0cut ) {
1682  passedSelection = true;
1683  }
1684  } else {
1685  LogTrace ("HLTMuonVal") << "This event didn't have a valid track of type "
1686  << mySelection.trackCollection;
1687  }
1688 
1689  return passedSelection;
1690 
1691 }
reco::TrackRef getCandTrackRef(MuonSelectionStruct mySelection, reco::Muon candMuon)
tuple d0
Definition: debug_cff.py:3
bool isNonnull() const
Checks for non-null.
Definition: Ref.h:248
#define LogTrace(id)
bool HLTMuonMatchAndPlot::applyTriggerSelection ( MuonSelectionStruct  mySelection,
const edm::Event event 
)
protectedvirtual

Definition at line 1693 of file HLTMuonMatchAndPlot.cc.

References edm::HandleBase::isValid(), LogTrace, MuonSelectionStruct::requiredTriggers, and findQualityFiles::size.

1693  {
1694 
1695  bool passedAnyTrigger = false;
1696  // Look and your event selection criteria
1697  // if you have a vector of size zero
1698  // or if you have a vector with just an empty string
1699  // then you should just skip this selection and return true
1700 
1701  LogTrace ("HLTMuonVal") << "Checking to see if you have non-empty triggers to match"
1702  << endl;
1703 
1704  if (mySelection.requiredTriggers.size() < 1)
1705  return true;
1706 
1707  vector<string>::const_iterator iTargetTrig;
1708 
1709  bool everythingIsEmpty = true;
1710  for ( iTargetTrig = mySelection.requiredTriggers.begin();
1711  iTargetTrig != mySelection.requiredTriggers.end();
1712  iTargetTrig ++ ) {
1713 
1714  if ( (*iTargetTrig) != "" ) {
1715  everythingIsEmpty = false;
1716  }
1717 
1718  }
1719 
1720  if (everythingIsEmpty) {
1721  LogTrace ("HLTMuonVal") << "Only empty triggers, skipping match";
1722  return true;
1723  }
1724 
1725  // At this point, you have a true trigger requirement
1726  // You need to check the trigger results
1727  // 0. Get the trigger resutls
1728  // 1. Loop over list of target triggers
1729  // 2. See if the target is valid according to HLTConfig
1730  // 3. If it is, check to see that it fired
1731  //
1732  // Potential optimization - store the trigger index
1733  // rather than doing the match for each event
1734 
1735 
1736  // Get the trigger results
1737 
1738  Handle<TriggerResults> trigRes;
1739  event.getByLabel(TriggerResultLabel, trigRes);
1740  if (!trigRes.isValid()){
1741  edm::InputTag triggerResultsLabelFU(TriggerResultLabel.label(),TriggerResultLabel.instance(), "FU");
1742  event.getByLabel(triggerResultsLabelFU,trigRes);
1743  if(!trigRes.isValid()) {
1744  LogTrace("HLTMuonVal")<< "Trigger Results WARNING: No trigger Results in event info, but you wanted to check a trigger";
1745  // Do nothing, and
1746  //TrigResultsIn=false;
1747 
1748  return false;
1749  }
1750  }
1751  unsigned size = trigRes->size();
1752 
1753  unsigned int Ntp = 0;
1754 
1755  LogTrace("HLTMuonVal")<< "Ntp=" << Ntp <<" Size of trigger results="<<size;
1756 
1757 
1758  // loop over the list of target triggers
1759 
1760  map<string,bool> firedTrigger;
1761 
1762  for ( iTargetTrig = mySelection.requiredTriggers.begin();
1763  iTargetTrig != mySelection.requiredTriggers.end();
1764  iTargetTrig++ ) {
1765 
1766  std::string targetName = (*iTargetTrig);
1767 
1768  LogTrace("HLTMuonVal") << "Looking to see if " << targetName << " has fired... ";
1769 
1770  firedTrigger[targetName] = false;
1771  vector<string>::const_iterator iValidTrig;
1772  unsigned int trigIndex = 0;
1773  for ( iValidTrig = selectedValidTriggers.begin();
1774  iValidTrig != selectedValidTriggers.end();
1775  iValidTrig ++) {
1776 
1777  if ( targetName == (*iValidTrig)){
1778 
1779  LogTrace ("HLTMuonVal") << "Trigger " << targetName
1780  << " was part of the hlt configuration at index"
1781  << trigIndex
1782  << endl;
1783 
1784  firedTrigger[targetName] = trigRes->accept(trigIndex);
1785 
1786  LogTrace ("HLTMuonVal") << "Did the trigger fire? "
1787  << ((firedTrigger[targetName]) ? "PASSED" : "FAILED")
1788  << endl;
1789 
1790  }
1791 
1792  trigIndex++;
1793  } // end loop over valid triggers
1794  }// end loop over target triggers
1795 
1796 
1797  map<string,bool>::const_iterator iResult;
1798 
1799  passedAnyTrigger = false;
1800 
1801  LogTrace ("HLTMuonVal") << "OR-ing trigger results together" <<endl;
1802 
1803 
1804  for (iResult = firedTrigger.begin();
1805  iResult != firedTrigger.end();
1806  iResult ++) {
1807 
1808  passedAnyTrigger = passedAnyTrigger || iResult->second;
1809 
1810  }
1811 
1812  LogTrace ("HLTMuonVal") << "Returning " << passedAnyTrigger;
1813 
1814  return passedAnyTrigger;
1815 
1816 }
std::vector< std::string > selectedValidTriggers
bool isValid() const
Definition: HandleBase.h:76
#define LogTrace(id)
std::string const & label() const
Definition: InputTag.h:25
std::vector< std::string > requiredTriggers
std::string const & instance() const
Definition: InputTag.h:26
tuple size
Write out results.
edm::InputTag TriggerResultLabel
void HLTMuonMatchAndPlot::begin ( void  )
virtual

Reimplemented in HLTMuonBPAG, and HLTTopPlotter.

Definition at line 1871 of file HLTMuonMatchAndPlot.cc.

References DQMStore::cd(), dbe_, h, i, testEve_cfg::level, LogTrace, jptDQMConfig_cff::ptBins, and DQMStore::setCurrentFolder().

Referenced by HLTTopPlotter::begin().

1872 {
1873  LogTrace ("HLTMuonVal") << "\n\nInside HLTMuonMatchAndPlot begin()";
1874 
1875  TString myLabel, newFolder;
1876  vector<TH1F*> h;
1877 
1878  if ( dbe_ ) {
1879  dbe_->cd();
1880  dbe_->setCurrentFolder("HLT/Muon");
1881 
1882  // JMS I think this is trimming all L1 names to
1883  // to be L1Filtered
1884  // Update this so that it really is just L1Filtered
1885  // new trigger names ruin string trimming
1886 
1887  if (useOldLabels) {
1888  myLabel = theL1CollectionLabel;
1889  myLabel = myLabel(myLabel.Index("L1"),myLabel.Length());
1890  myLabel = myLabel(0,myLabel.Index("Filtered")+8);
1891  } else {
1892  myLabel = "L1Filtered";
1893  }
1894  // JMS Old way of doing things
1895  //newFolder = "HLT/Muon/Distributions/" + theTriggerName;
1896  newFolder = "HLT/Muon/Distributions/" + theTriggerName + "/" + mySelection.customLabel;
1897 
1898 
1899 
1900  dbe_->setCurrentFolder( newFolder.Data() );
1901 
1902  //meNumberOfEvents = dbe_->bookInt("NumberOfEvents");
1903  //MonitorElement *meMinPtCut = dbe_->bookFloat("MinPtCut" );
1904  //MonitorElement *meMaxEtaCut = dbe_->bookFloat("MaxEtaCut" );
1905  //meMinPtCut ->Fill(theMinPtCut );
1906  //meMaxEtaCut->Fill(theMaxEtaCut);
1907 
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() );
1912 
1913  //hNumObjects = dbe_->book1D( "numObjects", "Number of Objects", 7, 0, 7 );
1914  //hNumObjects->setBinLabel( 1, "Gen" );
1915  //hNumObjects->setBinLabel( 2, "Reco" );
1916  //for ( size_t i = 0; i < binLabels.size(); i++ )
1917  //hNumObjects->setBinLabel( i + 3, binLabels[i].c_str() );
1918  //hNumObjects->getTH1()->LabelsDeflate("X");
1919 
1920 
1921  if ( useMuonFromReco ){
1922 
1923  //hNumOrphansRec = dbe_->book1D( "recNumOrphans", "Number of Orphans;;Number of Objects Not Matched to a Reconstructed #mu", 5, 0, 5 );
1924  // for ( size_t i = 0; i < binLabels.size(); i++ )
1925  // hNumOrphansRec->setBinLabel( i + 1, binLabels[i].c_str() );
1926  //hNumOrphansRec->getTH1()->LabelsDeflate("X");
1927 
1928 
1929 
1930 
1931  // 0 = MaxPt_All
1932  hPassMaxPtRec.push_back( bookIt( "recPassMaxPt_All", "pt of Leading Reco Muon" , numBinsInPtHisto, ptBins) );
1933  // 1 = MaxPt if matched to L1 Trigger
1934  if (useFullDebugInformation || isL1Path) hPassMaxPtRec.push_back( bookIt( "recPassMaxPt_" + myLabel, "pt of Leading Reco Muon, if matched to " + myLabel, numBinsInPtHisto, ptBins) );
1935 
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) );
1938 
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) );
1941 
1942 
1943 
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) );
1946 
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) );
1949 
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) );
1952 
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));
1957 
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));
1962 
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));
1965 
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));
1968 
1969  // beamspot filled only once
1970  hBeamSpotZ0Rec.push_back ( bookIt("recBeamSpotZ0_All", "Z0 of beamspot for this event", theZ0Parameters));
1971 
1972 
1973 
1974  // =======================================================
1975  // these hisotgrams requite a match, and so will only have
1976  // L1,L2,L3 histograms and no "all" histogram
1977  // =======================================================
1978 
1979  // hDeltaRMatched.push_back ( bookIt("recDeltaRMatched_All" , "#Delta R between matched HLTCand", theDRParameters));
1980  if (useFullDebugInformation || isL1Path) hDeltaRMatched.push_back ( bookIt("recDeltaRMatched_" + myLabel, "#Delta R between matched HLTCand", theDRParameters));
1981 
1982  // hChargeFlipMatched.push_back ( bookIt("recChargeFlipMatched_All" , "Charge Flip from hlt to RECO;HLT;Reco", theChargeFlipParameters));
1983  if (useFullDebugInformation || isL1Path) hChargeFlipMatched.push_back ( bookIt("recChargeFlipMatched_" + myLabel, "Charge Flip from hlt to RECO;HLT Charge (-,+);Reco (-,+)", theChargeFlipParameters));
1984 
1985  if (useFullDebugInformation || isL1Path) hPassMatchPtRec.push_back( bookIt( "recPassMatchPt_" + myLabel, "Pt of Reco Muon that is matched to Trigger Muon " + myLabel, numBinsInPtHisto, ptBins) );
1986  //hPtMatchVsPtRec.push_back (bookIt("recPtVsMatchPt" + myLabel, "Reco Pt vs Matched HLT Muon Pt" + myLabel , theMaxPtParameters2d) );
1987  //hEtaMatchVsEtaRec.push_back( bookIt( "recEtaVsMatchEta_" + myLabel, "Reco #eta vs HLT #eta " + myLabel, theEtaParameters2d) );
1988  //hPhiMatchVsPhiRec.push_back( bookIt( "recPhiVsMatchPhi_" + myLabel, "Reco #phi vs HLT #phi " + myLabel, thePhiParameters2d) );
1989 
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));
1993 
1994  // Cosmic debugging histos
1995  if (useFullDebugInformation || isL1Path) hMatchedDeltaPhi.push_back ( bookIt( "recDeltaPhiMatched_" + myLabel, "Reco #phi vs HLT #phi " + myLabel, thePhiParameters0Pi) );
1996  //hDeltaPhiVsPhi.push_back(bookIt( "recDeltaPhiVsPhi_" + myLabel, "#Delta #phi (reco,hlt) vs HLT #phi " + myLabel, theDeltaPhiVsPhiParameters) );
1997  //hDeltaPhiVsZ0.push_back(bookIt( "recDeltaPhiVsZ0_" + myLabel, "#Delta #phi (reco, hlt) vs HLT z0 " + myLabel, theDeltaPhiVsZ0Parameters) );
1998  //hDeltaPhiVsD0.push_back(bookIt( "recDeltaPhiVsD0_" + myLabel, "#Delta #phi (reco, hlt) vs HLT d0 " + myLabel, theDeltaPhiVsD0Parameters) );
1999 
2001  // RAW Histograms
2003 
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) );
2007 
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) );
2010 
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) );
2013  }
2014 
2015  //=================================
2016  // 2-D Histograms
2017  //=================================
2018 
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));
2021 
2022  }
2023 
2024  // we won't enter this loop if we don't have an hlt label
2025  // we won't have an hlt label is this is a l1 path
2026  for ( unsigned int i = 0; i < theHltCollectionLabels.size(); i++ ) {
2027 
2028  if (useOldLabels) {
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);
2033  } else {
2034  TString tempString = theHltCollectionLabels[i];
2035  TString level = ( tempString.Contains("L2") ) ? "L2" : "L3";
2036  myLabel = level + "Filtered";
2037  }
2038 
2039  if ( useMuonFromReco ) {
2040 
2041  // These histos have All, L1, L2, L3
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) );
2045 
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) );
2048 
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));
2051 
2052 
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));
2058 
2059  hIsolationRec.push_back ( bookIt("recPassIsolation_" + myLabel, "Muon Isolation cone 0.3 " + myLabel, theIsolationParameters));
2060 
2061  // Match histos only have numHltLabels indices
2062  hPassMatchPtRec.push_back( bookIt( "recPassMatchPt_" + myLabel, "Pt of Reco Muon that is matched to Trigger Muon " + myLabel, numBinsInPtHisto, ptBins) );
2063 
2064  //hPtMatchVsPtRec.push_back (bookIt("recPtVsMatchPt" + myLabel, "Reco Pt vs Matched HLT Muon Pt" + myLabel , theMaxPtParameters2d) );
2065  //hEtaMatchVsEtaRec.push_back( bookIt( "recEtaVsMatchEta_" + myLabel, "Reco #eta vs HLT #eta " + myLabel, theEtaParameters2d) );
2066  //hPhiMatchVsPhiRec.push_back( bookIt( "recPhiVsMatchPhi_" + myLabel, "Reco #phi vs HLT #phi " + myLabel, thePhiParameters2d) );
2067 
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));
2071 
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));
2074 
2075  // cosmic plots
2076 
2077  hMatchedDeltaPhi.push_back ( bookIt( "recDeltaPhiMatched_" + myLabel, "Reco #phi vs HLT #phi " + myLabel, thePhiParameters0Pi) );
2078  //hDeltaPhiVsPhi.push_back(bookIt( "recDeltaPhiVsPhi_" + myLabel, "Reco #phi vs HLT #phi " + myLabel, theDeltaPhiVsPhiParameters) );
2079  //hDeltaPhiVsZ0.push_back(bookIt( "recDeltaPhiVsZ0_" + myLabel, "Reco #phi vs HLT #phi " + myLabel, theDeltaPhiVsZ0Parameters) );
2080  //hDeltaPhiVsD0.push_back(bookIt( "recDeltaPhiVsD0_" + myLabel, "#Delta #phi (reco, hlt) vs HLT d0 " + myLabel, theDeltaPhiVsD0Parameters) );
2081 
2082  // these candidates are indexed by the number
2083  // of hlt labels
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));
2087 
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));
2091 
2092  //fakeHltCandEtaPhi.push_back(bookIt("fakeHltCandPhiVsEta_" + myLabel, " AOD #phi vs #eta for fake HLT Muon Cands, for HLT " +myLabel, thePhiEtaParameters2d));
2093 
2094  // raw histograms
2095 
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) );
2100  }
2101  }
2102 
2103  }
2104  }
2105 
2106 }
virtual MonitorElement * bookIt(TString name, TString title, std::vector< double >)
std::vector< MonitorElement * > hPassZ0BeamRec
std::vector< MonitorElement * > fakeHltCandPt
int i
Definition: DBlmapReader.cc:9
std::vector< MonitorElement * > hPassPtRecExactlyOne
std::vector< double > theDRParameters
std::vector< MonitorElement * > rawMatchHltCandPt
std::vector< MonitorElement * > hBeamSpotZ0Rec
void cd(void)
go to top directory (ie. root)
Definition: DQMStore.cc:214
std::vector< MonitorElement * > hPassD0Rec
std::vector< MonitorElement * > hPassZ0Rec
std::vector< double > theD0Parameters
std::vector< double > theZ0Parameters
std::vector< MonitorElement * > hResoEtaAodRec
std::vector< MonitorElement * > allHltCandPt
std::vector< double > theEtaParameters
std::vector< double > theChargeFlipParameters
std::vector< MonitorElement * > hPassMatchPtRec
std::string theL1CollectionLabel
std::vector< MonitorElement * > hIsolationRec
std::vector< MonitorElement * > hPassMaxPtRec
std::vector< MonitorElement * > hDeltaRMatched
std::vector< double > thePhiEtaParameters2d
std::vector< MonitorElement * > hPassCharge
std::vector< MonitorElement * > fakeHltCandPhi
std::vector< double > thePhiParameters
#define LogTrace(id)
std::vector< double > theIsolationParameters
std::vector< MonitorElement * > hPassD0BeamRec
std::vector< MonitorElement * > rawMatchHltCandPhi
std::vector< MonitorElement * > hPassEtaRec
std::vector< MonitorElement * > allHltCandPhi
std::vector< MonitorElement * > hPassPtRec
std::vector< MonitorElement * > hPassPhiRec
std::vector< MonitorElement * > fakeHltCandEta
std::vector< MonitorElement * > allHltCandEta
std::vector< std::string > theHltCollectionLabels
std::vector< double > theResParameters
MuonSelectionStruct mySelection
std::vector< MonitorElement * > hMatchedDeltaPhi
std::vector< MonitorElement * > hResoPhiAodRec
std::vector< double > thePhiParameters0Pi
std::vector< double > theChargeParameters
tuple level
Definition: testEve_cfg.py:34
The Signals That Services Can Subscribe To This is based on ActivityRegistry h
Helper function to determine trigger accepts.
Definition: Activities.doc:4
std::vector< MonitorElement * > hResoPtAodRec
std::vector< MonitorElement * > hChargeFlipMatched
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:237
std::vector< MonitorElement * > hPassExaclyOneMuonMaxPtRec
std::vector< MonitorElement * > hPhiVsEtaRec
std::vector< MonitorElement * > rawMatchHltCandEta
MonitorElement * HLTMuonMatchAndPlot::bookIt ( TString  name,
TString  title,
std::vector< double >  parameters 
)
virtual

Definition at line 2111 of file HLTMuonMatchAndPlot.cc.

References DQMStore::book1D(), DQMStore::book2D(), dbe_, h, LogTrace, max(), min, DQMStore::pwd(), and indexGen::title.

2112 {
2113  LogTrace("HLTMuonVal") << "Directory " << dbe_->pwd() << " Name " <<
2114  name << " Title:" << title;
2115  int nBins = (int)parameters[0];
2116  double min = parameters[1];
2117  double max = parameters[2];
2118 
2119  // this is the 1D hist case
2120  if (parameters.size() == 3) {
2121  TH1F *h = new TH1F( name, title, nBins, min, max );
2122  h->Sumw2();
2123  MonitorElement * returnedME = dbe_->book1D( name.Data(), h );
2124  delete h;
2125  booked1DMonitorElements.push_back(returnedME);
2126  return returnedME;
2127 
2128  // this is the case for a 2D hist
2129  } else if (parameters.size() == 6) {
2130 
2131  int nBins2 = (int)parameters[3];
2132  double min2 = parameters[4];
2133  double max2 = parameters[5];
2134 
2135  TH2F *h = new TH2F (name, title, nBins, min, max, nBins2, min2, max2);
2136  h->Sumw2();
2137  MonitorElement * returnedME = dbe_->book2D (name.Data(), h);
2138  delete h;
2139  return returnedME;
2140 
2141  } else {
2142  LogInfo ("HLTMuonVal") << "Directory" << dbe_->pwd() << " Name "
2143  << name << " had an invalid number of paramters";
2144  return 0;
2145  }
2146 
2147 }
MonitorElement * book1D(const char *name, const char *title, int nchX, double lowX, double highX)
Book 1D histogram.
Definition: DQMStore.cc:519
#define min(a, b)
Definition: mlp_lapack.h:161
std::vector< MonitorElement * > booked1DMonitorElements
const T & max(const T &a, const T &b)
#define LogTrace(id)
MonitorElement * book2D(const char *name, const char *title, int nchX, double lowX, double highX, int nchY, double lowY, double highY)
Book 2D histogram.
Definition: DQMStore.cc:647
The Signals That Services Can Subscribe To This is based on ActivityRegistry h
Helper function to determine trigger accepts.
Definition: Activities.doc:4
const std::string & pwd(void) const
Definition: DQMStore.cc:209
MonitorElement * HLTMuonMatchAndPlot::bookIt ( TString  name,
TString  title,
int  nbins,
float *  xBinLowEdges 
)
virtual

Definition at line 2150 of file HLTMuonMatchAndPlot.cc.

References DQMStore::book1D(), dbe_, LogTrace, DQMStore::pwd(), and indexGen::title.

2151 {
2152  LogTrace("HLTMuonVal") << "Directory " << dbe_->pwd() << " Name " <<
2153  name << " Title:" << title;
2154 
2155  TH1F *tempHist = new TH1F(name, title, nbins, xBinLowEdges);
2156  tempHist->Sumw2();
2157  MonitorElement * returnedME = dbe_->book1D(name.Data(), tempHist);
2158  delete tempHist;
2159 
2160  booked1DMonitorElements.push_back(returnedME);
2161  return returnedME;
2162 
2163 }
MonitorElement * book1D(const char *name, const char *title, int nchX, double lowX, double highX)
Book 1D histogram.
Definition: DQMStore.cc:519
std::vector< MonitorElement * > booked1DMonitorElements
#define LogTrace(id)
const std::string & pwd(void) const
Definition: DQMStore.cc:209
TString HLTMuonMatchAndPlot::calcHistoSuffix ( std::string  moduleName)

Definition at line 2176 of file HLTMuonMatchAndPlot.cc.

References testEve_cfg::level.

2176  {
2177 
2178  TString level = "L3";
2179  TString myLabel = moduleName; // the return value
2180 
2181 
2182  if ( myLabel.Contains("L1") ) {
2183  level = "L1";
2184  } else if (myLabel.Contains("L2")) {
2185  level = "L2";
2186  } else if (myLabel.Contains("L3")) {
2187  level = "L3";
2188  }
2189 
2190  if (useOldLabels) {
2191  myLabel = myLabel(myLabel.Index(level),myLabel.Length());
2192  myLabel = myLabel(0,myLabel.Index("Filtered")+8);
2193 
2194  } else {
2195  myLabel = level + "Filtered";
2196  }
2197 
2198  return myLabel;
2199 
2200 }
tuple level
Definition: testEve_cfg.py:34
void HLTMuonMatchAndPlot::endRun ( const edm::Run r,
const edm::EventSetup c 
)
virtual

Definition at line 487 of file HLTMuonMatchAndPlot.cc.

References LogTrace.

488 {
489 
490  LogTrace ("HLTMuonVal") << "\n\nInside HLTMuonMatchAndPlot endRun()";
491 
492  // loop over all the histograms we booked, and handle the overflow bins
493 
494  // do this at end run, since you want to be sure you did it before you
495  // saved your ME's.
496 
497  vector<MonitorElement*>::iterator iMonitorEl;
498 
499  for ( iMonitorEl = booked1DMonitorElements.begin();
500  iMonitorEl != booked1DMonitorElements.end();
501  iMonitorEl++ ) {
502 
503  moveOverflow((*iMonitorEl));
504 
505  }
506 
507 
508 }
void moveOverflow(MonitorElement *myElement)
std::vector< MonitorElement * > booked1DMonitorElements
#define LogTrace(id)
void HLTMuonMatchAndPlot::fillPlots ( std::vector< MatchStruct > &  myRecMatches,
std::vector< std::vector< HltFakeStruct > > &  myHltFakeCands 
)
virtual

Definition at line 1129 of file HLTMuonMatchAndPlot.cc.

References ExpressReco_HICollisions_FallBack::beamSpot, DeDxDiscriminatorTools::charge(), debug_cff::d0, dbe_, reco::deltaPhi(), Geom::deltaPhi(), deltaR(), reco::deltaR(), reco::MuonIsolation::emEt, trigger::TriggerObject::eta(), eta(), reco::MuonIsolation::hadEt, i, edm::Ref< C, T, F >::isNonnull(), j, LogTrace, phi, trigger::TriggerObject::phi(), trigger::TriggerObject::pt(), and ExpressReco_HICollisions_FallBack::pt.

1130  {
1131 
1132 
1133  if (!dbe_) {
1134 
1135  LogTrace ("HLTMuonVal")
1136  << "===Warning=== You've tried to call fill plots, "
1137  << "but no DQMStore object exists... refusing to fill plots"
1138  << endl;
1139 
1140  return;
1141 
1142  }
1143 
1144  int numRecMatches = myRecMatches.size();
1145 
1146 
1147 
1148  //double recMuonPt = -1;
1149 
1150  //=======================
1151  // DoubleMu Triggers
1152  // ----------------------
1153  // If you're using a double mu trigger
1154  // Check to see if you found at least two reco muons
1155  // If you haven't, then skip this event!
1156  //========================
1157 
1158  if ((theNumberOfObjects == 2) && (myRecMatches.size() < 2)) return;
1159 
1161  // Fill histograms
1162 
1164  //
1165  // RECO Matching
1166  //
1168 
1169  double maxMatchPtRec = -10.0;
1170  //std::vector <double> allRecPts;
1171  //std::vector <bool> matchedToHLT;
1172 
1173  // Look at each rec & hlt cand
1174 
1175  for ( size_t i = 0; i < myRecMatches.size(); i++ ) {
1176 
1177  LogTrace("HLTMuonVal") << "Reco Candidate loop:"
1178  << "looking at cand " << i
1179  << " out of " << myRecMatches.size()
1180  << endl;
1181 
1182 
1184 
1185  LogTrace ("HLTMuonVal") << "Checking to see if your RECO muon matched to an L1 seed"
1186  << endl;
1187 
1188  if (myRecMatches[i].l1Seed.pt() < 0) {
1189  LogTrace ("HLTMuonVal") << "No match to L1 seed, skipping this RECO muon" << endl;
1190  continue;
1191  }
1192  }
1193 
1194 
1195 
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();
1200 
1201  LogTrace ("HLTMuonVal") << "trying to get a global track for this muon" << endl;
1202 
1203  // old way - breaks if no global track
1204  //TrackRef theMuoGlobalTrack = myRecMatches[i].recCand->globalTrack();
1205 
1206  TrackRef theMuonTrack = getCandTrackRef (mySelection, (*myRecMatches[i].recCand));
1207 
1208  double d0 = -9e20;
1209  double z0 = -9e20;
1210  int charge = -99999;
1211  int plottedCharge = -99999;
1212 
1213  double d0beam = -9e20;
1214  double z0beam = -9e20;
1215 
1216  if (theMuonTrack.isNonnull() ) {
1217  d0 = theMuonTrack->d0();
1218  z0 = theMuonTrack->dz();
1219  // comment:
1220  // does the charge function return the
1221  // same value as the abs(pdgId) ?
1222  charge = theMuonTrack->charge();
1223  plottedCharge = getCharge (recPdgId);
1224 
1225 
1226  if (foundBeamSpot) {
1227  d0beam = theMuonTrack->dxy(beamSpot.position());
1228  z0beam = theMuonTrack->dz(beamSpot.position());
1229 
1230  hBeamSpotZ0Rec[0]->Fill(beamSpot.z0());
1231  }
1232 
1233 
1234  } else {
1235  LogTrace ("HLTMuonVal") << "... oops! that wasn't a global muon" << endl;
1236  }
1237 
1238 
1239  // For now, take out the cuts on the pt/eta,
1240  // We'll get the total efficiency and worry about
1241  // the hlt matching later.
1242  // if ( pt > theMinPtCut && fabs(eta) < theMaxEtaCut ) {
1243 
1244  //hNumObjects->getTH1()->AddBinContent(2);
1245 
1246  // fill the "all" histograms for basic muon
1247  // parameters
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);
1257 
1258  MuonIsolation thisIso = myRecMatches[i].recCand->isolationR03();
1259  double emEnergy = thisIso.emEt;
1260  double hadEnergy = thisIso.hadEt;
1261  double myMuonIso = (emEnergy + hadEnergy) / pt;
1262 
1263  hIsolationRec[0]->Fill(myMuonIso);
1264 
1265  if (numRecMatches == 1) {
1266  hPassPtRecExactlyOne[0]->Fill(pt);
1267  }
1268 
1269 
1270  // if you found an L1 match, fill this histo
1271  // check for L1 match using pt, not energy
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);
1283 
1284  double l1eta = myRecMatches[i].l1Cand.eta();
1285  double l1phi = myRecMatches[i].l1Cand.phi();
1286  double l1pt = myRecMatches[i].l1Cand.energy();
1287 
1288  // Get the charges in terms of charge constants
1289  // this reduces bins in histogram.
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 "
1294  << l1plottedCharge;
1295 
1296 
1297  double deltaR = reco::deltaR (l1eta, l1phi, eta, phi);
1298 
1299  double deltaPhi = reco::deltaPhi (l1phi, phi);
1300 
1301  // These are matched histos
1302  // so they have no "all" histos
1303  //
1304 
1305  hDeltaRMatched[0]->Fill(deltaR);
1306  hPassMatchPtRec[0]->Fill(pt);
1307  //hPtMatchVsPtRec[0]->Fill(l1pt, pt);
1308  //hEtaMatchVsEtaRec[0]->Fill(l1eta, eta);
1309  //hPhiMatchVsPhiRec[0]->Fill(l1phi, phi);
1310  hMatchedDeltaPhi[0]->Fill(deltaPhi);
1311  //hDeltaPhiVsPhi[0]->Fill(phi, deltaPhi);
1312  //hDeltaPhiVsZ0[0]->Fill(z0, deltaPhi);
1313  //hDeltaPhiVsD0[0]->Fill(d0, deltaPhi);
1314  // Resolution histos must have hlt matches
1315 
1316  hResoPtAodRec[0]->Fill((pt - l1pt)/pt);
1317  hResoEtaAodRec[0]->Fill((eta - l1eta)/fabs(eta));
1318  hResoPhiAodRec[0]->Fill((phi - l1phi)/fabs(phi));
1319 
1320 
1321  hChargeFlipMatched[0]->Fill(l1plottedCharge, plottedCharge);
1322 
1323  if (numRecMatches == 1) {
1324  hPassExaclyOneMuonMaxPtRec[1]->Fill(pt);
1325  hPassPtRecExactlyOne[1]->Fill(pt);
1326  }
1327  }
1328 
1329  // bool foundAllPreviousCands = true;
1330  // Look through the hltCands and see what's going on
1331  //
1332 
1333 
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());
1340 
1341  // store this rec muon pt, not hlt cand pt
1342  if (theHltCollectionLabels.size() > j) {
1343  TString tempString = theHltCollectionLabels[j];
1344  if (tempString.Contains("L3")) {
1345 
1346  maxMatchPtRec = (pt > maxMatchPtRec)? pt : maxMatchPtRec;
1347  }
1348  }
1349 
1350  // these are histos where you have
1351  // all + L1 (= displaced two indices)
1352  // Which means your HLT histos are
1353  // at index j+HLT_PLOT_OFFSET
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);
1364 
1365 
1366  // Histograms with Match in the name only have HLT
1367  // matches possible
1368  // so there are no "all" histograms
1369  // so offset = 1 b/c of L1 histos
1370 
1371  double deltaR = reco::deltaR (hltCand_eta, hltCand_phi,
1372  eta, phi);
1373 
1374  double deltaPhi = reco::deltaPhi (hltCand_phi, phi);
1375 
1376  hDeltaRMatched[j+HLT_PLOT_OFFSET-1]->Fill(deltaR);
1377  hPassMatchPtRec[j+HLT_PLOT_OFFSET-1]->Fill(pt);
1378  //hPtMatchVsPtRec[j+HLT_PLOT_OFFSET-1]->Fill(hltCand_pt, pt);
1379  //hEtaMatchVsEtaRec[j+HLT_PLOT_OFFSET-1]->Fill(hltCand_eta, eta);
1380  //hPhiMatchVsPhiRec[j+HLT_PLOT_OFFSET-1]->Fill(hltCand_phi, phi);
1381  hMatchedDeltaPhi[j+HLT_PLOT_OFFSET-1]->Fill(deltaPhi);
1382  //hDeltaPhiVsPhi[j+HLT_PLOT_OFFSET-1]->Fill(phi, deltaPhi);
1383  //hDeltaPhiVsZ0[j+HLT_PLOT_OFFSET-1]->Fill(z0, deltaPhi);
1384  //hDeltaPhiVsD0[j+HLT_PLOT_OFFSET-1]->Fill(d0, deltaPhi);
1385 
1386 
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 "
1392  << charge
1393  << ", and plotted charge "
1394  << plottedCharge
1395  << "\n "
1396  << "and rec pdg id = "
1397  << recPdgId;
1398 
1399 
1400 
1401  hChargeFlipMatched[j+HLT_PLOT_OFFSET-1]->Fill( hltCand_plottedCharge, plottedCharge);
1402 
1403 
1404  // Resolution histos must have hlt matches
1405 
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));
1409 
1410  if (numRecMatches == 1 && (myRecMatches[i].hltCands.size()== 1)) {
1413  }
1414  } // end if found hlt match
1415  }
1416 
1418  // Fill some RAW histograms
1421  LogTrace ("HLTMuonVal") << "\n.... now Filling Raw Histos";
1422  if ( myRecMatches[i].l1RawCand.energy() > 0 ) {
1423 
1424  // you've found a L1 raw candidate
1425  rawMatchHltCandPt[1]->Fill(pt);
1426  rawMatchHltCandEta[1]->Fill(eta);
1427  rawMatchHltCandPhi[1]->Fill(phi);
1428  }
1429 
1430  LogTrace ("HLTMuonVal") << "There are " << myRecMatches[i].hltCands.size()
1431  << " hltRaw candidates that could match, starting loop"
1432  << endl;
1433 
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);
1439  }
1440  }
1441 
1442  }
1443  } // end RECO matching
1444 
1446  //
1447  // HLT fakes cands
1448  //
1450 
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()
1458  << " )\n";
1459 
1460 
1461  TriggerObject candVect = myHltFakeCands[iHltModule][iCand].myHltCand;
1462  bool candIsFake = myHltFakeCands[iHltModule][iCand].isAFake;
1463 
1464  allHltCandPt[iHltModule]->Fill(candVect.pt());
1465  allHltCandEta[iHltModule]->Fill(candVect.eta());
1466  allHltCandPhi[iHltModule]->Fill(candVect.phi());
1467 
1468  if (candIsFake) {
1469  fakeHltCandPt[iHltModule]->Fill(candVect.pt());
1470  fakeHltCandEta[iHltModule]->Fill(candVect.eta());
1471  fakeHltCandPhi[iHltModule]->Fill(candVect.phi());
1472  //fakeHltCandEtaPhi[iHltModule]->Fill(candVect.eta(), candVect.phi());
1473 
1474  // JMS extra hack - print out run,event so you can look
1475  // in event display
1476  // int myRun = iEvent.id().run();
1477  // int myEvent = iEvent.id().event();
1478 
1479 
1480  // cout << endl << "FAKE! run = " << myRun << ", event = "
1481  // << myEvent << ", pt = " << candVect.pt() << ", eta = "
1482  // << candVect.eta() << "phi, " << candVect.phi() << endl << endl;
1483 
1484  }
1485 
1486  }
1487 
1488  }
1489 
1490 
1491  LogTrace ("HLTMuonVal") << "There are " << myRecMatches.size()
1492  << " RECO muons in this event"
1493  << endl;
1494 
1495  LogTrace ("HLTMuonVal") << "The max pt found by looking at candiates is "
1496  << maxMatchPtRec
1497  //<< "\n and the max found while storing reco was "
1498  //<< recMuonPt
1499  << endl;
1500 
1502  //
1503  // Fill MAX PT plot
1504  //
1506 
1507 
1508  // genMuonPt and maxMatchPtRec are the max values
1509  // fill these hists with the max reconstructed Pt
1510  //if ( genMuonPt > 0 ) hPassMaxPtGen[0]->Fill( genMuonPt );
1511  if ( maxMatchPtRec > 0 ) hPassMaxPtRec[0]->Fill( maxMatchPtRec );
1512 
1513  // there will be one hlt match for each
1514  // trigger module label
1515  // int numHltMatches = myRecMatches[i].hltCands.size();
1516 
1517  if (numRecMatches == 1) {
1518  if (maxMatchPtRec >0) hPassExaclyOneMuonMaxPtRec[0]->Fill(maxMatchPtRec);
1519  }
1520 
1521  // Fill these if there are any L1 candidates
1523  if ( numL1Cands >= theNumberOfObjects ) {
1524  //if ( genMuonPt > 0 ) hPassMaxPtGen[1]->Fill( genMuonPt );
1525  if ( maxMatchPtRec > 0 ) hPassMaxPtRec[1]->Fill( maxMatchPtRec );
1526  if (numRecMatches == 1 && numL1Cands == 1) {
1527  if (maxMatchPtRec >0) hPassExaclyOneMuonMaxPtRec[1]->Fill(maxMatchPtRec);
1528  }
1529  }
1530  }
1531 
1532 
1533 
1534  for ( size_t i = 0; i < numHltLabels; i++ ) {
1535  // this will only fill up if L3
1536  // I don't think it's correct to fill
1537  // all the labels with this
1538  if (maxMatchPtRec > 0) hPassMaxPtRec[i+HLT_PLOT_OFFSET]->Fill(maxMatchPtRec);
1539 
1540  }
1541 
1542 
1543 
1544 
1545 } // end fillPlots: Done filling histograms
std::vector< MonitorElement * > hPassZ0BeamRec
float hadEt
hcal sum-Et
Definition: MuonIsolation.h:9
std::vector< MonitorElement * > fakeHltCandPt
double z0() const
z coordinate
Definition: BeamSpot.h:69
int i
Definition: DBlmapReader.cc:9
std::vector< MonitorElement * > hPassPtRecExactlyOne
std::vector< MonitorElement * > rawMatchHltCandPt
reco::TrackRef getCandTrackRef(MuonSelectionStruct mySelection, reco::Muon candMuon)
std::vector< MonitorElement * > hBeamSpotZ0Rec
tuple d0
Definition: debug_cff.py:3
float phi() const
Definition: TriggerObject.h:60
double deltaPhi(float phi1, float phi2)
Definition: VectorUtil.h:30
std::vector< MonitorElement * > hPassD0Rec
std::vector< MonitorElement * > hPassZ0Rec
float eta() const
Definition: TriggerObject.h:59
std::vector< MonitorElement * > hResoEtaAodRec
double charge(const std::vector< uint8_t > &Ampls)
T eta() const
std::vector< MonitorElement * > allHltCandPt
double deltaR(double eta1, double phi1, double eta2, double phi2)
Definition: deltaR.h:19
Single trigger physics object (e.g., an isolated muon)
Definition: TriggerObject.h:24
bool isNonnull() const
Checks for non-null.
Definition: Ref.h:248
std::vector< MonitorElement * > hPassMatchPtRec
unsigned int theNumberOfObjects
std::vector< MonitorElement * > hIsolationRec
float emEt
ecal sum-Et
Definition: MuonIsolation.h:8
std::vector< MonitorElement * > hPassMaxPtRec
std::vector< MonitorElement * > hDeltaRMatched
std::vector< MonitorElement * > hPassCharge
int j
Definition: DBlmapReader.cc:9
std::vector< MonitorElement * > fakeHltCandPhi
#define LogTrace(id)
std::vector< MonitorElement * > hPassD0BeamRec
std::vector< MonitorElement * > rawMatchHltCandPhi
double deltaR(double eta1, double eta2, double phi1, double phi2)
Definition: TreeUtility.cc:17
double deltaPhi(double phi1, double phi2)
Definition: deltaPhi.h:12
std::vector< MonitorElement * > hPassEtaRec
std::vector< MonitorElement * > allHltCandPhi
std::vector< MonitorElement * > hPassPtRec
std::vector< MonitorElement * > hPassPhiRec
std::vector< MonitorElement * > fakeHltCandEta
std::vector< MonitorElement * > allHltCandEta
std::vector< std::string > theHltCollectionLabels
MuonSelectionStruct mySelection
std::vector< MonitorElement * > hMatchedDeltaPhi
std::vector< MonitorElement * > hResoPhiAodRec
const Point & position() const
position
Definition: BeamSpot.h:63
std::vector< MonitorElement * > hResoPtAodRec
std::vector< MonitorElement * > hChargeFlipMatched
std::vector< MonitorElement * > hPassExaclyOneMuonMaxPtRec
std::vector< MonitorElement * > hPhiVsEtaRec
std::vector< MonitorElement * > rawMatchHltCandEta
Definition: DDAxes.h:10
int HLTMuonMatchAndPlot::findGenMatch ( double  eta,
double  phi,
double  maxDeltaR,
std::vector< MatchStruct matches 
)
protected

Definition at line 1567 of file HLTMuonMatchAndPlot.cc.

References i.

1568 {
1569  double bestDeltaR = maxDeltaR;
1570  int bestMatch = -1;
1571  for ( size_t i = 0; i < matches.size(); i++ ) {
1572  // double dR = reco::deltaR( eta, phi,
1573  // matches[i].genCand->eta(),
1574  // matches[i].genCand->phi() );
1575 
1576 
1577  double dR = 10;
1578 
1579  if ( dR < bestDeltaR ) {
1580  bestMatch = i;
1581  bestDeltaR = dR;
1582  }
1583  }
1584  return bestMatch;
1585 }
int i
Definition: DBlmapReader.cc:9
const reco::Candidate * HLTMuonMatchAndPlot::findMother ( const reco::Candidate p)
protected

Definition at line 1550 of file HLTMuonMatchAndPlot.cc.

References reco::Candidate::mother(), and reco::Candidate::pdgId().

1551 {
1552  const reco::Candidate* mother = p->mother();
1553  if ( mother ) {
1554  if ( mother->pdgId() == p->pdgId() ) return findMother(mother);
1555  else return mother;
1556  }
1557  else return 0;
1558 }
virtual const Candidate * mother(size_type i=0) const =0
return pointer to mother
const reco::Candidate * findMother(const reco::Candidate *)
virtual int pdgId() const =0
PDG identifier.
int HLTMuonMatchAndPlot::findRecMatch ( double  eta,
double  phi,
double  maxdeltaR,
std::vector< MatchStruct matches 
)
protected

Definition at line 1590 of file HLTMuonMatchAndPlot.cc.

References reco::deltaPhi(), reco::deltaR(), and i.

1591 {
1592  double bestDeltaR = maxDeltaR;
1593  int bestMatch = -1;
1594 
1595  // Case for delta R matching
1596  // the != cosmic case is for default handling.
1597  if (matchType != "cosmic" || matchType == "dr" ) {
1598  for ( size_t i = 0; i < matches.size(); i++ ) {
1599  double dR = reco::deltaR( eta, phi,
1600  matches[i].recCand->eta(),
1601  matches[i].recCand->phi() );
1602  if ( dR < bestDeltaR ) {
1603  bestMatch = i;
1604  bestDeltaR = dR;
1605  }
1606  }
1607  return bestMatch;
1608  }
1609 
1610  if (matchType == "cosmic") {
1611 
1612  // Comsic trigger matching
1613  // Just require the the muon
1614  // will be in the same half of the detector
1615  // ignore the eta information
1616  // but we will look for the minmum delta phi
1617  // with the muon in that region of the detector
1618 
1619  double bestDphi = 100.0;
1620  for ( size_t i = 0; i < matches.size(); i++ ) {
1621 
1622  double recCandPhi = matches[i].recCand->phi();
1623 
1624 
1625  if (recCandPhi < 0 && phi < 0) {
1626  if ( reco::deltaPhi(phi, recCandPhi) < bestDphi) {
1627  bestDphi = reco::deltaPhi(phi, recCandPhi);
1628  bestMatch = i;
1629  }
1630  }
1631 
1632 
1633  if (recCandPhi > 0 && phi > 0) {
1634 
1635  if ( reco::deltaPhi(phi, recCandPhi) < bestDphi) {
1636  bestDphi = reco::deltaPhi(phi, recCandPhi);
1637  bestMatch = i;
1638  }
1639 
1640  }
1641 
1642  }
1643  return bestMatch;
1644  }
1645 
1646  // If you get here, then you've improperly set
1647  // your matching
1648 
1649  LogWarning ("HLTMuonVal") << "WARNING: You have improperly set matchType" << endl
1650  << "valid choices are 'dr' and 'cosmic', " <<endl
1651  << "but you provided " << matchType << endl;
1652 
1653  return bestMatch;
1654 
1655 }
int i
Definition: DBlmapReader.cc:9
T eta() const
double deltaR(double eta1, double phi1, double eta2, double phi2)
Definition: deltaR.h:19
double deltaPhi(double phi1, double phi2)
Definition: deltaPhi.h:12
Definition: DDAxes.h:10
void HLTMuonMatchAndPlot::finish ( )
virtual

Reimplemented in HLTMuonBPAG, and HLTTopPlotter.

Definition at line 511 of file HLTMuonMatchAndPlot.cc.

References dbe_, diJetCalib::histoFileName, LogTrace, and DQMStore::save().

Referenced by HLTTopPlotter::finish(), and HLTMuonBPAG::finish().

512 {
513 
514  LogTrace ("HLTMuonVal") << "\n\nInside HLTMuonMatchAndPlot finish()" << endl;
515 
516  if (createStandAloneHistos && histoFileName != "") {
518  }
519 
520 }
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")
Definition: DQMStore.cc:1883
#define LogTrace(id)
void HLTMuonMatchAndPlot::getAodTriggerObjectsForModule ( edm::InputTag  collectionTag,
edm::Handle< trigger::TriggerEvent aodTriggerEvent,
trigger::TriggerObjectCollection  trigObjs,
std::vector< trigger::TriggerObject > &  foundObjects,
MuonSelectionStruct  muonSelection 
)
protected

Definition at line 2234 of file HLTMuonMatchAndPlot.cc.

References MuonSelectionStruct::customLabel, trigger::TriggerObject::eta(), MuonSelectionStruct::hltMuonSelector, trigger::TriggerObject::id(), j, relativeConstraints::keys, LogTrace, and trigger::TriggerObject::pt().

2238  {
2239 
2240 
2241  //LogTrace ("HLTMuonVal") << "Getting trigger muons for module label = " << collectionTag << endl;
2242 
2243  size_t filterIndex = aodTriggerEvent->filterIndex( collectionTag );
2244 
2245  LogTrace ("HLTMuonVal") << "\n\n filterIndex is "
2246  << filterIndex;
2247 
2248  if ( filterIndex < aodTriggerEvent->sizeFilters() ) {
2249  const Keys &keys = aodTriggerEvent->filterKeys( filterIndex );
2250 
2251  LogTrace ("HLTMuonVal") << "\n\nGot keys";
2252  LogTrace ("HLTMuonVal") << "Key size is " << keys.size();
2253 
2254  // The keys are apparently pointers into the trigger
2255  // trigObjs collections
2256  // Use the key's to look up the particles for the
2257  // filter module that you're using
2258 
2259  for ( size_t j = 0; j < keys.size(); j++ ){
2260  TriggerObject foundObject = trigObjs[keys[j]];
2261 
2262  // This is the trigger object. Apply your filter to it!
2263  LogTrace ("HLTMuonVal") << "Testing to see if object in key passes selection"
2264  << endl ;
2265 
2266  if (muonSelection.hltMuonSelector(foundObject)){
2267 
2268  LogTrace ("HLTMuonVal") << "OBJECT FOUND!!! - Storing a trigger object with id = "
2269  << foundObject.id()
2270  << ", eta = " << foundObject.eta()
2271  << ", pt = " << foundObject.pt()
2272  << ", custom name = " << muonSelection.customLabel
2273  << "\n\n" << endl;
2274  //l1Particles.push_back( trigObjs[keys[j]].particle().p4() );
2275  foundObjects.push_back( foundObject );
2276  }
2277  }
2278  }
2279 
2280 
2281 
2282 }
int id() const
getters
Definition: TriggerObject.h:57
float eta() const
Definition: TriggerObject.h:59
Single trigger physics object (e.g., an isolated muon)
Definition: TriggerObject.h:24
int j
Definition: DBlmapReader.cc:9
#define LogTrace(id)
std::vector< size_type > Keys
StringCutObjectSelector< trigger::TriggerObject > hltMuonSelector
TrackRef HLTMuonMatchAndPlot::getCandTrackRef ( MuonSelectionStruct  mySelection,
reco::Muon  candMuon 
)
protected

Definition at line 1820 of file HLTMuonMatchAndPlot.cc.

References reco::LeafCandidate::eta(), reco::Muon::globalTrack(), reco::Muon::innerTrack(), reco::Muon::isGlobalMuon(), edm::Ref< C, T, F >::isNonnull(), reco::Muon::isStandAloneMuon(), reco::Muon::isTrackerMuon(), LogTrace, reco::Muon::outerTrack(), reco::LeafCandidate::phi(), reco::LeafCandidate::pt(), MuonSelectionStruct::trackCollection, and ExpressReco_HICollisions_FallBack::trackCollection.

1820  {
1821 
1822  string trackCollection = mySelection.trackCollection;
1823  TrackRef theTrack;
1824 
1825  LogTrace ("HLTMuonVal") << "Getting the track reference for coll "
1826  << trackCollection
1827  << endl;
1828 
1829  LogTrace ("HLTMuonVal") << "Muon information" << endl
1830  << "pt = " << candMuon.pt()
1831  << ", phi = " << candMuon.phi()
1832  << ", eta = " << candMuon.eta()
1833  << ", global muon? = " << candMuon.isGlobalMuon()
1834  << ", standalone muon = " << candMuon.isStandAloneMuon()
1835  << ", tracker muon = " << candMuon.isTrackerMuon()
1836  << endl;
1837 
1838  if (trackCollection == "innerTrack") {
1839  LogTrace ("HLTMuonVal") << "----> GET " << trackCollection;
1840 
1841  if ( candMuon.isTrackerMuon() ) {
1842  theTrack = candMuon.innerTrack();
1843  }
1844 
1845  } else if ( trackCollection == "outerTrack" ) {
1846 
1847  LogTrace ("HLTMuonVal") << "----> GET " << trackCollection;
1848 
1849  if ( candMuon.isStandAloneMuon() ) {
1850  theTrack = candMuon.outerTrack();
1851  }
1852 
1853  } else if ( trackCollection == "globalTrack") {
1854 
1855  LogTrace ("HLTMuonVal") << "----> GET " << trackCollection;
1856  if (candMuon.isGlobalMuon()) {
1857  theTrack = candMuon.globalTrack();
1858  }
1859  }
1860 
1861  if (theTrack.isNonnull()) {
1862  LogTrace ("HLTMuonVal") << "Found the desired track";
1863  } else {
1864  LogTrace ("HLTMuonVal") << "No track for this candidate";
1865  }
1866 
1867  return theTrack;
1868 }
virtual TrackRef innerTrack() const
Definition: Muon.h:38
bool isTrackerMuon() const
Definition: Muon.h:149
bool isGlobalMuon() const
Definition: Muon.h:148
bool isStandAloneMuon() const
Definition: Muon.h:150
virtual double eta() const
momentum pseudorapidity
bool isNonnull() const
Checks for non-null.
Definition: Ref.h:248
#define LogTrace(id)
virtual TrackRef outerTrack() const
reference to Track reconstructed in the muon detector only
Definition: Muon.h:41
virtual double pt() const
transverse momentum
virtual double phi() const
momentum azimuthal angle
virtual TrackRef globalTrack() const
reference to Track reconstructed in both tracked and muon detector
Definition: Muon.h:44
int HLTMuonMatchAndPlot::getCharge ( int  pdgId)
protected

Definition at line 2168 of file HLTMuonMatchAndPlot.cc.

2168  {
2169 
2170  int resultCharge = (pdgId > 0) ? POS_CHARGE : NEG_CHARGE;
2171 
2172  return resultCharge;
2173 
2174 }
static const int POS_CHARGE
static const int NEG_CHARGE
void HLTMuonMatchAndPlot::moveOverflow ( MonitorElement myElement)
protected

Definition at line 2202 of file HLTMuonMatchAndPlot.cc.

References MonitorElement::getBinContent(), MonitorElement::getEntries(), MonitorElement::getNbinsX(), LogTrace, MonitorElement::setBinContent(), and MonitorElement::setEntries().

2202  {
2203 
2204  LogTrace ("HLTMuonVal") << "MOVEOVERFLOW" << endl;
2205 
2206 
2207  // This will handle an arbitrary dimension first/last bin
2208  // but you should think about how you will interpret this for
2209  // 2D/3D histos
2210  // Actually, this can't handle abitrary dimensions.
2211  int maxBin = myElement->getNbinsX();
2212 
2213  double originalEntries = myElement->getEntries();
2214 
2215  LogTrace ("HLTMuonVal") << "==MOVEOVERFLOW== "
2216  << "maxBin = " << maxBin
2217  << ", calling underflow"
2218  << endl;
2219 
2220  myElement->setBinContent(1, myElement->getBinContent(0) + myElement->getBinContent(1));
2221 
2222  LogTrace ("HLTMuonVal") << "reseting underflow to zero" << endl;
2223  myElement->setBinContent(0,0.0);
2224  LogTrace ("HLTMuonVal") << "calling overflow" << endl;
2225  myElement->setBinContent(maxBin,myElement->getBinContent(maxBin) + myElement->getBinContent(maxBin+1));
2226  LogTrace ("HLTMuonVal") << "seting overflow to zero" << endl;
2227  myElement->setBinContent(maxBin+1,0.0);
2228 
2229  myElement->setEntries(originalEntries);
2230 
2231 }
void setBinContent(int binx, double content)
set content of bin (1-D)
double getEntries(void) const
get # of entries
void setEntries(double nentries)
set # of entries
#define LogTrace(id)
double getBinContent(int binx) const
get content of bin (1-D)
int getNbinsX(void) const
get # of bins in X-axis
bool HLTMuonMatchAndPlot::selectAndMatchMuons ( const edm::Event iEvent,
std::vector< MatchStruct > &  myRecMatches,
std::vector< std::vector< HltFakeStruct > > &  myHltFakeCands 
)
virtual

Reimplemented in HLTMuonBPAG.

Definition at line 538 of file HLTMuonMatchAndPlot.cc.

References LogTrace.

Referenced by HLTMuonBPAG::selectAndMatchMuons().

540  {
541 
542  LogTrace ("HLTMuonVal") << "\n\nInside selectAndMatchMuons, called with no selection argument"
543  << endl
544  << "Calling function using mySelection"
545  << endl;
546 
547  return selectAndMatchMuons (iEvent, myRecMatches, myHltFakeCands, mySelection);
548 
549 }
virtual bool selectAndMatchMuons(const edm::Event &iEvent, std::vector< MatchStruct > &myRecMatches, std::vector< std::vector< HltFakeStruct > > &myHltFakeCands)
#define LogTrace(id)
MuonSelectionStruct mySelection
bool HLTMuonMatchAndPlot::selectAndMatchMuons ( const edm::Event iEvent,
std::vector< MatchStruct > &  myRecMatches,
std::vector< std::vector< HltFakeStruct > > &  myHltFakeCands,
MuonSelectionStruct  muonSelection 
)

Get the candidates from the AOD trigger summary JMS This is the unpacking that you might have otherwise had to do

Definition at line 552 of file HLTMuonMatchAndPlot.cc.

References assign, ExpressReco_HICollisions_FallBack::beamSpot, MuonSelectionStruct::customLabel, trigger::TriggerObject::eta(), eta(), edm::HandleBase::failedToGet(), edm::Event::getByLabel(), i, HLTMuonMatchAndPlot::HltFakeStruct::isAFake, edm::HandleBase::isValid(), LogTrace, match(), metsig::muon, HLTMuonMatchAndPlot::HltFakeStruct::myHltCand, phi, trigger::TriggerObject::phi(), trigger::TriggerObject::pt(), ExpressReco_HICollisions_FallBack::pt, HLTMuonMatchAndPlot::MatchStruct::recCand, MuonSelectionStruct::recoMuonSelector, and findQualityFiles::size.

554  {
555 
556  // clear the matches from the last event
557  myRecMatches.clear();
558 
559  // a fake hlt cand is an hlt object not matched to a
560  // reco object
561  // std::vector< std::vector<HltFakeStruct> > myHltFakeCands(numHltLabels);
562 
563  myHltFakeCands.clear();
564  for (unsigned iLabel = 0; iLabel < numHltLabels; iLabel++){
565 
566  std::vector<HltFakeStruct> tempFake;
567 
568  myHltFakeCands.push_back(tempFake);
569 
570  }
571 
572 
573 
574  // Update event numbers
575  // meNumberOfEvents->Fill(eventNumber);
576 
577 
578  //------------------------------------------
579  // Trigger Requirement
580  //
581  //------------------------------------------
582 
583  LogTrace("HLTMuonVal") << "Checking trigger result for "
584  << "trigger information stored in the following block "
586 
587  bool passedRequiredTrigger = applyTriggerSelection ( muonSelection, iEvent);
588 
589  if (!passedRequiredTrigger) {
590  LogTrace ("HLTMuonVal") << "You didn't pass the required trigger"
591  << "skipping event"
592  << endl;
593  return false;
594  }
595 
597  // Get all generated and reconstructed muons and create structs to hold
598  // matches to trigger candidates
599 
600  double genMuonPt = -1;
601  double recMuonPt = -1;
602 
603 
604  LogTrace ("HLTMuonVal") << "\n\nStarting to look for gen muons\n\n";
605 
606 
607  //std::vector<MatchStruct> genMatches;
608 
609 
610  LogTrace ("HLTMuonVal") << "\n\n\n\nDone getting gen, now getting reco\n\n\n";
611 
612 
613 
614  //std::vector<MatchStruct> highPtMatches;
615 
616  //reco::BeamSpot beamSpot;
617  foundBeamSpot = false;
618 
619  if ( useMuonFromReco ) {
620  //Handle<reco::TrackCollection> muTracks;
621  Handle<MuonCollection> muTracks;
622  iEvent.getByLabel(RecoMuonInputTag, muTracks);
623  //reco::TrackCollection::const_iterator muon;
624  MuonCollection::const_iterator muon;
625  if ( muTracks.failedToGet() ) {
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;
630  } else {
631 
632  LogTrace ("HLTMuonVal") << "Beginning loop over reco muons" << endl;
633 
634  for ( muon = muTracks->begin(); muon != muTracks->end(); ++muon ) {
635 
636  // this applies cuts that can
637  // go towards the muon collection
638 
639  LogTrace ("HLTMuonVal") << "... Applying selection" << endl;
640  if ( muonSelection.recoMuonSelector((*muon)) ) {
641 
642  // now apply cuts to the tracks.
643  LogTrace ("HLTMuonVal") << "Passed selection!" << endl;
644 
645  if ( applyTrackSelection( muonSelection, (*muon) ) ){
646 
647 
648 
649  float pt = muon->pt();
650  float eta = muon->eta();
651  MatchStruct newMatchStruct;
652  newMatchStruct.recCand = &*muon;
653  myRecMatches.push_back(newMatchStruct);
654 
655  LogTrace ("HLTMuonVal") << "\n\nFound a muon track in " << muonSelection.customLabel
656  << " with pt = " << pt
657  << ", eta = " << eta;
658  // Take out this eta cut, but still check to see if
659  // it is a new maximum pt
660  //if ( pt > recMuonPt && fabs(eta) < theMaxEtaCut)
661  if (pt > recMuonPt )
662  recMuonPt = pt;
663 
664  }
665  }
666  }
667  }
668 
669  // This loop checks to see that we successfully stored our cands
670  LogTrace ("HLTMuonVal") << "Print out all rec cands for " << muonSelection.customLabel
671  << endl;
672 
673  for (unsigned iMatch = 0; iMatch < myRecMatches.size(); iMatch++) {
674  LogTrace ("HLTMuonVal") << "Cand #" << iMatch << " ";
675  LogTrace ("HLTMuonVal") << "Pt = " << myRecMatches[iMatch].recCand->pt()
676  << endl;
677  }
678 
679  edm::Handle<reco::BeamSpot> recoBeamSpotHandle;
680  iEvent.getByLabel(BeamSpotInputTag,recoBeamSpotHandle);
681  if (!recoBeamSpotHandle.failedToGet()) {
682 
683  beamSpot = *recoBeamSpotHandle;
684  foundBeamSpot = true;
685 
686  LogTrace ("HLTMuonVal") << "\n\n\nSUCESS finding beamspot\n\n\n" << endl;
687 
688  } else {
689  LogWarning ("HLTMuonVal") << "FAILED to get the beamspot for this event";
690  }
691 
692 
693  }
694 
695  LogTrace("HLTMuonVal") << "\n\n\n\ngenMuonPt: " << genMuonPt << ", "
696  << "recMuonPt: " << recMuonPt
697  << "\nCustom name = " << muonSelection.customLabel << endl
698  << "\nNow preparing to get trigger objects"
699  << "\n\n\n\n";
700 
702  // Get the L1 and HLT trigger collections
703 
705  edm::Handle<trigger::TriggerEvent> aodTriggerEvent;
706  vector<TriggerObject> l1Particles;
707  vector<TriggerObject> l1RawParticles;
708  vector<TriggerObject> l1Seeds;
709  //-- HLTParticles [0] is a vector of L2 matches
710  //-- HLTParticles [1] is a vector of L1 matches
711 
712  // HLT particles are just 4 vectors
713  vector< vector<TriggerObject> > hltParticles(numHltLabels);
714 
715  // HLT cands are references to trigger objects
716  vector< vector<RecoChargedCandidateRef> > hltCands(numHltLabels);
717 
718  // L1 Cands are references to trigger objects
719  vector<L1MuonParticleRef> l1Cands;
720 
721  InputTag collectionTag;
722  //size_t filterIndex;
723 
724 
725  // Try to get the triggerSummaryRAW branch for
726  // this event. If it's there, great, keep using it.
727  // but if it isn't there, skip over it silently
728 
729 // LogTrace ("HLTMuonVal") << "Trying to get RAW information\n\n";
730 
731 // iEvent.getByLabel( HltRawInputTag, rawTriggerEvent );
732 
733 // if ( rawTriggerEvent.isValid() ) {
734 // LogTrace("HLTMuonVal") << "\n\nRAW trigger summary found! "
735 // << "\n\nUsing RAW information";
736 
737 // collectionTag = InputTag( theL1CollectionLabel, "", theHltProcessName );
738 // filterIndex = rawTriggerEvent->filterIndex(collectionTag);
739 
740 
741 // if ( filterIndex < rawTriggerEvent->size() ) {
742 // rawTriggerEvent->getObjects( filterIndex, TriggerL1Mu, l1Cands );
743 // LogTrace ("HLTMuonVal") << "Found l1 raw cands for filter = " << filterIndex ;
744 
745 // } else {
746 // LogTrace("HLTMuonVal") << "No L1 Collection with label "
747 // << collectionTag;
748 // }
749 
750 // //for ( size_t i = 0; i < l1Cands.size(); i++ )
751 // // l1Cands.push_back( l1Cands[i]->p4() );
752 // LogTrace ("HLTMuonVal") << "Looking for information from hltFilters";
753 
754 // for ( size_t i = 0; i < numHltLabels; i++ ) {
755 
756 // collectionTag = InputTag( theHltCollectionLabels[i],
757 // "", theHltProcessName );
758 // filterIndex = rawTriggerEvent->filterIndex(collectionTag);
759 
760 // LogTrace ("HLTMuonVal") << "Looking for candidates for filter "
761 // << theHltCollectionLabels[i]
762 // << ", index = "
763 // << filterIndex;
764 
765 // if ( filterIndex < rawTriggerEvent->size() )
766 // rawTriggerEvent->getObjects( filterIndex, TriggerMuon, hltCands[i]);
767 // else LogTrace("HLTMuonVal") << "No HLT Collection with label "
768 // << collectionTag;
769 
770 // // JMS -- do we ever store this raw info in the MatchStruct?
771 
772 
773 // // don't copy the hltCands into particles
774 // // for ( size_t j = 0; j < hltCands[i].size(); j++ )
775 // // hltParticles[i].push_back( hltCands[i][j]->p4() );
776 
777 // } // End loop over theHltCollectionLabels
778 // } else {
779 // LogTrace ("HLTMuonVal") << "\n\nCouldn't find any RAW information for this event";
780 
781 // } // Done processing RAW summary information
782 
783 
784 
788  // if ( useAod ) {
789 
790  LogTrace ("HLTMuonVal") << "\n\n\nLooking for AOD branch named "
791  << "hltTriggerSummaryAOD\n\n\n";
792 
793  iEvent.getByLabel(HltAodInputTag, aodTriggerEvent);
794  if ( !aodTriggerEvent.isValid() ) {
795  LogInfo("HLTMuonVal") << "No AOD trigger summary found! Returning...";
796  return false;
797  }
798 
799  LogTrace ("HLTMuonVal") << "\n\n\nFound a branch! Getting objects\n\n\n";
800 
801 
802  // This gets you all of the stored trigger objects in the AOD block
803  // could be muons, met, etc
804  const TriggerObjectCollection objects = aodTriggerEvent->getObjects();
805 
806  LogTrace ("HLTMuonVal") << "\n\n\nFound a collection with size "
807  << objects.size() << "\n\n\n";
808 
809  if (objects.size() < 1) {
810  LogTrace ("HLTMuonVal")
811  << "You found the collection, but doesn't have any entries";
812 
813  return false;
814  }
815 
816  // The AOD block has many collections, and you need to
817  // parse which one you want. There are fancy lookup functions
818  // to give you the number of the collection you want.
819  // I think this is related to the trigger bits for each
820  // event not being constant... so kinda like triger
821 
822  collectionTag = InputTag( theL1CollectionLabel, "", theHltProcessName );
823 
824  LogTrace ("HLTMuonVal") << "Trigger Name is " << theTriggerName;
825 
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";
831 
832  // this function call fills l1 particles with your matching trigger objects
833  getAodTriggerObjectsForModule ( collectionTag, aodTriggerEvent, objects, l1Particles, muonSelection);
834 
835  int indexHltColl = 0;
836  vector<string>::const_iterator iHltColl;
837  for (iHltColl = theHltCollectionLabels.begin();
838  iHltColl != theHltCollectionLabels.end();
839  iHltColl++ ){
840  collectionTag = InputTag((*iHltColl) , "",
842 
843  // this function call filles hltParticles with your hlt matches.
844  getAodTriggerObjectsForModule ( collectionTag, aodTriggerEvent, objects, hltParticles[indexHltColl] , muonSelection);
845 
846 
847  indexHltColl++;
848  }
849 
850 
851  // more very verbose debug
852  // trying to restructure code
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)
856  << endl;
857 
859  //
860  // Look up the L1 seeds
861  //
863 
864  collectionTag = InputTag( theL1SeedModuleForHLTPath, "", theHltProcessName );
865 
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";
871 
872  // this function call fills l1 particles with your matching trigger objects
873  getAodTriggerObjectsForModule ( collectionTag, aodTriggerEvent, objects, l1Seeds, muonSelection);
874 
875  LogTrace ("HLTMuonVal") << "At the end of parsing the L1 filter, you have found "
876  << l1Particles.size() << " objects: ";
877 
878 
880  // Initialize MatchStructs
881 
882  LorentzVector nullLorentzVector( 0., 0., 0., -999. );
883 
884  // trigger object id, pt
885  TriggerObject nullTriggerObject (-9999, -9e10, -20, 0, 0);
886 
887  //L1MuonParticleRef nullL1Ref(L1MuonParticle(-1, nullLorentzVector));
888 
889 
890 
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 );
895  //myRecMatches[i].hltTracks.assign( numHltLabels, false );
896  // new! raw matches too
897  myRecMatches[i].hltRawCands.assign(numHltLabels, nullLorentzVector);
898  myRecMatches[i].l1RawCand = nullLorentzVector;
899  }
900 
901 
902 
903 
904 
906  // Loop through L1 candidates, matching to gen/reco muons
907 
908  numL1Cands = 0;
909 
910 
911  for ( size_t i = 0; i < l1Particles.size(); i++ ) {
912 
913  TriggerObject l1Cand = l1Particles[i];
914  double eta = l1Cand.eta();
915  double phi = l1Cand.phi();
916  // L1 pt is taken from a lookup table
917  // double ptLUT = l1Cand->pt();
918 
919  double maxDeltaR = theL1DrCut;
920  numL1Cands++;
921 
922 
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();
930  } else {
931  //hNumOrphansRec->getTH1F()->AddBinContent( 1 );
932  }
933  }
934 
935  } // End loop over l1Particles
936 
937 
938  //========================================
939  // Loop over L1 seeds and store matches
940  //========================================
941 
942  for ( size_t i = 0; i < l1Seeds.size(); i++ ) {
943 
944  TriggerObject l1Cand = l1Seeds[i];
945  double eta = l1Cand.eta();
946  double phi = l1Cand.phi();
947  // L1 pt is taken from a lookup table
948  // double ptLUT = l1Cand->pt();
949 
950  double maxDeltaR = theL1DrCut;
951  //numL1Cands++;
952 
953 
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();
961  } else {
962  //hNumOrphansRec->getTH1F()->AddBinContent( 1 );
963  }
964  }
965 
966  } // End loop over l1Seeds
967 
968 
969 
971  // Loop over the L1 Candidates (RAW information)
972  // and look for matches
974 
975  for ( size_t i = 0; i < l1Cands.size(); i++ ) {
976 
977  LorentzVector l1Cand = l1Cands[i]->p4();
978 
979  double eta = l1Cand.eta();
980  double phi = l1Cand.phi();
981  // L1 pt is taken from a lookup table
982  // double ptLUT = l1Cand.pt();
983 
984  double maxDeltaR = theL1DrCut;
985  //numL1Cands++;
986 
987 
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";
993  } else {
994  //hNumOrphansRec->getTH1F()->AddBinContent( 1 );
995  }
996  }
997 
998  } // End loop over L1 Candidates (RAW)
999 
1000 
1001 
1002  LogTrace("HLTMuonVal") << "Number of L1 Cands: " << numL1Cands;
1003 
1005  // Loop through HLT candidates, matching to gen/reco muons
1006 
1007  vector<unsigned int> numHltCands( numHltLabels, 0) ;
1008 
1009  LogTrace ("HLTMuonVal") << "Looking for HLT matches for numHltLabels = "
1010  << numHltLabels;
1011 
1012  for ( size_t i = 0; i < numHltLabels; i++ ) {
1013 
1014  int triggerLevel = ( i < ( numHltLabels / 2 ) ) ? 2 : 3;
1015  double maxDeltaR = ( triggerLevel == 2 ) ? theL2DrCut : theL3DrCut;
1016 
1017  LogTrace ("HLTMuonVal") << "Looking at 4-vectors for " << theHltCollectionLabels[i];
1018 
1019  for ( size_t candNum = 0; candNum < hltParticles[i].size(); candNum++ ) {
1020 
1021  TriggerObject hltCand = hltParticles[i][candNum];
1022  double eta = hltCand.eta();
1023  double phi = hltCand.phi();
1024 
1025  numHltCands[i]++;
1026 
1027 
1028  if ( useMuonFromReco ){
1029 
1030  HltFakeStruct tempFakeCand;
1031  tempFakeCand.myHltCand = hltCand;
1032 
1033  int match = findRecMatch( eta, phi, maxDeltaR, myRecMatches );
1034 
1035  // if match doesn't return error (-1)
1036  // and if this candidate spot isn't filled
1037  if ( match != -1 && myRecMatches[match].hltCands[i].pt() < 0 ) {
1038  myRecMatches[match].hltCands[i] = hltCand;
1039 
1040  LogTrace ("HLTMuonVal") << "Found a HLT cand match! "
1041  << " rec pt = " << myRecMatches[match].recCand->pt()
1042  << ", hlt pt = " << myRecMatches[match].hltCands[i].pt();
1043 
1044  // since this matched, it's not a fake, so
1045  // record it as "not a fake"
1046  tempFakeCand.isAFake = false;
1047 
1048 
1049  // if match *did* return -1, then this is a fake hlt candidate
1050  // it is fake because it isn't matched to a reco muon
1051  // 2009-03-24 oops, found a bug here, used to be != -1
1052  // fixed
1053  } else if (match == -1){
1054  tempFakeCand.isAFake = true;
1055  //hNumOrphansRec->getTH1F()->AddBinContent( i + 2 );
1056  }
1057 
1058  // add this cand
1059  myHltFakeCands[i].push_back(tempFakeCand);
1060  LogTrace ("HLTMuonVal") << "\n\nWas this a fake hlt cand? "
1061  << tempFakeCand.isAFake;
1062 
1063  }
1064 
1065 
1066 
1067  LogTrace("HLTMuonVal") << "Number of HLT Cands: " << numHltCands[i];
1068 
1069  } // End loop over HLT particles
1070 
1071 
1072  LogTrace ("HLTMuonVal") << "Looking at RAW Candidates for "
1074 
1075 
1076  for ( size_t candNum = 0; candNum < hltCands[i].size(); candNum++ ) {
1077 
1078  LorentzVector hltCand = hltCands[i][candNum]->p4();
1079  double eta = hltCand.eta();
1080  double phi = hltCand.phi();
1081 
1082  numHltCands[i]++;
1083 
1084 
1085  if ( useMuonFromReco ){
1086 
1087  //HltFakeStruct tempFakeCand;
1088  //tempFakeCand.myHltCand = hltCand;
1089 
1090  int match = findRecMatch( eta, phi, maxDeltaR, myRecMatches );
1091 
1092  // if match doesn't return error (-1)
1093  // and if this candidate spot isn't filled
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";
1097  }
1098 
1099  //else if (match == -1){
1100  //tempFakeCand.isAFake = true;
1101  //hNumOrphansRec->getTH1F()->AddBinContent( i + 2 );
1102  //}
1103 
1104  // add this cand
1105  //myHltFakeCands[i].push_back(tempFakeCand);
1106  //LogTrace ("HLTMuonVal") << "\n\nWas this a fake hlt cand? "
1107  // << tempFakeCand.isAFake;
1108 
1109  }
1110 
1111 
1112 
1113  //LogTrace("HLTMuonVal") << "Number of HLT Cands: " << numHltCands[i];
1114 
1115  } // End loop over HLT RAW information
1116 
1117 
1118  } // End loop over HLT labels
1119 
1120 
1121  // if you reach this point, then the code was
1122  // successful
1123 
1124  return true;
1125 
1126 }// end select and match muons
int i
Definition: DBlmapReader.cc:9
edm::InputTag HltAodInputTag
virtual bool applyTriggerSelection(MuonSelectionStruct mySelection, const edm::Event &event)
float phi() const
Definition: TriggerObject.h:60
#define assign
Definition: vmac.h:54
edm::InputTag RecoMuonInputTag
float eta() const
Definition: TriggerObject.h:59
T eta() const
math::XYZTLorentzVector LorentzVector
Definition: HLTMuonBPAG.h:55
Single trigger physics object (e.g., an isolated muon)
Definition: TriggerObject.h:24
int findRecMatch(double eta, double phi, double maxdeltaR, std::vector< MatchStruct > matches)
std::string theL1CollectionLabel
bool isValid() const
Definition: HandleBase.h:76
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:359
#define LogTrace(id)
std::vector< TriggerObject > TriggerObjectCollection
collection of trigger physics objects (e.g., all isolated muons)
Definition: TriggerObject.h:83
bool failedToGet() const
Definition: HandleBase.h:80
StringCutObjectSelector< reco::Muon > recoMuonSelector
std::vector< std::string > theHltCollectionLabels
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.
Definition: Utils.h:6
virtual bool applyTrackSelection(MuonSelectionStruct mySelection, reco::Muon candMuon)
edm::InputTag BeamSpotInputTag
std::string theL1SeedModuleForHLTPath
tuple size
Write out results.
edm::InputTag TriggerResultLabel
Definition: DDAxes.h:10

Member Data Documentation

std::vector<MonitorElement*> HLTMuonMatchAndPlot::allHltCandEta
protected

Definition at line 398 of file HLTMuonMatchAndPlot.h.

std::vector<MonitorElement*> HLTMuonMatchAndPlot::allHltCandPhi
protected

Definition at line 399 of file HLTMuonMatchAndPlot.h.

std::vector<MonitorElement*> HLTMuonMatchAndPlot::allHltCandPt
protected

Definition at line 397 of file HLTMuonMatchAndPlot.h.

reco::BeamSpot HLTMuonMatchAndPlot::beamSpot
protected

Definition at line 249 of file HLTMuonMatchAndPlot.h.

edm::InputTag HLTMuonMatchAndPlot::BeamSpotInputTag
protected

Definition at line 267 of file HLTMuonMatchAndPlot.h.

std::vector<MonitorElement*> HLTMuonMatchAndPlot::booked1DMonitorElements
protected

Definition at line 230 of file HLTMuonMatchAndPlot.h.

bool HLTMuonMatchAndPlot::createStandAloneHistos
protected

Definition at line 357 of file HLTMuonMatchAndPlot.h.

DQMStore* HLTMuonMatchAndPlot::dbe_
protected

Definition at line 355 of file HLTMuonMatchAndPlot.h.

int HLTMuonMatchAndPlot::eventNumber
protected
std::vector<MonitorElement*> HLTMuonMatchAndPlot::fakeHltCandEta
protected

Definition at line 405 of file HLTMuonMatchAndPlot.h.

std::vector<MonitorElement*> HLTMuonMatchAndPlot::fakeHltCandPhi
protected

Definition at line 406 of file HLTMuonMatchAndPlot.h.

std::vector<MonitorElement*> HLTMuonMatchAndPlot::fakeHltCandPt
protected

Definition at line 404 of file HLTMuonMatchAndPlot.h.

bool HLTMuonMatchAndPlot::foundBeamSpot
protected

Definition at line 250 of file HLTMuonMatchAndPlot.h.

std::vector<MonitorElement*> HLTMuonMatchAndPlot::hBeamSpotZ0Rec
protected

Definition at line 383 of file HLTMuonMatchAndPlot.h.

std::vector<MonitorElement*> HLTMuonMatchAndPlot::hChargeFlipMatched
protected

Definition at line 395 of file HLTMuonMatchAndPlot.h.

std::vector<MonitorElement*> HLTMuonMatchAndPlot::hDeltaRMatched
protected

Definition at line 393 of file HLTMuonMatchAndPlot.h.

std::vector<MonitorElement*> HLTMuonMatchAndPlot::hIsolationRec
protected

Definition at line 394 of file HLTMuonMatchAndPlot.h.

std::string HLTMuonMatchAndPlot::histoFileName
protected

Definition at line 358 of file HLTMuonMatchAndPlot.h.

int HLTMuonMatchAndPlot::HLT_PLOT_OFFSET
protected

Definition at line 239 of file HLTMuonMatchAndPlot.h.

edm::InputTag HLTMuonMatchAndPlot::HltAodInputTag
protected

Definition at line 269 of file HLTMuonMatchAndPlot.h.

std::vector< std::vector<HltFakeStruct> > HLTMuonMatchAndPlot::hltFakeCands

Definition at line 169 of file HLTMuonMatchAndPlot.h.

edm::InputTag HLTMuonMatchAndPlot::HltRawInputTag
protected

Definition at line 268 of file HLTMuonMatchAndPlot.h.

std::vector<MonitorElement*> HLTMuonMatchAndPlot::hMatchedDeltaPhi
protected

Definition at line 386 of file HLTMuonMatchAndPlot.h.

MonitorElement* HLTMuonMatchAndPlot::hNumObjects
protected

Definition at line 423 of file HLTMuonMatchAndPlot.h.

MonitorElement* HLTMuonMatchAndPlot::hNumOrphansRec
protected

Definition at line 425 of file HLTMuonMatchAndPlot.h.

std::vector<MonitorElement*> HLTMuonMatchAndPlot::hPassCharge
protected

Definition at line 380 of file HLTMuonMatchAndPlot.h.

std::vector<MonitorElement*> HLTMuonMatchAndPlot::hPassD0BeamRec
protected

Definition at line 381 of file HLTMuonMatchAndPlot.h.

std::vector<MonitorElement*> HLTMuonMatchAndPlot::hPassD0Rec
protected

Definition at line 378 of file HLTMuonMatchAndPlot.h.

std::vector<MonitorElement*> HLTMuonMatchAndPlot::hPassEtaRec
protected

Definition at line 365 of file HLTMuonMatchAndPlot.h.

std::vector<MonitorElement*> HLTMuonMatchAndPlot::hPassExaclyOneMuonMaxPtRec
protected

Definition at line 368 of file HLTMuonMatchAndPlot.h.

std::vector<MonitorElement*> HLTMuonMatchAndPlot::hPassMatchPtRec
protected

Definition at line 367 of file HLTMuonMatchAndPlot.h.

std::vector<MonitorElement*> HLTMuonMatchAndPlot::hPassMaxPtRec
protected

Definition at line 364 of file HLTMuonMatchAndPlot.h.

std::vector<MonitorElement*> HLTMuonMatchAndPlot::hPassPhiRec
protected

Definition at line 366 of file HLTMuonMatchAndPlot.h.

std::vector<MonitorElement*> HLTMuonMatchAndPlot::hPassPtRec
protected

Definition at line 373 of file HLTMuonMatchAndPlot.h.

std::vector<MonitorElement*> HLTMuonMatchAndPlot::hPassPtRecExactlyOne
protected

Definition at line 374 of file HLTMuonMatchAndPlot.h.

std::vector<MonitorElement*> HLTMuonMatchAndPlot::hPassZ0BeamRec
protected

Definition at line 382 of file HLTMuonMatchAndPlot.h.

std::vector<MonitorElement*> HLTMuonMatchAndPlot::hPassZ0Rec
protected

Definition at line 379 of file HLTMuonMatchAndPlot.h.

std::vector<MonitorElement*> HLTMuonMatchAndPlot::hPhiVsEtaRec
protected

Definition at line 372 of file HLTMuonMatchAndPlot.h.

std::vector<MonitorElement*> HLTMuonMatchAndPlot::hResoEtaAodRec
protected

Definition at line 376 of file HLTMuonMatchAndPlot.h.

std::vector<MonitorElement*> HLTMuonMatchAndPlot::hResoPhiAodRec
protected

Definition at line 377 of file HLTMuonMatchAndPlot.h.

std::vector<MonitorElement*> HLTMuonMatchAndPlot::hResoPtAodRec
protected

Definition at line 375 of file HLTMuonMatchAndPlot.h.

bool HLTMuonMatchAndPlot::includeOverflow
protected

Definition at line 216 of file HLTMuonMatchAndPlot.h.

bool HLTMuonMatchAndPlot::isIsolatedPath
protected

Definition at line 351 of file HLTMuonMatchAndPlot.h.

bool HLTMuonMatchAndPlot::isL1Path
protected

Definition at line 240 of file HLTMuonMatchAndPlot.h.

bool HLTMuonMatchAndPlot::isL2Path
protected

Definition at line 240 of file HLTMuonMatchAndPlot.h.

bool HLTMuonMatchAndPlot::isL3Path
protected

Definition at line 240 of file HLTMuonMatchAndPlot.h.

bool HLTMuonMatchAndPlot::makeNtuple
protected

Definition at line 244 of file HLTMuonMatchAndPlot.h.

std::string HLTMuonMatchAndPlot::matchType
protected

Definition at line 278 of file HLTMuonMatchAndPlot.h.

MonitorElement* HLTMuonMatchAndPlot::meNumberOfEvents
protected

Definition at line 426 of file HLTMuonMatchAndPlot.h.

MuonSelectionStruct HLTMuonMatchAndPlot::mySelection
protected

Definition at line 280 of file HLTMuonMatchAndPlot.h.

const int HLTMuonMatchAndPlot::NEG_CHARGE = -1
staticprotected

Definition at line 296 of file HLTMuonMatchAndPlot.h.

int HLTMuonMatchAndPlot::numBinsInPtHisto
protected

Definition at line 314 of file HLTMuonMatchAndPlot.h.

unsigned int HLTMuonMatchAndPlot::numHltLabels
protected

Definition at line 350 of file HLTMuonMatchAndPlot.h.

unsigned int HLTMuonMatchAndPlot::numL1Cands
protected

Definition at line 242 of file HLTMuonMatchAndPlot.h.

const int HLTMuonMatchAndPlot::POS_CHARGE = 1
staticprotected

Definition at line 295 of file HLTMuonMatchAndPlot.h.

float HLTMuonMatchAndPlot::ptBins[100]
protected

Definition at line 313 of file HLTMuonMatchAndPlot.h.

std::vector<MonitorElement*> HLTMuonMatchAndPlot::rawMatchHltCandEta
protected

Definition at line 416 of file HLTMuonMatchAndPlot.h.

std::vector<MonitorElement*> HLTMuonMatchAndPlot::rawMatchHltCandPhi
protected

Definition at line 417 of file HLTMuonMatchAndPlot.h.

std::vector<MonitorElement*> HLTMuonMatchAndPlot::rawMatchHltCandPt
protected

Definition at line 415 of file HLTMuonMatchAndPlot.h.

std::vector<MatchStruct> HLTMuonMatchAndPlot::recMatches

Definition at line 167 of file HLTMuonMatchAndPlot.h.

edm::InputTag HLTMuonMatchAndPlot::RecoMuonInputTag
protected

Definition at line 266 of file HLTMuonMatchAndPlot.h.

bool HLTMuonMatchAndPlot::requireL1SeedForHLTPaths
protected

Definition at line 275 of file HLTMuonMatchAndPlot.h.

std::vector<std::string> HLTMuonMatchAndPlot::selectedValidTriggers
protected

Definition at line 285 of file HLTMuonMatchAndPlot.h.

std::string HLTMuonMatchAndPlot::theAodL1Label
protected

Definition at line 272 of file HLTMuonMatchAndPlot.h.

std::string HLTMuonMatchAndPlot::theAodL2Label
protected

Definition at line 273 of file HLTMuonMatchAndPlot.h.

std::vector<double> HLTMuonMatchAndPlot::theChargeFlipParameters
protected

Definition at line 309 of file HLTMuonMatchAndPlot.h.

std::vector<double> HLTMuonMatchAndPlot::theChargeParameters
protected

Definition at line 307 of file HLTMuonMatchAndPlot.h.

std::vector<double> HLTMuonMatchAndPlot::theD0Parameters
protected

Definition at line 305 of file HLTMuonMatchAndPlot.h.

std::vector<double> HLTMuonMatchAndPlot::theDRParameters
protected

Definition at line 308 of file HLTMuonMatchAndPlot.h.

std::vector<double> HLTMuonMatchAndPlot::theEtaParameters
protected

Definition at line 302 of file HLTMuonMatchAndPlot.h.

TFile* HLTMuonMatchAndPlot::theFile
protected

Definition at line 247 of file HLTMuonMatchAndPlot.h.

std::vector<std::string> HLTMuonMatchAndPlot::theHltCollectionLabels
protected

Definition at line 258 of file HLTMuonMatchAndPlot.h.

std::string HLTMuonMatchAndPlot::theHltProcessName
protected

Definition at line 255 of file HLTMuonMatchAndPlot.h.

std::vector<double> HLTMuonMatchAndPlot::theIsolationParameters
protected

Definition at line 332 of file HLTMuonMatchAndPlot.h.

std::string HLTMuonMatchAndPlot::theL1CollectionLabel
protected

Definition at line 257 of file HLTMuonMatchAndPlot.h.

double HLTMuonMatchAndPlot::theL1DrCut
protected

Definition at line 338 of file HLTMuonMatchAndPlot.h.

std::string HLTMuonMatchAndPlot::theL1SeedModuleForHLTPath
protected

Definition at line 287 of file HLTMuonMatchAndPlot.h.

double HLTMuonMatchAndPlot::theL2DrCut
protected

Definition at line 339 of file HLTMuonMatchAndPlot.h.

double HLTMuonMatchAndPlot::theL3DrCut
protected

Definition at line 340 of file HLTMuonMatchAndPlot.h.

double HLTMuonMatchAndPlot::theMaxEtaCut
protected

Definition at line 337 of file HLTMuonMatchAndPlot.h.

std::vector<double> HLTMuonMatchAndPlot::theMaxPtParameters
protected

Definition at line 300 of file HLTMuonMatchAndPlot.h.

double HLTMuonMatchAndPlot::theMinPtCut
protected

Definition at line 336 of file HLTMuonMatchAndPlot.h.

int HLTMuonMatchAndPlot::theMotherParticleId
protected

Definition at line 341 of file HLTMuonMatchAndPlot.h.

std::vector<double> HLTMuonMatchAndPlot::theNSigmas
protected

Definition at line 342 of file HLTMuonMatchAndPlot.h.

TNtuple* HLTMuonMatchAndPlot::theNtuple
protected

Definition at line 246 of file HLTMuonMatchAndPlot.h.

std::string HLTMuonMatchAndPlot::theNtupleFileName
protected

Definition at line 344 of file HLTMuonMatchAndPlot.h.

float HLTMuonMatchAndPlot::theNtuplePars[100]
protected

Definition at line 245 of file HLTMuonMatchAndPlot.h.

std::string HLTMuonMatchAndPlot::theNtuplePath
protected

Definition at line 345 of file HLTMuonMatchAndPlot.h.

unsigned int HLTMuonMatchAndPlot::theNumberOfObjects
protected

Definition at line 259 of file HLTMuonMatchAndPlot.h.

std::vector<double> HLTMuonMatchAndPlot::thePhiEtaParameters2d
protected

Definition at line 317 of file HLTMuonMatchAndPlot.h.

std::vector<double> HLTMuonMatchAndPlot::thePhiParameters
protected

Definition at line 303 of file HLTMuonMatchAndPlot.h.

std::vector<double> HLTMuonMatchAndPlot::thePhiParameters0Pi
protected

Definition at line 304 of file HLTMuonMatchAndPlot.h.

std::vector<double> HLTMuonMatchAndPlot::thePtParameters
protected

Definition at line 301 of file HLTMuonMatchAndPlot.h.

std::vector<double> HLTMuonMatchAndPlot::theResParameters
protected

Definition at line 329 of file HLTMuonMatchAndPlot.h.

std::string HLTMuonMatchAndPlot::theTriggerName
protected

Definition at line 256 of file HLTMuonMatchAndPlot.h.

std::vector<double> HLTMuonMatchAndPlot::theZ0Parameters
protected

Definition at line 306 of file HLTMuonMatchAndPlot.h.

edm::InputTag HLTMuonMatchAndPlot::TriggerResultLabel
protected

Definition at line 283 of file HLTMuonMatchAndPlot.h.

bool HLTMuonMatchAndPlot::useAod
protected

Definition at line 271 of file HLTMuonMatchAndPlot.h.

bool HLTMuonMatchAndPlot::useFullDebugInformation
protected

Definition at line 238 of file HLTMuonMatchAndPlot.h.

bool HLTMuonMatchAndPlot::useMuonFromReco
protected

Definition at line 262 of file HLTMuonMatchAndPlot.h.

bool HLTMuonMatchAndPlot::useOldLabels
protected

Definition at line 237 of file HLTMuonMatchAndPlot.h.