|
|
Go to the documentation of this file.
41 #include "CLHEP/Units/GlobalSystemOfUnits.h"
42 #include "CLHEP/Units/GlobalPhysicalConstants.h"
44 #include "Randomize.hh"
93 usesResource(
"TFileService");
95 m_ECAL =
p.getParameter<
bool>(
"ECAL");
101 m_eta =
p.getParameter<
double>(
"MinEta");
102 m_phi =
p.getParameter<
double>(
"MinPhi");
103 m_ener =
p.getParameter<
double>(
"MinE");
104 m_PDG =
p.getParameter<std::vector<int> >(
"PartID");
106 double minEta =
p.getParameter<
double>(
"MinEta");
107 double maxEta =
p.getParameter<
double>(
"MaxEta");
108 double minPhi =
p.getParameter<
double>(
"MinPhi");
109 double maxPhi =
p.getParameter<
double>(
"MaxPhi");
139 <<
" MIP= " << eMIP <<
" GeV"
150 edm::LogInfo(
"HcalTB06Analysis") <<
" =====> End of Run; Total number of events: " <<
count;
162 std::vector<double> eCalo(6, 0), eTrig(7, 0);
164 const std::vector<PCaloHit>* EcalHits =
nullptr;
170 const std::vector<PCaloHit>* HcalHits = Hcal.
product();
172 const std::vector<PCaloHit>* BeamHits = Beam.
product();
181 ne = EcalHits->size();
182 for (
unsigned int i = 0;
i < ne; ++
i) {
183 EBDetId ecalid((*EcalHits)[
i].
id());
187 << (*EcalHits)[
i].energy() << std::endl;
192 eCalo[0] += (*EcalHits)[
i].energy();
201 nh = HcalHits->size();
202 for (
unsigned int i = 0;
i <
nh; ++
i) {
207 << (*HcalHits)[
i].energy() << std::endl;
213 eCalo[2] += (*HcalHits)[
i].energy();
215 eCalo[4] += (*HcalHits)[
i].energy();
225 double etots = eecals + ehcals;
227 edm::LogInfo(
"HcalTBSim") <<
"HcalTB06Analysis:: Etot(MeV)= " << etots <<
" E(Ecal)= " << eecals
228 <<
" E(Hcal)= " << ehcals <<
" Nhits(ECAL)= " << ne <<
" Nhits(HCAL)= " <<
nh;
232 for (
unsigned int i = 0;
i < BeamHits->size(); ++
i) {
233 unsigned int id = ((*BeamHits)[
i].id());
234 int det, lay, ix, iy;
237 if (lay > 0 && lay <= 4) {
238 eTrig[lay - 1] += (*BeamHits)[
i].energy();
239 }
else if (lay == 7 || lay == 8) {
240 eTrig[lay - 2] += (*BeamHits)[
i].energy();
241 }
else if (lay >= 11 && lay <= 14) {
242 eTrig[4] += (*BeamHits)[
i].energy();
248 edm::LogInfo(
"HcalTBSim") <<
"HcalTB06Analysis:: Trigger Info: " << eTrig[0] <<
":" << eTrig[1] <<
":" << eTrig[2]
249 <<
":" << eTrig[3] <<
":" << eTrig[4] <<
":" << eTrig[5] <<
":" << eTrig[6];
int ieta() const
get the crystal ieta
~HcalTB06Analysis() override
T const * product() const
constexpr int iphi() const
get the cell iphi
Log< level::Info, false > LogInfo
void fillTree(std::vector< double > &ecalo, std::vector< double > &etrig)
edm::EDGetTokenT< edm::PCaloHitContainer > m_EcalToken
#define DEFINE_FWK_MODULE(type)
HcalTB06Analysis(const edm::ParameterSet &p)
const HcalTB06Analysis & operator=(const HcalTB06Analysis &)=delete
bool getByToken(EDGetToken token, Handle< PROD > &result) const
void fillPrimary(double energy, double eta, double phi)
constexpr int ieta() const
get the cell ieta
void analyze(const edm::Event &e, const edm::EventSetup &c) override
static void unpackIndex(const uint32_t &idx, int &det, int &lay, int &x, int &y)
constexpr HcalSubdetector subdet() const
get the subdetector
edm::EDGetTokenT< edm::PCaloHitContainer > m_BeamToken
T getParameter(std::string const &) const
edm::EDGetTokenT< edm::PCaloHitContainer > m_HcalToken
int iphi() const
get the crystal iphi
Abs< T >::type abs(const T &t)
void fillEdep(double etots, double eecals, double ehcals)