|
|
Go to the documentation of this file.
31 #include "CLHEP/Geometry/Point3D.h"
32 #include "CLHEP/Geometry/Transform3D.h"
33 #include "CLHEP/Geometry/Vector3D.h"
34 #include "CLHEP/Units/GlobalSystemOfUnits.h"
35 #include "CLHEP/Units/GlobalPhysicalConstants.h"
71 std::map<std::pair<int, int>, TH1D*>
h_phi_;
79 caloHitSource_(iConfig.getParameter<
std::
string>(
"caloHitSource")),
80 ietaMin_(iConfig.getUntrackedParameter<
int>(
"ietaMin", -41)),
81 ietaMax_(iConfig.getUntrackedParameter<
int>(
"ietaMax", 41)),
82 depthMax_(iConfig.getUntrackedParameter<
int>(
"depthMax", 7)),
83 rmin_(iConfig.getUntrackedParameter<double>(
"rMin", 0.0)),
84 rmax_(iConfig.getUntrackedParameter<double>(
"rMax", 5500.0)),
85 zmin_(iConfig.getUntrackedParameter<double>(
"zMin", -12500.0)),
86 zmax_(iConfig.getUntrackedParameter<double>(
"zMax", 12500.0)),
87 nbinR_(iConfig.getUntrackedParameter<
int>(
"nBinR", 550)),
88 nbinZ_(iConfig.getUntrackedParameter<
int>(
"nBinZ", 2500)),
89 verbosity_(iConfig.getUntrackedParameter<
int>(
"verbosity", 0)) {
92 tok_HRNDC_ = esConsumes<HcalDDDRecConstants, HcalRecNumberingRecord, edm::Transition::BeginRun>();
98 desc.addUntracked<
int>(
"ietaMin", -41);
99 desc.addUntracked<
int>(
"ietaMax", 41);
100 desc.addUntracked<
int>(
"depthMax", 7);
101 desc.addUntracked<
double>(
"rMin", 0.0);
102 desc.addUntracked<
double>(
"rMax", 5500.0);
103 desc.addUntracked<
double>(
"zMin", -12500.0);
104 desc.addUntracked<
double>(
"zMax", 12500.0);
105 desc.addUntracked<
int>(
"nBinR", 550);
106 desc.addUntracked<
int>(
"nBinZ", 250);
107 desc.addUntracked<
int>(
"verbosity", 0);
108 descriptions.
add(
"hcalGeomCheck",
desc);
115 if (theCaloHitContainer.
isValid()) {
117 edm::LogVerbatim(
"HcalValidation") <<
" PcalohitItr = " << theCaloHitContainer->size();
120 std::map<HcalDetId, hitsinfo> map_hits;
121 unsigned int nused(0);
122 for (
auto const&
hit : *(theCaloHitContainer.
product())) {
123 unsigned int id =
hit.
id();
127 int subdet = detId.
subdet();
136 HepGeom::Point3D<float> gcoord = HepGeom::Point3D<float>(rz *
cos(
etaphi.second) / cosh(
etaphi.first),
140 double tof = (gcoord.mag() * CLHEP::mm) / CLHEP::c_light;
143 <<
"Detector " << subdet <<
" ieta = " <<
ieta <<
" iphi = " <<
iphi <<
" depth = " <<
depth
144 <<
" positon = " << gcoord <<
" energy = " <<
energy <<
" time = " <<
time <<
":" << tof;
149 if (map_hits.count(detId) != 0) {
150 hinfo = map_hits[detId];
152 hinfo.phi = gcoord.getPhi();
153 hinfo.eta = gcoord.getEta();
157 map_hits[detId] =
hinfo;
159 h_RZ_->Fill(gcoord.z(), gcoord.rho());
163 for (
auto const&
hit : map_hits) {
165 int subdet =
hit.first.subdet();
166 if (subdet > 0 && subdet < static_cast<int>(
h_E_.size())) {
172 <<
" ---------------------- eta = " <<
ieta <<
":" <<
hinfo.eta <<
" phi = " <<
iphi <<
":" <<
hinfo.phi
173 <<
" depth = " <<
depth <<
" E = " <<
hinfo.energy <<
" T = " <<
hinfo.time;
178 itr1->second->Fill(
iphi);
181 itr2->second->Fill(
ieta);
195 edm::LogVerbatim(
"HcalValidation") <<
"Obtain HcalDDDRecConstants from Event Setup";
204 edm::LogVerbatim(
"HcalValidation") <<
"HcalGeomCheck: booked scatterplot RZ";
221 std::vector<std::string> dets = {
"HCAL",
"HB",
"HE",
"HF",
"HO"};
222 for (
unsigned int ih = 0; ih < dets.size(); ++ih) {
223 sprintf(
name,
"E_%s", dets[ih].c_str());
224 sprintf(
title,
"Energy deposit in %s (MeV)", dets[ih].c_str());
228 sprintf(
name,
"T_%s", dets[ih].c_str());
229 sprintf(
title,
"Time of hit in %s (ns)", dets[ih].c_str());
edm::EDGetTokenT< edm::PCaloHitContainer > tok_hits_
T const * product() const
constexpr int iphi() const
get the cell iphi
HcalGeomCheck(const edm::ParameterSet &)
constexpr int depth() const
get the tower depth
std::vector< TH1D * > h_E_
Sin< T >::type sin(const T &t)
Cos< T >::type cos(const T &t)
#define DEFINE_FWK_MODULE(type)
void add(std::string const &label, ParameterSetDescription const &psetDescription)
edm::ESGetToken< HcalDDDRecConstants, HcalRecNumberingRecord > tok_HRNDC_
constexpr int ieta() const
get the cell ieta
constexpr HcalSubdetector subdet() const
get the subdetector
std::map< int, TH1D * > h_eta_
void analyze(edm::Event const &, edm::EventSetup const &) override
T * make(const Args &...args) const
make new ROOT object
bool getData(T &iHolder) const
DetId relabel(const uint32_t testId) const
double getRZ(const int &subdet, const int &ieta, const int &depth) const
std::vector< TH1D * > h_T_
void analyzeHits(int, const std::string &, const std::vector< PCaloHit > &)
Log< level::Info, true > LogVerbatim
static const std::string kSharedResource
const std::string caloHitSource_
void endRun(edm::Run const &, edm::EventSetup const &) override
std::pair< double, double > getEtaPhi(const int &subdet, const int &ieta, const int &iphi) const
~HcalGeomCheck() override
std::pair< T, T > etaphi(T x, T y, T z)
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
std::map< std::pair< int, int >, TH1D * > h_phi_
void beginRun(edm::Run const &, edm::EventSetup const &) override
const HcalDDDRecConstants * hcons_