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::one::EDProducer< edm::Accumulator, edm::EndLuminosityBlockProducer, edm::EndRunProducer, edm::one::WatchLuminosityBlocks, edm::one::WatchRuns > edm::one::EDProducerBase edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

 ESRecoSummary (const edm::ParameterSet &)
 
 ~ESRecoSummary () override
 
- Public Member Functions inherited from DQMEDAnalyzer
void accumulate (edm::Event const &ev, edm::EventSetup const &es) final
 
virtual void analyze (edm::Event const &, edm::EventSetup const &)
 
void beginLuminosityBlock (edm::LuminosityBlock const &lumi, edm::EventSetup const &setup) override
 
void beginRun (edm::Run const &run, edm::EventSetup const &setup) final
 
virtual void dqmBeginRun (edm::Run const &, edm::EventSetup const &)
 
 DQMEDAnalyzer ()
 
 DQMEDAnalyzer (DQMEDAnalyzer const &)=delete
 
 DQMEDAnalyzer (DQMEDAnalyzer &&)=delete
 
void endLuminosityBlock (edm::LuminosityBlock const &, edm::EventSetup const &) override
 
void endLuminosityBlockProduce (edm::LuminosityBlock &lumi, edm::EventSetup const &setup) final
 
void endRun (edm::Run const &run, edm::EventSetup const &setup) override
 
void endRunProduce (edm::Run &run, edm::EventSetup const &setup) override
 
 ~DQMEDAnalyzer () override=default
 
- Public Member Functions inherited from edm::one::EDProducer< edm::Accumulator, edm::EndLuminosityBlockProducer, edm::EndRunProducer, edm::one::WatchLuminosityBlocks, edm::one::WatchRuns >
 EDProducer ()=default
 
SerialTaskQueueglobalLuminosityBlocksQueue () final
 
SerialTaskQueueglobalRunsQueue () final
 
bool hasAbilityToProduceInLumis () const final
 
bool hasAbilityToProduceInRuns () const final
 
bool wantsGlobalLuminosityBlocks () const final
 
bool wantsGlobalRuns () const final
 
- Public Member Functions inherited from edm::one::EDProducerBase
 EDProducerBase ()
 
ModuleDescription const & moduleDescription () const
 
bool wantsStreamLuminosityBlocks () const
 
bool wantsStreamRuns () const
 
 ~EDProducerBase () override
 
- Public Member Functions inherited from edm::ProducerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
std::vector< edm::ProductResolverIndex > const & indiciesForPutProducts (BranchType iBranchType) const
 
 ProducerBase ()
 
std::vector< edm::ProductResolverIndex > const & putTokenIndexToProductResolverIndex () const
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
std::function< void(BranchDescription const &)> registrationCallback () const
 used by the fwk to register list of products More...
 
void resolvePutIndicies (BranchType iBranchType, ModuleToResolverIndicies const &iIndicies, std::string const &moduleLabel)
 
 ~ProducerBase () override
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
void convertCurrentProcessAlias (std::string const &processName)
 Convert "@currentProcess" in InputTag process names to the actual current process name. More...
 
 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 & itemsToGetFrom (BranchType iType) 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
 
ProductResolverIndexAndSkipBit uncheckedIndexFrom (EDGetToken) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
virtual ~EDConsumerBase () noexcept(false)
 

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_
 

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 edm::one::EDProducerBase
typedef EDProducerBase ModuleType
 
- Public Types inherited from edm::ProducerBase
using ModuleToResolverIndicies = std::unordered_multimap< std::string, std::tuple< edm::TypeID const *, const char *, edm::ProductResolverIndex >>
 
typedef ProductRegistryHelper::TypeLabelList TypeLabelList
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Static Public Member Functions inherited from edm::one::EDProducerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 
- 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)
 

Detailed Description

Definition at line 15 of file ESRecoSummary.h.

Constructor & Destructor Documentation

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

Definition at line 53 of file ESRecoSummary.cc.

References edm::ParameterSet::getParameter(), edm::ParameterSet::getUntrackedParameter(), and AlCaHLTBitMon_QueryRunRegistry::string.

54 {
55  prefixME_ = ps.getUntrackedParameter<std::string>("prefixME", "");
56 
57  //now do what ever initialization is needed
58  esRecHitCollection_ = consumes<ESRecHitCollection>(ps.getParameter<edm::InputTag>("recHitCollection_ES"));
59  esClusterCollectionX_ = consumes<reco::PreshowerClusterCollection>(ps.getParameter<edm::InputTag>("ClusterCollectionX_ES"));
60  esClusterCollectionY_ = consumes<reco::PreshowerClusterCollection>(ps.getParameter<edm::InputTag>("ClusterCollectionY_ES"));
61 
62  superClusterCollection_EE_ = consumes<reco::SuperClusterCollection>(ps.getParameter<edm::InputTag>("superClusterCollection_EE"));
63 }
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
edm::EDGetTokenT< ESRecHitCollection > esRecHitCollection_
Definition: ESRecoSummary.h:39
edm::EDGetTokenT< reco::PreshowerClusterCollection > esClusterCollectionY_
Definition: ESRecoSummary.h:41
std::string prefixME_
Definition: ESRecoSummary.h:24
edm::EDGetTokenT< reco::PreshowerClusterCollection > esClusterCollectionX_
Definition: ESRecoSummary.h:40
edm::EDGetTokenT< reco::SuperClusterCollection > superClusterCollection_EE_
Definition: ESRecoSummary.h:38
ESRecoSummary::~ESRecoSummary ( )
inlineoverride

Definition at line 18 of file ESRecoSummary.h.

References analyze(), and bookHistograms().

18 {}

Member Function Documentation

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

Definition at line 86 of file ESRecoSummary.cc.

References edm::SortedCollection< T, SORT >::begin(), MessageLogger_cfi::cerr, DEFINE_FWK_MODULE, edm::SortedCollection< T, SORT >::end(), reco::CaloCluster::energy(), HcalObjRepresent::Fill(), edm::Event::getByToken(), edm::HandleBase::isValid(), and edm::Handle< T >::product().

Referenced by ~ESRecoSummary().

87 {
88  //Preshower RecHits
90  ev.getByToken (esRecHitCollection_, recHitsES) ;
91  const ESRecHitCollection* thePreShowerRecHits = recHitsES.product () ;
92 
93  if ( ! recHitsES.isValid() ) {
94  std::cerr << "ESRecoSummary::analyze --> recHitsES not found" << std::endl;
95  }
96 
97  float maxRecHitEnergyES = -999.;
98 
99  for (ESRecHitCollection::const_iterator esItr = thePreShowerRecHits->begin(); esItr != thePreShowerRecHits->end(); ++esItr)
100  {
101 
102  h_recHits_ES_time -> Fill(esItr->time());
103  if (esItr -> energy() > maxRecHitEnergyES ) maxRecHitEnergyES = esItr -> energy() ;
104 
105  } // end loop over ES rec Hits
106 
107  h_recHits_ES_energyMax -> Fill(maxRecHitEnergyES );
108 
109  // ES clusters in X plane
111  ev.getByToken( esClusterCollectionX_, esClustersX);
112  const reco::PreshowerClusterCollection *ESclustersX = esClustersX.product();
113 
114  // ES clusters in Y plane
116  ev.getByToken( esClusterCollectionY_, esClustersY);
117  const reco::PreshowerClusterCollection *ESclustersY = esClustersY.product();
118 
119 
120  // ... endcap
122  ev.getByToken( superClusterCollection_EE_, superClusters_EE_h );
123  const reco::SuperClusterCollection* theEndcapSuperClusters = superClusters_EE_h.product () ;
124  if ( ! superClusters_EE_h.isValid() ) {
125  std::cerr << "EcalRecHitSummary::analyze --> superClusters_EE_h not found" << std::endl;
126  }
127 
128  // loop over all super clusters
129  for (reco::SuperClusterCollection::const_iterator itSC = theEndcapSuperClusters->begin();
130  itSC != theEndcapSuperClusters->end(); ++itSC ) {
131 
132  if ( fabs(itSC->eta()) < 1.65 || fabs(itSC->eta()) > 2.6 ) continue;
133 
134  float ESenergyPlane1 = 0.;
135  float ESenergyPlane2 = 0.;
136 
137 
138  // Loop over all ECAL Basic clusters in the supercluster
139  for (reco::CaloCluster_iterator ecalBasicCluster = itSC->clustersBegin(); ecalBasicCluster!= itSC->clustersEnd();
140  ecalBasicCluster++) {
141  const reco::CaloClusterPtr ecalBasicClusterPtr = *(ecalBasicCluster);
142 
143  for (reco::PreshowerClusterCollection::const_iterator iESClus = ESclustersX->begin(); iESClus != ESclustersX->end();
144  ++iESClus) {
145  const reco::CaloClusterPtr preshBasicCluster = iESClus->basicCluster();
146  const reco::PreshowerCluster *esCluster = &*iESClus;
147  if (preshBasicCluster == ecalBasicClusterPtr) {
148  ESenergyPlane1 += esCluster->energy();
149  }
150  } // end of x loop
151 
152  for (reco::PreshowerClusterCollection::const_iterator iESClus = ESclustersY->begin(); iESClus != ESclustersY->end();
153  ++iESClus) {
154  const reco::CaloClusterPtr preshBasicCluster = iESClus->basicCluster();
155  const reco::PreshowerCluster *esCluster = &*iESClus;
156  if (preshBasicCluster == ecalBasicClusterPtr) {
157  ESenergyPlane2 += esCluster->energy();
158  }
159  } // end of y loop
160  } // end loop over all basic clusters in the supercluster
161 
162  //cout<<"DQM : "<<ESenergyPlane1<<" "<<ESenergyPlane2<<endl;
163  h_esClusters_energy_plane1->Fill(ESenergyPlane1);
164  h_esClusters_energy_plane2->Fill(ESenergyPlane2);
165  if (ESenergyPlane1 > 0 && ESenergyPlane2 > 0) h_esClusters_energy_ratio -> Fill(ESenergyPlane1/ESenergyPlane2);
166 
167  }// end loop over superclusters
168 
169 }
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:519
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:39
MonitorElement * h_esClusters_energy_ratio
Definition: ESRecoSummary.h:32
void Fill(long long x)
edm::EDGetTokenT< reco::PreshowerClusterCollection > esClusterCollectionY_
Definition: ESRecoSummary.h:41
std::vector< SuperCluster > SuperClusterCollection
collection of SuperCluser objectr
MonitorElement * h_recHits_ES_energyMax
Definition: ESRecoSummary.h:27
void Fill(HcalDetId &id, double val, std::vector< TH2F > &depth)
std::vector< PreshowerCluster > PreshowerClusterCollection
collection of PreshowerCluster objects
double energy() const
cluster energy
Definition: CaloCluster.h:124
bool isValid() const
Definition: HandleBase.h:74
const_iterator end() const
T const * product() const
Definition: Handle.h:81
edm::EDGetTokenT< reco::PreshowerClusterCollection > esClusterCollectionX_
Definition: ESRecoSummary.h:40
MonitorElement * h_esClusters_energy_plane2
Definition: ESRecoSummary.h:31
edm::EDGetTokenT< reco::SuperClusterCollection > superClusterCollection_EE_
Definition: ESRecoSummary.h:38
const_iterator begin() const
void ESRecoSummary::bookHistograms ( DQMStore::IBooker iBooker,
edm::Run const &  ,
edm::EventSetup const &   
)
overrideprivatevirtual

Implements DQMEDAnalyzer.

Definition at line 66 of file ESRecoSummary.cc.

References DQMStore::IBooker::book1D(), and DQMStore::IBooker::setCurrentFolder().

Referenced by ~ESRecoSummary().

67 {
68  // Monitor Elements (ex THXD)
69  iBooker.setCurrentFolder(prefixME_ + "/ESRecoSummary"); // to organise the histos in folders
70 
71 
72  // Preshower ----------------------------------------------
73  h_recHits_ES_energyMax = iBooker.book1D("recHits_ES_energyMax","recHits_ES_energyMax",200,0.,0.01);
74  h_recHits_ES_time = iBooker.book1D("recHits_ES_time","recHits_ES_time",200,-100.,100.);
75 
76  h_esClusters_energy_plane1 = iBooker.book1D("esClusters_energy_plane1","esClusters_energy_plane1",200,0.,0.01);
77  h_esClusters_energy_plane2 = iBooker.book1D("esClusters_energy_plane2","esClusters_energy_plane2",200,0.,0.01);
78  h_esClusters_energy_ratio = iBooker.book1D("esClusters_energy_ratio","esClusters_energy_ratio",200,0.,20.);
79 }
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 * book1D(Args &&...args)
Definition: DQMStore.h:118
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:279
MonitorElement * h_esClusters_energy_plane2
Definition: ESRecoSummary.h:31

Member Data Documentation

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

Definition at line 40 of file ESRecoSummary.h.

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

Definition at line 41 of file ESRecoSummary.h.

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

Definition at line 39 of file ESRecoSummary.h.

MonitorElement* ESRecoSummary::h_esClusters_energy_plane1
private

Definition at line 30 of file ESRecoSummary.h.

MonitorElement* ESRecoSummary::h_esClusters_energy_plane2
private

Definition at line 31 of file ESRecoSummary.h.

MonitorElement* ESRecoSummary::h_esClusters_energy_ratio
private

Definition at line 32 of file ESRecoSummary.h.

MonitorElement* ESRecoSummary::h_recHits_ES_energyMax
private

Definition at line 27 of file ESRecoSummary.h.

MonitorElement* ESRecoSummary::h_recHits_ES_time
private

Definition at line 28 of file ESRecoSummary.h.

std::string ESRecoSummary::prefixME_
private

Definition at line 24 of file ESRecoSummary.h.

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

Definition at line 38 of file ESRecoSummary.h.