CMS 3D CMS Logo

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

#include <Calibration/EcalCalibAlgos/src/miscalibExample.cc>

Inheritance diagram for miscalibExample:
edm::EDAnalyzer edm::EDConsumerBase

Public Member Functions

virtual void analyze (const edm::Event &, const edm::EventSetup &)
 
virtual void beginJob ()
 
virtual void endJob ()
 
 miscalibExample (const edm::ParameterSet &)
 
 ~miscalibExample ()
 
- Public Member Functions inherited from edm::EDAnalyzer
 EDAnalyzer ()
 
std::string workerType () const
 
virtual ~EDAnalyzer ()
 
- Public Member Functions inherited from edm::EDConsumerBase
 EDConsumerBase ()
 
ProductHolderIndex indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductHolderIndex > &) const
 
void itemsToGet (BranchType, std::vector< ProductHolderIndex > &) const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void updateLookup (BranchType iBranchType, ProductHolderIndexHelper const &)
 
virtual ~EDConsumerBase ()
 

Private Attributes

std::string BarrelHitsCollection_
 
std::string correctedHybridSuperClusterCollection_
 
std::string correctedHybridSuperClusterProducer_
 
std::string ecalHitsProducer_
 
int read_events
 
std::string rootfile_
 
TH1F * scEnergy
 

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
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
CurrentProcessingContext const * currentContext () const
 
- 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

Description: Analyzer to fetch collection of objects from event and make simple plots

Implementation: \

Author
: Lorenzo Agostino, September 2006

Description: Perform single electron calibration (tested on TB data only).

Implementation: <Notes on="" implementation>="">

Definition at line 37 of file miscalibExample.h.

Constructor & Destructor Documentation

miscalibExample::miscalibExample ( const edm::ParameterSet iConfig)
explicit

Definition at line 66 of file miscalibExample.cc.

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

67 {
68 
69  rootfile_ = iConfig.getUntrackedParameter<std::string>("rootfile","ecalSimpleTBanalysis.root");
70  correctedHybridSuperClusterProducer_ = iConfig.getParameter<std::string>("correctedHybridSuperClusterProducer");
71  correctedHybridSuperClusterCollection_ = iConfig.getParameter<std::string>("correctedHybridSuperClusterCollection");
72 
73 }
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
std::string correctedHybridSuperClusterProducer_
std::string correctedHybridSuperClusterCollection_
std::string rootfile_
miscalibExample::~miscalibExample ( )

Definition at line 76 of file miscalibExample.cc.

77 {
78 
79 
80 }

Member Function Documentation

void miscalibExample::analyze ( const edm::Event iEvent,
const edm::EventSetup iSetup 
)
virtual

Implements edm::EDAnalyzer.

Definition at line 115 of file miscalibExample.cc.

References correctedHybridSuperClusterCollection_, correctedHybridSuperClusterProducer_, correctedHybridSuperClusters_cfi::correctedHybridSuperClusters, edm::Event::getByLabel(), read_events, and scEnergy.

116 {
117 //=================================================================================
118  using namespace edm;
119  using namespace std;
120 
121  read_events++;
122 
123  // Get hybrid super clusters after energy correction
124 
125  Handle<reco::SuperClusterCollection> pCorrectedHybridSuperClusters;
127  if (!pCorrectedHybridSuperClusters.isValid()) {
128  LogError("EgammaSimpleAnalyzer") << "Error! can't get collection with label " << correctedHybridSuperClusterCollection_.c_str() ;
129  }
130  const reco::SuperClusterCollection* correctedHybridSuperClusters = pCorrectedHybridSuperClusters.product();
131 
132 
133  reco::SuperClusterCollection::const_iterator superClusterIt;
134  for(superClusterIt=correctedHybridSuperClusters->begin(); superClusterIt!=correctedHybridSuperClusters->end(); superClusterIt++ )
135  {
136 
137  scEnergy->Fill(superClusterIt->energy());
138 
139  }
140 
141 }
std::string correctedHybridSuperClusterProducer_
std::vector< SuperCluster > SuperClusterCollection
collection of SuperCluser objectr
std::string correctedHybridSuperClusterCollection_
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:361
void miscalibExample::beginJob ( void  )
virtual

Reimplemented from edm::EDAnalyzer.

Definition at line 84 of file miscalibExample.cc.

References read_events, and scEnergy.

84  {
85 //========================================================================
86 
87  // Book histograms
88  scEnergy = new TH1F("scEnergy","SuperCluster energy", 100, 20., 80.);
89  read_events=0;
90 
91  }
void miscalibExample::endJob ( void  )
virtual

Reimplemented from edm::EDAnalyzer.

Definition at line 95 of file miscalibExample.cc.

References gather_cfg::cout, f, read_events, rootfile_, and scEnergy.

95  {
96 //========================================================================
97 
98  std::cout << "************* STATISTICS **************" << std::endl;
99  std::cout << "Read Events: " << read_events << std::endl;
100 
101 
103 
104  TFile f(rootfile_.c_str(),"RECREATE");
105 
106  scEnergy->Write();
107  f.Close();
108 
109 }
double f[11][100]
std::string rootfile_
tuple cout
Definition: gather_cfg.py:121

Member Data Documentation

std::string miscalibExample::BarrelHitsCollection_
private

Definition at line 52 of file miscalibExample.h.

std::string miscalibExample::correctedHybridSuperClusterCollection_
private

Definition at line 51 of file miscalibExample.h.

Referenced by analyze(), and miscalibExample().

std::string miscalibExample::correctedHybridSuperClusterProducer_
private

Definition at line 50 of file miscalibExample.h.

Referenced by analyze(), and miscalibExample().

std::string miscalibExample::ecalHitsProducer_
private

Definition at line 53 of file miscalibExample.h.

int miscalibExample::read_events
private

Definition at line 54 of file miscalibExample.h.

Referenced by analyze(), beginJob(), and endJob().

std::string miscalibExample::rootfile_
private

Definition at line 49 of file miscalibExample.h.

Referenced by endJob(), and miscalibExample().

TH1F* miscalibExample::scEnergy
private

Definition at line 56 of file miscalibExample.h.

Referenced by analyze(), beginJob(), and endJob().