30 #include "CLHEP/Units/GlobalSystemOfUnits.h"
31 #include "CLHEP/Units/GlobalPhysicalConstants.h"
33 #include "Randomize.hh"
44 :
count(0), m_EcalTag(edm::
InputTag(
"g4SimHits",
"EcalHitsEB")),
45 m_HcalTag(edm::
InputTag(
"g4SimHits",
"HcalHits"))
49 consumes<edm::PCaloHitContainer>(
m_EcalTag);
51 consumes<edm::PCaloHitContainer>(
m_HcalTag);
58 m_widthEcal = ptb.getParameter<
double>(
"EcalWidth");
59 m_factEcal = ptb.getParameter<
double>(
"EcalFactor");
60 m_factHcal = ptb.getParameter<
double>(
"HcalFactor");
63 <<
"Beam parameters: E(GeV)= " << m_ener
64 <<
" pdgID= " << m_PDG[0]
67 <<
"\n EcalFactor= " << m_factEcal
68 <<
" EcalWidth= " << m_widthEcal <<
" GeV"
80 edm::LogInfo(
"HcalTB06Analysis") <<
" =====> Begin of Run";
86 <<
" =====> End of Run; Total number of events: " <<
count;
99 const std::vector<PCaloHit>* EcalHits =
nullptr;
105 const std::vector<PCaloHit>* HcalHits = Hcal.
product();
115 ne = EcalHits->size();
116 for (
unsigned int i=0;
i<
ne; ++
i) {
117 eecals += (*EcalHits)[
i].energy();
125 nh = HcalHits->size();
126 for (
unsigned int i=0;
i<nh; ++
i) {
127 ehcals += (*HcalHits)[
i].energy();
131 double etots = eecals + ehcals;
132 LogDebug(
"HcalTBSim") <<
"HcalTB06Analysis:: Etot(MeV)= " << etots
133 <<
" E(Ecal)= " << eecals
134 <<
" E(Hcal)= " << ehcals
135 <<
" Nhits(ECAL)= " << ne
136 <<
" Nhits(HCAL)= " << nh;
T getParameter(std::string const &) const
virtual void beginJob() override
virtual void analyze(const edm::Event &e, const edm::EventSetup &c) override
void fillEdep(double etots, double eecals, double ehcals)
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
T const * product() const
HcalTB06Analysis(const edm::ParameterSet &p)
void fillPrimary(double energy, double eta, double phi)
virtual ~HcalTB06Analysis()
virtual void endJob() override