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

Public Member Functions

 ESRecoSummary (const edm::ParameterSet &)
 
 ~ESRecoSummary ()
 
- Public Member Functions inherited from edm::EDAnalyzer
 EDAnalyzer ()
 
std::string workerType () const
 
virtual ~EDAnalyzer ()
 

Protected Attributes

edm::InputTag esClusterCollectionX_
 
edm::InputTag esClusterCollectionY_
 
edm::InputTag esRecHitCollection_
 
edm::InputTag 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
 
typedef WorkerT< EDAnalyzerWorkerType
 
- Static Public Member Functions inherited from edm::EDAnalyzer
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &)
 
- Protected Member Functions inherited from edm::EDAnalyzer
CurrentProcessingContext const * currentContext () const
 

Detailed Description

Definition at line 42 of file ESRecoSummary.h.

Constructor & Destructor Documentation

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

Definition at line 69 of file ESRecoSummary.cc.

References 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_, and superClusterCollection_EE_.

70 {
71 
72  prefixME_ = ps.getUntrackedParameter<std::string>("prefixME", "");
73 
74  //now do what ever initialization is needed
75  esRecHitCollection_ = ps.getParameter<edm::InputTag>("recHitCollection_ES");
76  esClusterCollectionX_ = ps.getParameter<edm::InputTag>("ClusterCollectionX_ES");
77  esClusterCollectionY_ = ps.getParameter<edm::InputTag>("ClusterCollectionY_ES");
78 
80 
81  // Monitor Elements (ex THXD)
82  dqmStore_->setCurrentFolder(prefixME_ + "/ESRecoSummary"); // to organise the histos in folders
83 
84  superClusterCollection_EE_ = ps.getParameter<edm::InputTag>("superClusterCollection_EE");
85 
86  // Preshower ----------------------------------------------
87  h_recHits_ES_energyMax = dqmStore_->book1D("recHits_ES_energyMax","recHits_ES_energyMax",200,0.,0.01);
88  h_recHits_ES_time = dqmStore_->book1D("recHits_ES_time","recHits_ES_time",200,-100.,100.);
89 
90  h_esClusters_energy_plane1 = dqmStore_->book1D("esClusters_energy_plane1","esClusters_energy_plane1",200,0.,0.01);
91  h_esClusters_energy_plane2 = dqmStore_->book1D("esClusters_energy_plane2","esClusters_energy_plane2",200,0.,0.01);
92  h_esClusters_energy_ratio = dqmStore_->book1D("esClusters_energy_ratio","esClusters_energy_ratio",200,0.,20.);
93 
94 }
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:717
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::InputTag esClusterCollectionY_
Definition: ESRecoSummary.h:74
MonitorElement * h_esClusters_energy_ratio
Definition: ESRecoSummary.h:65
edm::InputTag superClusterCollection_EE_
Definition: ESRecoSummary.h:71
std::string prefixME_
Definition: ESRecoSummary.h:57
edm::InputTag esRecHitCollection_
Definition: ESRecoSummary.h:72
MonitorElement * h_recHits_ES_energyMax
Definition: ESRecoSummary.h:60
MonitorElement * h_esClusters_energy_plane2
Definition: ESRecoSummary.h:64
edm::InputTag esClusterCollectionX_
Definition: ESRecoSummary.h:73
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:429
ESRecoSummary::~ESRecoSummary ( )

Definition at line 98 of file ESRecoSummary.cc.

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

Member Function Documentation

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

Implements edm::EDAnalyzer.

Definition at line 110 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::getByLabel(), 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_.

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

Reimplemented from edm::EDAnalyzer.

Definition at line 203 of file ESRecoSummary.cc.

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

Reimplemented from edm::EDAnalyzer.

Definition at line 209 of file ESRecoSummary.cc.

210 {}

Member Data Documentation

DQMStore* ESRecoSummary::dqmStore_
private

Definition at line 55 of file ESRecoSummary.h.

Referenced by ESRecoSummary().

edm::InputTag ESRecoSummary::esClusterCollectionX_
protected

Definition at line 73 of file ESRecoSummary.h.

Referenced by analyze(), and ESRecoSummary().

edm::InputTag ESRecoSummary::esClusterCollectionY_
protected

Definition at line 74 of file ESRecoSummary.h.

Referenced by analyze(), and ESRecoSummary().

edm::InputTag 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::InputTag ESRecoSummary::superClusterCollection_EE_
protected

Definition at line 71 of file ESRecoSummary.h.

Referenced by analyze(), and ESRecoSummary().