19 #include <CLHEP/Units/GlobalPhysicalConstants.h> 20 #include <CLHEP/Units/GlobalSystemOfUnits.h> 50 : g4Label_(ps.getParameter<
std::
string>(
"ModuleLabel")),
51 hitLab_(ps.getParameter<
std::
string>(
"HitCollection")),
52 maxEnergy_(ps.getParameter<double>(
"MaxEnergy")),
53 tCut_(ps.getParameter<double>(
"TimeCut")),
54 verbose_(ps.getParameter<
bool>(
"Verbose")),
66 desc.add<
double>(
"MaxEnergy", 50.0);
67 desc.add<
double>(
"TimeCut", 2000.0);
68 desc.add<
bool>(
"Verbose",
false);
69 descriptions.
add(
"zdcSimHitStudy",
desc);
75 if (!
tfile.isAvailable())
77 <<
"please add it to config file";
79 hit_ =
tfile->make<TH1F>(
"Hits",
"Number of Hits", 100, 0., 100);
80 edep_ =
tfile->make<TH1F>(
"Edep",
"Deposited Energy (GeV)", 1000, 0.,
ymax);
81 eTot_ =
tfile->make<TH1F>(
"ETot",
"Total Energy in a time window (GeV)", 1000, 0.,
ymax);
82 eTotT_ =
tfile->make<TH1F>(
"ETotT",
"Total Energy (GeV)", 1000, 0.,
ymax);
83 time_ =
tfile->make<TH1F>(
"Time",
"Hit Time (ns)", 2000, 0., 2000);
84 indx_ =
tfile->make<TH1F>(
"Indx",
"Hit ID", 100, 0., 100);
88 edm::LogVerbatim(
"HitStudy") <<
"ZDCSimHitStudy::Run = " <<
e.id().run() <<
" Event = " <<
e.id().event();
91 bool getHits = (hitsCalo.
isValid());
94 std::vector<PCaloHit> zdcHits;
96 zdcHits.insert(zdcHits.end(), hitsCalo->begin(), hitsCalo->end());
97 unsigned int isiz = zdcHits.size();
105 double etot(0), etotT(0);
106 int nHit = zdcHits.size();
107 for (
int i = 0;
i < nHit;
i++) {
108 double edep = zdcHits[
i].energy();
109 double time = zdcHits[
i].time();
110 uint32_t
id = zdcHits[
i].id();
111 int indx = (
id & 0xFF);
130 edm::LogVerbatim(
"HitStudy") <<
"ZDCSimHitStudy::analyzeHits: Hits in ZDC " << nHit <<
" Energy deposits " << etot
static const std::string kSharedResource
Log< level::Info, true > LogVerbatim
const std::string hitLab_
std::vector< PCaloHit > PCaloHitContainer
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
constexpr uint32_t denseIndex() const
~ZDCSimHitStudy() override=default
void analyzeHits(const std::vector< PCaloHit > &)
constexpr int32_t depth() const
get the depth (1 for EM, channel + 1 for HAD, 2 for RPD, not sure yet for LUM, leave as default) ...
void analyze(const edm::Event &e, const edm::EventSetup &c) override
#define DEFINE_FWK_MODULE(type)
const edm::EDGetTokenT< edm::PCaloHitContainer > toks_calo_
void add(std::string const &label, ParameterSetDescription const &psetDescription)
constexpr Section section() const
get the section
constexpr int32_t channel() const
get the channel
constexpr int32_t zside() const
get the z-side of the cell (1/-1)
const std::string g4Label_
ZDCSimHitStudy(const edm::ParameterSet &ps)