|
|
Go to the documentation of this file.
42 #include "CLHEP/Units/GlobalSystemOfUnits.h"
43 #include "CLHEP/Units/GlobalPhysicalConstants.h"
45 #include "Randomize.hh"
94 usesResource(
"TFileService");
96 m_ECAL =
p.getParameter<
bool>(
"ECAL");
102 m_eta =
p.getParameter<
double>(
"MinEta");
103 m_phi =
p.getParameter<
double>(
"MinPhi");
104 m_ener =
p.getParameter<
double>(
"MinE");
105 m_PDG =
p.getParameter<std::vector<int> >(
"PartID");
107 double minEta =
p.getParameter<
double>(
"MinEta");
108 double maxEta =
p.getParameter<
double>(
"MaxEta");
109 double minPhi =
p.getParameter<
double>(
"MinPhi");
110 double maxPhi =
p.getParameter<
double>(
"MaxPhi");
140 <<
" MIP= " << eMIP <<
" GeV"
151 edm::LogInfo(
"HcalTB06Analysis") <<
" =====> End of Run; Total number of events: " <<
count;
163 std::vector<double> eCalo(6, 0), eTrig(7, 0);
165 const std::vector<PCaloHit>* EcalHits =
nullptr;
171 const std::vector<PCaloHit>* HcalHits = Hcal.
product();
173 const std::vector<PCaloHit>* BeamHits = Beam.
product();
182 ne = EcalHits->size();
183 for (
unsigned int i = 0;
i < ne; ++
i) {
184 EBDetId ecalid((*EcalHits)[
i].
id());
188 << (*EcalHits)[
i].energy() << std::endl;
193 eCalo[0] += (*EcalHits)[
i].energy();
202 nh = HcalHits->size();
203 for (
unsigned int i = 0;
i <
nh; ++
i) {
208 << (*HcalHits)[
i].energy() << std::endl;
214 eCalo[2] += (*HcalHits)[
i].energy();
216 eCalo[4] += (*HcalHits)[
i].energy();
226 double etots = eecals + ehcals;
228 edm::LogInfo(
"HcalTBSim") <<
"HcalTB06Analysis:: Etot(MeV)= " << etots <<
" E(Ecal)= " << eecals
229 <<
" E(Hcal)= " << ehcals <<
" Nhits(ECAL)= " << ne <<
" Nhits(HCAL)= " <<
nh;
233 for (
unsigned int i = 0;
i < BeamHits->size(); ++
i) {
234 unsigned int id = ((*BeamHits)[
i].id());
235 int det, lay, ix, iy;
238 if (lay > 0 && lay <= 4) {
239 eTrig[lay - 1] += (*BeamHits)[
i].energy();
240 }
else if (lay == 7 || lay == 8) {
241 eTrig[lay - 2] += (*BeamHits)[
i].energy();
242 }
else if (lay >= 11 && lay <= 14) {
243 eTrig[4] += (*BeamHits)[
i].energy();
249 edm::LogInfo(
"HcalTBSim") <<
"HcalTB06Analysis:: Trigger Info: " << eTrig[0] <<
":" << eTrig[1] <<
":" << eTrig[2]
250 <<
":" << 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)