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 | Private Member Functions | Private Attributes
EmDQMReco Class Reference

#include <EmDQMReco.h>

Inheritance diagram for EmDQMReco:
edm::EDAnalyzer

Classes

class  FourVectorMonitorElements
 

Public Member Functions

void analyze (const edm::Event &event, const edm::EventSetup &)
 
void beginJob ()
 
void beginRun (const edm::Run &, const edm::EventSetup &)
 
 EmDQMReco (const edm::ParameterSet &pset)
 Constructor. More...
 
void endJob ()
 
 ~EmDQMReco ()
 Destructor. More...
 
- Public Member Functions inherited from edm::EDAnalyzer
 EDAnalyzer ()
 
std::string workerType () const
 
virtual ~EDAnalyzer ()
 

Private Member Functions

template<class T >
void fillHistos (edm::Handle< trigger::TriggerEventWithRefs > &, const edm::Event &, unsigned int, std::vector< reco::Particle > &, bool, bool)
 

Private Attributes

DQMStoredbe
 
std::string dirname_
 
int eventnum
 
HLTConfigProvider hltConfig_
 
bool isHltConfigInitialized_
 
std::vector< std::vector
< edm::InputTag > > 
isoNames
 
unsigned int numOfHLTCollectionLabels
 
int pdgGen
 
unsigned int plotBins
 
std::vector< std::pair< double,
double > > 
plotBounds
 
double plotEtaMax
 
std::vector< bool > plotiso
 
double plotPhiMax
 
double plotPtMax
 
double plotPtMin
 
std::string processNameRecoMonPath
 
GreaterByPt< reco::ParticlepTComparator_
 
GreaterByPt< reco::GsfElectronpTRecoComparator_
 
unsigned int recocut_
 
edm::InputTag recocutCollection_
 
edm::InputTag recoElectronsInputTag
 
double recoEtaAcc
 
double recoEtAcc
 
unsigned int reqNum
 
std::vector< std::string > theHLTCollectionHumanNames
 
std::vector< edm::InputTagtheHLTCollectionLabels
 
std::string theHltName
 
std::vector< int > theHLTOutputTypes
 
edm::InputTag theL1Seed
 
MonitorElementtotalmatchreco
 
MonitorElementtotalreco
 
std::string triggerNameRecoMonPath
 
bool useHumanReadableHistTitles
 
boost::ptr_vector
< FourVectorMonitorElements
standardHist
 
boost::ptr_vector
< FourVectorMonitorElements
histMatchReco
 
boost::ptr_vector
< FourVectorMonitorElements
histMatchRecoMonPath
 
boost::ptr_vector
< FourVectorMonitorElements
histHltObjMatchToReco
 
std::vector< MonitorElement * > etahistiso
 
std::vector< MonitorElement * > ethistiso
 
std::vector< MonitorElement * > phiHistIso
 
std::vector< MonitorElement * > etahistisomatchreco
 
std::vector< MonitorElement * > ethistisomatchreco
 
std::vector< MonitorElement * > phiHistIsoMatchReco
 
std::vector< MonitorElement * > histEtIsoOfHltObjMatchToReco
 
std::vector< MonitorElement * > histEtaIsoOfHltObjMatchToReco
 
std::vector< MonitorElement * > histPhiIsoOfHltObjMatchToReco
 
reco histograms
boost::scoped_ptr
< FourVectorMonitorElements
histReco
 
boost::scoped_ptr
< FourVectorMonitorElements
histRecoMonpath
 
boost::scoped_ptr
< FourVectorMonitorElements
histMonpath
 

Additional Inherited Members

- Public Types inherited from edm::EDAnalyzer
typedef EDAnalyzer ModuleType
 
typedef WorkerT< EDAnalyzerWorkerType
 
- Static Public Member Functions inherited from edm::EDAnalyzer
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &)
 
- Protected Member Functions inherited from edm::EDAnalyzer
CurrentProcessingContext const * currentContext () const
 

Detailed Description

Definition at line 26 of file EmDQMReco.h.

Constructor & Destructor Documentation

EmDQMReco::EmDQMReco ( const edm::ParameterSet pset)
explicit

Constructor.

Definition at line 101 of file EmDQMReco.cc.

References dbe, dirname_, eventnum, filters, edm::ParameterSet::getParameter(), edm::ParameterSet::getUntrackedParameter(), i, isHltConfigInitialized_, isoNames, numOfHLTCollectionLabels, cppFunctionSkipper::operator, pdgGen, plotBins, plotBounds, plotEtaMax, plotiso, plotPhiMax, plotPtMax, plotPtMin, processNameRecoMonPath, recocut_, recoElectronsInputTag, recoEtaAcc, recoEtAcc, reqNum, DQMStore::setCurrentFolder(), DQMStore::setVerbose(), theHLTCollectionHumanNames, theHLTCollectionLabels, theHLTOutputTypes, triggerNameRecoMonPath, and useHumanReadableHistTitles.

102 {
103 
105  dbe->setVerbose(0);
106 
107 
109  // Read from configuration file //
111  dirname_="HLT/HLTEgammaValidation/"+pset.getParameter<std::string>("@module_label");
113 
114  // parameters for generator study
115  reqNum = pset.getParameter<unsigned int>("reqNum");
116  pdgGen = pset.getParameter<int>("pdgGen");
117  recoEtaAcc = pset.getParameter<double>("genEtaAcc");
118  recoEtAcc = pset.getParameter<double>("genEtAcc");
119  // plotting parameters (untracked because they don't affect the physics)
120  plotPtMin = pset.getUntrackedParameter<double>("PtMin",0.);
121  plotPtMax = pset.getUntrackedParameter<double>("PtMax",1000.);
122  plotEtaMax = pset.getUntrackedParameter<double>("EtaMax", 2.7);
123  plotPhiMax = pset.getUntrackedParameter<double>("PhiMax", 3.15);
124  plotBins = pset.getUntrackedParameter<unsigned int>("Nbins",50);
125  useHumanReadableHistTitles = pset.getUntrackedParameter<bool>("useHumanReadableHistTitles", false);
126 
127  triggerNameRecoMonPath = pset.getUntrackedParameter<std::string>("triggerNameRecoMonPath","HLT_MinBias");
128  processNameRecoMonPath = pset.getUntrackedParameter<std::string>("processNameRecoMonPath","HLT");
129 
130  recoElectronsInputTag = pset.getUntrackedParameter<edm::InputTag>("recoElectrons",edm::InputTag("gsfElectrons"));
131 
132  // preselction cuts
133  // recocutCollection_= pset.getParameter<edm::InputTag>("cutcollection");
134  recocut_ = pset.getParameter<int>("cutnum");
135 
136  // prescale = 10;
137  eventnum = 0;
138 
139  // just init
140  isHltConfigInitialized_ = false;
141 
143  // Read in the Vector of Parameter Sets. //
144  // Information for each filter-step //
146  std::vector<edm::ParameterSet> filters =
147  pset.getParameter<std::vector<edm::ParameterSet> >("filters");
148 
149  int i = 0;
150  for(std::vector<edm::ParameterSet>::iterator filterconf = filters.begin() ; filterconf != filters.end() ; filterconf++)
151  {
152 
153  theHLTCollectionLabels.push_back(filterconf->getParameter<edm::InputTag>("HLTCollectionLabels"));
154  theHLTOutputTypes.push_back(filterconf->getParameter<int>("theHLTOutputTypes"));
155  // Grab the human-readable name, if it is not specified, use the Collection Label
156  theHLTCollectionHumanNames.push_back(filterconf->getUntrackedParameter<std::string>("HLTCollectionHumanName",theHLTCollectionLabels[i].label()));
157 
158  std::vector<double> bounds = filterconf->getParameter<std::vector<double> >("PlotBounds");
159  // If the size of plot "bounds" vector != 2, abort
160  assert(bounds.size() == 2);
161  plotBounds.push_back(std::pair<double,double>(bounds[0],bounds[1]));
162  isoNames.push_back(filterconf->getParameter<std::vector<edm::InputTag> >("IsoCollections"));
163  // If the size of the isoNames vector is not greater than zero, abort
164  assert(isoNames.back().size()>0);
165  if (isoNames.back().at(0).label()=="none") {
166  plotiso.push_back(false);
167  } else {
168  plotiso.push_back(true);
169  }
170  i++;
171  } // END of loop over parameter sets
172 
173  // Record number of HLTCollectionLabels
175 
176 }
int pdgGen
Definition: EmDQMReco.h:101
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
int i
Definition: DBlmapReader.cc:9
std::vector< std::vector< edm::InputTag > > isoNames
Definition: EmDQMReco.h:90
std::string dirname_
Definition: EmDQMReco.h:204
int eventnum
Definition: EmDQMReco.h:199
std::vector< int > theHLTOutputTypes
Definition: EmDQMReco.h:88
unsigned int plotBins
Definition: EmDQMReco.h:111
std::vector< TPRegexp > filters
Definition: eve_filter.cc:25
bool isHltConfigInitialized_
Definition: EmDQMReco.h:94
double recoEtaAcc
Definition: EmDQMReco.h:102
double recoEtAcc
Definition: EmDQMReco.h:103
std::vector< std::string > theHLTCollectionHumanNames
Definition: EmDQMReco.h:86
unsigned int numOfHLTCollectionLabels
Definition: EmDQMReco.h:83
void setVerbose(unsigned level)
Definition: DQMStore.cc:393
DQMStore * dbe
Definition: EmDQMReco.h:203
unsigned int recocut_
Definition: EmDQMReco.h:115
std::string triggerNameRecoMonPath
Definition: EmDQMReco.h:119
std::vector< bool > plotiso
Definition: EmDQMReco.h:89
bool useHumanReadableHistTitles
Definition: EmDQMReco.h:85
double plotPhiMax
Definition: EmDQMReco.h:108
unsigned int reqNum
Definition: EmDQMReco.h:100
std::vector< std::pair< double, double > > plotBounds
Definition: EmDQMReco.h:91
std::vector< edm::InputTag > theHLTCollectionLabels
Definition: EmDQMReco.h:81
double plotPtMin
Definition: EmDQMReco.h:106
double plotPtMax
Definition: EmDQMReco.h:107
edm::InputTag recoElectronsInputTag
Definition: EmDQMReco.h:129
double plotEtaMax
Definition: EmDQMReco.h:105
std::string processNameRecoMonPath
Definition: EmDQMReco.h:124
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:429
EmDQMReco::~EmDQMReco ( )

Destructor.

Definition at line 490 of file EmDQMReco.cc.

490  {
491 }

Member Function Documentation

void EmDQMReco::analyze ( const edm::Event event,
const edm::EventSetup setup 
)
virtual

NOTE: hltConfigProvider initialization has been moved to beginRun()

Implements edm::EDAnalyzer.

Definition at line 498 of file EmDQMReco.cc.

References reco::Particle::energy(), event(), eventnum, MonitorElement::Fill(), histReco, histRecoMonpath, hltConfig_, i, isHltConfigInitialized_, edm::HandleBase::isValid(), n, numOfHLTCollectionLabels, p4, pdgGen, funct::pow(), processNameRecoMonPath, pTComparator_, recocut_, recoElectronsInputTag, reqNum, findQualityFiles::size, python.multivaluedict::sort(), mathSSE::sqrt(), theHLTOutputTypes, totalmatchreco, totalreco, trigger::TriggerCluster, trigger::TriggerElectron, HLTConfigProvider::triggerIndex(), trigger::TriggerL1IsoEG, trigger::TriggerL1NoIsoEG, triggerNameRecoMonPath, and trigger::TriggerPhoton.

499 {
500 
501  // protect from hlt config failure
502  if( !isHltConfigInitialized_ ) return;
503 
504  eventnum++;
505  bool plotMonpath = false;
506  bool plotReco = true;
507 
511 
512  if (pdgGen == 11) {
513 
514  event.getByLabel(recoElectronsInputTag, recoObjects);
515 
516  if (recoObjects->size() < (unsigned int)recocut_) {
517  // edm::LogWarning("EmDQMReco") << "Less than "<< recocut_ <<" Reco particles with pdgId=" << pdgGen << ". Only " << cutRecoCounter->size() << " particles.";
518  return;
519  }
520  } else if (pdgGen == 22) {
521 
522  event.getByLabel("correctedHybridSuperClusters", recoObjectsEB);
523  event.getByLabel("correctedMulti5x5SuperClustersWithPreshower", recoObjectsEE);
524 
525  if (recoObjectsEB->size() + recoObjectsEE->size() < (unsigned int)recocut_) {
526  // edm::LogWarning("EmDQMReco") << "Less than "<< recocut_ <<" Reco particles with pdgId=" << pdgGen << ". Only " << cutRecoCounter.size() << " particles.";
527  return;
528  }
529  }
530 
532  event.getByLabel(edm::InputTag("TriggerResults","",processNameRecoMonPath), HLTR);
533 
538 
539  /* if (theHLTCollectionHumanNames[0] == "hltL1sRelaxedSingleEgammaEt8"){
540  triggerIndex = hltConfig.triggerIndex("HLT_L1SingleEG8");
541  } else if (theHLTCollectionHumanNames[0] == "hltL1sRelaxedSingleEgammaEt5") {
542  triggerIndex = hltConfig.triggerIndex("HLT_L1SingleEG5");
543  } else if (theHLTCollectionHumanNames[0] == "hltL1sRelaxedDoubleEgammaEt5") {
544  triggerIndex = hltConfig.triggerIndex("HLT_L1DoubleEG5");
545  } else {
546  triggerIndex = hltConfig.triggerIndex("");
547  } */
548 
549  unsigned int triggerIndex;
551 
552  //triggerIndex must be less than the size of HLTR or you get a CMSException
553  bool isFired = false;
554  if (triggerIndex < HLTR->size()){
555  isFired = HLTR->accept(triggerIndex);
556  }
557 
558  // fill L1 and HLT info
559  // get objects possed by each filter
561  event.getByLabel("hltTriggerSummaryRAW",triggerObj);
562  if(!triggerObj.isValid()) {
563  edm::LogWarning("EmDQMReco") << "RAW-type HLT results not found, skipping event";
564  return;
565  }
566 
568  // Fill the bin labeled "Total" //
569  // This will be the number of events looked at. //
573 
574  /* edm::Handle< edm::View<reco::GsfElectron> > recoParticles;
575  event.getByLabel("gsfElectrons", recoParticles);
576 
577  std::vector<reco::GsfElectron> allSortedRecoParticles;
578 
579  for(edm::View<reco::GsfElectron>::const_iterator currentRecoParticle = recoParticles->begin(); currentRecoParticle != recoParticles->end(); currentRecoParticle++){
580  if ( !((*currentRecoParticle).et() > 2.0) ) continue;
581  reco::GsfElectron tmpcand( *(currentRecoParticle) );
582  allSortedRecoParticles.push_back(tmpcand);
583  }
584 
585  std::sort(allSortedRecoParticles.begin(), allSortedRecoParticles.end(),pTRecoComparator_);*/
586 
587  // Were enough high energy gen particles found?
588  // It was an event worth keeping. Continue.
589 
591  // Fill the bin labeled "Total" //
592  // This will be the number of events looked at. //
594  //total->Fill(numOfHLTCollectionLabels+0.5);
595  //totalmatch->Fill(numOfHLTCollectionLabels+0.5);
596 
597 
599  // Fill reconstruction info //
601  // the recocut_ highest Et generator objects of the preselected type are our matches
602 
603  std::vector<reco::Particle> sortedReco;
604  if (plotReco == true) {
605  if (pdgGen == 11) {
606  for(edm::View<reco::Candidate>::const_iterator recopart = recoObjects->begin(); recopart != recoObjects->end();recopart++){
607  reco::Particle tmpcand( recopart->charge(), recopart->p4(), recopart->vertex(),recopart->pdgId(),recopart->status() );
608  sortedReco.push_back(tmpcand);
609  }
610  }
611  else if (pdgGen == 22) {
612  for(std::vector<reco::SuperCluster>::const_iterator recopart2 = recoObjectsEB->begin(); recopart2 != recoObjectsEB->end();recopart2++){
613  float en = recopart2->energy();
614  float er = sqrt(pow(recopart2->x(),2) + pow(recopart2->y(),2) + pow(recopart2->z(),2) );
615  float px = recopart2->energy()*recopart2->x()/er;
616  float py = recopart2->energy()*recopart2->y()/er;
617  float pz = recopart2->energy()*recopart2->z()/er;
618  reco::Candidate::LorentzVector thisLV(px,py,pz,en);
619  reco::Particle tmpcand( 0, thisLV, math::XYZPoint(0.,0.,0.), 22, 1 );
620  sortedReco.push_back(tmpcand);
621  }
622  for(std::vector<reco::SuperCluster>::const_iterator recopart2 = recoObjectsEE->begin(); recopart2 != recoObjectsEE->end();recopart2++){
623  float en = recopart2->energy();
624  float er = sqrt(pow(recopart2->x(),2) + pow(recopart2->y(),2) + pow(recopart2->z(),2) );
625  float px = recopart2->energy()*recopart2->x()/er;
626  float py = recopart2->energy()*recopart2->y()/er;
627  float pz = recopart2->energy()*recopart2->z()/er;
628  reco::Candidate::LorentzVector thisLV(px,py,pz,en);
629  reco::Particle tmpcand( 0, thisLV, math::XYZPoint(0.,0.,0.), 22, 1 );
630  sortedReco.push_back(tmpcand);
631  }
632  }
633 
634  std::sort(sortedReco.begin(),sortedReco.end(),pTComparator_ );
635 
636  // Now the collection of gen particles is sorted by pt.
637  // So, remove all particles from the collection so that we
638  // only have the top "1 thru recocut_" particles in it
639 
640  sortedReco.erase(sortedReco.begin()+recocut_,sortedReco.end());
641 
642  for (unsigned int i = 0 ; i < recocut_ ; i++ ) {
643  //validity has been implicitily checked by the cut on recocut_ above
644  histReco->fill(sortedReco[i].p4());
645 
646 // etreco ->Fill( sortedReco[i].et() );
647 // etareco->Fill( sortedReco[i].eta() );
648 // phiReco->Fill( sortedReco[i].phi() );
649 
650  if (isFired) {
651  histRecoMonpath->fill(sortedReco[i].p4());
652  plotMonpath = true;
653  }
654 
655  } // END of loop over Reconstructed particles
656 
657  if (recocut_ >= reqNum) totalreco->Fill(numOfHLTCollectionLabels+1.5); // this isn't really needed anymore keep for backward comp.
658  if (recocut_ >= reqNum) totalmatchreco->Fill(numOfHLTCollectionLabels+1.5); // this isn't really needed anymore keep for backward comp.
659 
660  }
661 
662 
663 
664 
666  // Loop over filter modules //
668  for(unsigned int n=0; n < numOfHLTCollectionLabels ; n++) {
669  // These numbers are from the Parameter Set, such as:
670  // theHLTOutputTypes = cms.uint32(100)
671  switch(theHLTOutputTypes[n])
672  {
673  case trigger::TriggerL1NoIsoEG: // Non-isolated Level 1
674  fillHistos<l1extra::L1EmParticleCollection>(triggerObj,event,n, sortedReco, plotReco, plotMonpath);break;
675  case trigger::TriggerL1IsoEG: // Isolated Level 1
676  fillHistos<l1extra::L1EmParticleCollection>(triggerObj,event,n, sortedReco, plotReco, plotMonpath);break;
677  case trigger::TriggerPhoton: // Photon
678  fillHistos<reco::RecoEcalCandidateCollection>(triggerObj,event,n, sortedReco, plotReco, plotMonpath);break;
679  case trigger::TriggerElectron: // Electron
680  fillHistos<reco::ElectronCollection>(triggerObj,event,n, sortedReco, plotReco, plotMonpath);break;
681  case trigger::TriggerCluster: // TriggerCluster
682  fillHistos<reco::RecoEcalCandidateCollection>(triggerObj,event,n, sortedReco, plotReco, plotMonpath);break;
683  default:
684  throw(cms::Exception("Release Validation Error") << "HLT output type not implemented: theHLTOutputTypes[n]" );
685  }
686  } // END of loop over filter modules
687 }
int pdgGen
Definition: EmDQMReco.h:101
int i
Definition: DBlmapReader.cc:9
boost::indirect_iterator< typename seq_t::const_iterator > const_iterator
Definition: View.h:81
double energy() const
energy
Definition: Particle.h:75
int eventnum
Definition: EmDQMReco.h:199
std::vector< int > theHLTOutputTypes
Definition: EmDQMReco.h:88
bool isHltConfigInitialized_
Definition: EmDQMReco.h:94
void Fill(long long x)
HLTConfigProvider hltConfig_
Definition: EmDQMReco.h:93
unsigned int triggerIndex(const std::string &triggerName) const
slot position of trigger path in trigger table (0 to size-1)
GreaterByPt< reco::Particle > pTComparator_
Definition: EmDQMReco.h:207
unsigned int numOfHLTCollectionLabels
Definition: EmDQMReco.h:83
T sqrt(T t)
Definition: SSEVec.h:46
double p4[4]
Definition: TauolaWrapper.h:92
MonitorElement * totalreco
Definition: EmDQMReco.h:178
MonitorElement * totalmatchreco
Definition: EmDQMReco.h:179
unsigned int recocut_
Definition: EmDQMReco.h:115
How EventSelector::AcceptEvent() decides whether to accept an event for output otherwise it is excluding the probing of A single or multiple positive and the trigger will pass if any such matching triggers are PASS or EXCEPTION[A criterion thatmatches no triggers at all is detected and causes a throw.] A single negative with an expectation of appropriate bit checking in the decision and the trigger will pass if any such matching triggers are FAIL or EXCEPTION A wildcarded negative criterion that matches more than one trigger in the trigger but the state exists so we define the behavior If all triggers are the negative crieriion will lead to accepting the event(this again matches the behavior of"!*"before the partial wildcard feature was incorporated).The per-event"cost"of each negative criterion with multiple relevant triggers is about the same as!*was in the past
bool isValid() const
Definition: HandleBase.h:76
std::string triggerNameRecoMonPath
Definition: EmDQMReco.h:119
unsigned int reqNum
Definition: EmDQMReco.h:100
boost::scoped_ptr< FourVectorMonitorElements > histRecoMonpath
Definition: EmDQMReco.h:191
XYZPointD XYZPoint
point in space with cartesian internal representation
Definition: Point3D.h:13
math::XYZTLorentzVector LorentzVector
Lorentz vector.
Definition: Candidate.h:38
edm::InputTag recoElectronsInputTag
Definition: EmDQMReco.h:129
std::string processNameRecoMonPath
Definition: EmDQMReco.h:124
boost::scoped_ptr< FourVectorMonitorElements > histReco
Definition: EmDQMReco.h:186
tuple size
Write out results.
Power< A, B >::type pow(const A &a, const B &b)
Definition: Power.h:40
void EmDQMReco::beginJob ( void  )
virtual

Reimplemented from edm::EDAnalyzer.

Definition at line 198 of file EmDQMReco.cc.

References DQMStore::book1D(), DQMStore::book2D(), dbe, dirname_, etahistiso, etahistisomatchreco, ethistiso, ethistisomatchreco, histEtaIsoOfHltObjMatchToReco, histEtIsoOfHltObjMatchToReco, histHltObjMatchToReco, histMatchReco, histMatchRecoMonPath, histMonpath, histPhiIsoOfHltObjMatchToReco, histReco, histRecoMonpath, i, diffTwoXMLs::label, NULL, numOfHLTCollectionLabels, pdgGen, phiHistIso, phiHistIsoMatchReco, plotBins, plotBounds, plotEtaMax, plotiso, plotPhiMax, plotPtMax, plotPtMin, MonitorElement::setBinLabel(), DQMStore::setCurrentFolder(), standardHist, theHLTCollectionHumanNames, theHLTCollectionLabels, totalmatchreco, totalreco, and useHumanReadableHistTitles.

199 {
200  //edm::Service<TFileService> fs;
202 
204  // Set up Histogram of Effiency vs Step. //
205  // theHLTCollectionLabels is a vector of InputTags //
206  // from the configuration file. //
208 
209  std::string histName="total_eff";
210  std::string histTitle = "total events passing";
211  // This plot will have bins equal to 2+(number of
212  // HLTCollectionLabels in the config file)
213  totalreco = dbe->book1D(histName.c_str(),histTitle.c_str(),numOfHLTCollectionLabels+2,0,numOfHLTCollectionLabels+2);
216  for (unsigned int u=0; u<numOfHLTCollectionLabels; u++){totalreco->setBinLabel(u+1,theHLTCollectionLabels[u].label().c_str());}
217 
218  histName="total_eff_RECO_matched";
219  histTitle="total events passing (Reco matched)";
220  totalmatchreco = dbe->book1D(histName.c_str(),histTitle.c_str(),numOfHLTCollectionLabels+2,0,numOfHLTCollectionLabels+2);
221  totalmatchreco->setBinLabel(numOfHLTCollectionLabels+1,"Total");
222  totalmatchreco->setBinLabel(numOfHLTCollectionLabels+2,"Reco");
223  for (unsigned int u=0; u<numOfHLTCollectionLabels; u++){totalmatchreco->setBinLabel(u+1,theHLTCollectionLabels[u].label().c_str());}
224 
225  // MonitorElement* tmphisto;
226  MonitorElement* tmpiso;
227 
229  // Set up generator-level histograms //
231  std::string pdgIdString;
232  switch(pdgGen) {
233  case 11:
234  pdgIdString="Electron";break;
235  case 22:
236  pdgIdString="Photon";break;
237  default:
238  pdgIdString="Particle";
239  }
240 
241  //--------------------
242 
243  // reco
244  // (note that reset(..) must be used to set the value of the scoped_ptr...)
245  histReco.reset(
246  new FourVectorMonitorElements(this,
247  "reco_%s", // pattern for histogram name
248  "%s of " + pdgIdString + "s"
249  ));
250 
251  //--------------------
252 
253  // monpath
254  histRecoMonpath.reset(
255  new FourVectorMonitorElements(this,
256  "reco_%s_monpath", // pattern for histogram name
257  "%s of " + pdgIdString + "s monpath"
258  )
259  );
260 
261  //--------------------
262 
263  // TODO: WHAT ARE THESE HISTOGRAMS FOR ? THEY SEEM NEVER REFERENCED ANYWHERE IN THIS FILE...
264  // final X monpath
265  histMonpath.reset(
266  new FourVectorMonitorElements(this,
267  "final_%s_monpath", // pattern for histogram name
268  "Final %s Monpath"
269  )
270  );
271 
272  //--------------------
273 
275  // Set up histograms of HLT objects //
277 
278  // Determine what strings to use for histogram titles
279  std::vector<std::string> HltHistTitle;
280  if ( theHLTCollectionHumanNames.size() == numOfHLTCollectionLabels && useHumanReadableHistTitles ) {
281  HltHistTitle = theHLTCollectionHumanNames;
282  } else {
283  for (unsigned int i =0; i < numOfHLTCollectionLabels; i++) {
284  HltHistTitle.push_back(theHLTCollectionLabels[i].label());
285  }
286  }
287 
288  for(unsigned int i = 0; i< numOfHLTCollectionLabels ; i++){
289  //--------------------
290  // distributions of HLT objects passing filter i
291  //--------------------
292 
293 // // Et
294 // histName = theHLTCollectionLabels[i].label()+"et_all";
295 // histTitle = HltHistTitle[i]+" Et (ALL)";
296 // tmphisto = dbe->book1D(histName.c_str(),histTitle.c_str(),plotBins,plotPtMin,plotPtMax);
297 // ethist.push_back(tmphisto);
298 //
299 // // Eta
300 // histName = theHLTCollectionLabels[i].label()+"eta_all";
301 // histTitle = HltHistTitle[i]+" #eta (ALL)";
302 // tmphisto = dbe->book1D(histName.c_str(),histTitle.c_str(),plotBins,-plotEtaMax,plotEtaMax);
303 // etahist.push_back(tmphisto);
304 //
305 // // phi
306 // histName = theHLTCollectionLabels[i].label()+"phi_all";
307 // histTitle = HltHistTitle[i]+" #phi (ALL)";
308 // tmphisto = dbe->book1D(histName.c_str(),histTitle.c_str(),plotBins,-plotPhiMax,plotPhiMax);
309 // phiHist.push_back(tmphisto);
310 
311  standardHist.push_back(new FourVectorMonitorElements(this,
312  theHLTCollectionLabels[i].label()+"%s_all", // histogram name
313  HltHistTitle[i]+" %s (ALL)" // histogram title
314  ));
315 
316  //--------------------
317  // distributions of reco object matching HLT object passing filter i
318  //--------------------
319 
320  // Et
321 // histName = theHLTCollectionLabels[i].label()+"et_RECO_matched";
322 // histTitle = HltHistTitle[i]+" Et (RECO matched)";
323 // tmphisto = dbe->book1D(histName.c_str(),histTitle.c_str(),plotBins,plotPtMin,plotPtMax);
324 // ethistmatchreco.push_back(tmphisto);
325 
326 // // Eta
327 // histName = theHLTCollectionLabels[i].label()+"eta_RECO_matched";
328 // histTitle = HltHistTitle[i]+" #eta (RECO matched)";
329 // tmphisto = dbe->book1D(histName.c_str(),histTitle.c_str(),plotBins,-plotEtaMax,plotEtaMax);
330 // etahistmatchreco.push_back(tmphisto);
331 //
332 // // phi
333 // histName = theHLTCollectionLabels[i].label()+"phi_RECO_matched";
334 // histTitle = HltHistTitle[i]+" #phi (RECO matched)";
335 // tmphisto = dbe->book1D(histName.c_str(),histTitle.c_str(),plotBins,-plotPhiMax,plotPhiMax);
336 // phiHistMatchReco.push_back(tmphisto);
337  histMatchReco.push_back(new FourVectorMonitorElements(this,
338  theHLTCollectionLabels[i].label()+"%s_RECO_matched", // histogram name
339  HltHistTitle[i]+" %s (RECO matched)" // histogram title
340  ));
341 
342  //--------------------
343  // distributions of reco object matching HLT object passing filter i
344  //--------------------
345 
346 // // Et
347 // histName = theHLTCollectionLabels[i].label()+"et_RECO_matched_monpath";
348 // histTitle = HltHistTitle[i]+" Et (RECO matched, monpath)";
349 // tmphisto = dbe->book1D(histName.c_str(),histTitle.c_str(),plotBins,plotPtMin,plotPtMax);
350 // ethistmatchrecomonpath.push_back(tmphisto);
351 //
352 // // Eta
353 // histName = theHLTCollectionLabels[i].label()+"eta_RECO_matched_monpath";
354 // histTitle = HltHistTitle[i]+" #eta (RECO matched, monpath)";
355 // tmphisto = dbe->book1D(histName.c_str(),histTitle.c_str(),plotBins,-plotEtaMax,plotEtaMax);
356 // etahistmatchrecomonpath.push_back(tmphisto);
357 //
358 // // phi
359 // histName = theHLTCollectionLabels[i].label()+"phi_RECO_matched_monpath";
360 // histTitle = HltHistTitle[i]+" #phi (RECO matched, monpath)";
361 // tmphisto = dbe->book1D(histName.c_str(),histTitle.c_str(),plotBins,-plotPhiMax,plotPhiMax);
362 // phiHistMatchRecoMonPath.push_back(tmphisto);
363 
364  histMatchRecoMonPath.push_back(new FourVectorMonitorElements(this,
365  theHLTCollectionLabels[i].label()+"%s_RECO_matched_monpath", // histogram name
366  HltHistTitle[i]+" %s (RECO matched, monpath)" // histogram title
367  ));
368  //--------------------
369  // distributions of HLT object that is closest delta-R match to sorted reco particle(s)
370  //--------------------
371 
372  // Et
373 // histName = theHLTCollectionLabels[i].label()+"et_reco";
374 // histTitle = HltHistTitle[i]+" Et (reco)";
375 // tmphisto = dbe->book1D(histName.c_str(),histTitle.c_str(),plotBins,plotPtMin,plotPtMax);
376 // histEtOfHltObjMatchToReco.push_back(tmphisto);
377 //
378 // // eta
379 // histName = theHLTCollectionLabels[i].label()+"eta_reco";
380 // histTitle = HltHistTitle[i]+" eta (reco)";
381 // tmphisto = dbe->book1D(histName.c_str(),histTitle.c_str(),plotBins,-plotEtaMax,plotEtaMax);
382 // histEtaOfHltObjMatchToReco.push_back(tmphisto);
383 //
384 // // phi
385 // histName = theHLTCollectionLabels[i].label()+"phi_reco";
386 // histTitle = HltHistTitle[i]+" phi (reco)";
387 // tmphisto = dbe->book1D(histName.c_str(),histTitle.c_str(),plotBins,-plotPhiMax,plotPhiMax);
388 // histPhiOfHltObjMatchToReco.push_back(tmphisto);
389 
390  histHltObjMatchToReco.push_back(new FourVectorMonitorElements(this,
391  theHLTCollectionLabels[i].label()+"%s_reco", // histogram name
392  HltHistTitle[i]+" %s (reco)" // histogram title
393  ));
394 
395  //--------------------
396 
397  if (!plotiso[i]) {
398  tmpiso = NULL;
399  etahistiso.push_back(tmpiso);
400  ethistiso.push_back(tmpiso);
401  phiHistIso.push_back(tmpiso);
402 
403  etahistisomatchreco.push_back(tmpiso);
404  ethistisomatchreco.push_back(tmpiso);
405  phiHistIsoMatchReco.push_back(tmpiso);
406 
407  histEtaIsoOfHltObjMatchToReco.push_back(tmpiso);
408  histEtIsoOfHltObjMatchToReco.push_back(tmpiso);
409  histPhiIsoOfHltObjMatchToReco.push_back(tmpiso);
410 
411  } else {
412 
413  //--------------------
414  // 2D plot: Isolation values vs X for all objects
415  //--------------------
416 
417  // X = eta
418  histName = theHLTCollectionLabels[i].label()+"eta_isolation_all";
419  histTitle = HltHistTitle[i]+" isolation vs #eta (all)";
420  tmpiso = dbe->book2D(histName.c_str(),histTitle.c_str(),plotBins,-plotEtaMax,plotEtaMax,plotBins,plotBounds[i].first,plotBounds[i].second);
421  etahistiso.push_back(tmpiso);
422 
423  // X = et
424  histName = theHLTCollectionLabels[i].label()+"et_isolation_all";
425  histTitle = HltHistTitle[i]+" isolation vs Et (all)";
426  tmpiso = dbe->book2D(histName.c_str(),histTitle.c_str(),plotBins,plotPtMin,plotPtMax,plotBins,plotBounds[i].first,plotBounds[i].second);
427  ethistiso.push_back(tmpiso);
428 
429  // X = phi
430  histName = theHLTCollectionLabels[i].label()+"phi_isolation_all";
431  histTitle = HltHistTitle[i]+" isolation vs #phi (all)";
432  tmpiso = dbe->book2D(histName.c_str(),histTitle.c_str(),plotBins,-plotPhiMax,plotPhiMax,plotBins,plotBounds[i].first,plotBounds[i].second);
433  phiHistIso.push_back(tmpiso);
434 
435  //--------------------
436  // 2D plot: Isolation values vs X for reco matched objects
437  //--------------------
438 
439  // X = eta
440  histName = theHLTCollectionLabels[i].label()+"eta_isolation_RECO_matched";
441  histTitle = HltHistTitle[i]+" isolation vs #eta (reco matched)";
442  tmpiso = dbe->book2D(histName.c_str(),histTitle.c_str(),plotBins,-plotEtaMax,plotEtaMax,plotBins,plotBounds[i].first,plotBounds[i].second);
443  etahistisomatchreco.push_back(tmpiso);
444 
445  // X = et
446  histName = theHLTCollectionLabels[i].label()+"et_isolation_RECO_matched";
447  histTitle = HltHistTitle[i]+" isolation vs Et (reco matched)";
448  tmpiso = dbe->book2D(histName.c_str(),histTitle.c_str(),plotBins,plotPtMin,plotPtMax,plotBins,plotBounds[i].first,plotBounds[i].second);
449  ethistisomatchreco.push_back(tmpiso);
450 
451  // X = eta
452  histName = theHLTCollectionLabels[i].label()+"phi_isolation_RECO_matched";
453  histTitle = HltHistTitle[i]+" isolation vs #phi (reco matched)";
454  tmpiso = dbe->book2D(histName.c_str(),histTitle.c_str(),plotBins,-plotPhiMax,plotPhiMax,plotBins,plotBounds[i].first,plotBounds[i].second);
455  phiHistIsoMatchReco.push_back(tmpiso);
456 
457  //--------------------
458  // 2D plot: Isolation values vs X for HLT object that
459  // is closest delta-R match to sorted reco particle(s)
460  //--------------------
461 
462  // X = eta
463  histName = theHLTCollectionLabels[i].label()+"eta_isolation_reco";
464  histTitle = HltHistTitle[i]+" isolation vs #eta (reco)";
465  tmpiso = dbe->book2D(histName.c_str(),histTitle.c_str(),plotBins,-plotEtaMax,plotEtaMax,plotBins,plotBounds[i].first,plotBounds[i].second);
466  histEtaIsoOfHltObjMatchToReco.push_back(tmpiso);
467 
468  // X = et
469  histName = theHLTCollectionLabels[i].label()+"et_isolation_reco";
470  histTitle = HltHistTitle[i]+" isolation vs Et (reco)";
471  tmpiso = dbe->book2D(histName.c_str(),histTitle.c_str(),plotBins,plotPtMin,plotPtMax,plotBins,plotBounds[i].first,plotBounds[i].second);
472  histEtIsoOfHltObjMatchToReco.push_back(tmpiso);
473 
474  // X = phi
475  histName = theHLTCollectionLabels[i].label()+"phi_isolation_reco";
476  histTitle = HltHistTitle[i]+" isolation vs #phi (reco)";
477  tmpiso = dbe->book2D(histName.c_str(),histTitle.c_str(),plotBins,-plotPhiMax,plotPhiMax,plotBins,plotBounds[i].first,plotBounds[i].second);
478  histPhiIsoOfHltObjMatchToReco.push_back(tmpiso);
479  //--------------------
480 
481  } // END of HLT histograms
482 
483  }
484 }
int pdgGen
Definition: EmDQMReco.h:101
int i
Definition: DBlmapReader.cc:9
boost::ptr_vector< FourVectorMonitorElements > standardHist
Definition: EmDQMReco.h:141
MonitorElement * book1D(const char *name, const char *title, int nchX, double lowX, double highX)
Book 1D histogram.
Definition: DQMStore.cc:717
std::string dirname_
Definition: EmDQMReco.h:204
boost::ptr_vector< FourVectorMonitorElements > histMatchReco
Definition: EmDQMReco.h:146
std::vector< MonitorElement * > histEtIsoOfHltObjMatchToReco
Definition: EmDQMReco.h:171
void setBinLabel(int bin, const std::string &label, int axis=1)
set bin label for x, y or z axis (axis=1, 2, 3 respectively)
#define NULL
Definition: scimark2.h:8
std::vector< MonitorElement * > phiHistIso
Definition: EmDQMReco.h:165
unsigned int plotBins
Definition: EmDQMReco.h:111
std::vector< MonitorElement * > histEtaIsoOfHltObjMatchToReco
Definition: EmDQMReco.h:172
boost::ptr_vector< FourVectorMonitorElements > histMatchRecoMonPath
Definition: EmDQMReco.h:151
std::vector< std::string > theHLTCollectionHumanNames
Definition: EmDQMReco.h:86
unsigned int numOfHLTCollectionLabels
Definition: EmDQMReco.h:83
MonitorElement * totalreco
Definition: EmDQMReco.h:178
MonitorElement * totalmatchreco
Definition: EmDQMReco.h:179
DQMStore * dbe
Definition: EmDQMReco.h:203
std::vector< MonitorElement * > ethistisomatchreco
Definition: EmDQMReco.h:168
std::vector< bool > plotiso
Definition: EmDQMReco.h:89
bool useHumanReadableHistTitles
Definition: EmDQMReco.h:85
double plotPhiMax
Definition: EmDQMReco.h:108
boost::scoped_ptr< FourVectorMonitorElements > histRecoMonpath
Definition: EmDQMReco.h:191
std::vector< MonitorElement * > etahistiso
Definition: EmDQMReco.h:163
boost::scoped_ptr< FourVectorMonitorElements > histMonpath
Definition: EmDQMReco.h:196
std::vector< MonitorElement * > etahistisomatchreco
Definition: EmDQMReco.h:167
std::vector< std::pair< double, double > > plotBounds
Definition: EmDQMReco.h:91
std::vector< edm::InputTag > theHLTCollectionLabels
Definition: EmDQMReco.h:81
double plotPtMin
Definition: EmDQMReco.h:106
double plotPtMax
Definition: EmDQMReco.h:107
boost::ptr_vector< FourVectorMonitorElements > histHltObjMatchToReco
Definition: EmDQMReco.h:157
double plotEtaMax
Definition: EmDQMReco.h:105
std::vector< MonitorElement * > ethistiso
Definition: EmDQMReco.h:164
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:845
boost::scoped_ptr< FourVectorMonitorElements > histReco
Definition: EmDQMReco.h:186
std::vector< MonitorElement * > phiHistIsoMatchReco
Definition: EmDQMReco.h:169
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:429
std::vector< MonitorElement * > histPhiIsoOfHltObjMatchToReco
Definition: EmDQMReco.h:173
void EmDQMReco::beginRun ( const edm::Run iRun,
const edm::EventSetup iSetup 
)
virtual

Reimplemented from edm::EDAnalyzer.

Definition at line 183 of file EmDQMReco.cc.

References hltConfig_, HLTConfigProvider::init(), and isHltConfigInitialized_.

183  {
184 
185  bool isHltConfigChanged = false; // change of cfg at run boundaries?
186  isHltConfigInitialized_ = hltConfig_.init( iRun, iSetup, "HLT", isHltConfigChanged );
187 
188 }
bool isHltConfigInitialized_
Definition: EmDQMReco.h:94
HLTConfigProvider hltConfig_
Definition: EmDQMReco.h:93
bool init(const edm::Run &iRun, const edm::EventSetup &iSetup, const std::string &processName, bool &changed)
d&#39;tor
void EmDQMReco::endJob ( void  )
virtual

Reimplemented from edm::EDAnalyzer.

Definition at line 890 of file EmDQMReco.cc.

890  {
891 
892 }
template<class T >
void EmDQMReco::fillHistos ( edm::Handle< trigger::TriggerEventWithRefs > &  triggerObj,
const edm::Event iEvent,
unsigned int  n,
std::vector< reco::Particle > &  sortedReco,
bool  plotReco,
bool  plotMonpath 
)
private

Definition at line 694 of file EmDQMReco.cc.

References asciidump::at, deltaR(), eta(), etahistiso, etahistisomatchreco, ethistiso, ethistisomatchreco, MonitorElement::Fill(), edm::Event::getByLabel(), histEtaIsoOfHltObjMatchToReco, histEtIsoOfHltObjMatchToReco, histHltObjMatchToReco, histMatchReco, histMatchRecoMonPath, histPhiIsoOfHltObjMatchToReco, i, isoNames, edm::HandleBase::isValid(), j, n, numOfHLTCollectionLabels, p4, phi, phiHistIso, phiHistIsoMatchReco, plotiso, recocut_, reqNum, standardHist, theHLTCollectionLabels, theHLTOutputTypes, totalmatchreco, totalreco, trigger::TriggerL1IsoEG, and trigger::TriggerL1NoIsoEG.

695 {
696  std::vector<edm::Ref<T> > recoecalcands;
697  if ( ( triggerObj->filterIndex(theHLTCollectionLabels[n])>=triggerObj->size() )){ // only process if available
698  return;
699  }
700 
702  // Retrieve saved filter objects //
704  triggerObj->getObjects(triggerObj->filterIndex(theHLTCollectionLabels[n]),theHLTOutputTypes[n],recoecalcands);
705  //Danger: special case, L1 non-isolated
706  // needs to be merged with L1 iso
708  std::vector<edm::Ref<T> > isocands;
709  triggerObj->getObjects(triggerObj->filterIndex(theHLTCollectionLabels[n]),trigger::TriggerL1IsoEG,isocands);
710  if (isocands.size()>0)
711  {
712  for (unsigned int i=0; i < isocands.size(); i++)
713  recoecalcands.push_back(isocands[i]);
714  }
715  } // END of if theHLTOutputTypes == 82
716 
717 
718  if (recoecalcands.size() < 1){ // stop if no object passed the previous filter
719  return;
720  }
721 
722 
723  if (recoecalcands.size() >= reqNum )
724  totalreco->Fill(n+0.5);
725 
726 
728  // check for validity //
729  // prevents crash in CMSSW_3_1_0_pre6 //
731  for (unsigned int j=0; j<recoecalcands.size(); j++){
732  if(!( recoecalcands.at(j).isAvailable())){
733  edm::LogError("EmDQMReco") << "Event content inconsistent: TriggerEventWithRefs contains invalid Refs" << std::endl << "invalid refs for: " << theHLTCollectionLabels[n].label();
734  return;
735  }
736  }
737 
739  // Loop over all HLT objects in this filter step, and //
740  // fill histograms. //
742  // bool foundAllMatches = false;
743  // unsigned int numOfHLTobjectsMatched = 0;
744  for (unsigned int i=0; i<recoecalcands.size(); i++) {
745 
746  standardHist[n].fill(recoecalcands[i]->p4());
747 
749  // Plot isolation variables (show the not-yet-cut //
750  // isolation, i.e. associated to next filter) //
752  if ( n+1 < numOfHLTCollectionLabels ) { // can't plot beyond last
753  if (plotiso[n+1]) {
754  for (unsigned int j = 0 ; j < isoNames[n+1].size() ;j++ ){
756  iEvent.getByLabel(isoNames[n+1].at(j),depMap);
757  if (depMap.isValid()){ //Map may not exist if only one candidate passes a double filter
758  typename edm::AssociationMap<edm::OneToValue< T , float > >::const_iterator mapi = depMap->find(recoecalcands[i]);
759  if (mapi!=depMap->end()){ // found candidate in isolation map!
760  etahistiso[n+1]->Fill(recoecalcands[i]->eta(),mapi->val);
761  ethistiso[n+1]->Fill(recoecalcands[i]->et() ,mapi->val);
762  phiHistIso[n+1]->Fill(recoecalcands[i]->phi(),mapi->val);
763  }
764  }
765  }
766  }
767  } // END of if n+1 < then the number of hlt collections
768  }
769 
771  // Loop over the Reconstructed Particles, and find the //
772  // closest HLT object match. //
774  if (plotReco == true) {
775  for (unsigned int i=0; i < recocut_; i++) {
776  math::XYZVector currentRecoParticleMomentum = sortedReco[i].momentum();
777 
778  // float closestRecoDeltaR = 0.5;
779  float closestRecoDeltaR = 1000.;
780  int closestRecoEcalCandIndex = -1;
781  for (unsigned int j=0; j<recoecalcands.size(); j++) {
782  float deltaR = DeltaR(recoecalcands[j]->momentum(),currentRecoParticleMomentum);
783 
784  if (deltaR < closestRecoDeltaR) {
785  closestRecoDeltaR = deltaR;
786  closestRecoEcalCandIndex = j;
787  }
788  }
789 
790  // If an HLT object was found within some delta-R
791  // of this reco particle, store it in a histogram
792  if ( closestRecoEcalCandIndex >= 0 ) {
793 // histEtOfHltObjMatchToReco[n] ->Fill( recoecalcands[closestRecoEcalCandIndex]->et() );
794 // histEtaOfHltObjMatchToReco[n]->Fill( recoecalcands[closestRecoEcalCandIndex]->eta() );
795 // histPhiOfHltObjMatchToReco[n]->Fill( recoecalcands[closestRecoEcalCandIndex]->phi() );
796 
797  histHltObjMatchToReco[n].fill(recoecalcands[closestRecoEcalCandIndex]->p4());
798 
799  // Also store isolation info
800  if (n+1 < numOfHLTCollectionLabels){ // can't plot beyond last
801  if (plotiso[n+1] ){ // only plot if requested in config
802  for (unsigned int j = 0 ; j < isoNames[n+1].size() ;j++ ){
804  iEvent.getByLabel(isoNames[n+1].at(j),depMap);
805  if (depMap.isValid()){ //Map may not exist if only one candidate passes a double filter
806  typename edm::AssociationMap<edm::OneToValue< T , float > >::const_iterator mapi = depMap->find(recoecalcands[closestRecoEcalCandIndex]);
807  if (mapi!=depMap->end()) { // found candidate in isolation map!
808  histEtaIsoOfHltObjMatchToReco[n+1]->Fill( recoecalcands[closestRecoEcalCandIndex]->eta(),mapi->val);
809  histEtIsoOfHltObjMatchToReco[n+1] ->Fill( recoecalcands[closestRecoEcalCandIndex]->et(), mapi->val);
810  histPhiIsoOfHltObjMatchToReco[n+1] ->Fill( recoecalcands[closestRecoEcalCandIndex]->phi(), mapi->val);
811  }
812  }
813  }
814  }
815  }
816  } // END of if closestEcalCandIndex >= 0
817  }
818 
820  // Fill reco matched objects into histograms //
822  unsigned int mtachedRecoParts = 0;
823  float minrecodist=0.3;
824  if(n==0) minrecodist=0.5; //low L1-resolution => allow wider matching
825  for(unsigned int i =0; i < recocut_; i++){
826  //match generator candidate
827  bool matchThis= false;
828  math::XYZVector candDir=sortedReco[i].momentum();
829  unsigned int closest = 0;
830  double closestDr = 1000.;
831  for(unsigned int trigOb = 0 ; trigOb < recoecalcands.size(); trigOb++){
832  double dr = DeltaR(recoecalcands[trigOb]->momentum(),candDir);
833  if (dr < closestDr) {
834  closestDr = dr;
835  closest = trigOb;
836  }
837  if (closestDr > minrecodist) { // it's not really a "match" if it's that far away
838  closest = -1;
839  } else {
840  mtachedRecoParts++;
841  matchThis = true;
842  }
843  }
844  if ( !matchThis ) continue; // only plot matched candidates
845  // fill coordinates of mc particle matching trigger object
846 // ethistmatchreco[n] ->Fill( sortedReco[i].et() );
847 // etahistmatchreco[n]->Fill( sortedReco[i].eta() );
848 // phiHistMatchReco[n]->Fill( sortedReco[i].phi() );
849  histMatchReco[n].fill(sortedReco[i].p4());
850 
851  if (plotMonpath) {
852 // ethistmatchrecomonpath[n]->Fill( sortedReco[i].et() );
853 // etahistmatchrecomonpath[n]->Fill( sortedReco[i].eta() );
854 // phiHistMatchRecoMonPath[n]->Fill( sortedReco[i].phi() );
855  histMatchRecoMonPath[n].fill(sortedReco[i].p4());
856 
857  }
859  // Plot isolation variables (show the not-yet-cut //
860  // isolation, i.e. associated to next filter) //
862  if (n+1 < numOfHLTCollectionLabels){ // can't plot beyond last
863  if (plotiso[n+1] ){ // only plot if requested in config
864  for (unsigned int j = 0 ; j < isoNames[n+1].size() ;j++ ){
866  iEvent.getByLabel(isoNames[n+1].at(j),depMapReco);
867  if (depMapReco.isValid()){ //Map may not exist if only one candidate passes a double filter
868  typename edm::AssociationMap<edm::OneToValue< T , float > >::const_iterator mapi = depMapReco->find(recoecalcands[closest]);
869  if (mapi!=depMapReco->end()){ // found candidate in isolation map!
870  etahistisomatchreco[n+1]->Fill(sortedReco[i].eta(),mapi->val);
871  ethistisomatchreco[n+1]->Fill(sortedReco[i].et(),mapi->val);
872  phiHistIsoMatchReco[n+1]->Fill(sortedReco[i].eta(),mapi->val);
873  }
874  }
875  }
876  }
877  } // END of if n+1 < then the number of hlt collections
878  }
879  // fill total reco matched efficiency
880  if (mtachedRecoParts >= reqNum )
881  totalmatchreco->Fill(n+0.5);
882  }
883 
884 }
int i
Definition: DBlmapReader.cc:9
boost::ptr_vector< FourVectorMonitorElements > standardHist
Definition: EmDQMReco.h:141
std::vector< std::vector< edm::InputTag > > isoNames
Definition: EmDQMReco.h:90
Definition: deltaR.h:51
boost::ptr_vector< FourVectorMonitorElements > histMatchReco
Definition: EmDQMReco.h:146
std::vector< MonitorElement * > histEtIsoOfHltObjMatchToReco
Definition: EmDQMReco.h:171
std::vector< int > theHLTOutputTypes
Definition: EmDQMReco.h:88
T eta() const
std::vector< MonitorElement * > phiHistIso
Definition: EmDQMReco.h:165
std::vector< MonitorElement * > histEtaIsoOfHltObjMatchToReco
Definition: EmDQMReco.h:172
void Fill(long long x)
boost::ptr_vector< FourVectorMonitorElements > histMatchRecoMonPath
Definition: EmDQMReco.h:151
unsigned int numOfHLTCollectionLabels
Definition: EmDQMReco.h:83
double p4[4]
Definition: TauolaWrapper.h:92
MonitorElement * totalreco
Definition: EmDQMReco.h:178
int j
Definition: DBlmapReader.cc:9
MonitorElement * totalmatchreco
Definition: EmDQMReco.h:179
unsigned int recocut_
Definition: EmDQMReco.h:115
std::vector< MonitorElement * > ethistisomatchreco
Definition: EmDQMReco.h:168
bool isValid() const
Definition: HandleBase.h:76
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:356
std::vector< bool > plotiso
Definition: EmDQMReco.h:89
double deltaR(double eta1, double eta2, double phi1, double phi2)
Definition: TreeUtility.cc:17
unsigned int reqNum
Definition: EmDQMReco.h:100
std::vector< MonitorElement * > etahistiso
Definition: EmDQMReco.h:163
XYZVectorD XYZVector
spatial vector with cartesian internal representation
Definition: Vector3D.h:31
std::vector< MonitorElement * > etahistisomatchreco
Definition: EmDQMReco.h:167
std::vector< edm::InputTag > theHLTCollectionLabels
Definition: EmDQMReco.h:81
boost::ptr_vector< FourVectorMonitorElements > histHltObjMatchToReco
Definition: EmDQMReco.h:157
std::vector< MonitorElement * > ethistiso
Definition: EmDQMReco.h:164
std::vector< MonitorElement * > phiHistIsoMatchReco
Definition: EmDQMReco.h:169
std::vector< MonitorElement * > histPhiIsoOfHltObjMatchToReco
Definition: EmDQMReco.h:173
list at
Definition: asciidump.py:428
Definition: DDAxes.h:10

Member Data Documentation

DQMStore* EmDQMReco::dbe
private
std::string EmDQMReco::dirname_
private

Definition at line 204 of file EmDQMReco.h.

Referenced by beginJob(), and EmDQMReco().

std::vector<MonitorElement*> EmDQMReco::etahistiso
private

Isolation distributions

Definition at line 163 of file EmDQMReco.h.

Referenced by beginJob(), and fillHistos().

std::vector<MonitorElement*> EmDQMReco::etahistisomatchreco
private

Definition at line 167 of file EmDQMReco.h.

Referenced by beginJob(), and fillHistos().

std::vector<MonitorElement*> EmDQMReco::ethistiso
private

Definition at line 164 of file EmDQMReco.h.

Referenced by beginJob(), and fillHistos().

std::vector<MonitorElement*> EmDQMReco::ethistisomatchreco
private

Definition at line 168 of file EmDQMReco.h.

Referenced by beginJob(), and fillHistos().

int EmDQMReco::eventnum
private

Definition at line 199 of file EmDQMReco.h.

Referenced by analyze(), and EmDQMReco().

std::vector<MonitorElement*> EmDQMReco::histEtaIsoOfHltObjMatchToReco
private

Definition at line 172 of file EmDQMReco.h.

Referenced by beginJob(), and fillHistos().

std::vector<MonitorElement*> EmDQMReco::histEtIsoOfHltObjMatchToReco
private

Definition at line 171 of file EmDQMReco.h.

Referenced by beginJob(), and fillHistos().

boost::ptr_vector<FourVectorMonitorElements> EmDQMReco::histHltObjMatchToReco
private

Definition at line 157 of file EmDQMReco.h.

Referenced by beginJob(), and fillHistos().

boost::ptr_vector<FourVectorMonitorElements> EmDQMReco::histMatchReco
private

Definition at line 146 of file EmDQMReco.h.

Referenced by beginJob(), and fillHistos().

boost::ptr_vector<FourVectorMonitorElements> EmDQMReco::histMatchRecoMonPath
private

Definition at line 151 of file EmDQMReco.h.

Referenced by beginJob(), and fillHistos().

boost::scoped_ptr<FourVectorMonitorElements> EmDQMReco::histMonpath
private

Definition at line 196 of file EmDQMReco.h.

Referenced by beginJob().

std::vector<MonitorElement*> EmDQMReco::histPhiIsoOfHltObjMatchToReco
private

Definition at line 173 of file EmDQMReco.h.

Referenced by beginJob(), and fillHistos().

boost::scoped_ptr<FourVectorMonitorElements> EmDQMReco::histReco
private

Definition at line 186 of file EmDQMReco.h.

Referenced by analyze(), and beginJob().

boost::scoped_ptr<FourVectorMonitorElements> EmDQMReco::histRecoMonpath
private

Definition at line 191 of file EmDQMReco.h.

Referenced by analyze(), and beginJob().

HLTConfigProvider EmDQMReco::hltConfig_
private

Definition at line 93 of file EmDQMReco.h.

Referenced by analyze(), and beginRun().

bool EmDQMReco::isHltConfigInitialized_
private

Definition at line 94 of file EmDQMReco.h.

Referenced by analyze(), beginRun(), and EmDQMReco().

std::vector<std::vector<edm::InputTag> > EmDQMReco::isoNames
private

Definition at line 90 of file EmDQMReco.h.

Referenced by EmDQMReco(), and fillHistos().

unsigned int EmDQMReco::numOfHLTCollectionLabels
private

Definition at line 83 of file EmDQMReco.h.

Referenced by analyze(), beginJob(), EmDQMReco(), and fillHistos().

int EmDQMReco::pdgGen
private

Definition at line 101 of file EmDQMReco.h.

Referenced by analyze(), beginJob(), and EmDQMReco().

std::vector<MonitorElement*> EmDQMReco::phiHistIso
private

Definition at line 165 of file EmDQMReco.h.

Referenced by beginJob(), and fillHistos().

std::vector<MonitorElement*> EmDQMReco::phiHistIsoMatchReco
private

Definition at line 169 of file EmDQMReco.h.

Referenced by beginJob(), and fillHistos().

unsigned int EmDQMReco::plotBins
private

number of bins to use for ALL plots (?)

Definition at line 111 of file EmDQMReco.h.

Referenced by beginJob(), EmDQMReco(), and EmDQMReco::FourVectorMonitorElements::FourVectorMonitorElements().

std::vector<std::pair<double,double> > EmDQMReco::plotBounds
private

Definition at line 91 of file EmDQMReco.h.

Referenced by beginJob(), and EmDQMReco().

double EmDQMReco::plotEtaMax
private
std::vector<bool> EmDQMReco::plotiso
private

Definition at line 89 of file EmDQMReco.h.

Referenced by beginJob(), EmDQMReco(), and fillHistos().

double EmDQMReco::plotPhiMax
private
double EmDQMReco::plotPtMax
private
double EmDQMReco::plotPtMin
private
std::string EmDQMReco::processNameRecoMonPath
private

process name for the trigger results for events to be filled into {et,eta,phi}recomonpath

Definition at line 124 of file EmDQMReco.h.

Referenced by analyze(), and EmDQMReco().

GreaterByPt<reco::Particle> EmDQMReco::pTComparator_
private

Definition at line 207 of file EmDQMReco.h.

Referenced by analyze().

GreaterByPt<reco::GsfElectron> EmDQMReco::pTRecoComparator_
private

Definition at line 208 of file EmDQMReco.h.

unsigned int EmDQMReco::recocut_
private

Definition at line 115 of file EmDQMReco.h.

Referenced by analyze(), EmDQMReco(), and fillHistos().

edm::InputTag EmDQMReco::recocutCollection_
private

Definition at line 114 of file EmDQMReco.h.

edm::InputTag EmDQMReco::recoElectronsInputTag
private

input tag for the reconstructed electron collection (with respect to which the HLT efficiencies are calculated ?)

Definition at line 129 of file EmDQMReco.h.

Referenced by analyze(), and EmDQMReco().

double EmDQMReco::recoEtaAcc
private

Definition at line 102 of file EmDQMReco.h.

Referenced by EmDQMReco().

double EmDQMReco::recoEtAcc
private

Definition at line 103 of file EmDQMReco.h.

Referenced by EmDQMReco().

unsigned int EmDQMReco::reqNum
private

Definition at line 100 of file EmDQMReco.h.

Referenced by analyze(), EmDQMReco(), and fillHistos().

boost::ptr_vector<FourVectorMonitorElements> EmDQMReco::standardHist
private

Et, eta and phi distributions (RECO) for the different HLT modules to be looked at.

Definition at line 141 of file EmDQMReco.h.

Referenced by beginJob(), and fillHistos().

std::vector<std::string> EmDQMReco::theHLTCollectionHumanNames
private

Definition at line 86 of file EmDQMReco.h.

Referenced by beginJob(), and EmDQMReco().

std::vector<edm::InputTag> EmDQMReco::theHLTCollectionLabels
private

the HLT collections to be looked at

Definition at line 81 of file EmDQMReco.h.

Referenced by beginJob(), EmDQMReco(), and fillHistos().

std::string EmDQMReco::theHltName
private

Definition at line 92 of file EmDQMReco.h.

std::vector<int> EmDQMReco::theHLTOutputTypes
private

Definition at line 88 of file EmDQMReco.h.

Referenced by analyze(), EmDQMReco(), and fillHistos().

edm::InputTag EmDQMReco::theL1Seed
private

Definition at line 87 of file EmDQMReco.h.

MonitorElement* EmDQMReco::totalmatchreco
private

Definition at line 179 of file EmDQMReco.h.

Referenced by analyze(), beginJob(), and fillHistos().

MonitorElement* EmDQMReco::totalreco
private

Plots of efficiency per step (note that these are NOT filled with four vector quantities but rather event counts)

Definition at line 178 of file EmDQMReco.h.

Referenced by analyze(), beginJob(), and fillHistos().

std::string EmDQMReco::triggerNameRecoMonPath
private

events which fire this trigger are filled into {et,eta,phi}recomonpath

Definition at line 119 of file EmDQMReco.h.

Referenced by analyze(), and EmDQMReco().

bool EmDQMReco::useHumanReadableHistTitles
private

Definition at line 85 of file EmDQMReco.h.

Referenced by beginJob(), and EmDQMReco().