CMS 3D CMS Logo

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

#include <HLTTopPlotter.h>

Inheritance diagram for HLTTopPlotter:
HLTMuonMatchAndPlot

Public Member Functions

void analyze (const edm::Event &iEvent)
 
void begin ()
 
void finish ()
 
 HLTTopPlotter (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...
 
- Public Member Functions inherited from HLTMuonMatchAndPlot
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)
 
 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 ()
 

Private Member Functions

void sortJets (reco::CaloJetCollection &theJets)
 

Private Attributes

edm::InputTag CaloJetInputTag
 
double EtaCut_
 
std::vector< MonitorElement * > hDeltaRMaxJetLep
 
std::vector< MonitorElement * > hJetMultip
 
int NJets_
 
double PtCut_
 
std::vector< double > theJetMParameters
 

Additional Inherited Members

- Public Attributes inherited from HLTMuonMatchAndPlot
std::vector< std::vector
< HltFakeStruct > > 
hltFakeCands
 
std::vector< MatchStructrecMatches
 
- Protected Member Functions inherited from HLTMuonMatchAndPlot
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 inherited from HLTMuonMatchAndPlot
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 inherited from HLTMuonMatchAndPlot
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.5
Author
J. Slaunwhite (modified from above

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:40
Revision:
1.5
Author
J. Slaunwhite (modified from above

Definition at line 57 of file HLTTopPlotter.h.

Constructor & Destructor Documentation

HLTTopPlotter::HLTTopPlotter ( 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 62 of file HLTTopPlotter.cc.

References edm::ParameterSet::getParameter(), edm::ParameterSet::getUntrackedParameter(), and LogTrace.

67  : HLTMuonMatchAndPlot(pset, triggerName, moduleNames, inputSelection, customName, validTriggers, currentRun, currentEventSetup)
68 
69 {
70 
71  CaloJetInputTag = pset.getParameter<edm::InputTag>("CaloJetInputTag");
72  EtaCut_ = pset.getUntrackedParameter<double>("EtaCut");
73  PtCut_ = pset.getUntrackedParameter<double>("PtCut");
74  NJets_ = pset.getUntrackedParameter<int>("NJets");
75  theJetMParameters = pset.getUntrackedParameter< vector<double> >("JetMParameters");
76 
77 
78  LogTrace ("HLTMuonVal") << "\n\n Inside HLTTopPlotter Constructor";
79  LogTrace ("HLTMuonVal") << "The trigger name is " << triggerName
80  << "and we've done all the other intitializations";
81 
82  LogTrace ("HLTMuonVal") << "exiting constructor\n\n";
83 
84 }
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
std::vector< double > theJetMParameters
Definition: HLTTopPlotter.h:93
#define LogTrace(id)
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.
edm::InputTag CaloJetInputTag
Definition: HLTTopPlotter.h:91

Member Function Documentation

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

Reimplemented from HLTMuonMatchAndPlot.

Definition at line 100 of file HLTTopPlotter.cc.

References HLTMuonMatchAndPlot::analyze(), reco::deltaR(), edm::Event::getByLabel(), i, edm::HandleBase::isValid(), j, metsig::jet, analyzePatCleaning_cfg::jets, LogTrace, edm::Handle< T >::product(), and ExpressReco_HICollisions_FallBack::pt.

101 {
102 
103  LogTrace ("HLTMuonVal") << "Inside of TopPlotter analyze method!"
104  << "calling my match and plot module's analyze..."
105  << endl;
106 
107  // Make sure you are valid before proceeding
108 
109 
110  // Do some top specific selection, then call the muon matching
111  // if the event looks top-like
112 
113  LogTrace ("HLTMuonVal") << "Do top-specific selection" << endl;
114 
115 
116  // get calo jet collection
117  Handle<CaloJetCollection> jetsHandle;
118  iEvent.getByLabel(CaloJetInputTag, jetsHandle);
119 
120  int n_jets_20 = 0;
121  CaloJetCollection selectedJets;
122 
123  if (jetsHandle.isValid()) {
124  LogTrace ("HLTMuonVal") << "Looking in jet collection" << endl;
125  //Jet Collection to use
126 
127  // Raw jets
128  const CaloJetCollection *jets = jetsHandle.product();
129  CaloJetCollection::const_iterator jet;
130 
131  //int n_jets_20=0;
132 
133  // The parameters for the n jets should be
134 
135 
136  for (jet = jets->begin(); jet != jets->end(); jet++){
137  // if (fabs(jet->eta()) <2.4 && jet->et() > 20) n_jets_20++;
138  if (fabs(jet->eta()) <EtaCut_ && jet->et() > PtCut_) {
139  n_jets_20++;
140  selectedJets.push_back((*jet));
141  }
142 
143  }
144 
145  }
146 
147 
148 
149  // sort the result
150  sortJets(selectedJets);
151 
152 
153 
154  LogTrace ("HLTMuonVal") << "Number of jets in this event = "
155  << n_jets_20
156  << endl;
157 
158  // if (n_jets_20 <= 1 ) {
159  if (n_jets_20 < NJets_ ) {
160  LogTrace ("HLTMuonVal") << "Not enought jets in this event, skipping it"
161  << endl;
162 
163  return;
164  }
165 
166 
167 
169  //
170  // Call the other analyze method
171  //
173 
174 
175 
176  LogTrace("HLTMuonVal") << "Calling analyze for muon ana" << endl;
178 
179 
180  LogTrace ("HLTMuonVal") << "TOPPLOT: returned from muon ana, now in top module"
181  << endl
182  << "muon ana stored size rec muons = "
183  //<< myMuonAna->recMatches.size()
184  << endl;
185 
186  vector<HLTMuonMatchAndPlot::MatchStruct>::const_iterator iRecMuon;
187 
188  int numCands = 0;
189  for ( unsigned int i = 0;
190  i < recMatches.size();
191  i++ ) {
192 
193 
194  LogTrace ("HLTMuonVal") << "Cand " << numCands
195  << ", Pt = "
196  << recMatches[i].recCand->pt()
197  << ", eta = "
198  << recMatches[i].recCand->eta()
199  << ", phi = "
200  << recMatches[i].recCand->phi()
201  << endl;
202 
203 
204  double deltaRLeadJetLep = reco::deltaR (recMatches[i].recCand->eta(), recMatches[i].recCand->phi(),
205  selectedJets[0].eta(), selectedJets[0].phi());
206 
208  //
209  // Fill Plots for All
210  //
212 
213  hDeltaRMaxJetLep[0]->Fill(deltaRLeadJetLep);
214  hJetMultip[0]->Fill(n_jets_20);
215 
216 
218  //
219  // Fill Plots for L1
220  //
222 
223 
224  if ( (recMatches[i].l1Cand.pt() > 0) && ((useFullDebugInformation) || (isL1Path)) ) {
225  hDeltaRMaxJetLep[1]->Fill(deltaRLeadJetLep);
226  hJetMultip[1]->Fill(n_jets_20);
227  }
228 
230  //
231  // Fill Plots for HLT
232  //
234 
235  for ( size_t j = 0; j < recMatches[i].hltCands.size(); j++ ) {
236  if ( recMatches[i].hltCands[j].pt() > 0 ) {
237  // you've found it!
238  hDeltaRMaxJetLep[j+HLT_PLOT_OFFSET]->Fill(deltaRLeadJetLep);
239  hJetMultip[j+HLT_PLOT_OFFSET]->Fill(n_jets_20);
240 
241  }
242  }
243 
244 
245 
246  numCands++;
247  }
248 
249 
250  LogTrace ("HLTMuonVal") << "-----End of top plotter analyze method-----" << endl;
251 } // Done filling histograms
int i
Definition: DBlmapReader.cc:9
void sortJets(reco::CaloJetCollection &theJets)
std::vector< MonitorElement * > hDeltaRMaxJetLep
Definition: HLTTopPlotter.h:84
std::vector< MonitorElement * > hJetMultip
Definition: HLTTopPlotter.h:85
double deltaR(double eta1, double phi1, double eta2, double phi2)
Definition: deltaR.h:19
int j
Definition: DBlmapReader.cc:9
bool isValid() const
Definition: HandleBase.h:76
std::vector< MatchStruct > recMatches
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:359
#define LogTrace(id)
virtual void analyze(const edm::Event &iEvent)
T const * product() const
Definition: Handle.h:74
edm::InputTag CaloJetInputTag
Definition: HLTTopPlotter.h:91
std::vector< CaloJet > CaloJetCollection
collection of CaloJet objects
void HLTTopPlotter::begin ( void  )
virtual

Reimplemented from HLTMuonMatchAndPlot.

Definition at line 256 of file HLTTopPlotter.cc.

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

257 {
258 
259  TString myLabel, newFolder;
260  vector<TH1F*> h;
261 
262  LogTrace ("HLTMuonVal") << "Inside begin for top analyzer" << endl;
263 
264 
265  LogTrace ("HLTMuonVal") << "Calling begin for muon analyzer" << endl;
267 
268  LogTrace ("HLTMuonVal") << "Continuing with top analyzer begin" << endl;
269 
270  if ( dbe_ ) {
271  dbe_->cd();
272  dbe_->setCurrentFolder("HLT/Muon");
273 
274 
275  // JMS I think this is trimming all L1 names to
276  // to be L1Filtered
277  myLabel = theL1CollectionLabel;
278  myLabel = myLabel(myLabel.Index("L1"),myLabel.Length());
279  myLabel = myLabel(0,myLabel.Index("Filtered")+8);
280 
281 
282  // JMS Old way of doing things
283  //newFolder = "HLT/Muon/Distributions/" + theTriggerName;
284  newFolder = "HLT/Muon/Distributions/" + theTriggerName + "/" + mySelection.customLabel;
285 
286 
287 
288  dbe_->setCurrentFolder( newFolder.Data() );
289 
290  vector<string> binLabels;
291  binLabels.push_back( theL1CollectionLabel.c_str() );
292  for ( size_t i = 0; i < theHltCollectionLabels.size(); i++ )
293  binLabels.push_back( theHltCollectionLabels[i].c_str() );
294 
295 
296  //------- Define labels for plots -------
297 
298  if (useOldLabels) {
299  myLabel = theL1CollectionLabel;
300  myLabel = myLabel(myLabel.Index("L1"),myLabel.Length());
301  myLabel = myLabel(0,myLabel.Index("Filtered")+8);
302  } else {
303  myLabel = "L1Filtered";
304  }
305 
306  //------ Definte the plots themselves------------------------
307 
308 
310  //
311  // ALL + L1 plots
312  //
314 
315  hDeltaRMaxJetLep.push_back (bookIt("topDeltaRMaxJetLep_All", "delta R between muon and highest pt jet", theDRParameters));
316  if (useFullDebugInformation || isL1Path) hDeltaRMaxJetLep.push_back (bookIt("topDeltaRMaxJetLep_" + myLabel, "delta R between muon and highest pt jet", theDRParameters));
317 
318  hJetMultip.push_back (bookIt("topJetMultip_All", "Jet multiplicity", theJetMParameters));
319  if (useFullDebugInformation || isL1Path) hJetMultip.push_back(bookIt("topJetMultip_" + myLabel, "Jet multiplicity", theJetMParameters));
320 
321 
323  //
324  // ALL + L1 plots
325  //
327 
328 
329  // we won't enter this loop if we don't have an hlt label
330  // we won't have an hlt label is this is a l1 path
331  for ( unsigned int i = 0; i < theHltCollectionLabels.size(); i++ ) {
332 
333  if (useOldLabels) {
334  myLabel = theHltCollectionLabels[i];
335  TString level = ( myLabel.Contains("L2") ) ? "L2" : "L3";
336  myLabel = myLabel(myLabel.Index(level),myLabel.Length());
337  myLabel = myLabel(0,myLabel.Index("Filtered")+8);
338  } else {
339  TString tempString = theHltCollectionLabels[i];
340  TString level = ( tempString.Contains("L2") ) ? "L2" : "L3";
341  myLabel = level + "Filtered";
342  } // end if useOldLabels
343 
344 
345  // Book for L2, L3
346  hDeltaRMaxJetLep.push_back (bookIt("topDeltaRMaxJetLep_" + myLabel, "delta R between muon and highest pt jet", theDRParameters)) ;
347  hJetMultip.push_back (bookIt("topJetMultip_" + myLabel, "Jet Multiplicity", theJetMParameters)) ;
348 
349 
350 
351  }// end for each collection label
352 
353  }// end if dbe_ exists
354 
355 }// end begin method
virtual MonitorElement * bookIt(TString name, TString title, std::vector< double >)
int i
Definition: DBlmapReader.cc:9
std::vector< double > theDRParameters
void cd(void)
go to top directory (ie. root)
Definition: DQMStore.cc:214
std::vector< MonitorElement * > hDeltaRMaxJetLep
Definition: HLTTopPlotter.h:84
std::vector< MonitorElement * > hJetMultip
Definition: HLTTopPlotter.h:85
std::vector< double > theJetMParameters
Definition: HLTTopPlotter.h:93
std::string theL1CollectionLabel
#define LogTrace(id)
std::vector< std::string > theHltCollectionLabels
MuonSelectionStruct mySelection
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
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:237
void HLTTopPlotter::finish ( )
virtual

Reimplemented from HLTMuonMatchAndPlot.

Definition at line 88 of file HLTTopPlotter.cc.

References HLTMuonMatchAndPlot::finish().

89 {
90 
91  // you could do something else in here
92  // but for now, just do what the base class
93  // would have done
94 
96 }
void HLTTopPlotter::sortJets ( reco::CaloJetCollection theJets)
private

Definition at line 370 of file HLTTopPlotter.cc.

References ExpressReco_HICollisions_FallBack::et, and LogTrace.

370  {
371 
372 
373  LogTrace ("HLTMuonVal") << "Sorting Jets" << endl;
374 
375  // bubble sort jets
376 
377  for ( unsigned int iJet = 0;
378  iJet < theJets.size();
379  iJet ++) {
380 
381  for ( unsigned int jJet = iJet;
382  jJet < theJets.size();
383  jJet ++ ){
384 
385  if ( theJets[jJet].et() > theJets[iJet].et() ) {
386  reco::CaloJet tmpJet = theJets[iJet];
387  theJets[iJet] = theJets[jJet];
388  theJets[jJet] = tmpJet;
389  }
390 
391  }// end for each jJet
392 
393  }// end for each iJet
394 
395  for ( unsigned int iJet = 0;
396  iJet != theJets.size();
397  iJet ++ ) {
398 
399  LogTrace ("HLTMuonVal") << "Jet # " << iJet
400  << " Et = " << theJets[iJet].et()
401  << endl;
402 
403  }
404 
405 }
Jets made from CaloTowers.
Definition: CaloJet.h:30
#define LogTrace(id)

Member Data Documentation

edm::InputTag HLTTopPlotter::CaloJetInputTag
private

Definition at line 91 of file HLTTopPlotter.h.

double HLTTopPlotter::EtaCut_
private

Definition at line 89 of file HLTTopPlotter.h.

std::vector<MonitorElement*> HLTTopPlotter::hDeltaRMaxJetLep
private

Definition at line 84 of file HLTTopPlotter.h.

std::vector<MonitorElement*> HLTTopPlotter::hJetMultip
private

Definition at line 85 of file HLTTopPlotter.h.

int HLTTopPlotter::NJets_
private

Definition at line 90 of file HLTTopPlotter.h.

double HLTTopPlotter::PtCut_
private

Definition at line 89 of file HLTTopPlotter.h.

std::vector<double> HLTTopPlotter::theJetMParameters
private

Definition at line 93 of file HLTTopPlotter.h.