CMS 3D CMS Logo

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

#include <ESRecoSummary.h>

Inheritance diagram for ESRecoSummary:
DQMEDAnalyzer edm::stream::EDProducer< edm::GlobalCache< DQMEDAnalyzerGlobalCache >, edm::EndRunProducer, edm::EndLuminosityBlockProducer, edm::Accumulator >

Public Member Functions

 ESRecoSummary (const edm::ParameterSet &)
 
 ~ESRecoSummary () override
 
- Public Member Functions inherited from DQMEDAnalyzer
void accumulate (edm::Event const &event, edm::EventSetup const &setup) final
 
void beginLuminosityBlock (edm::LuminosityBlock const &lumi, edm::EventSetup const &setup) final
 
void beginRun (edm::Run const &run, edm::EventSetup const &setup) final
 
void beginStream (edm::StreamID id) final
 
virtual void dqmBeginRun (edm::Run const &, edm::EventSetup const &)
 
 DQMEDAnalyzer ()
 
void endLuminosityBlock (edm::LuminosityBlock const &lumi, edm::EventSetup const &setup) final
 
void endRun (edm::Run const &run, edm::EventSetup const &setup) final
 
virtual bool getCanSaveByLumi ()
 
- Public Member Functions inherited from edm::stream::EDProducer< edm::GlobalCache< DQMEDAnalyzerGlobalCache >, edm::EndRunProducer, edm::EndLuminosityBlockProducer, edm::Accumulator >
 EDProducer ()=default
 
 EDProducer (const EDProducer &)=delete
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginProcessBlocks () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndProcessBlocks () const final
 
bool hasAbilityToProduceInEndRuns () const final
 
const EDProduceroperator= (const EDProducer &)=delete
 

Protected Attributes

edm::EDGetTokenT< reco::PreshowerClusterCollectionesClusterCollectionX_
 
edm::EDGetTokenT< reco::PreshowerClusterCollectionesClusterCollectionY_
 
edm::EDGetTokenT< ESRecHitCollectionesRecHitCollection_
 
edm::EDGetTokenT< reco::SuperClusterCollectionsuperClusterCollection_EE_
 
- Protected Attributes inherited from DQMEDAnalyzer
edm::EDPutTokenT< DQMTokenlumiToken_
 
edm::EDPutTokenT< DQMTokenrunToken_
 
unsigned int streamId_
 

Private Member Functions

void analyze (const edm::Event &, const edm::EventSetup &) override
 
void bookHistograms (DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
 

Private Attributes

MonitorElementh_esClusters_energy_plane1
 
MonitorElementh_esClusters_energy_plane2
 
MonitorElementh_esClusters_energy_ratio
 
MonitorElementh_recHits_ES_energyMax
 
MonitorElementh_recHits_ES_time
 
std::string prefixME_
 

Additional Inherited Members

- Public Types inherited from DQMEDAnalyzer
typedef dqm::reco::DQMStore DQMStore
 
typedef dqm::reco::MonitorElement MonitorElement
 
- Public Types inherited from edm::stream::EDProducer< edm::GlobalCache< DQMEDAnalyzerGlobalCache >, edm::EndRunProducer, edm::EndLuminosityBlockProducer, edm::Accumulator >
using CacheTypes = CacheContexts< T... >
 
using GlobalCache = typename CacheTypes::GlobalCache
 
using HasAbility = AbilityChecker< T... >
 
using InputProcessBlockCache = typename CacheTypes::InputProcessBlockCache
 
using LuminosityBlockCache = typename CacheTypes::LuminosityBlockCache
 
using LuminosityBlockContext = LuminosityBlockContextT< LuminosityBlockCache, RunCache, GlobalCache >
 
using LuminosityBlockSummaryCache = typename CacheTypes::LuminosityBlockSummaryCache
 
using RunCache = typename CacheTypes::RunCache
 
using RunContext = RunContextT< RunCache, GlobalCache >
 
using RunSummaryCache = typename CacheTypes::RunSummaryCache
 
- Static Public Member Functions inherited from DQMEDAnalyzer
static void globalEndJob (DQMEDAnalyzerGlobalCache const *)
 
static void globalEndLuminosityBlockProduce (edm::LuminosityBlock &lumi, edm::EventSetup const &setup, LuminosityBlockContext const *context)
 
static void globalEndRunProduce (edm::Run &run, edm::EventSetup const &setup, RunContext const *context)
 
static std::unique_ptr< DQMEDAnalyzerGlobalCacheinitializeGlobalCache (edm::ParameterSet const &)
 
- Protected Member Functions inherited from DQMEDAnalyzer
uint64_t meId () const
 

Detailed Description

Definition at line 15 of file ESRecoSummary.h.

Constructor & Destructor Documentation

◆ ESRecoSummary()

ESRecoSummary::ESRecoSummary ( const edm::ParameterSet ps)
explicit

Definition at line 42 of file ESRecoSummary.cc.

References esClusterCollectionX_, esClusterCollectionY_, esRecHitCollection_, edm::ParameterSet::getParameter(), edm::ParameterSet::getUntrackedParameter(), prefixME_, AlCaHLTBitMon_QueryRunRegistry::string, and superClusterCollection_EE_.

42  {
43  prefixME_ = ps.getUntrackedParameter<std::string>("prefixME", "");
44 
45  // now do what ever initialization is needed
46  esRecHitCollection_ = consumes<ESRecHitCollection>(ps.getParameter<edm::InputTag>("recHitCollection_ES"));
48  consumes<reco::PreshowerClusterCollection>(ps.getParameter<edm::InputTag>("ClusterCollectionX_ES"));
50  consumes<reco::PreshowerClusterCollection>(ps.getParameter<edm::InputTag>("ClusterCollectionY_ES"));
51 
53  consumes<reco::SuperClusterCollection>(ps.getParameter<edm::InputTag>("superClusterCollection_EE"));
54 }
T getParameter(std::string const &) const
Definition: ParameterSet.h:307
edm::EDGetTokenT< ESRecHitCollection > esRecHitCollection_
Definition: ESRecoSummary.h:37
T getUntrackedParameter(std::string const &, T const &) const
edm::EDGetTokenT< reco::PreshowerClusterCollection > esClusterCollectionY_
Definition: ESRecoSummary.h:39
std::string prefixME_
Definition: ESRecoSummary.h:24
edm::EDGetTokenT< reco::PreshowerClusterCollection > esClusterCollectionX_
Definition: ESRecoSummary.h:38
edm::EDGetTokenT< reco::SuperClusterCollection > superClusterCollection_EE_
Definition: ESRecoSummary.h:36

◆ ~ESRecoSummary()

ESRecoSummary::~ESRecoSummary ( )
inlineoverride

Definition at line 18 of file ESRecoSummary.h.

18 {}

Member Function Documentation

◆ analyze()

void ESRecoSummary::analyze ( const edm::Event ev,
const edm::EventSetup  
)
overrideprivatevirtual

Reimplemented from DQMEDAnalyzer.

Definition at line 74 of file ESRecoSummary.cc.

References edm::SortedCollection< T, SORT >::begin(), DMR_cfg::cerr, edm::SortedCollection< T, SORT >::end(), reco::CaloCluster::energy(), esClusterCollectionX_, esClusterCollectionY_, esRecHitCollection_, makeMEIFBenchmarkPlots::ev, dqm::impl::MonitorElement::Fill(), h_esClusters_energy_plane1, h_esClusters_energy_plane2, h_esClusters_energy_ratio, h_recHits_ES_energyMax, h_recHits_ES_time, edm::HandleBase::isValid(), edm::Handle< T >::product(), and superClusterCollection_EE_.

74  {
75  // Preshower RecHits
77  ev.getByToken(esRecHitCollection_, recHitsES);
78  const ESRecHitCollection *thePreShowerRecHits = recHitsES.product();
79 
80  if (!recHitsES.isValid()) {
81  std::cerr << "ESRecoSummary::analyze --> recHitsES not found" << std::endl;
82  }
83 
84  float maxRecHitEnergyES = -999.;
85 
86  for (ESRecHitCollection::const_iterator esItr = thePreShowerRecHits->begin(); esItr != thePreShowerRecHits->end();
87  ++esItr) {
88  h_recHits_ES_time->Fill(esItr->time());
89  if (esItr->energy() > maxRecHitEnergyES)
90  maxRecHitEnergyES = esItr->energy();
91 
92  } // end loop over ES rec Hits
93 
94  h_recHits_ES_energyMax->Fill(maxRecHitEnergyES);
95 
96  // ES clusters in X plane
98  ev.getByToken(esClusterCollectionX_, esClustersX);
99  const reco::PreshowerClusterCollection *ESclustersX = esClustersX.product();
100 
101  // ES clusters in Y plane
103  ev.getByToken(esClusterCollectionY_, esClustersY);
104  const reco::PreshowerClusterCollection *ESclustersY = esClustersY.product();
105 
106  // ... endcap
108  ev.getByToken(superClusterCollection_EE_, superClusters_EE_h);
109  const reco::SuperClusterCollection *theEndcapSuperClusters = superClusters_EE_h.product();
110  if (!superClusters_EE_h.isValid()) {
111  std::cerr << "EcalRecHitSummary::analyze --> superClusters_EE_h not found" << std::endl;
112  }
113 
114  // loop over all super clusters
115  for (reco::SuperClusterCollection::const_iterator itSC = theEndcapSuperClusters->begin();
116  itSC != theEndcapSuperClusters->end();
117  ++itSC) {
118  if (fabs(itSC->eta()) < 1.65 || fabs(itSC->eta()) > 2.6)
119  continue;
120 
121  float ESenergyPlane1 = 0.;
122  float ESenergyPlane2 = 0.;
123 
124  // Loop over all ECAL Basic clusters in the supercluster
125  for (reco::CaloCluster_iterator ecalBasicCluster = itSC->clustersBegin(); ecalBasicCluster != itSC->clustersEnd();
126  ecalBasicCluster++) {
127  const reco::CaloClusterPtr ecalBasicClusterPtr = *(ecalBasicCluster);
128 
129  for (reco::PreshowerClusterCollection::const_iterator iESClus = ESclustersX->begin();
130  iESClus != ESclustersX->end();
131  ++iESClus) {
132  const reco::CaloClusterPtr preshBasicCluster = iESClus->basicCluster();
133  const reco::PreshowerCluster *esCluster = &*iESClus;
134  if (preshBasicCluster == ecalBasicClusterPtr) {
135  ESenergyPlane1 += esCluster->energy();
136  }
137  } // end of x loop
138 
139  for (reco::PreshowerClusterCollection::const_iterator iESClus = ESclustersY->begin();
140  iESClus != ESclustersY->end();
141  ++iESClus) {
142  const reco::CaloClusterPtr preshBasicCluster = iESClus->basicCluster();
143  const reco::PreshowerCluster *esCluster = &*iESClus;
144  if (preshBasicCluster == ecalBasicClusterPtr) {
145  ESenergyPlane2 += esCluster->energy();
146  }
147  } // end of y loop
148  } // end loop over all basic clusters in the supercluster
149 
150  // cout<<"DQM : "<<ESenergyPlane1<<" "<<ESenergyPlane2<<endl;
151  h_esClusters_energy_plane1->Fill(ESenergyPlane1);
152  h_esClusters_energy_plane2->Fill(ESenergyPlane2);
153  if (ESenergyPlane1 > 0 && ESenergyPlane2 > 0)
154  h_esClusters_energy_ratio->Fill(ESenergyPlane1 / ESenergyPlane2);
155 
156  } // end loop over superclusters
157 }
T const * product() const
Definition: Handle.h:70
std::vector< EcalRecHit >::const_iterator const_iterator
MonitorElement * h_esClusters_energy_plane1
Definition: ESRecoSummary.h:30
MonitorElement * h_recHits_ES_time
Definition: ESRecoSummary.h:28
edm::EDGetTokenT< ESRecHitCollection > esRecHitCollection_
Definition: ESRecoSummary.h:37
MonitorElement * h_esClusters_energy_ratio
Definition: ESRecoSummary.h:32
void Fill(long long x)
edm::EDGetTokenT< reco::PreshowerClusterCollection > esClusterCollectionY_
Definition: ESRecoSummary.h:39
std::vector< SuperCluster > SuperClusterCollection
collection of SuperCluser objectr
MonitorElement * h_recHits_ES_energyMax
Definition: ESRecoSummary.h:27
std::vector< PreshowerCluster > PreshowerClusterCollection
collection of PreshowerCluster objects
const_iterator begin() const
const_iterator end() const
double energy() const
cluster energy
Definition: CaloCluster.h:149
bool isValid() const
Definition: HandleBase.h:70
edm::EDGetTokenT< reco::PreshowerClusterCollection > esClusterCollectionX_
Definition: ESRecoSummary.h:38
MonitorElement * h_esClusters_energy_plane2
Definition: ESRecoSummary.h:31
edm::EDGetTokenT< reco::SuperClusterCollection > superClusterCollection_EE_
Definition: ESRecoSummary.h:36

◆ bookHistograms()

void ESRecoSummary::bookHistograms ( DQMStore::IBooker iBooker,
edm::Run const &  ,
edm::EventSetup const &   
)
overrideprivatevirtual

Implements DQMEDAnalyzer.

Definition at line 56 of file ESRecoSummary.cc.

References dqm::implementation::IBooker::book1D(), h_esClusters_energy_plane1, h_esClusters_energy_plane2, h_esClusters_energy_ratio, h_recHits_ES_energyMax, h_recHits_ES_time, prefixME_, and dqm::implementation::NavigatorBase::setCurrentFolder().

56  {
57  // Monitor Elements (ex THXD)
58  iBooker.setCurrentFolder(prefixME_ + "/ESRecoSummary"); // to organise the histos in folders
59 
60  // Preshower ----------------------------------------------
61  h_recHits_ES_energyMax = iBooker.book1D("recHits_ES_energyMax", "recHits_ES_energyMax", 200, 0., 0.01);
62  h_recHits_ES_time = iBooker.book1D("recHits_ES_time", "recHits_ES_time", 200, -100., 100.);
63 
64  h_esClusters_energy_plane1 = iBooker.book1D("esClusters_energy_plane1", "esClusters_energy_plane1", 200, 0., 0.01);
65  h_esClusters_energy_plane2 = iBooker.book1D("esClusters_energy_plane2", "esClusters_energy_plane2", 200, 0., 0.01);
66  h_esClusters_energy_ratio = iBooker.book1D("esClusters_energy_ratio", "esClusters_energy_ratio", 200, 0., 20.);
67 }
virtual void setCurrentFolder(std::string const &fullpath)
Definition: DQMStore.cc:36
MonitorElement * h_esClusters_energy_plane1
Definition: ESRecoSummary.h:30
MonitorElement * h_recHits_ES_time
Definition: ESRecoSummary.h:28
MonitorElement * h_esClusters_energy_ratio
Definition: ESRecoSummary.h:32
std::string prefixME_
Definition: ESRecoSummary.h:24
MonitorElement * h_recHits_ES_energyMax
Definition: ESRecoSummary.h:27
MonitorElement * h_esClusters_energy_plane2
Definition: ESRecoSummary.h:31
MonitorElement * book1D(TString const &name, TString const &title, int const nchX, double const lowX, double const highX, FUNC onbooking=NOOP())
Definition: DQMStore.h:98

Member Data Documentation

◆ esClusterCollectionX_

edm::EDGetTokenT<reco::PreshowerClusterCollection> ESRecoSummary::esClusterCollectionX_
protected

Definition at line 38 of file ESRecoSummary.h.

Referenced by analyze(), and ESRecoSummary().

◆ esClusterCollectionY_

edm::EDGetTokenT<reco::PreshowerClusterCollection> ESRecoSummary::esClusterCollectionY_
protected

Definition at line 39 of file ESRecoSummary.h.

Referenced by analyze(), and ESRecoSummary().

◆ esRecHitCollection_

edm::EDGetTokenT<ESRecHitCollection> ESRecoSummary::esRecHitCollection_
protected

Definition at line 37 of file ESRecoSummary.h.

Referenced by analyze(), and ESRecoSummary().

◆ h_esClusters_energy_plane1

MonitorElement* ESRecoSummary::h_esClusters_energy_plane1
private

Definition at line 30 of file ESRecoSummary.h.

Referenced by analyze(), and bookHistograms().

◆ h_esClusters_energy_plane2

MonitorElement* ESRecoSummary::h_esClusters_energy_plane2
private

Definition at line 31 of file ESRecoSummary.h.

Referenced by analyze(), and bookHistograms().

◆ h_esClusters_energy_ratio

MonitorElement* ESRecoSummary::h_esClusters_energy_ratio
private

Definition at line 32 of file ESRecoSummary.h.

Referenced by analyze(), and bookHistograms().

◆ h_recHits_ES_energyMax

MonitorElement* ESRecoSummary::h_recHits_ES_energyMax
private

Definition at line 27 of file ESRecoSummary.h.

Referenced by analyze(), and bookHistograms().

◆ h_recHits_ES_time

MonitorElement* ESRecoSummary::h_recHits_ES_time
private

Definition at line 28 of file ESRecoSummary.h.

Referenced by analyze(), and bookHistograms().

◆ prefixME_

std::string ESRecoSummary::prefixME_
private

Definition at line 24 of file ESRecoSummary.h.

Referenced by bookHistograms(), and ESRecoSummary().

◆ superClusterCollection_EE_

edm::EDGetTokenT<reco::SuperClusterCollection> ESRecoSummary::superClusterCollection_EE_
protected

Definition at line 36 of file ESRecoSummary.h.

Referenced by analyze(), and ESRecoSummary().