32 #include "CLHEP/Units/GlobalSystemOfUnits.h" 33 #include "CLHEP/Units/GlobalPhysicalConstants.h" 35 #include "Randomize.hh" 48 usesResource(
"TFileService");
65 double beamEta = (maxEta+
minEta)*0.5;
66 double beamPhi = (maxPhi+
minPhi)*0.5;
67 if (beamPhi < 0) { beamPhi += twopi; }
84 <<
"Beam parameters: E(GeV)= " << m_ener
85 <<
" pdgID= " << m_PDG[0]
86 <<
"\n eta= " << m_eta
92 <<
"\n EcalFactor= " << m_factEcal
93 <<
" EcalWidth= " << m_widthEcal <<
" GeV" 94 <<
"\n HcalFactor= " << m_factHcal
95 <<
" HcalWidth= " << m_widthHcal <<
" GeV" 96 <<
"\n TimeLimit= " << m_timeLimit <<
" ns" <<
"\n";
105 edm::LogInfo(
"HcalTB06Analysis") <<
" =====> Begin of Run";
110 <<
" =====> End of Run; Total number of events: " <<
count;
123 std::vector<double> eCalo(6,0), eTrig(7,0);
125 const std::vector<PCaloHit>* EcalHits =
nullptr;
131 const std::vector<PCaloHit>* HcalHits = Hcal.
product();
133 const std::vector<PCaloHit>* BeamHits = Beam.
product();
142 ne = EcalHits->size();
143 for (
unsigned int i=0;
i<
ne; ++
i) {
144 EBDetId ecalid((*EcalHits)[
i].
id());
149 << (*EcalHits)[
i].energy() << std::endl;
155 eCalo[0] += (*EcalHits)[
i].energy();
164 nh = HcalHits->size();
165 for (
unsigned int i=0;
i<nh; ++
i) {
172 << (*HcalHits)[
i].energy() << std::endl;
179 eCalo[2] += (*HcalHits)[
i].energy();
181 eCalo[4] += (*HcalHits)[
i].energy();
191 double etots = eecals + ehcals;
193 edm::LogInfo(
"HcalTBSim") <<
"HcalTB06Analysis:: Etot(MeV)= " << etots
194 <<
" E(Ecal)= " << eecals
195 <<
" E(Hcal)= " << ehcals
196 <<
" Nhits(ECAL)= " << ne
197 <<
" Nhits(HCAL)= " << nh;
201 for (
unsigned int i=0;
i<BeamHits->size(); ++
i) {
202 unsigned int id = ((*BeamHits)[
i].id());
203 int det, lay, ix, iy;
206 if (lay > 0 && lay <= 4) {
207 eTrig[lay-1] += (*BeamHits)[
i].energy();
208 }
else if (lay == 7 || lay == 8) {
209 eTrig[lay-2] += (*BeamHits)[
i].energy();
210 }
else if (lay >= 11 && lay <= 14) {
211 eTrig[4] += (*BeamHits)[
i].energy();
217 edm::LogInfo(
"HcalTBSim") <<
"HcalTB06Analysis:: Trigger Info: " 218 << eTrig[0] <<
":" << eTrig[1] <<
":" << eTrig[2]
219 <<
":" << eTrig[3] <<
":" << eTrig[4] <<
":" 220 << eTrig[5] <<
":" << eTrig[6];
T getParameter(std::string const &) const
HcalSubdetector subdet() const
get the subdetector
virtual void beginJob() override
edm::EDGetTokenT< edm::PCaloHitContainer > m_BeamToken
bool getByToken(EDGetToken token, Handle< PROD > &result) const
virtual void analyze(const edm::Event &e, const edm::EventSetup &c) override
void fillEdep(double etots, double eecals, double ehcals)
int iphi() const
get the crystal iphi
void fillTree(std::vector< double > &ecalo, std::vector< double > &etrig)
int ieta() const
get the cell ieta
edm::EDGetTokenT< edm::PCaloHitContainer > m_HcalToken
Abs< T >::type abs(const T &t)
int ieta() const
get the crystal ieta
int iphi() const
get the cell iphi
T const * product() const
HcalTB06Analysis(const edm::ParameterSet &p)
static void unpackIndex(const uint32_t &idx, int &det, int &lay, int &x, int &y)
void fillPrimary(double energy, double eta, double phi)
virtual ~HcalTB06Analysis()
edm::EDGetTokenT< edm::PCaloHitContainer > m_EcalToken
minPhi
set NPt=0 and the vector of double for variable size binning
virtual void endJob() override