CMS 3D CMS Logo

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

void analyze (const edm::Event &, const edm::EventSetup &) override
 
void beginJob () override
 
void endJob () override
 
 miscalibExample (const edm::ParameterSet &)
 
 ~miscalibExample () override
 
- 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
 
 ~EDAnalyzer () 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
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
virtual ~EDConsumerBase () noexcept(false)
 

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
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- 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

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 36 of file miscalibExample.h.

Constructor & Destructor Documentation

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

Definition at line 65 of file miscalibExample.cc.

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

66 {
67 
68  rootfile_ = iConfig.getUntrackedParameter<std::string>("rootfile","ecalSimpleTBanalysis.root");
69  correctedHybridSuperClusterProducer_ = iConfig.getParameter<std::string>("correctedHybridSuperClusterProducer");
70  correctedHybridSuperClusterCollection_ = iConfig.getParameter<std::string>("correctedHybridSuperClusterCollection");
71 
72 }
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 ( )
override

Definition at line 75 of file miscalibExample.cc.

76 {
77 
78 
79 }

Member Function Documentation

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

Definition at line 114 of file miscalibExample.cc.

References correctedHybridSuperClusterCollection_, correctedHybridSuperClusterProducer_, correctedHybridSuperClusters_cfi::correctedHybridSuperClusters, edm::Event::getByLabel(), edm::HandleBase::isValid(), edm::Handle< T >::product(), read_events, and scEnergy.

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

Reimplemented from edm::EDAnalyzer.

Definition at line 83 of file miscalibExample.cc.

References read_events, and scEnergy.

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

Reimplemented from edm::EDAnalyzer.

Definition at line 94 of file miscalibExample.cc.

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

Referenced by o2olib.O2ORunMgr::executeJob().

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

Member Data Documentation

std::string miscalibExample::BarrelHitsCollection_
private

Definition at line 51 of file miscalibExample.h.

std::string miscalibExample::correctedHybridSuperClusterCollection_
private

Definition at line 50 of file miscalibExample.h.

Referenced by analyze(), and miscalibExample().

std::string miscalibExample::correctedHybridSuperClusterProducer_
private

Definition at line 49 of file miscalibExample.h.

Referenced by analyze(), and miscalibExample().

std::string miscalibExample::ecalHitsProducer_
private

Definition at line 52 of file miscalibExample.h.

int miscalibExample::read_events
private

Definition at line 53 of file miscalibExample.h.

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

std::string miscalibExample::rootfile_
private

Definition at line 48 of file miscalibExample.h.

Referenced by endJob(), and miscalibExample().

TH1F* miscalibExample::scEnergy
private

Definition at line 55 of file miscalibExample.h.

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