CMS 3D CMS Logo

List of all members | Public Member Functions | Private Member Functions | Private Attributes
CherenkovAnalysis Class Reference
Inheritance diagram for CherenkovAnalysis:
edm::EDAnalyzer edm::EDConsumerBase

Public Member Functions

 CherenkovAnalysis (const edm::ParameterSet &)
 
 ~CherenkovAnalysis () 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
 
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
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
ProductResolverIndexAndSkipBit uncheckedIndexFrom (EDGetToken) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
void updateLookup (eventsetup::ESRecordsToProxyIndices const &)
 
virtual ~EDConsumerBase () noexcept(false)
 

Private Member Functions

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

Private Attributes

TH1F * hEnergy_
 
TH1F * hTimeStructure_
 
double maxEnergy_
 
int nBinsEnergy_
 
edm::EDGetTokenT< edm::PCaloHitContainertok_calo_
 

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 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>
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<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes (ESInputTag const &tag)
 
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

SimG4CMS/CherenkovAnalysis/test/CherenkovAnalysis.cpp

Description: <one line="" class="" summary>="">

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

Definition at line 43 of file CherenkovAnalysis.cc.

Constructor & Destructor Documentation

◆ CherenkovAnalysis()

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

Definition at line 62 of file CherenkovAnalysis.cc.

63  : maxEnergy_(iConfig.getParameter<double>("maxEnergy")),
64  nBinsEnergy_(iConfig.getParameter<unsigned>("nBinsEnergy")) {
65  tok_calo_ = consumes<edm::PCaloHitContainer>(iConfig.getParameter<edm::InputTag>("caloHitSource"));
66 
67  // Book histograms
69 
70  if (!tfile.isAvailable())
71  throw cms::Exception("BadConfig") << "TFileService unavailable: "
72  << "please add it to config file";
73 
74  hEnergy_ = tfile->make<TH1F>("hEnergy", "Total energy deposit [GeV]", nBinsEnergy_, 0, maxEnergy_);
75  hTimeStructure_ = tfile->make<TH1F>("hTimeStructure", "Time structure [ns]", 100, 0, 0.3);
76 }

References edm::ParameterSet::getParameter(), hEnergy_, hTimeStructure_, maxEnergy_, nBinsEnergy_, compare::tfile, and tok_calo_.

◆ ~CherenkovAnalysis()

CherenkovAnalysis::~CherenkovAnalysis ( )
inlineoverride

Definition at line 46 of file CherenkovAnalysis.cc.

46 {}

Member Function Documentation

◆ analyze()

void CherenkovAnalysis::analyze ( const edm::Event iEvent,
const edm::EventSetup iSetup 
)
overrideprivatevirtual

Implements edm::EDAnalyzer.

Definition at line 79 of file CherenkovAnalysis.cc.

79  {
81  iEvent.getByToken(tok_calo_, pCaloHits);
82 
83  double totalEnergy = 0;
84 
85  // Loop on all hits and calculate total energy loss
86  edm::PCaloHitContainer::const_iterator it = pCaloHits.product()->begin();
87  edm::PCaloHitContainer::const_iterator itend = pCaloHits.product()->end();
88  for (; it != itend; ++it) {
89  totalEnergy += (*it).energy();
90  hTimeStructure_->Fill((*it).time(),
91  (*it).energy()); // Time weighted by energy...
92  // edm::LogInfo("CherenkovAnalysis") << "Time = " << (*it).time() <<
93  // std::endl;
94  }
95 #ifdef EDM_ML_DEBUG
96  edm::LogVerbatim("CherenkovAnalysis") << "CherenkovAnalysis::Total energy = " << totalEnergy;
97 #endif
98  hEnergy_->Fill(totalEnergy);
99 }

References hEnergy_, hTimeStructure_, iEvent, edm::Handle< T >::product(), and tok_calo_.

◆ beginJob()

void CherenkovAnalysis::beginJob ( void  )
inlineoverrideprivatevirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 56 of file CherenkovAnalysis.cc.

56 {}

◆ endJob()

void CherenkovAnalysis::endJob ( void  )
inlineoverrideprivatevirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 58 of file CherenkovAnalysis.cc.

58 {}

Member Data Documentation

◆ hEnergy_

TH1F* CherenkovAnalysis::hEnergy_
private

Definition at line 50 of file CherenkovAnalysis.cc.

Referenced by analyze(), and CherenkovAnalysis().

◆ hTimeStructure_

TH1F* CherenkovAnalysis::hTimeStructure_
private

Definition at line 54 of file CherenkovAnalysis.cc.

Referenced by analyze(), and CherenkovAnalysis().

◆ maxEnergy_

double CherenkovAnalysis::maxEnergy_
private

Definition at line 51 of file CherenkovAnalysis.cc.

Referenced by CherenkovAnalysis().

◆ nBinsEnergy_

int CherenkovAnalysis::nBinsEnergy_
private

Definition at line 52 of file CherenkovAnalysis.cc.

Referenced by CherenkovAnalysis().

◆ tok_calo_

edm::EDGetTokenT<edm::PCaloHitContainer> CherenkovAnalysis::tok_calo_
private

Definition at line 49 of file CherenkovAnalysis.cc.

Referenced by analyze(), and CherenkovAnalysis().

CherenkovAnalysis::hTimeStructure_
TH1F * hTimeStructure_
Definition: CherenkovAnalysis.cc:54
edm::Handle::product
T const * product() const
Definition: Handle.h:70
CherenkovAnalysis::maxEnergy_
double maxEnergy_
Definition: CherenkovAnalysis.cc:51
edm::Handle
Definition: AssociativeIterator.h:50
CherenkovAnalysis::hEnergy_
TH1F * hEnergy_
Definition: CherenkovAnalysis.cc:50
tfile
Definition: tfile.py:1
CherenkovAnalysis::nBinsEnergy_
int nBinsEnergy_
Definition: CherenkovAnalysis.cc:52
edm::Service< TFileService >
iEvent
int iEvent
Definition: GenABIO.cc:224
edm::LogVerbatim
Definition: MessageLogger.h:297
compare.tfile
tfile
Definition: compare.py:325
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
CherenkovAnalysis::tok_calo_
edm::EDGetTokenT< edm::PCaloHitContainer > tok_calo_
Definition: CherenkovAnalysis.cc:49
cms::Exception
Definition: Exception.h:70
edm::InputTag
Definition: InputTag.h:15