CMS 3D CMS Logo

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

#include <ESRecoSummary.h>

Inheritance diagram for ESRecoSummary:
edm::EDAnalyzer edm::EDConsumerBase

Public Member Functions

 ESRecoSummary (const edm::ParameterSet &)
 
 ~ESRecoSummary ()
 
- Public Member Functions inherited from edm::EDAnalyzer
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 EDAnalyzer ()
 
ModuleDescription const & moduleDescription () const
 
std::string workerType () const
 
virtual ~EDAnalyzer ()
 
- Public Member Functions inherited from edm::EDConsumerBase
 EDConsumerBase ()
 
ProductHolderIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
std::vector
< ProductHolderIndexAndSkipBit >
const & 
itemsToGetFromEvent () const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
bool registeredToConsume (ProductHolderIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductHolderIndexHelper const &)
 
virtual ~EDConsumerBase ()
 

Protected Attributes

edm::EDGetTokenT
< reco::PreshowerClusterCollection
esClusterCollectionX_
 
edm::EDGetTokenT
< reco::PreshowerClusterCollection
esClusterCollectionY_
 
edm::EDGetTokenT
< ESRecHitCollection
esRecHitCollection_
 
edm::EDGetTokenT
< reco::SuperClusterCollection
superClusterCollection_EE_
 

Private Member Functions

virtual void analyze (const edm::Event &, const edm::EventSetup &)
 
virtual void beginJob ()
 
virtual void endJob ()
 

Private Attributes

DQMStoredqmStore_
 
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::EDAnalyzer
typedef EDAnalyzer ModuleType
 
- 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::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 42 of file ESRecoSummary.h.

Constructor & Destructor Documentation

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

Definition at line 70 of file ESRecoSummary.cc.

References DQMStore::book1D(), dqmStore_, esClusterCollectionX_, esClusterCollectionY_, esRecHitCollection_, edm::ParameterSet::getParameter(), edm::ParameterSet::getUntrackedParameter(), h_esClusters_energy_plane1, h_esClusters_energy_plane2, h_esClusters_energy_ratio, h_recHits_ES_energyMax, h_recHits_ES_time, cppFunctionSkipper::operator, prefixME_, DQMStore::setCurrentFolder(), AlCaHLTBitMon_QueryRunRegistry::string, and superClusterCollection_EE_.

71 {
72 
73  prefixME_ = ps.getUntrackedParameter<std::string>("prefixME", "");
74 
75  //now do what ever initialization is needed
76  esRecHitCollection_ = consumes<ESRecHitCollection>(ps.getParameter<edm::InputTag>("recHitCollection_ES"));
77  esClusterCollectionX_ = consumes<reco::PreshowerClusterCollection>(ps.getParameter<edm::InputTag>("ClusterCollectionX_ES"));
78  esClusterCollectionY_ = consumes<reco::PreshowerClusterCollection>(ps.getParameter<edm::InputTag>("ClusterCollectionY_ES"));
79 
81 
82  // Monitor Elements (ex THXD)
83  dqmStore_->setCurrentFolder(prefixME_ + "/ESRecoSummary"); // to organise the histos in folders
84 
85  superClusterCollection_EE_ = consumes<reco::SuperClusterCollection>(ps.getParameter<edm::InputTag>("superClusterCollection_EE"));
86 
87  // Preshower ----------------------------------------------
88  h_recHits_ES_energyMax = dqmStore_->book1D("recHits_ES_energyMax","recHits_ES_energyMax",200,0.,0.01);
89  h_recHits_ES_time = dqmStore_->book1D("recHits_ES_time","recHits_ES_time",200,-100.,100.);
90 
91  h_esClusters_energy_plane1 = dqmStore_->book1D("esClusters_energy_plane1","esClusters_energy_plane1",200,0.,0.01);
92  h_esClusters_energy_plane2 = dqmStore_->book1D("esClusters_energy_plane2","esClusters_energy_plane2",200,0.,0.01);
93  h_esClusters_energy_ratio = dqmStore_->book1D("esClusters_energy_ratio","esClusters_energy_ratio",200,0.,20.);
94 
95 }
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
MonitorElement * book1D(const char *name, const char *title, int nchX, double lowX, double highX)
Book 1D histogram.
Definition: DQMStore.cc:873
DQMStore * dqmStore_
Definition: ESRecoSummary.h:55
MonitorElement * h_esClusters_energy_plane1
Definition: ESRecoSummary.h:63
MonitorElement * h_recHits_ES_time
Definition: ESRecoSummary.h:61
edm::EDGetTokenT< ESRecHitCollection > esRecHitCollection_
Definition: ESRecoSummary.h:72
MonitorElement * h_esClusters_energy_ratio
Definition: ESRecoSummary.h:65
edm::EDGetTokenT< reco::PreshowerClusterCollection > esClusterCollectionY_
Definition: ESRecoSummary.h:74
std::string prefixME_
Definition: ESRecoSummary.h:57
MonitorElement * h_recHits_ES_energyMax
Definition: ESRecoSummary.h:60
edm::EDGetTokenT< reco::PreshowerClusterCollection > esClusterCollectionX_
Definition: ESRecoSummary.h:73
MonitorElement * h_esClusters_energy_plane2
Definition: ESRecoSummary.h:64
edm::EDGetTokenT< reco::SuperClusterCollection > superClusterCollection_EE_
Definition: ESRecoSummary.h:71
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:585
ESRecoSummary::~ESRecoSummary ( )

Definition at line 99 of file ESRecoSummary.cc.

100 {
101  // do anything here that needs to be done at desctruction time
102  // (e.g. close files, deallocate resources etc.)
103 }

Member Function Documentation

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

Implements edm::EDAnalyzer.

Definition at line 111 of file ESRecoSummary.cc.

References edm::SortedCollection< T, SORT >::begin(), dtNoiseDBValidation_cfg::cerr, edm::SortedCollection< T, SORT >::end(), relval_parameters_module::energy, reco::CaloCluster::energy(), esClusterCollectionX_, esClusterCollectionY_, esRecHitCollection_, MonitorElement::Fill(), HcalObjRepresent::Fill(), edm::EventSetup::get(), edm::Event::getByToken(), 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_.

112 {
113 
114  //Get the magnetic field
115  edm::ESHandle<MagneticField> theMagField;
116  iSetup.get<IdealMagneticFieldRecord>().get(theMagField);
117 
118  //Preshower RecHits
120  ev.getByToken (esRecHitCollection_, recHitsES) ;
121  const ESRecHitCollection* thePreShowerRecHits = recHitsES.product () ;
122 
123  if ( ! recHitsES.isValid() ) {
124  std::cerr << "ESRecoSummary::analyze --> recHitsES not found" << std::endl;
125  }
126 
127  float maxRecHitEnergyES = -999.;
128 
129  for (ESRecHitCollection::const_iterator esItr = thePreShowerRecHits->begin(); esItr != thePreShowerRecHits->end(); ++esItr)
130  {
131 
132  h_recHits_ES_time -> Fill(esItr->time());
133  if (esItr -> energy() > maxRecHitEnergyES ) maxRecHitEnergyES = esItr -> energy() ;
134 
135  } // end loop over ES rec Hits
136 
137  h_recHits_ES_energyMax -> Fill(maxRecHitEnergyES );
138 
139  // ES clusters in X plane
141  ev.getByToken( esClusterCollectionX_, esClustersX);
142  const reco::PreshowerClusterCollection *ESclustersX = esClustersX.product();
143 
144  // ES clusters in Y plane
146  ev.getByToken( esClusterCollectionY_, esClustersY);
147  const reco::PreshowerClusterCollection *ESclustersY = esClustersY.product();
148 
149 
150  // ... endcap
152  ev.getByToken( superClusterCollection_EE_, superClusters_EE_h );
153  const reco::SuperClusterCollection* theEndcapSuperClusters = superClusters_EE_h.product () ;
154  if ( ! superClusters_EE_h.isValid() ) {
155  std::cerr << "EcalRecHitSummary::analyze --> superClusters_EE_h not found" << std::endl;
156  }
157 
158  // loop over all super clusters
159  for (reco::SuperClusterCollection::const_iterator itSC = theEndcapSuperClusters->begin();
160  itSC != theEndcapSuperClusters->end(); ++itSC ) {
161 
162  if ( fabs(itSC->eta()) < 1.65 || fabs(itSC->eta()) > 2.6 ) continue;
163 
164  float ESenergyPlane1 = 0.;
165  float ESenergyPlane2 = 0.;
166 
167 
168  // Loop over all ECAL Basic clusters in the supercluster
169  for (reco::CaloCluster_iterator ecalBasicCluster = itSC->clustersBegin(); ecalBasicCluster!= itSC->clustersEnd();
170  ecalBasicCluster++) {
171  const reco::CaloClusterPtr ecalBasicClusterPtr = *(ecalBasicCluster);
172 
173  for (reco::PreshowerClusterCollection::const_iterator iESClus = ESclustersX->begin(); iESClus != ESclustersX->end();
174  ++iESClus) {
175  const reco::CaloClusterPtr preshBasicCluster = iESClus->basicCluster();
176  const reco::PreshowerCluster *esCluster = &*iESClus;
177  if (preshBasicCluster == ecalBasicClusterPtr) {
178  ESenergyPlane1 += esCluster->energy();
179  }
180  } // end of x loop
181 
182  for (reco::PreshowerClusterCollection::const_iterator iESClus = ESclustersY->begin(); iESClus != ESclustersY->end();
183  ++iESClus) {
184  const reco::CaloClusterPtr preshBasicCluster = iESClus->basicCluster();
185  const reco::PreshowerCluster *esCluster = &*iESClus;
186  if (preshBasicCluster == ecalBasicClusterPtr) {
187  ESenergyPlane2 += esCluster->energy();
188  }
189  } // end of y loop
190  } // end loop over all basic clusters in the supercluster
191 
192  //cout<<"DQM : "<<ESenergyPlane1<<" "<<ESenergyPlane2<<endl;
193  h_esClusters_energy_plane1->Fill(ESenergyPlane1);
194  h_esClusters_energy_plane2->Fill(ESenergyPlane2);
195  if (ESenergyPlane1 > 0 && ESenergyPlane2 > 0) h_esClusters_energy_ratio -> Fill(ESenergyPlane1/ESenergyPlane2);
196 
197  }// end loop over superclusters
198 
199 }
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:434
std::vector< EcalRecHit >::const_iterator const_iterator
MonitorElement * h_esClusters_energy_plane1
Definition: ESRecoSummary.h:63
MonitorElement * h_recHits_ES_time
Definition: ESRecoSummary.h:61
edm::EDGetTokenT< ESRecHitCollection > esRecHitCollection_
Definition: ESRecoSummary.h:72
MonitorElement * h_esClusters_energy_ratio
Definition: ESRecoSummary.h:65
void Fill(long long x)
edm::EDGetTokenT< reco::PreshowerClusterCollection > esClusterCollectionY_
Definition: ESRecoSummary.h:74
std::vector< SuperCluster > SuperClusterCollection
collection of SuperCluser objectr
MonitorElement * h_recHits_ES_energyMax
Definition: ESRecoSummary.h:60
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:120
bool isValid() const
Definition: HandleBase.h:76
const_iterator end() const
const T & get() const
Definition: EventSetup.h:55
T const * product() const
Definition: Handle.h:81
edm::EDGetTokenT< reco::PreshowerClusterCollection > esClusterCollectionX_
Definition: ESRecoSummary.h:73
MonitorElement * h_esClusters_energy_plane2
Definition: ESRecoSummary.h:64
edm::EDGetTokenT< reco::SuperClusterCollection > superClusterCollection_EE_
Definition: ESRecoSummary.h:71
const_iterator begin() const
void ESRecoSummary::beginJob ( void  )
privatevirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 204 of file ESRecoSummary.cc.

205 {
206 }
void ESRecoSummary::endJob ( void  )
privatevirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 210 of file ESRecoSummary.cc.

211 {}

Member Data Documentation

DQMStore* ESRecoSummary::dqmStore_
private

Definition at line 55 of file ESRecoSummary.h.

Referenced by ESRecoSummary().

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

Definition at line 73 of file ESRecoSummary.h.

Referenced by analyze(), and ESRecoSummary().

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

Definition at line 74 of file ESRecoSummary.h.

Referenced by analyze(), and ESRecoSummary().

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

Definition at line 72 of file ESRecoSummary.h.

Referenced by analyze(), and ESRecoSummary().

MonitorElement* ESRecoSummary::h_esClusters_energy_plane1
private

Definition at line 63 of file ESRecoSummary.h.

Referenced by analyze(), and ESRecoSummary().

MonitorElement* ESRecoSummary::h_esClusters_energy_plane2
private

Definition at line 64 of file ESRecoSummary.h.

Referenced by analyze(), and ESRecoSummary().

MonitorElement* ESRecoSummary::h_esClusters_energy_ratio
private

Definition at line 65 of file ESRecoSummary.h.

Referenced by analyze(), and ESRecoSummary().

MonitorElement* ESRecoSummary::h_recHits_ES_energyMax
private

Definition at line 60 of file ESRecoSummary.h.

Referenced by analyze(), and ESRecoSummary().

MonitorElement* ESRecoSummary::h_recHits_ES_time
private

Definition at line 61 of file ESRecoSummary.h.

Referenced by analyze(), and ESRecoSummary().

std::string ESRecoSummary::prefixME_
private

Definition at line 57 of file ESRecoSummary.h.

Referenced by ESRecoSummary().

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

Definition at line 71 of file ESRecoSummary.h.

Referenced by analyze(), and ESRecoSummary().