CMS 3D CMS Logo

List of all members | Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes
L1TEGammaOffline Class Reference

#include <L1TEGammaOffline.h>

Inheritance diagram for L1TEGammaOffline:
DQMEDAnalyzer edm::stream::EDAnalyzer< edm::RunSummaryCache< dqmDetails::NoCache >, edm::LuminosityBlockSummaryCache< dqmDetails::NoCache > > edm::stream::EDAnalyzerBase edm::EDConsumerBase

Public Member Functions

 L1TEGammaOffline (const edm::ParameterSet &ps)
 
virtual ~L1TEGammaOffline ()
 
- Public Member Functions inherited from DQMEDAnalyzer
virtual void beginRun (edm::Run const &, edm::EventSetup const &) final
 
virtual void beginStream (edm::StreamID id) final
 
 DQMEDAnalyzer (void)
 
virtual void endLuminosityBlockSummary (edm::LuminosityBlock const &, edm::EventSetup const &, dqmDetails::NoCache *) const final
 
virtual void endRunSummary (edm::Run const &, edm::EventSetup const &, dqmDetails::NoCache *) const final
 
uint32_t streamId () const
 
- Public Member Functions inherited from edm::stream::EDAnalyzer< edm::RunSummaryCache< dqmDetails::NoCache >, edm::LuminosityBlockSummaryCache< dqmDetails::NoCache > >
 EDAnalyzer ()=default
 
- Public Member Functions inherited from edm::stream::EDAnalyzerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 EDAnalyzerBase ()
 
ModuleDescription const & moduleDescription () const
 
virtual ~EDAnalyzerBase ()
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
 EDConsumerBase ()
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
 EDConsumerBase (EDConsumerBase &&)=default
 
ProductResolverIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
std::vector< ProductResolverIndexAndSkipBit > const & itemsToGetFromEvent () const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
virtual ~EDConsumerBase () noexcept(false)
 

Protected Member Functions

void analyze (edm::Event const &e, edm::EventSetup const &eSetup)
 
void beginLuminosityBlock (edm::LuminosityBlock const &lumi, edm::EventSetup const &eSetup)
 
void bookHistograms (DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
 
void dqmBeginRun (edm::Run const &, edm::EventSetup const &) override
 
void endLuminosityBlock (edm::LuminosityBlock const &lumi, edm::EventSetup const &eSetup)
 
void endRun (edm::Run const &run, edm::EventSetup const &eSetup)
 
- Protected Member Functions inherited from edm::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken consumes (TypeToGet const &id, edm::InputTag const &tag)
 
ConsumesCollector consumesCollector ()
 Use a ConsumesCollector to gather consumes information from helper functions. More...
 
template<typename ProductType , BranchType B = InEvent>
void consumesMany ()
 
void consumesMany (const TypeToGet &id)
 
template<BranchType B>
void consumesMany (const TypeToGet &id)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 

Private Member Functions

void bookElectronHistos (DQMStore::IBooker &)
 
void bookPhotonHistos (DQMStore::IBooker &)
 
double calcDeltaPhi (double phi1, double phi2)
 
double Distance (const reco::Candidate &c1, const reco::Candidate &c2)
 
double DistancePhi (const reco::Candidate &c1, const reco::Candidate &c2)
 
void fillElectrons (edm::Event const &e, const unsigned int nVertex)
 
void fillPhotons (edm::Event const &e, const unsigned int nVertex)
 
bool findTagAndProbePair (edm::Handle< reco::GsfElectronCollection > const &electrons)
 
bool passesLooseEleId (reco::GsfElectron const &electron) const
 
bool passesMediumEleId (reco::GsfElectron const &electron) const
 

Private Attributes

std::string efficiencyFolder_
 
std::vector< double > electronEfficiencyBins_
 
std::vector< double > electronEfficiencyThresholds_
 
std::map< double, MonitorElement * > h_efficiencyElectronET_EB_EE_pass_
 
std::map< double, MonitorElement * > h_efficiencyElectronET_EB_EE_total_
 
std::map< double, MonitorElement * > h_efficiencyElectronET_EB_pass_
 
std::map< double, MonitorElement * > h_efficiencyElectronET_EB_total_
 
std::map< double, MonitorElement * > h_efficiencyElectronET_EE_pass_
 
std::map< double, MonitorElement * > h_efficiencyElectronET_EE_total_
 
std::map< double, MonitorElement * > h_efficiencyPhotonET_EB_EE_pass_
 
std::map< double, MonitorElement * > h_efficiencyPhotonET_EB_EE_total_
 
std::map< double, MonitorElement * > h_efficiencyPhotonET_EB_pass_
 
std::map< double, MonitorElement * > h_efficiencyPhotonET_EB_total_
 
std::map< double, MonitorElement * > h_efficiencyPhotonET_EE_pass_
 
std::map< double, MonitorElement * > h_efficiencyPhotonET_EE_total_
 
MonitorElementh_L1EGammaEtavsElectronEta_
 
MonitorElementh_L1EGammaEtavsPhotonEta_
 
MonitorElementh_L1EGammaETvsElectronET_EB_
 
MonitorElementh_L1EGammaETvsElectronET_EB_EE_
 
MonitorElementh_L1EGammaETvsElectronET_EE_
 
MonitorElementh_L1EGammaETvsPhotonET_EB_
 
MonitorElementh_L1EGammaETvsPhotonET_EB_EE_
 
MonitorElementh_L1EGammaETvsPhotonET_EE_
 
MonitorElementh_L1EGammaPhivsElectronPhi_EB_
 
MonitorElementh_L1EGammaPhivsElectronPhi_EB_EE_
 
MonitorElementh_L1EGammaPhivsElectronPhi_EE_
 
MonitorElementh_L1EGammaPhivsPhotonPhi_EB_
 
MonitorElementh_L1EGammaPhivsPhotonPhi_EB_EE_
 
MonitorElementh_L1EGammaPhivsPhotonPhi_EE_
 
MonitorElementh_nVertex_
 
MonitorElementh_resolutionElectronET_EB_
 
MonitorElementh_resolutionElectronET_EB_EE_
 
MonitorElementh_resolutionElectronET_EE_
 
MonitorElementh_resolutionElectronEta_
 
MonitorElementh_resolutionElectronPhi_EB_
 
MonitorElementh_resolutionElectronPhi_EB_EE_
 
MonitorElementh_resolutionElectronPhi_EE_
 
MonitorElementh_resolutionPhotonET_EB_
 
MonitorElementh_resolutionPhotonET_EB_EE_
 
MonitorElementh_resolutionPhotonET_EE_
 
MonitorElementh_resolutionPhotonEta_
 
MonitorElementh_resolutionPhotonPhi_EB_
 
MonitorElementh_resolutionPhotonPhi_EB_EE_
 
MonitorElementh_resolutionPhotonPhi_EE_
 
MonitorElementh_tagAndProbeMass_
 
std::string histFolder_
 
std::vector< double > photonEfficiencyBins_
 
std::vector< double > photonEfficiencyThresholds_
 
reco::GsfElectron probeElectron_
 
math::XYZPoint PVPoint_
 
edm::EDGetTokenT< l1t::EGammaBxCollectionstage2CaloLayer2EGammaToken_
 
double tagAndProbleInvariantMass_
 
reco::GsfElectron tagElectron_
 
edm::EDGetTokenT< reco::BeamSpottheBSCollection_
 
edm::EDGetTokenT< reco::GsfElectronCollectiontheGsfElectronCollection_
 
edm::EDGetTokenT< std::vector< reco::Photon > > thePhotonCollection_
 
edm::EDGetTokenT< reco::VertexCollectionthePVCollection_
 
edm::EDGetTokenT< trigger::TriggerEventtriggerEvent_
 
edm::InputTag triggerFilter_
 
std::string triggerPath_
 
edm::EDGetTokenT< edm::TriggerResultstriggerResults_
 

Additional Inherited Members

- Public Types inherited from edm::stream::EDAnalyzer< edm::RunSummaryCache< dqmDetails::NoCache >, edm::LuminosityBlockSummaryCache< dqmDetails::NoCache > >
typedef CacheContexts< T... > CacheTypes
 
typedef CacheTypes::GlobalCache GlobalCache
 
typedef AbilityChecker< T... > HasAbility
 
typedef CacheTypes::LuminosityBlockCache LuminosityBlockCache
 
typedef LuminosityBlockContextT< LuminosityBlockCache, RunCache, GlobalCacheLuminosityBlockContext
 
typedef CacheTypes::LuminosityBlockSummaryCache LuminosityBlockSummaryCache
 
typedef CacheTypes::RunCache RunCache
 
typedef RunContextT< RunCache, GlobalCacheRunContext
 
typedef CacheTypes::RunSummaryCache RunSummaryCache
 
- Public Types inherited from edm::stream::EDAnalyzerBase
typedef EDAnalyzerAdaptorBase ModuleType
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Static Public Member Functions inherited from DQMEDAnalyzer
static std::shared_ptr< dqmDetails::NoCacheglobalBeginLuminosityBlockSummary (edm::LuminosityBlock const &, edm::EventSetup const &, LuminosityBlockContext const *)
 
static std::shared_ptr< dqmDetails::NoCacheglobalBeginRunSummary (edm::Run const &, edm::EventSetup const &, RunContext const *)
 
static void globalEndLuminosityBlockSummary (edm::LuminosityBlock const &, edm::EventSetup const &, LuminosityBlockContext const *, dqmDetails::NoCache *)
 
static void globalEndRunSummary (edm::Run const &, edm::EventSetup const &, RunContext const *, dqmDetails::NoCache *)
 
- Static Public Member Functions inherited from edm::stream::EDAnalyzerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 

Detailed Description

Definition at line 37 of file L1TEGammaOffline.h.

Constructor & Destructor Documentation

L1TEGammaOffline::L1TEGammaOffline ( const edm::ParameterSet ps)

Definition at line 23 of file L1TEGammaOffline.cc.

23  :
25  consumes < reco::GsfElectronCollection > (ps.getParameter < edm::InputTag > ("electronCollection"))),
27  consumes < std::vector<reco::Photon> > (ps.getParameter < edm::InputTag > ("photonCollection"))),
28  thePVCollection_(consumes < reco::VertexCollection > (ps.getParameter < edm::InputTag > ("PVCollection"))),
29  theBSCollection_(consumes < reco::BeamSpot > (ps.getParameter < edm::InputTag > ("beamSpotCollection"))),
30  triggerEvent_(consumes < trigger::TriggerEvent > (ps.getParameter < edm::InputTag > ("TriggerEvent"))),
31  triggerResults_(consumes < edm::TriggerResults > (ps.getParameter < edm::InputTag > ("TriggerResults"))),
32  triggerFilter_(ps.getParameter < edm::InputTag > ("TriggerFilter")),
33  triggerPath_(ps.getParameter < std::string > ("TriggerPath")),
34  histFolder_(ps.getParameter < std::string > ("histFolder")),
35  efficiencyFolder_(histFolder_ + "/efficiency_raw"),
37  consumes < l1t::EGammaBxCollection > (ps.getParameter < edm::InputTag > ("stage2CaloLayer2EGammaSource"))),
38  electronEfficiencyThresholds_(ps.getParameter < std::vector<double> > ("electronEfficiencyThresholds")),
39  electronEfficiencyBins_(ps.getParameter < std::vector<double> > ("electronEfficiencyBins")),
40  photonEfficiencyThresholds_(ps.getParameter < std::vector<double> > ("photonEfficiencyThresholds")),
41  photonEfficiencyBins_(ps.getParameter < std::vector<double> > ("photonEfficiencyBins")),
42  tagElectron_(),
45 {
46  edm::LogInfo("L1TEGammaOffline") << "Constructor " << "L1TEGammaOffline::L1TEGammaOffline " << std::endl;
47 }
edm::EDGetTokenT< edm::TriggerResults > triggerResults_
T getParameter(std::string const &) const
std::vector< double > electronEfficiencyBins_
edm::EDGetTokenT< reco::GsfElectronCollection > theGsfElectronCollection_
std::string triggerPath_
edm::EDGetTokenT< std::vector< reco::Photon > > thePhotonCollection_
std::string histFolder_
edm::InputTag triggerFilter_
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
std::vector< double > electronEfficiencyThresholds_
double tagAndProbleInvariantMass_
edm::EDGetTokenT< l1t::EGammaBxCollection > stage2CaloLayer2EGammaToken_
reco::GsfElectron tagElectron_
std::string efficiencyFolder_
reco::GsfElectron probeElectron_
std::vector< double > photonEfficiencyBins_
edm::EDGetTokenT< reco::BeamSpot > theBSCollection_
edm::EDGetTokenT< reco::VertexCollection > thePVCollection_
std::vector< double > photonEfficiencyThresholds_
edm::EDGetTokenT< trigger::TriggerEvent > triggerEvent_
L1TEGammaOffline::~L1TEGammaOffline ( )
virtual

Definition at line 52 of file L1TEGammaOffline.cc.

53 {
54  edm::LogInfo("L1TEGammaOffline") << "Destructor L1TEGammaOffline::~L1TEGammaOffline " << std::endl;
55 }

Member Function Documentation

void L1TEGammaOffline::analyze ( edm::Event const &  e,
edm::EventSetup const &  eSetup 
)
protectedvirtual

Implements edm::stream::EDAnalyzerBase.

Definition at line 87 of file L1TEGammaOffline.cc.

References fillElectrons(), fillPhotons(), dqmoffline::l1t::fillWithinLimits(), edm::Event::getByToken(), h_nVertex_, edm::HandleBase::isValid(), and thePVCollection_.

88 {
89  edm::LogInfo("L1TEGammaOffline") << "L1TEGammaOffline::analyze" << std::endl;
90 
92  e.getByToken(thePVCollection_, vertexHandle);
93  if (!vertexHandle.isValid()) {
94  edm::LogError("L1TEGammaOffline") << "invalid collection: vertex " << std::endl;
95  return;
96  }
97 
98  unsigned int nVertex = vertexHandle->size();
100 
101  // L1T
102  fillElectrons(e, nVertex);
103  fillPhotons(e, nVertex);
104 }
void fillPhotons(edm::Event const &e, const unsigned int nVertex)
void fillElectrons(edm::Event const &e, const unsigned int nVertex)
bool isValid() const
Definition: HandleBase.h:74
MonitorElement * h_nVertex_
void fillWithinLimits(MonitorElement *mon, double value, double weight=1.)
edm::EDGetTokenT< reco::VertexCollection > thePVCollection_
void L1TEGammaOffline::beginLuminosityBlock ( edm::LuminosityBlock const &  lumi,
edm::EventSetup const &  eSetup 
)
protectedvirtual

Reimplemented from edm::stream::EDAnalyzerBase.

Definition at line 79 of file L1TEGammaOffline.cc.

80 {
81  edm::LogInfo("L1TEGammaOffline") << "L1TEGammaOffline::beginLuminosityBlock" << std::endl;
82 }
void L1TEGammaOffline::bookElectronHistos ( DQMStore::IBooker ibooker)
private

Definition at line 486 of file L1TEGammaOffline.cc.

References DQMStore::IBooker::book1D(), DQMStore::IBooker::book2D(), DQMStore::IBooker::cd(), efficiencyFolder_, electronEfficiencyBins_, electronEfficiencyThresholds_, h_efficiencyElectronET_EB_EE_pass_, h_efficiencyElectronET_EB_EE_total_, h_efficiencyElectronET_EB_pass_, h_efficiencyElectronET_EB_total_, h_efficiencyElectronET_EE_pass_, h_efficiencyElectronET_EE_total_, h_L1EGammaEtavsElectronEta_, h_L1EGammaETvsElectronET_EB_, h_L1EGammaETvsElectronET_EB_EE_, h_L1EGammaETvsElectronET_EE_, h_L1EGammaPhivsElectronPhi_EB_, h_L1EGammaPhivsElectronPhi_EB_EE_, h_L1EGammaPhivsElectronPhi_EE_, h_nVertex_, h_resolutionElectronET_EB_, h_resolutionElectronET_EB_EE_, h_resolutionElectronET_EE_, h_resolutionElectronEta_, h_resolutionElectronPhi_EB_, h_resolutionElectronPhi_EB_EE_, h_resolutionElectronPhi_EE_, h_tagAndProbeMass_, histFolder_, DQMStore::IBooker::setCurrentFolder(), AlCaHLTBitMon_QueryRunRegistry::string, and ctppsDiamondLocalTracks_cfi::threshold.

Referenced by bookHistograms().

487 {
488  ibooker.cd();
489  ibooker.setCurrentFolder(histFolder_.c_str());
490  h_nVertex_ = ibooker.book1D("nVertex", "Number of event vertices in collection", 40, -0.5, 39.5);
491  h_tagAndProbeMass_ = ibooker.book1D("tagAndProbeMass", "Invariant mass of tag & probe pair", 100, 40, 140);
492  // electron reco vs L1
493  h_L1EGammaETvsElectronET_EB_ = ibooker.book2D("L1EGammaETvsElectronET_EB",
494  "L1 EGamma E_{T} vs GSF Electron E_{T} (EB); GSF Electron E_{T} (GeV); L1 EGamma E_{T} (GeV)", 300, 0, 300, 300,
495  0, 300);
496  h_L1EGammaETvsElectronET_EE_ = ibooker.book2D("L1EGammaETvsElectronET_EE",
497  "L1 EGamma E_{T} vs GSF Electron E_{T} (EE); GSF Electron E_{T} (GeV); L1 EGamma E_{T} (GeV)", 300, 0, 300, 300,
498  0, 300);
499  h_L1EGammaETvsElectronET_EB_EE_ = ibooker.book2D("L1EGammaETvsElectronET_EB_EE",
500  "L1 EGamma E_{T} vs GSF Electron E_{T} (EB+EE); GSF Electron E_{T} (GeV); L1 EGamma E_{T} (GeV)", 300, 0, 300,
501  300, 0, 300);
502 
503  h_L1EGammaPhivsElectronPhi_EB_ = ibooker.book2D("L1EGammaPhivsElectronPhi_EB",
504  "#phi_{electron}^{L1} vs #phi_{electron}^{offline} (EB); #phi_{electron}^{offline}; #phi_{electron}^{L1}", 100,
505  -4, 4, 100, -4, 4);
506  h_L1EGammaPhivsElectronPhi_EE_ = ibooker.book2D("L1EGammaPhivsElectronPhi_EE",
507  "#phi_{electron}^{L1} vs #phi_{electron}^{offline} (EE); #phi_{electron}^{offline}; #phi_{electron}^{L1}", 100,
508  -4, 4, 100, -4, 4);
509  h_L1EGammaPhivsElectronPhi_EB_EE_ = ibooker.book2D("L1EGammaPhivsElectronPhi_EB_EE",
510  "#phi_{electron}^{L1} vs #phi_{electron}^{offline} (EB+EE); #phi_{electron}^{offline}; #phi_{electron}^{L1}", 100,
511  -4, 4, 100, -4, 4);
512 
513  h_L1EGammaEtavsElectronEta_ = ibooker.book2D("L1EGammaEtavsElectronEta",
514  "L1 EGamma #eta vs GSF Electron #eta; GSF Electron #eta; L1 EGamma #eta", 100, -3, 3, 100, -3, 3);
515 
516  // electron resolutions
517  h_resolutionElectronET_EB_ = ibooker.book1D("resolutionElectronET_EB",
518  "electron ET resolution (EB); (L1 EGamma E_{T} - GSF Electron E_{T})/GSF Electron E_{T}; events", 50, -1, 1.5);
519  h_resolutionElectronET_EE_ = ibooker.book1D("resolutionElectronET_EE",
520  "electron ET resolution (EE); (L1 EGamma E_{T} - GSF Electron E_{T})/GSF Electron E_{T}; events", 50, -1, 1.5);
521  h_resolutionElectronET_EB_EE_ = ibooker.book1D("resolutionElectronET_EB_EE",
522  "electron ET resolution (EB+EE); (L1 EGamma E_{T} - GSF Electron E_{T})/GSF Electron E_{T}; events", 50, -1, 1.5);
523 
525  ibooker.book1D("resolutionElectronPhi_EB",
526  "#phi_{electron} resolution (EB); (#phi_{electron}^{L1} - #phi_{electron}^{offline})/#phi_{electron}^{offline}; events",
527  120, -0.3, 0.3);
529  ibooker.book1D("resolutionElectronPhi_EE",
530  "electron #phi resolution (EE); (#phi_{electron}^{L1} - #phi_{electron}^{offline})/#phi_{electron}^{offline}; events",
531  120, -0.3, 0.3);
533  ibooker.book1D("resolutionElectronPhi_EB_EE",
534  "electron #phi resolution (EB+EE); (#phi_{electron}^{L1} - #phi_{electron}^{offline})/#phi_{electron}^{offline}; events",
535  120, -0.3, 0.3);
536 
537  h_resolutionElectronEta_ = ibooker.book1D("resolutionElectronEta",
538  "electron #eta resolution (EB); (L1 EGamma #eta - GSF Electron #eta)/GSF Electron #eta; events", 120, -0.3, 0.3);
539 
540  // electron turn-ons
541  ibooker.setCurrentFolder(efficiencyFolder_.c_str());
542  std::vector<float> electronBins(electronEfficiencyBins_.begin(), electronEfficiencyBins_.end());
543  int nBins = electronBins.size() - 1;
544  float* electronBinArray = &(electronBins[0]);
545 
547  std::string str_threshold = std::to_string(int(threshold));
549  "efficiencyElectronET_EB_threshold_" + str_threshold + "_Num",
550  "electron efficiency (EB); GSF Electron E_{T} (GeV); events", nBins, electronBinArray);
552  "efficiencyElectronET_EE_threshold_" + str_threshold + "_Num",
553  "electron efficiency (EE); GSF Electron E_{T} (GeV); events", nBins, electronBinArray);
555  "efficiencyElectronET_EB_EE_threshold_" + str_threshold + "_Num",
556  "electron efficiency (EB+EE); GSF Electron E_{T} (GeV); events", nBins, electronBinArray);
557 
559  "efficiencyElectronET_EB_threshold_" + str_threshold + "_Den",
560  "electron efficiency (EB); GSF Electron E_{T} (GeV); events", nBins, electronBinArray);
562  "efficiencyElectronET_EE_threshold_" + str_threshold + "_Den",
563  "electron efficiency (EE); GSF Electron E_{T} (GeV); events", nBins, electronBinArray);
565  "efficiencyElectronET_EB_EE_threshold_" + str_threshold + "_Den",
566  "electron efficiency (EB+EE); GSF Electron E_{T} (GeV); events", nBins, electronBinArray);
567  }
568 
569  ibooker.cd();
570 }
std::vector< double > electronEfficiencyBins_
MonitorElement * h_resolutionElectronPhi_EB_EE_
MonitorElement * h_L1EGammaPhivsElectronPhi_EE_
MonitorElement * h_tagAndProbeMass_
MonitorElement * h_L1EGammaETvsElectronET_EB_EE_
void cd(void)
Definition: DQMStore.cc:269
std::map< double, MonitorElement * > h_efficiencyElectronET_EB_EE_pass_
std::string histFolder_
MonitorElement * h_resolutionElectronET_EB_
std::map< double, MonitorElement * > h_efficiencyElectronET_EB_total_
MonitorElement * h_L1EGammaETvsElectronET_EB_
MonitorElement * h_L1EGammaPhivsElectronPhi_EB_EE_
MonitorElement * h_resolutionElectronET_EE_
std::vector< double > electronEfficiencyThresholds_
MonitorElement * h_L1EGammaEtavsElectronEta_
MonitorElement * book1D(Args &&...args)
Definition: DQMStore.h:115
MonitorElement * h_resolutionElectronEta_
std::map< double, MonitorElement * > h_efficiencyElectronET_EE_total_
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:277
std::string efficiencyFolder_
std::map< double, MonitorElement * > h_efficiencyElectronET_EE_pass_
MonitorElement * book2D(Args &&...args)
Definition: DQMStore.h:133
MonitorElement * h_resolutionElectronET_EB_EE_
std::map< double, MonitorElement * > h_efficiencyElectronET_EB_EE_total_
MonitorElement * h_resolutionElectronPhi_EB_
MonitorElement * h_nVertex_
MonitorElement * h_L1EGammaETvsElectronET_EE_
MonitorElement * h_resolutionElectronPhi_EE_
std::map< double, MonitorElement * > h_efficiencyElectronET_EB_pass_
MonitorElement * h_L1EGammaPhivsElectronPhi_EB_
void L1TEGammaOffline::bookHistograms ( DQMStore::IBooker ibooker,
edm::Run const &  ,
edm::EventSetup const &   
)
overrideprotectedvirtual

Implements DQMEDAnalyzer.

Definition at line 68 of file L1TEGammaOffline.cc.

References bookElectronHistos(), and bookPhotonHistos().

69 {
70  edm::LogInfo("L1TEGammaOffline") << "L1TEGammaOffline::bookHistograms" << std::endl;
71 
72  //book at beginRun
73  bookElectronHistos(ibooker);
74  bookPhotonHistos(ibooker);
75 }
void bookElectronHistos(DQMStore::IBooker &)
void bookPhotonHistos(DQMStore::IBooker &)
void L1TEGammaOffline::bookPhotonHistos ( DQMStore::IBooker ibooker)
private

Definition at line 572 of file L1TEGammaOffline.cc.

References DQMStore::IBooker::book1D(), DQMStore::IBooker::book2D(), DQMStore::IBooker::cd(), DEFINE_FWK_MODULE, efficiencyFolder_, h_efficiencyPhotonET_EB_EE_pass_, h_efficiencyPhotonET_EB_EE_total_, h_efficiencyPhotonET_EB_pass_, h_efficiencyPhotonET_EB_total_, h_efficiencyPhotonET_EE_pass_, h_efficiencyPhotonET_EE_total_, h_L1EGammaEtavsPhotonEta_, h_L1EGammaETvsPhotonET_EB_, h_L1EGammaETvsPhotonET_EB_EE_, h_L1EGammaETvsPhotonET_EE_, h_L1EGammaPhivsPhotonPhi_EB_, h_L1EGammaPhivsPhotonPhi_EB_EE_, h_L1EGammaPhivsPhotonPhi_EE_, h_resolutionPhotonET_EB_, h_resolutionPhotonET_EB_EE_, h_resolutionPhotonET_EE_, h_resolutionPhotonEta_, h_resolutionPhotonPhi_EB_, h_resolutionPhotonPhi_EB_EE_, h_resolutionPhotonPhi_EE_, histFolder_, photonEfficiencyBins_, photonEfficiencyThresholds_, DQMStore::IBooker::setCurrentFolder(), AlCaHLTBitMon_QueryRunRegistry::string, and ctppsDiamondLocalTracks_cfi::threshold.

Referenced by bookHistograms().

573 {
574  ibooker.cd();
575  ibooker.setCurrentFolder(histFolder_.c_str());
576  h_L1EGammaETvsPhotonET_EB_ = ibooker.book2D("L1EGammaETvsPhotonET_EB",
577  "L1 EGamma E_{T} vs Photon E_{T} (EB); Photon E_{T} (GeV); L1 EGamma E_{T} (GeV)", 300, 0, 300, 300, 0, 300);
578  h_L1EGammaETvsPhotonET_EE_ = ibooker.book2D("L1EGammaETvsPhotonET_EE",
579  "L1 EGamma E_{T} vs Photon E_{T} (EE); Photon E_{T} (GeV); L1 EGamma E_{T} (GeV)", 300, 0, 300, 300, 0, 300);
580  h_L1EGammaETvsPhotonET_EB_EE_ = ibooker.book2D("L1EGammaETvsPhotonET_EB_EE",
581  "L1 EGamma E_{T} vs Photon E_{T} (EB+EE); Photon E_{T} (GeV); L1 EGamma E_{T} (GeV)", 300, 0, 300, 300, 0, 300);
582 
583  h_L1EGammaPhivsPhotonPhi_EB_ = ibooker.book2D("L1EGammaPhivsPhotonPhi_EB",
584  "#phi_{photon}^{L1} vs #phi_{photon}^{offline} (EB); #phi_{photon}^{offline}; #phi_{photon}^{L1}", 100, -4, 4,
585  100, -4, 4);
586  h_L1EGammaPhivsPhotonPhi_EE_ = ibooker.book2D("L1EGammaPhivsPhotonPhi_EE",
587  "#phi_{photon}^{L1} vs #phi_{photon}^{offline} (EE); #phi_{photon}^{offline}; #phi_{photon}^{L1}", 100, -4, 4,
588  100, -4, 4);
589  h_L1EGammaPhivsPhotonPhi_EB_EE_ = ibooker.book2D("L1EGammaPhivsPhotonPhi_EB_EE",
590  "#phi_{photon}^{L1} vs #phi_{photon}^{offline} (EB+EE); #phi_{photon}^{offline}; #phi_{photon}^{L1}", 100, -4, 4,
591  100, -4, 4);
592 
593  h_L1EGammaEtavsPhotonEta_ = ibooker.book2D("L1EGammaEtavsPhotonEta",
594  "L1 EGamma #eta vs Photon #eta; Photon #eta; L1 EGamma #eta", 100, -3, 3, 100, -3, 3);
595 
596  // photon resolutions
597  h_resolutionPhotonET_EB_ = ibooker.book1D("resolutionPhotonET_EB",
598  "photon ET resolution (EB); (L1 EGamma E_{T} - Photon E_{T})/ Photon E_{T}; events", 50, -1, 1.5);
599  h_resolutionPhotonET_EE_ = ibooker.book1D("resolutionPhotonET_EE",
600  "photon ET resolution (EE); (L1 EGamma E_{T} - Photon E_{T})/ Photon E_{T}; events", 50, -1, 1.5);
601  h_resolutionPhotonET_EB_EE_ = ibooker.book1D("resolutionPhotonET_EB_EE",
602  "photon ET resolution (EB+EE); (L1 EGamma E_{T} - Photon E_{T})/ Photon E_{T}; events", 50, -1, 1.5);
603 
604  h_resolutionPhotonPhi_EB_ = ibooker.book1D("resolutionPhotonPhi_EB",
605  "#phi_{photon} resolution (EB); (#phi_{photon}^{L1} - #phi_{photon}^{offline})/#phi_{photon}^{offline}; events",
606  120, -0.3, 0.3);
607  h_resolutionPhotonPhi_EE_ = ibooker.book1D("resolutionPhotonPhi_EE",
608  "photon #phi resolution (EE); (#phi_{photon}^{L1} - #phi_{photon}^{offline})/#phi_{photon}^{offline}; events",
609  120, -0.3, 0.3);
610  h_resolutionPhotonPhi_EB_EE_ = ibooker.book1D("resolutionPhotonPhi_EB_EE",
611  "photon #phi resolution (EB+EE); (#phi_{photon}^{L1} - #phi_{photon}^{offline})/#phi_{photon}^{offline}; events",
612  120, -0.3, 0.3);
613 
614  h_resolutionPhotonEta_ = ibooker.book1D("resolutionPhotonEta",
615  "photon #eta resolution (EB); (L1 EGamma #eta - Photon #eta)/ Photon #eta; events", 120, -0.3, 0.3);
616 
617  // photon turn-ons
618  ibooker.setCurrentFolder(efficiencyFolder_.c_str());
619  std::vector<float> photonBins(photonEfficiencyBins_.begin(), photonEfficiencyBins_.end());
620  int nBins = photonBins.size() - 1;
621  float* photonBinArray = &(photonBins[0]);
622 
624  std::string str_threshold = std::to_string(int(threshold));
626  "efficiencyPhotonET_EB_threshold_" + str_threshold + "_Num",
627  "photon efficiency (EB); Photon E_{T} (GeV); events", nBins, photonBinArray);
629  "efficiencyPhotonET_EE_threshold_" + str_threshold + "_Num",
630  "photon efficiency (EE); Photon E_{T} (GeV); events", nBins, photonBinArray);
632  "efficiencyPhotonET_EB_EE_threshold_" + str_threshold + "_Num",
633  "photon efficiency (EB+EE); Photon E_{T} (GeV); events", nBins, photonBinArray);
634 
636  "efficiencyPhotonET_EB_threshold_" + str_threshold + "_Den",
637  "photon efficiency (EB); Photon E_{T} (GeV); events", nBins, photonBinArray);
639  "efficiencyPhotonET_EE_threshold_" + str_threshold + "_Den",
640  "photon efficiency (EE); Photon E_{T} (GeV); events", nBins, photonBinArray);
642  "efficiencyPhotonET_EB_EE_threshold_" + str_threshold + "_Den",
643  "photon efficiency (EB+EE); Photon E_{T} (GeV); events", nBins, photonBinArray);
644  }
645 
646  ibooker.cd();
647 }
std::map< double, MonitorElement * > h_efficiencyPhotonET_EE_total_
std::map< double, MonitorElement * > h_efficiencyPhotonET_EB_pass_
MonitorElement * h_L1EGammaPhivsPhotonPhi_EB_
MonitorElement * h_L1EGammaETvsPhotonET_EB_
void cd(void)
Definition: DQMStore.cc:269
std::string histFolder_
MonitorElement * h_L1EGammaETvsPhotonET_EE_
std::map< double, MonitorElement * > h_efficiencyPhotonET_EB_EE_total_
MonitorElement * h_resolutionPhotonET_EE_
std::map< double, MonitorElement * > h_efficiencyPhotonET_EB_EE_pass_
MonitorElement * h_L1EGammaPhivsPhotonPhi_EB_EE_
MonitorElement * h_resolutionPhotonET_EB_
MonitorElement * book1D(Args &&...args)
Definition: DQMStore.h:115
MonitorElement * h_resolutionPhotonEta_
MonitorElement * h_L1EGammaPhivsPhotonPhi_EE_
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:277
std::map< double, MonitorElement * > h_efficiencyPhotonET_EB_total_
std::string efficiencyFolder_
MonitorElement * book2D(Args &&...args)
Definition: DQMStore.h:133
MonitorElement * h_resolutionPhotonPhi_EB_EE_
MonitorElement * h_resolutionPhotonPhi_EB_
std::vector< double > photonEfficiencyBins_
MonitorElement * h_L1EGammaETvsPhotonET_EB_EE_
MonitorElement * h_L1EGammaEtavsPhotonEta_
MonitorElement * h_resolutionPhotonPhi_EE_
std::vector< double > photonEfficiencyThresholds_
std::map< double, MonitorElement * > h_efficiencyPhotonET_EE_pass_
MonitorElement * h_resolutionPhotonET_EB_EE_
double L1TEGammaOffline::calcDeltaPhi ( double  phi1,
double  phi2 
)
private
double L1TEGammaOffline::Distance ( const reco::Candidate c1,
const reco::Candidate c2 
)
private
double L1TEGammaOffline::DistancePhi ( const reco::Candidate c1,
const reco::Candidate c2 
)
private
void L1TEGammaOffline::dqmBeginRun ( edm::Run const &  ,
edm::EventSetup const &   
)
overrideprotectedvirtual

Reimplemented from DQMEDAnalyzer.

Definition at line 60 of file L1TEGammaOffline.cc.

61 {
62  edm::LogInfo("L1TEGammaOffline") << "L1TEGammaOffline::beginRun" << std::endl;
63 }
void L1TEGammaOffline::endLuminosityBlock ( edm::LuminosityBlock const &  lumi,
edm::EventSetup const &  eSetup 
)
protectedvirtual

Reimplemented from edm::stream::EDAnalyzerBase.

Definition at line 470 of file L1TEGammaOffline.cc.

471 {
472  edm::LogInfo("L1TEGammaOffline") << "L1TEGammaOffline::endLuminosityBlock" << std::endl;
473 }
void L1TEGammaOffline::endRun ( edm::Run const &  run,
edm::EventSetup const &  eSetup 
)
protectedvirtual

Reimplemented from edm::stream::EDAnalyzerBase.

Definition at line 478 of file L1TEGammaOffline.cc.

479 {
480  edm::LogInfo("L1TEGammaOffline") << "L1TEGammaOffline::endRun" << std::endl;
481 }
void L1TEGammaOffline::fillElectrons ( edm::Event const &  e,
const unsigned int  nVertex 
)
private

Definition at line 106 of file L1TEGammaOffline.cc.

References funct::abs(), BXVector< T >::begin(), deltaR(), electronEfficiencyThresholds_, BXVector< T >::end(), reco::LeafCandidate::et(), reco::LeafCandidate::eta(), dqmoffline::l1t::fill2DWithinLimits(), dqmoffline::l1t::fillWithinLimits(), findTagAndProbePair(), edm::Event::getByToken(), gsfElectrons_cfi::gsfElectrons, h_efficiencyElectronET_EB_EE_pass_, h_efficiencyElectronET_EB_EE_total_, h_efficiencyElectronET_EB_pass_, h_efficiencyElectronET_EB_total_, h_efficiencyElectronET_EE_pass_, h_efficiencyElectronET_EE_total_, h_L1EGammaEtavsElectronEta_, h_L1EGammaETvsElectronET_EB_, h_L1EGammaETvsElectronET_EB_EE_, h_L1EGammaETvsElectronET_EE_, h_L1EGammaPhivsElectronPhi_EB_, h_L1EGammaPhivsElectronPhi_EB_EE_, h_L1EGammaPhivsElectronPhi_EE_, h_resolutionElectronET_EB_, h_resolutionElectronET_EB_EE_, h_resolutionElectronET_EE_, h_resolutionElectronEta_, h_resolutionElectronPhi_EB_, h_resolutionElectronPhi_EB_EE_, h_resolutionElectronPhi_EE_, edm::HandleBase::isValid(), LogDebug, reco::LeafCandidate::phi(), probeElectron_, stage2CaloLayer2EGammaToken_, theGsfElectronCollection_, and ctppsDiamondLocalTracks_cfi::threshold.

Referenced by analyze().

107 {
109  e.getByToken(stage2CaloLayer2EGammaToken_, l1EGamma);
110 
112  e.getByToken(theGsfElectronCollection_, gsfElectrons);
113 
114  if (!gsfElectrons.isValid()) {
115  edm::LogError("L1TEGammaOffline") << "invalid collection: GSF electrons " << std::endl;
116  return;
117  }
118  if (gsfElectrons->size() == 0) {
119  LogDebug("L1TEGammaOffline") << "empty collection: GSF electrons " << std::endl;
120  return;
121  }
122  if (!l1EGamma.isValid()) {
123  edm::LogError("L1TEGammaOffline") << "invalid collection: L1 EGamma " << std::endl;
124  return;
125  }
126  if (!findTagAndProbePair(gsfElectrons)) {
127  LogDebug("L1TEGammaOffline") << "Could not find a tag & probe pair" << std::endl;
128  return; //continue to next event
129  }
130 
131  auto probeElectron = probeElectron_;
132 
133  // find corresponding L1 EG
134  double minDeltaR = 0.3;
135  l1t::EGamma closestL1EGamma;
136  bool foundMatch = false;
137 
138  int bunchCrossing = 0;
139  for (auto egamma = l1EGamma->begin(bunchCrossing); egamma != l1EGamma->end(bunchCrossing); ++egamma) {
140  double currentDeltaR = deltaR(egamma->eta(), egamma->phi(), probeElectron.eta(), probeElectron.phi());
141  if (currentDeltaR > minDeltaR) {
142  continue;
143  } else {
144  minDeltaR = currentDeltaR;
145  closestL1EGamma = *egamma;
146  foundMatch = true;
147  }
148 
149  }
150 
151  if (!foundMatch) {
152  LogDebug("L1TEGammaOffline") << "Could not find a matching L1 EGamma " << std::endl;
153  return;
154  }
155 
156  double recoEt = probeElectron.et();
157  double recoEta = probeElectron.eta();
158  double recoPhi = probeElectron.phi();
159 
160  double l1Et = closestL1EGamma.et();
161  double l1Eta = closestL1EGamma.eta();
162  double l1Phi = closestL1EGamma.phi();
163 
164  // if no reco value, relative resolution does not make sense -> sort to overflow
165  double outOfBounds = 9999;
166  double resolutionEt = recoEt > 0 ? (l1Et - recoEt) / recoEt : outOfBounds;
167  double resolutionEta = std::abs(recoEta) > 0 ? (l1Eta - recoEta) / recoEta : outOfBounds;
168  double resolutionPhi = std::abs(recoPhi) > 0 ? (l1Phi - recoPhi) / recoPhi : outOfBounds;
169 
170  using namespace dqmoffline::l1t;
171  // eta
174 
175  if (std::abs(recoEta) <= 1.479) { // barrel
176  // et
179  //resolution
182  // phi
185  // resolution
188 
189  // turn-ons
193  if (l1Et > threshold) {
196  }
197  }
198  } else { // end-cap
199  // et
202  //resolution
205  // phi
208  // resolution
211 
212  // turn-ons
213  for (auto threshold : electronEfficiencyThresholds_) {
216  if (l1Et > threshold) {
219  }
220  }
221  }
222 }
#define LogDebug(id)
const_iterator end(int bx) const
MonitorElement * h_resolutionElectronPhi_EB_EE_
MonitorElement * h_L1EGammaPhivsElectronPhi_EE_
edm::EDGetTokenT< reco::GsfElectronCollection > theGsfElectronCollection_
MonitorElement * h_L1EGammaETvsElectronET_EB_EE_
virtual double eta() const final
momentum pseudorapidity
std::map< double, MonitorElement * > h_efficiencyElectronET_EB_EE_pass_
MonitorElement * h_resolutionElectronET_EB_
std::map< double, MonitorElement * > h_efficiencyElectronET_EB_total_
MonitorElement * h_L1EGammaETvsElectronET_EB_
MonitorElement * h_L1EGammaPhivsElectronPhi_EB_EE_
MonitorElement * h_resolutionElectronET_EE_
virtual double phi() const final
momentum azimuthal angle
virtual double et() const final
transverse energy
std::vector< double > electronEfficiencyThresholds_
MonitorElement * h_L1EGammaEtavsElectronEta_
edm::EDGetTokenT< l1t::EGammaBxCollection > stage2CaloLayer2EGammaToken_
MonitorElement * h_resolutionElectronEta_
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
bool isValid() const
Definition: HandleBase.h:74
std::map< double, MonitorElement * > h_efficiencyElectronET_EE_total_
double deltaR(double eta1, double eta2, double phi1, double phi2)
Definition: TreeUtility.cc:17
bool findTagAndProbePair(edm::Handle< reco::GsfElectronCollection > const &electrons)
std::map< double, MonitorElement * > h_efficiencyElectronET_EE_pass_
reco::GsfElectron probeElectron_
void fill2DWithinLimits(MonitorElement *mon, double valueX, double valueY, double weight=1.)
MonitorElement * h_resolutionElectronET_EB_EE_
std::map< double, MonitorElement * > h_efficiencyElectronET_EB_EE_total_
MonitorElement * h_resolutionElectronPhi_EB_
void fillWithinLimits(MonitorElement *mon, double value, double weight=1.)
MonitorElement * h_L1EGammaETvsElectronET_EE_
MonitorElement * h_resolutionElectronPhi_EE_
std::map< double, MonitorElement * > h_efficiencyElectronET_EB_pass_
const_iterator begin(int bx) const
MonitorElement * h_L1EGammaPhivsElectronPhi_EB_
void L1TEGammaOffline::fillPhotons ( edm::Event const &  e,
const unsigned int  nVertex 
)
private

Definition at line 352 of file L1TEGammaOffline.cc.

References funct::abs(), BXVector< T >::begin(), deltaR(), BXVector< T >::end(), reco::LeafCandidate::et(), reco::LeafCandidate::eta(), dqmoffline::l1t::fill2DWithinLimits(), dqmoffline::l1t::fillWithinLimits(), edm::Event::getByToken(), h_efficiencyPhotonET_EB_EE_pass_, h_efficiencyPhotonET_EB_EE_total_, h_efficiencyPhotonET_EB_pass_, h_efficiencyPhotonET_EB_total_, h_efficiencyPhotonET_EE_pass_, h_efficiencyPhotonET_EE_total_, h_L1EGammaEtavsPhotonEta_, h_L1EGammaETvsPhotonET_EB_, h_L1EGammaETvsPhotonET_EB_EE_, h_L1EGammaETvsPhotonET_EE_, h_L1EGammaPhivsPhotonPhi_EB_, h_L1EGammaPhivsPhotonPhi_EB_EE_, h_L1EGammaPhivsPhotonPhi_EE_, h_resolutionPhotonET_EB_, h_resolutionPhotonET_EB_EE_, h_resolutionPhotonET_EE_, h_resolutionPhotonEta_, h_resolutionPhotonPhi_EB_, h_resolutionPhotonPhi_EB_EE_, h_resolutionPhotonPhi_EE_, edm::HandleBase::isValid(), LogDebug, reco::LeafCandidate::phi(), photonEfficiencyThresholds_, jetCleaner_cfi::photons, stage2CaloLayer2EGammaToken_, thePhotonCollection_, and ctppsDiamondLocalTracks_cfi::threshold.

Referenced by analyze().

353 {
354  // TODO - just an example here
356  e.getByToken(stage2CaloLayer2EGammaToken_, l1EGamma);
357 
359  e.getByToken(thePhotonCollection_, photons);
360 
361  if (!photons.isValid()) {
362  edm::LogError("L1TEGammaOffline") << "invalid collection: reco::Photons " << std::endl;
363  return;
364  }
365  if (!l1EGamma.isValid()) {
366  edm::LogError("L1TEGammaOffline") << "invalid collection: L1 EGamma " << std::endl;
367  return;
368  }
369 
370  if(photons->size() ==0){
371  LogDebug("L1TEGammaOffline") << "No photons found in event." << std::endl;
372  return;
373  }
374 
375  auto probePhoton = photons->at(0);
376 
377  double minDeltaR = 0.3;
378  l1t::EGamma closestL1EGamma;
379  bool foundMatch = false;
380 
381  int bunchCrossing = 0;
382  for (auto egamma = l1EGamma->begin(bunchCrossing); egamma != l1EGamma->end(bunchCrossing); ++egamma) {
383  double currentDeltaR = deltaR(egamma->eta(), egamma->phi(), probePhoton.eta(), probePhoton.phi());
384  if (currentDeltaR > minDeltaR) {
385  continue;
386  } else {
387  minDeltaR = currentDeltaR;
388  closestL1EGamma = *egamma;
389  foundMatch = true;
390  }
391 
392  }
393 
394  if (!foundMatch) {
395  LogDebug("L1TEGammaOffline") << "Could not find a matching L1 EGamma " << std::endl;
396  return;
397  }
398 
399  double recoEt = probePhoton.et();
400  double recoEta = probePhoton.eta();
401  double recoPhi = probePhoton.phi();
402 
403  double l1Et = closestL1EGamma.et();
404  double l1Eta = closestL1EGamma.eta();
405  double l1Phi = closestL1EGamma.phi();
406 
407  // if no reco value, relative resolution does not make sense -> sort to overflow
408  double outOfBounds = 9999;
409  double resolutionEt = recoEt > 0 ? (l1Et - recoEt) / recoEt : outOfBounds;
410  double resolutionEta = std::abs(recoEta) > 0 ? (l1Eta - recoEta) / recoEta : outOfBounds;
411  double resolutionPhi = std::abs(recoPhi) > 0 ? (l1Phi - recoPhi) / recoPhi : outOfBounds;
412 
413  using namespace dqmoffline::l1t;
414  // eta
417 
418  if (std::abs(recoEta) <= 1.479) { // barrel
419  // et
422  //resolution
425  // phi
428  // resolution
431 
432  // turn-ons
436  if (l1Et > threshold) {
439  }
440  }
441  } else { // end-cap
442  // et
445  //resolution
448  // phi
451  // resolution
454 
455  // turn-ons
456  for (auto threshold : photonEfficiencyThresholds_) {
459  if (l1Et > threshold) {
462  }
463  }
464  }
465 }
#define LogDebug(id)
const_iterator end(int bx) const
std::map< double, MonitorElement * > h_efficiencyPhotonET_EE_total_
std::map< double, MonitorElement * > h_efficiencyPhotonET_EB_pass_
MonitorElement * h_L1EGammaPhivsPhotonPhi_EB_
virtual double eta() const final
momentum pseudorapidity
MonitorElement * h_L1EGammaETvsPhotonET_EB_
edm::EDGetTokenT< std::vector< reco::Photon > > thePhotonCollection_
MonitorElement * h_L1EGammaETvsPhotonET_EE_
std::map< double, MonitorElement * > h_efficiencyPhotonET_EB_EE_total_
MonitorElement * h_resolutionPhotonET_EE_
std::map< double, MonitorElement * > h_efficiencyPhotonET_EB_EE_pass_
virtual double phi() const final
momentum azimuthal angle
virtual double et() const final
transverse energy
MonitorElement * h_L1EGammaPhivsPhotonPhi_EB_EE_
MonitorElement * h_resolutionPhotonET_EB_
edm::EDGetTokenT< l1t::EGammaBxCollection > stage2CaloLayer2EGammaToken_
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
bool isValid() const
Definition: HandleBase.h:74
MonitorElement * h_resolutionPhotonEta_
MonitorElement * h_L1EGammaPhivsPhotonPhi_EE_
double deltaR(double eta1, double eta2, double phi1, double phi2)
Definition: TreeUtility.cc:17
std::map< double, MonitorElement * > h_efficiencyPhotonET_EB_total_
MonitorElement * h_resolutionPhotonPhi_EB_EE_
void fill2DWithinLimits(MonitorElement *mon, double valueX, double valueY, double weight=1.)
void fillWithinLimits(MonitorElement *mon, double value, double weight=1.)
MonitorElement * h_resolutionPhotonPhi_EB_
MonitorElement * h_L1EGammaETvsPhotonET_EB_EE_
MonitorElement * h_L1EGammaEtavsPhotonEta_
MonitorElement * h_resolutionPhotonPhi_EE_
std::vector< double > photonEfficiencyThresholds_
const_iterator begin(int bx) const
std::map< double, MonitorElement * > h_efficiencyPhotonET_EE_pass_
MonitorElement * h_resolutionPhotonET_EB_EE_
bool L1TEGammaOffline::findTagAndProbePair ( edm::Handle< reco::GsfElectronCollection > const &  electrons)
private

From https://cds.cern.ch/record/2202966/files/DP2016_044.pdf slide 8 Filter on HLT_Ele30WP60_Ele8_Mass55 (TODO) HLT_Ele30WP60_SC4_Mass55 (TODO) Seeded by L1SingleEG, unprescaled required

Tag & probe selection Electron required to be within ECAL fiducial volume (|η|<1.4442 || 1.566<|η|<2.5). 60 < m(ee) < 120 GeV. Opposite charge requirement. Tag required to pass medium electron ID and ET > 30 GeV. Probe required to pass loose electron ID.

Parameters
electrons
Returns

Definition at line 242 of file L1TEGammaOffline.cc.

References funct::abs(), dqmoffline::l1t::fillWithinLimits(), h_tagAndProbeMass_, passesLooseEleId(), passesMediumEleId(), probeElectron_, and tagElectron_.

Referenced by fillElectrons().

243 {
244  bool foundBoth(false);
245  auto nElectrons = electrons->size();
246  if (nElectrons < 2)
247  return false;
248 
249  for (auto tagElectron : *electrons) {
250  for (auto probeElectron : *electrons) {
251  if (tagElectron.p4() == probeElectron.p4())
252  continue;
253 
254  auto combined(tagElectron.p4() + probeElectron.p4());
255  auto tagAbsEta = std::abs(tagElectron.eta());
256  auto probeAbsEta = std::abs(probeElectron.eta());
257 
258  // EB-EE transition region
259  bool isEBEEGap = tagElectron.isEBEEGap() || probeElectron.isEBEEGap();
260  bool passesEta = !isEBEEGap && tagAbsEta < 2.5 && probeAbsEta < 2.5;
261  bool passesCharge = tagElectron.charge() == -probeElectron.charge();
262 
263  // https://github.com/ikrav/cmssw/blob/egm_id_80X_v1/RecoEgamma/ElectronIdentification/plugins/cuts/GsfEleFull5x5SigmaIEtaIEtaCut.cc#L45
264  bool tagPassesMediumID = passesMediumEleId(tagElectron) && tagElectron.et() > 30.;
265  bool probePassesLooseID = passesLooseEleId(probeElectron);
266  bool passesInvariantMass = combined.M() > 60 && combined.M() < 120;
267 
268  if (passesEta && passesInvariantMass && passesCharge && tagPassesMediumID && probePassesLooseID) {
269  foundBoth = true;
270  tagElectron_ = tagElectron;
271  probeElectron_ = probeElectron;
272  // plot tag & probe invariant mass
274  break;
275  }
276  }
277 
278  }
279  return foundBoth;
280 }
MonitorElement * h_tagAndProbeMass_
bool passesMediumEleId(reco::GsfElectron const &electron) const
bool passesLooseEleId(reco::GsfElectron const &electron) const
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
reco::GsfElectron tagElectron_
reco::GsfElectron probeElectron_
void fillWithinLimits(MonitorElement *mon, double value, double weight=1.)
bool L1TEGammaOffline::passesLooseEleId ( reco::GsfElectron const &  electron) const
private

Structure from https://github.com/cms-sw/cmssw/blob/CMSSW_9_0_X/DQMOffline/EGamma/plugins/ElectronAnalyzer.cc Values from https://twiki.cern.ch/twiki/bin/view/CMS/CutBasedElectronIdentificationRun2

Definition at line 288 of file L1TEGammaOffline.cc.

References funct::abs(), reco::GsfElectron::deltaEtaSuperClusterTrackAtVtx(), reco::GsfElectron::deltaPhiSuperClusterTrackAtVtx(), reco::GsfElectron::ecalEnergy(), reco::GsfElectron::eSuperClusterOverP(), reco::GsfElectron::hadronicOverEm(), reco::GsfElectron::isEB(), reco::GsfElectron::isEE(), and reco::GsfElectron::scSigmaIEtaIEta().

Referenced by findTagAndProbePair().

289 {
290  const float ecal_energy_inverse = 1.0 / electron.ecalEnergy();
291  const float eSCoverP = electron.eSuperClusterOverP();
292  const float eOverP = std::abs(1.0 - eSCoverP) * ecal_energy_inverse;
293 
294  if (electron.isEB() && eOverP > 0.241)
295  return false;
296  if (electron.isEE() && eOverP > 0.14)
297  return false;
298  if (electron.isEB() && std::abs(electron.deltaEtaSuperClusterTrackAtVtx()) > 0.00477)
299  return false;
300  if (electron.isEE() && std::abs(electron.deltaEtaSuperClusterTrackAtVtx()) > 0.00868)
301  return false;
302  if (electron.isEB() && std::abs(electron.deltaPhiSuperClusterTrackAtVtx()) > 0.222)
303  return false;
304  if (electron.isEE() && std::abs(electron.deltaPhiSuperClusterTrackAtVtx()) > 0.213)
305  return false;
306  if (electron.isEB() && electron.scSigmaIEtaIEta() > 0.011)
307  return false;
308  if (electron.isEE() && electron.scSigmaIEtaIEta() > 0.0314)
309  return false;
310  if (electron.isEB() && electron.hadronicOverEm() > 0.298)
311  return false;
312  if (electron.isEE() && electron.hadronicOverEm() > 0.101)
313  return false;
314  return true;
315 }
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
bool L1TEGammaOffline::passesMediumEleId ( reco::GsfElectron const &  electron) const
private

Definition at line 323 of file L1TEGammaOffline.cc.

References funct::abs(), reco::GsfElectron::deltaEtaSuperClusterTrackAtVtx(), reco::GsfElectron::deltaPhiSuperClusterTrackAtVtx(), reco::GsfElectron::ecalEnergy(), reco::GsfElectron::eSuperClusterOverP(), reco::GsfElectron::hadronicOverEm(), reco::GsfElectron::isEB(), reco::GsfElectron::isEE(), and reco::GsfElectron::scSigmaIEtaIEta().

Referenced by findTagAndProbePair().

324 {
325  const float ecal_energy_inverse = 1.0 / electron.ecalEnergy();
326  const float eSCoverP = electron.eSuperClusterOverP();
327  const float eOverP = std::abs(1.0 - eSCoverP) * ecal_energy_inverse;
328 
329  if (electron.isEB() && eOverP < 0.134)
330  return false;
331  if (electron.isEE() && eOverP > 0.13)
332  return false;
333  if (electron.isEB() && std::abs(electron.deltaEtaSuperClusterTrackAtVtx()) > 0.00311)
334  return false;
335  if (electron.isEE() && std::abs(electron.deltaEtaSuperClusterTrackAtVtx()) > 0.00609)
336  return false;
337  if (electron.isEB() && std::abs(electron.deltaPhiSuperClusterTrackAtVtx()) > 0.103)
338  return false;
339  if (electron.isEE() && std::abs(electron.deltaPhiSuperClusterTrackAtVtx()) > 0.045)
340  return false;
341  if (electron.isEB() && electron.scSigmaIEtaIEta() > 0.00998)
342  return false;
343  if (electron.isEE() && electron.scSigmaIEtaIEta() > 0.0298)
344  return false;
345  if (electron.isEB() && electron.hadronicOverEm() > 0.253)
346  return false;
347  if (electron.isEE() && electron.hadronicOverEm() > 0.0878)
348  return false;
349  return true;
350 }
Abs< T >::type abs(const T &t)
Definition: Abs.h:22

Member Data Documentation

std::string L1TEGammaOffline::efficiencyFolder_
private

Definition at line 80 of file L1TEGammaOffline.h.

Referenced by bookElectronHistos(), and bookPhotonHistos().

std::vector<double> L1TEGammaOffline::electronEfficiencyBins_
private

Definition at line 85 of file L1TEGammaOffline.h.

Referenced by bookElectronHistos().

std::vector<double> L1TEGammaOffline::electronEfficiencyThresholds_
private

Definition at line 84 of file L1TEGammaOffline.h.

Referenced by bookElectronHistos(), and fillElectrons().

std::map<double, MonitorElement*> L1TEGammaOffline::h_efficiencyElectronET_EB_EE_pass_
private

Definition at line 124 of file L1TEGammaOffline.h.

Referenced by bookElectronHistos(), and fillElectrons().

std::map<double, MonitorElement*> L1TEGammaOffline::h_efficiencyElectronET_EB_EE_total_
private

Definition at line 130 of file L1TEGammaOffline.h.

Referenced by bookElectronHistos(), and fillElectrons().

std::map<double, MonitorElement*> L1TEGammaOffline::h_efficiencyElectronET_EB_pass_
private

Definition at line 122 of file L1TEGammaOffline.h.

Referenced by bookElectronHistos(), and fillElectrons().

std::map<double, MonitorElement*> L1TEGammaOffline::h_efficiencyElectronET_EB_total_
private

Definition at line 128 of file L1TEGammaOffline.h.

Referenced by bookElectronHistos(), and fillElectrons().

std::map<double, MonitorElement*> L1TEGammaOffline::h_efficiencyElectronET_EE_pass_
private

Definition at line 123 of file L1TEGammaOffline.h.

Referenced by bookElectronHistos(), and fillElectrons().

std::map<double, MonitorElement*> L1TEGammaOffline::h_efficiencyElectronET_EE_total_
private

Definition at line 129 of file L1TEGammaOffline.h.

Referenced by bookElectronHistos(), and fillElectrons().

std::map<double, MonitorElement*> L1TEGammaOffline::h_efficiencyPhotonET_EB_EE_pass_
private

Definition at line 157 of file L1TEGammaOffline.h.

Referenced by bookPhotonHistos(), and fillPhotons().

std::map<double, MonitorElement*> L1TEGammaOffline::h_efficiencyPhotonET_EB_EE_total_
private

Definition at line 163 of file L1TEGammaOffline.h.

Referenced by bookPhotonHistos(), and fillPhotons().

std::map<double, MonitorElement*> L1TEGammaOffline::h_efficiencyPhotonET_EB_pass_
private

Definition at line 155 of file L1TEGammaOffline.h.

Referenced by bookPhotonHistos(), and fillPhotons().

std::map<double, MonitorElement*> L1TEGammaOffline::h_efficiencyPhotonET_EB_total_
private

Definition at line 161 of file L1TEGammaOffline.h.

Referenced by bookPhotonHistos(), and fillPhotons().

std::map<double, MonitorElement*> L1TEGammaOffline::h_efficiencyPhotonET_EE_pass_
private

Definition at line 156 of file L1TEGammaOffline.h.

Referenced by bookPhotonHistos(), and fillPhotons().

std::map<double, MonitorElement*> L1TEGammaOffline::h_efficiencyPhotonET_EE_total_
private

Definition at line 162 of file L1TEGammaOffline.h.

Referenced by bookPhotonHistos(), and fillPhotons().

MonitorElement* L1TEGammaOffline::h_L1EGammaEtavsElectronEta_
private

Definition at line 108 of file L1TEGammaOffline.h.

Referenced by bookElectronHistos(), and fillElectrons().

MonitorElement* L1TEGammaOffline::h_L1EGammaEtavsPhotonEta_
private

Definition at line 141 of file L1TEGammaOffline.h.

Referenced by bookPhotonHistos(), and fillPhotons().

MonitorElement* L1TEGammaOffline::h_L1EGammaETvsElectronET_EB_
private

Definition at line 100 of file L1TEGammaOffline.h.

Referenced by bookElectronHistos(), and fillElectrons().

MonitorElement* L1TEGammaOffline::h_L1EGammaETvsElectronET_EB_EE_
private

Definition at line 102 of file L1TEGammaOffline.h.

Referenced by bookElectronHistos(), and fillElectrons().

MonitorElement* L1TEGammaOffline::h_L1EGammaETvsElectronET_EE_
private

Definition at line 101 of file L1TEGammaOffline.h.

Referenced by bookElectronHistos(), and fillElectrons().

MonitorElement* L1TEGammaOffline::h_L1EGammaETvsPhotonET_EB_
private

Definition at line 133 of file L1TEGammaOffline.h.

Referenced by bookPhotonHistos(), and fillPhotons().

MonitorElement* L1TEGammaOffline::h_L1EGammaETvsPhotonET_EB_EE_
private

Definition at line 135 of file L1TEGammaOffline.h.

Referenced by bookPhotonHistos(), and fillPhotons().

MonitorElement* L1TEGammaOffline::h_L1EGammaETvsPhotonET_EE_
private

Definition at line 134 of file L1TEGammaOffline.h.

Referenced by bookPhotonHistos(), and fillPhotons().

MonitorElement* L1TEGammaOffline::h_L1EGammaPhivsElectronPhi_EB_
private

Definition at line 104 of file L1TEGammaOffline.h.

Referenced by bookElectronHistos(), and fillElectrons().

MonitorElement* L1TEGammaOffline::h_L1EGammaPhivsElectronPhi_EB_EE_
private

Definition at line 106 of file L1TEGammaOffline.h.

Referenced by bookElectronHistos(), and fillElectrons().

MonitorElement* L1TEGammaOffline::h_L1EGammaPhivsElectronPhi_EE_
private

Definition at line 105 of file L1TEGammaOffline.h.

Referenced by bookElectronHistos(), and fillElectrons().

MonitorElement* L1TEGammaOffline::h_L1EGammaPhivsPhotonPhi_EB_
private

Definition at line 137 of file L1TEGammaOffline.h.

Referenced by bookPhotonHistos(), and fillPhotons().

MonitorElement* L1TEGammaOffline::h_L1EGammaPhivsPhotonPhi_EB_EE_
private

Definition at line 139 of file L1TEGammaOffline.h.

Referenced by bookPhotonHistos(), and fillPhotons().

MonitorElement* L1TEGammaOffline::h_L1EGammaPhivsPhotonPhi_EE_
private

Definition at line 138 of file L1TEGammaOffline.h.

Referenced by bookPhotonHistos(), and fillPhotons().

MonitorElement* L1TEGammaOffline::h_nVertex_
private

Definition at line 96 of file L1TEGammaOffline.h.

Referenced by analyze(), and bookElectronHistos().

MonitorElement* L1TEGammaOffline::h_resolutionElectronET_EB_
private

Definition at line 111 of file L1TEGammaOffline.h.

Referenced by bookElectronHistos(), and fillElectrons().

MonitorElement* L1TEGammaOffline::h_resolutionElectronET_EB_EE_
private

Definition at line 113 of file L1TEGammaOffline.h.

Referenced by bookElectronHistos(), and fillElectrons().

MonitorElement* L1TEGammaOffline::h_resolutionElectronET_EE_
private

Definition at line 112 of file L1TEGammaOffline.h.

Referenced by bookElectronHistos(), and fillElectrons().

MonitorElement* L1TEGammaOffline::h_resolutionElectronEta_
private

Definition at line 119 of file L1TEGammaOffline.h.

Referenced by bookElectronHistos(), and fillElectrons().

MonitorElement* L1TEGammaOffline::h_resolutionElectronPhi_EB_
private

Definition at line 115 of file L1TEGammaOffline.h.

Referenced by bookElectronHistos(), and fillElectrons().

MonitorElement* L1TEGammaOffline::h_resolutionElectronPhi_EB_EE_
private

Definition at line 117 of file L1TEGammaOffline.h.

Referenced by bookElectronHistos(), and fillElectrons().

MonitorElement* L1TEGammaOffline::h_resolutionElectronPhi_EE_
private

Definition at line 116 of file L1TEGammaOffline.h.

Referenced by bookElectronHistos(), and fillElectrons().

MonitorElement* L1TEGammaOffline::h_resolutionPhotonET_EB_
private

Definition at line 144 of file L1TEGammaOffline.h.

Referenced by bookPhotonHistos(), and fillPhotons().

MonitorElement* L1TEGammaOffline::h_resolutionPhotonET_EB_EE_
private

Definition at line 146 of file L1TEGammaOffline.h.

Referenced by bookPhotonHistos(), and fillPhotons().

MonitorElement* L1TEGammaOffline::h_resolutionPhotonET_EE_
private

Definition at line 145 of file L1TEGammaOffline.h.

Referenced by bookPhotonHistos(), and fillPhotons().

MonitorElement* L1TEGammaOffline::h_resolutionPhotonEta_
private

Definition at line 152 of file L1TEGammaOffline.h.

Referenced by bookPhotonHistos(), and fillPhotons().

MonitorElement* L1TEGammaOffline::h_resolutionPhotonPhi_EB_
private

Definition at line 148 of file L1TEGammaOffline.h.

Referenced by bookPhotonHistos(), and fillPhotons().

MonitorElement* L1TEGammaOffline::h_resolutionPhotonPhi_EB_EE_
private

Definition at line 150 of file L1TEGammaOffline.h.

Referenced by bookPhotonHistos(), and fillPhotons().

MonitorElement* L1TEGammaOffline::h_resolutionPhotonPhi_EE_
private

Definition at line 149 of file L1TEGammaOffline.h.

Referenced by bookPhotonHistos(), and fillPhotons().

MonitorElement* L1TEGammaOffline::h_tagAndProbeMass_
private

Definition at line 97 of file L1TEGammaOffline.h.

Referenced by bookElectronHistos(), and findTagAndProbePair().

std::string L1TEGammaOffline::histFolder_
private

Definition at line 79 of file L1TEGammaOffline.h.

Referenced by bookElectronHistos(), and bookPhotonHistos().

std::vector<double> L1TEGammaOffline::photonEfficiencyBins_
private

Definition at line 88 of file L1TEGammaOffline.h.

Referenced by bookPhotonHistos().

std::vector<double> L1TEGammaOffline::photonEfficiencyThresholds_
private

Definition at line 87 of file L1TEGammaOffline.h.

Referenced by bookPhotonHistos(), and fillPhotons().

reco::GsfElectron L1TEGammaOffline::probeElectron_
private

Definition at line 91 of file L1TEGammaOffline.h.

Referenced by fillElectrons(), and findTagAndProbePair().

math::XYZPoint L1TEGammaOffline::PVPoint_
private

Definition at line 68 of file L1TEGammaOffline.h.

edm::EDGetTokenT<l1t::EGammaBxCollection> L1TEGammaOffline::stage2CaloLayer2EGammaToken_
private

Definition at line 82 of file L1TEGammaOffline.h.

Referenced by fillElectrons(), and fillPhotons().

double L1TEGammaOffline::tagAndProbleInvariantMass_
private

Definition at line 92 of file L1TEGammaOffline.h.

reco::GsfElectron L1TEGammaOffline::tagElectron_
private

Definition at line 90 of file L1TEGammaOffline.h.

Referenced by findTagAndProbePair().

edm::EDGetTokenT<reco::BeamSpot> L1TEGammaOffline::theBSCollection_
private

Definition at line 74 of file L1TEGammaOffline.h.

edm::EDGetTokenT<reco::GsfElectronCollection> L1TEGammaOffline::theGsfElectronCollection_
private

Definition at line 71 of file L1TEGammaOffline.h.

Referenced by fillElectrons().

edm::EDGetTokenT<std::vector<reco::Photon> > L1TEGammaOffline::thePhotonCollection_
private

Definition at line 72 of file L1TEGammaOffline.h.

Referenced by fillPhotons().

edm::EDGetTokenT<reco::VertexCollection> L1TEGammaOffline::thePVCollection_
private

Definition at line 73 of file L1TEGammaOffline.h.

Referenced by analyze().

edm::EDGetTokenT<trigger::TriggerEvent> L1TEGammaOffline::triggerEvent_
private

Definition at line 75 of file L1TEGammaOffline.h.

edm::InputTag L1TEGammaOffline::triggerFilter_
private

Definition at line 77 of file L1TEGammaOffline.h.

std::string L1TEGammaOffline::triggerPath_
private

Definition at line 78 of file L1TEGammaOffline.h.

edm::EDGetTokenT<edm::TriggerResults> L1TEGammaOffline::triggerResults_
private

Definition at line 76 of file L1TEGammaOffline.h.