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 ()
 
SerialTaskQueueglobalLuminosityBlocksQueue ()
 
SerialTaskQueueglobalRunsQueue ()
 
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 &&)=default
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
ESProxyIndex const * esGetTokenIndices (edm::Transition iTrans) const
 
std::vector< ESProxyIndex > const & esGetTokenIndicesVector (edm::Transition iTrans) const
 
std::vector< ESRecordIndex > const & esGetTokenRecordIndicesVector (edm::Transition iTrans) const
 
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::array< std::vector< ModuleDescription const * > *, NumBranchTypes > &modulesAll, std::vector< ModuleProcessName > &modulesInPreviousProcesses, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void selectInputProcessBlocks (ProductRegistry const &productRegistry, ProcessBlockHelperBase const &processBlockHelperBase)
 
ProductResolverIndexAndSkipBit uncheckedIndexFrom (EDGetToken) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
void updateLookup (eventsetup::ESRecordsToProxyIndices const &)
 
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 &)
 
static bool wantsGlobalLuminosityBlocks ()
 
static bool wantsGlobalRuns ()
 
static bool wantsInputProcessBlocks ()
 
static bool wantsProcessBlocks ()
 
static bool wantsStreamLuminosityBlocks ()
 
static bool wantsStreamRuns ()
 
- Protected Member Functions inherited from edm::EDConsumerBase
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
template<BranchType B = InEvent>
EDConsumerBaseAdaptor< B > consumes (edm::InputTag tag) noexcept
 
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 ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes ()
 
template<Transition Tr = Transition::Event>
constexpr auto esConsumes () noexcept
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes (ESInputTag const &tag)
 
template<Transition Tr = Transition::Event>
auto esConsumes (ESInputTag tag) noexcept
 
template<Transition Tr = Transition::Event>
ESGetTokenGeneric esConsumes (eventsetup::EventSetupRecordKey const &iRecord, eventsetup::DataKey const &iKey)
 Used with EventSetupRecord::doGet. More...
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (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 33 of file miscalibExample.h.

Constructor & Destructor Documentation

◆ miscalibExample()

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

Definition at line 60 of file miscalibExample.cc.

60  {
61  rootfile_ = iConfig.getUntrackedParameter<std::string>("rootfile", "ecalSimpleTBanalysis.root");
62  correctedHybridSuperClusterProducer_ = iConfig.getParameter<std::string>("correctedHybridSuperClusterProducer");
63  correctedHybridSuperClusterCollection_ = iConfig.getParameter<std::string>("correctedHybridSuperClusterCollection");
64 }

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

◆ ~miscalibExample()

miscalibExample::~miscalibExample ( )
override

Definition at line 66 of file miscalibExample.cc.

66 {}

Member Function Documentation

◆ analyze()

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

Implements edm::EDAnalyzer.

Definition at line 93 of file miscalibExample.cc.

93  {
94  //=================================================================================
95  using namespace edm;
96  using namespace std;
97 
98  read_events++;
99 
100  // Get hybrid super clusters after energy correction
101 
102  Handle<reco::SuperClusterCollection> pCorrectedHybridSuperClusters;
103  iEvent.getByLabel(
105  if (!pCorrectedHybridSuperClusters.isValid()) {
106  LogError("EgammaSimpleAnalyzer") << "Error! can't get collection with label "
108  }
109  const reco::SuperClusterCollection* correctedHybridSuperClusters = pCorrectedHybridSuperClusters.product();
110 
111  reco::SuperClusterCollection::const_iterator superClusterIt;
112  for (superClusterIt = correctedHybridSuperClusters->begin(); superClusterIt != correctedHybridSuperClusters->end();
113  superClusterIt++) {
114  scEnergy->Fill(superClusterIt->energy());
115  }
116 }

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

◆ beginJob()

void miscalibExample::beginJob ( void  )
overridevirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 69 of file miscalibExample.cc.

69  {
70  //========================================================================
71 
72  // Book histograms
73  scEnergy = new TH1F("scEnergy", "SuperCluster energy", 100, 20., 80.);
74  read_events = 0;
75 }

References read_events, and scEnergy.

◆ endJob()

void miscalibExample::endJob ( void  )
overridevirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 78 of file miscalibExample.cc.

78  {
79  //========================================================================
80 
81  std::cout << "************* STATISTICS **************" << std::endl;
82  std::cout << "Read Events: " << read_events << std::endl;
83 
85 
86  TFile f(rootfile_.c_str(), "RECREATE");
87 
88  scEnergy->Write();
89  f.Close();
90 }

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

Referenced by o2olib.O2ORunMgr::executeJob().

Member Data Documentation

◆ BarrelHitsCollection_

std::string miscalibExample::BarrelHitsCollection_
private

Definition at line 47 of file miscalibExample.h.

◆ correctedHybridSuperClusterCollection_

std::string miscalibExample::correctedHybridSuperClusterCollection_
private

Definition at line 46 of file miscalibExample.h.

Referenced by analyze(), and miscalibExample().

◆ correctedHybridSuperClusterProducer_

std::string miscalibExample::correctedHybridSuperClusterProducer_
private

Definition at line 45 of file miscalibExample.h.

Referenced by analyze(), and miscalibExample().

◆ ecalHitsProducer_

std::string miscalibExample::ecalHitsProducer_
private

Definition at line 48 of file miscalibExample.h.

◆ read_events

int miscalibExample::read_events
private

Definition at line 49 of file miscalibExample.h.

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

◆ rootfile_

std::string miscalibExample::rootfile_
private

Definition at line 44 of file miscalibExample.h.

Referenced by endJob(), and miscalibExample().

◆ scEnergy

TH1F* miscalibExample::scEnergy
private

Definition at line 51 of file miscalibExample.h.

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

edm::Handle::product
T const * product() const
Definition: Handle.h:70
f
double f[11][100]
Definition: MuScleFitUtils.cc:78
edm
HLT enums.
Definition: AlignableModifier.h:19
miscalibExample::correctedHybridSuperClusterCollection_
std::string correctedHybridSuperClusterCollection_
Definition: miscalibExample.h:46
gather_cfg.cout
cout
Definition: gather_cfg.py:144
miscalibExample::correctedHybridSuperClusterProducer_
std::string correctedHybridSuperClusterProducer_
Definition: miscalibExample.h:45
edm::ParameterSet::getUntrackedParameter
T getUntrackedParameter(std::string const &, T const &) const
edm::Handle
Definition: AssociativeIterator.h:50
reco::SuperClusterCollection
std::vector< SuperCluster > SuperClusterCollection
collection of SuperCluser objectr
Definition: SuperClusterFwd.h:9
miscalibExample::rootfile_
std::string rootfile_
Definition: miscalibExample.h:44
miscalibExample::read_events
int read_events
Definition: miscalibExample.h:49
iEvent
int iEvent
Definition: GenABIO.cc:224
edm::LogError
Log< level::Error, false > LogError
Definition: MessageLogger.h:123
AlCaHLTBitMon_QueryRunRegistry.string
string string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
std
Definition: JetResolutionObject.h:76
miscalibExample::scEnergy
TH1F * scEnergy
Definition: miscalibExample.h:51
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
edm::HandleBase::isValid
bool isValid() const
Definition: HandleBase.h:70
correctedHybridSuperClusters_cfi.correctedHybridSuperClusters
correctedHybridSuperClusters
Definition: correctedHybridSuperClusters_cfi.py:4