|
|
Definition at line 55 of file HGCalSimHitValidation.cc.
◆ HGCalSimHitValidation()
◆ ~HGCalSimHitValidation()
HGCalSimHitValidation::~HGCalSimHitValidation |
( |
| ) |
|
|
inlineoverride |
◆ analyze()
Reimplemented from DQMEDAnalyzer.
Definition at line 140 of file HGCalSimHitValidation.cc.
150 for (HepMC::GenEvent::particle_const_iterator
p = myGenEvent->particles_begin();
p != myGenEvent->particles_end();
152 edm::LogVerbatim(
"HGCalValidation") <<
"Particle[" <<
k <<
"] with pt " << (*p)->momentum().perp() <<
" eta "
153 << (*p)->momentum().eta() <<
" phi " << (*p)->momentum().phi();
161 if (theCaloHitContainers.
isValid()) {
163 edm::LogVerbatim(
"HGCalValidation") <<
" PcalohitItr = " << theCaloHitContainers->size();
164 std::vector<PCaloHit> caloHits;
165 caloHits.insert(caloHits.end(), theCaloHitContainers->begin(), theCaloHitContainers->end());
167 for (
unsigned int i = 0;
i < caloHits.size(); ++
i) {
168 unsigned int id_ = caloHits[
i].
id();
172 caloHits[
i].setID(hid.
rawId());
References analyzeHits(), HcalDetId::depth(), edm::HepMCProduct::GetEvent(), HcalEmpty, HcalEndcap, hcons_, heRebuild_, mps_fire::i, edm::HandleBase::id(), HcalDetId::ieta(), iEvent, createfilelist::int, HcalDetId::iphi(), edm::HandleBase::isValid(), dqmdumpme::k, AlCaHLTBitMon_ParallelJobs::p, DetId::rawId(), HcalHitRelabeller::relabel(), HcalDetId::subdet(), testNumber_, tok_hepMC_, tok_hits_, and verbosity_.
◆ analyzeHits()
void HGCalSimHitValidation::analyzeHits |
( |
std::vector< PCaloHit > & |
hits | ) |
|
|
private |
Definition at line 183 of file HGCalSimHitValidation.cc.
184 std::map<int, int> OccupancyMap_plus, OccupancyMap_minus;
185 OccupancyMap_plus.clear();
186 OccupancyMap_minus.clear();
188 std::map<uint32_t, std::pair<hitsinfo, energysum> > map_hits;
193 unsigned int nused(0);
194 for (
unsigned int i = 0;
i <
hits.size();
i++) {
197 uint32_t id_ =
hits[
i].id();
198 int cell, sector, subsector(0), layer,
zside;
206 sector = detId.
iphi();
208 layer = detId.
depth();
213 cell = detId.
cellU();
216 subsector = detId.
waferV();
218 layer = detId.
layer();
229 layer = detId.
layer();
237 <<
"Detector " <<
nameDetector_ <<
" zside = " <<
zside <<
" sector|wafer = " << sector <<
":" << subsector
238 <<
" type = " <<
type <<
" layer = " << layer <<
" cell = " << cell <<
":" <<
cell2 <<
" energy = " <<
energy
239 <<
" energyem = " <<
hits[
i].energyEM() <<
" energyhad = " <<
hits[
i].energyHad() <<
" time = " <<
time;
241 HepGeom::Point3D<float> gcoord;
246 edm::LogVerbatim(
"HGCalValidation") <<
"i/p " << subdet <<
":" <<
zside <<
":" << cell <<
":" << sector <<
":"
247 << layer <<
" o/p " <<
etaphi.first <<
":" <<
etaphi.second <<
":" << rz;
248 gcoord = HepGeom::Point3D<float>(rz *
cos(
etaphi.second) / cosh(
etaphi.first),
253 const HepGeom::Point3D<float> lcoord(
xy.first,
xy.second, 0);
254 int subs = (
symmDet_ ? 0 : subsector);
258 std::pair<float, float>
xy;
269 float xp = (zp < 0) ? -
xy.first :
xy.first;
270 gcoord = HepGeom::Point3D<float>(xp,
xy.second, zp);
272 double tof = (gcoord.mag() * CLHEP::mm) / CLHEP::c_light;
275 << std::hex << id_ <<
std::dec <<
" global coordinate " << gcoord <<
" time " <<
time <<
":" << tof;
280 if (map_hits.count(id_) != 0) {
281 hinfo = map_hits[id_].first;
282 esum = map_hits[id_].second;
284 hinfo.x = gcoord.x();
285 hinfo.y = gcoord.y();
286 hinfo.z = gcoord.z();
287 hinfo.sector = sector;
288 hinfo.sector2 = subsector;
293 hinfo.phi = gcoord.getPhi();
294 hinfo.eta = gcoord.getEta();
304 <<
" gz = " <<
hinfo.z <<
" phi = " <<
hinfo.phi <<
" eta = " <<
hinfo.eta;
305 map_hits[id_] = std::pair<hitsinfo, energysum>(
hinfo, esum);
309 <<
" detector elements being hit";
311 std::map<uint32_t, std::pair<hitsinfo, energysum> >::iterator
itr;
312 for (
itr = map_hits.begin();
itr != map_hits.end(); ++
itr) {
313 hitsinfo
hinfo = (*itr).second.first;
314 energysum esum = (*itr).second.second;
315 int layer =
hinfo.layer;
318 for (
unsigned int itimeslice = 0; itimeslice <
nTimes_; itimeslice++) {
319 fillHitsInfo((*itr).second, itimeslice, esum.eTime[itimeslice]);
328 edm::LogVerbatim(
"HGCalValidation") <<
"With map:used:total " <<
hits.size() <<
"|" << nused <<
"|"
329 << map_hits.size() <<
" hits";
331 for (
auto const&
itr : OccupancyMap_plus) {
332 int layer =
itr.first;
333 int occupancy =
itr.second;
336 for (
auto const&
itr : OccupancyMap_minus) {
337 int layer =
itr.first;
338 int occupancy =
itr.second;
References hgcalTopologyTester_cfi::cell2, HGCSiliconDetId::cellU(), HGCSiliconDetId::cellV(), funct::cos(), TauDecayModes::dec, HcalDetId::depth(), HCALHighEnergyHPDFilter_cfi::energy, PVValHelper::eta, fastmath::etaphi(), HGCalSimHitValidation::energysum::eTime, HGCalSimHitValidation::energysum::etotal, fillHitsInfo(), fillOccupancyMap(), firstLayer_, ForwardEmpty, HGCalDDDConstants::geomMode(), HcalDDDRecConstants::getEtaPhi(), HcalDDDRecConstants::getRZ(), HcalEndcap, hcons_, heRebuild_, hgcons_, HitOccupancy_Minus_, HitOccupancy_Plus_, hfClusterShapes_cfi::hits, mps_fire::i, HGCScintillatorDetId::ietaAbs(), HcalDetId::ietaAbs(), HGCScintillatorDetId::iphi(), HcalDetId::iphi(), dqmdumpme::k, HGCScintillatorDetId::layer(), HGCSiliconDetId::layer(), HGCalDDDConstants::locateCell(), HGCalDDDConstants::locateCellTrap(), nameDetector_, nTimes_, HGCalTestNumbering::packSquareIndex(), funct::sin(), HGCalGeometryMode::Square, HcalDetId::subdet(), symmDet_, HGCalDDDConstants::tileTrapezoid(), ntuplemaker::time, times_, transMap_, HGCScintillatorDetId::type(), HGCSiliconDetId::type(), HGCalTestNumbering::unpackHexagonIndex(), HGCalTestNumbering::unpackSquareIndex(), verbosity_, HGCalDDDConstants::waferHexagon8(), HGCSiliconDetId::waferU(), HGCSiliconDetId::waferV(), HGCalDDDConstants::waferZ(), geometryCSVtoXML::xy, HGCScintillatorDetId::zside(), HGCSiliconDetId::zside(), HcalDetId::zside(), and ecaldqm::zside().
Referenced by analyze().
◆ bookHistograms()
Implements DQMEDAnalyzer.
Definition at line 486 of file HGCalSimHitValidation.cc.
489 std::ostringstream histoname;
490 for (
unsigned int il = 0; il <
layers_; ++il) {
492 auto istr1 = std::to_string(ilayer);
493 while (istr1.size() < 2) {
494 istr1.insert(0,
"0");
497 histoname <<
"HitOccupancy_Plus_layer_" << istr1;
500 histoname <<
"HitOccupancy_Minus_layer_" << istr1;
504 histoname <<
"EtaPhi_Plus_"
505 <<
"layer_" << istr1;
508 histoname <<
"EtaPhi_Minus_"
509 <<
"layer_" << istr1;
513 for (
unsigned int itimeslice = 0; itimeslice <
nTimes_; itimeslice++) {
515 histoname <<
"energy_time_" << itimeslice <<
"_layer_" << istr1;
516 energy_[itimeslice].push_back(iB.
book1D(histoname.str().c_str(),
"energy_", 100, 0, 0.1));
References dqm::implementation::IBooker::book1D(), dqm::implementation::IBooker::book2D(), energy_, EtaPhi_Minus_, EtaPhi_Plus_, firstLayer_, HitOccupancy_Minus_, HitOccupancy_Plus_, layers_, MeanHitOccupancy_Minus_, MeanHitOccupancy_Plus_, nameDetector_, nTimes_, pi, and dqm::implementation::NavigatorBase::setCurrentFolder().
◆ defineGeometry() [1/2]
Definition at line 416 of file HGCalSimHitValidation.cc.
426 while (fv.firstChild()) {
427 const auto&
name = fv.name();
430 const auto&
copy = fv.copyNos();
431 int nsiz = static_cast<int>(
copy.size());
432 int lay = (nsiz > 0) ?
copy[0] : -1;
433 int sec = (nsiz > 1) ?
copy[1] : -1;
434 int zp = (nsiz > 3) ?
copy[3] : -1;
437 const auto& pars = fv.parameters();
438 int subs = (pars[6] > 0 ? 1 : 0);
442 fv.rotation().GetComponents(
x,
y,
z);
443 const CLHEP::HepRep3x3
rotation(
x.X(),
y.X(),
z.X(),
x.Y(),
y.Y(),
z.Y(),
x.Z(),
y.Z(),
z.Z());
444 const CLHEP::HepRotation hr(
rotation);
445 const CLHEP::Hep3Vector h3v(fv.translation().X(), fv.translation().Y(), fv.translation().Z());
446 const HepGeom::Transform3D ht3d(hr, h3v);
447 transMap_.insert(std::make_pair(
id, ht3d));
References filterCSVwithJSON::copy, cms::DDFilteredView::copyNos(), ALCARECOTkAlBeamHalo_cff::filter, cms::DDFilteredView::firstChild(), HGCalDDDConstants::geomMode(), hgcons_, Skims_PA_cff::name, cms::DDFilteredView::name(), nameDetector_, HGCalTestNumbering::packSquareIndex(), cms::DDFilteredView::parameters(), idealTransformation::rotation, cms::DDFilteredView::rotation(), fileinputsource_cfi::sec, HGCalGeometryMode::Square, symmDet_, cms::DDFilteredView::translation(), transMap_, funct::true, verbosity_, x, y, and z.
◆ defineGeometry() [2/2]
Definition at line 368 of file HGCalSimHitValidation.cc.
380 bool dodet = fv.firstChild();
383 const DDSolid& sol = fv.logicalPart().solid();
387 std::vector<int>
copy = fv.copyNumbers();
388 int nsiz = static_cast<int>(
copy.size());
389 int lay = (nsiz > 0) ?
copy[nsiz - 1] : -1;
390 int sec = (nsiz > 1) ?
copy[nsiz - 2] : -1;
391 int zp = (nsiz > 3) ?
copy[nsiz - 4] : -1;
394 const DDTrap& trp = static_cast<DDTrap>(sol);
395 int subs = (trp.
alpha1() > 0 ? 1 : 0);
399 fv.rotation().GetComponents(
x,
y,
z);
400 const CLHEP::HepRep3x3
rotation(
x.X(),
y.X(),
z.X(),
x.Y(),
y.Y(),
z.Y(),
x.Z(),
y.Z(),
z.Z());
401 const CLHEP::HepRotation hr(
rotation);
402 const CLHEP::Hep3Vector h3v(fv.translation().X(), fv.translation().Y(), fv.translation().Z());
403 const HepGeom::Transform3D ht3d(hr, h3v);
404 transMap_.insert(std::make_pair(
id, ht3d));
References DDTrap::alpha1(), filterCSVwithJSON::copy, DDFilteredView::copyNumbers(), ALCARECOTkAlBeamHalo_cff::filter, DDFilteredView::firstChild(), DDName::fullname(), HGCalDDDConstants::geomMode(), hgcons_, DDFilteredView::logicalPart(), Skims_PA_cff::name, DDBase< N, C >::name(), nameDetector_, DDFilteredView::next(), HGCalTestNumbering::packSquareIndex(), idealTransformation::rotation, DDFilteredView::rotation(), fileinputsource_cfi::sec, DDLogicalPart::solid(), HGCalGeometryMode::Square, AlCaHLTBitMon_QueryRunRegistry::string, symmDet_, DDFilteredView::translation(), transMap_, funct::true, verbosity_, x, y, and z.
Referenced by dqmBeginRun().
◆ dqmBeginRun()
Reimplemented from DQMEDAnalyzer.
Definition at line 459 of file HGCalSimHitValidation.cc.
References defineGeometry(), HGCalDDDConstants::firstLayer(), firstLayer_, fromDDD_, edm::EventSetup::get(), get, HcalDDDRecConstants::getMaxDepth(), hcons_, heRebuild_, hgcons_, HGCalDDDConstants::layers(), layers_, nameDetector_, and verbosity_.
◆ fillDescriptions()
◆ fillHitsInfo()
void HGCalSimHitValidation::fillHitsInfo |
( |
std::pair< hitsinfo, energysum > |
hit_, |
|
|
unsigned int |
itimeslice, |
|
|
double |
esum |
|
) |
| |
|
private |
◆ fillOccupancyMap()
void HGCalSimHitValidation::fillOccupancyMap |
( |
std::map< int, int > & |
OccupancyMap, |
|
|
int |
layer |
|
) |
| |
|
private |
◆ caloHitSource_
std::string HGCalSimHitValidation::caloHitSource_ |
|
private |
◆ energy_
◆ EtaPhi_Minus_
◆ EtaPhi_Plus_
◆ firstLayer_
int HGCalSimHitValidation::firstLayer_ |
|
private |
◆ fromDDD_
bool HGCalSimHitValidation::fromDDD_ |
|
private |
◆ hcons_
◆ heRebuild_
bool HGCalSimHitValidation::heRebuild_ |
|
private |
◆ hgcons_
◆ HitOccupancy_Minus_
std::vector<MonitorElement*> HGCalSimHitValidation::HitOccupancy_Minus_ |
|
private |
◆ HitOccupancy_Plus_
std::vector<MonitorElement*> HGCalSimHitValidation::HitOccupancy_Plus_ |
|
private |
◆ layers_
unsigned int HGCalSimHitValidation::layers_ |
|
private |
◆ maxTime_
const unsigned int HGCalSimHitValidation::maxTime_ = 6 |
|
staticprivate |
◆ MeanHitOccupancy_Minus_
◆ MeanHitOccupancy_Plus_
◆ nameDetector_
std::string HGCalSimHitValidation::nameDetector_ |
|
private |
◆ nTimes_
unsigned int HGCalSimHitValidation::nTimes_ |
|
private |
◆ symmDet_
bool HGCalSimHitValidation::symmDet_ |
|
private |
◆ testNumber_
bool HGCalSimHitValidation::testNumber_ |
|
private |
◆ times_
std::vector<double> HGCalSimHitValidation::times_ |
|
private |
◆ tok_hepMC_
◆ tok_hits_
◆ transMap_
std::map<uint32_t, HepGeom::Transform3D> HGCalSimHitValidation::transMap_ |
|
private |
◆ verbosity_
int HGCalSimHitValidation::verbosity_ |
|
private |
std::vector< MonitorElement * > HitOccupancy_Plus_
int iphi() const
get the phi index
constexpr int iphi() const
get the cell iphi
std::pair< float, float > locateCellTrap(int lay, int ieta, int iphi, bool reco) const
MonitorElement * MeanHitOccupancy_Plus_
HGCalGeometryMode::GeometryMode geomMode() const
const HGCalDDDConstants * hgcons_
const HcalDDDRecConstants * hcons_
static void unpackHexagonIndex(const uint32_t &idx, int &subdet, int &z, int &lay, int &wafer, int &celltyp, int &cell)
double waferZ(int layer, bool reco) const
void analyzeHits(std::vector< PCaloHit > &hits)
bool waferHexagon8() const
virtual void setCurrentFolder(std::string const &fullpath)
constexpr int depth() const
get the tower depth
T getUntrackedParameter(std::string const &, T const &) const
static void unpackSquareIndex(const uint32_t &idx, int &z, int &lay, int &sec, int &subsec, int &cell)
bool defineGeometry(edm::ESTransientHandle< DDCompactView > &ddViewH)
Sin< T >::type sin(const T &t)
std::map< uint32_t, HepGeom::Transform3D > transMap_
int layer() const
get the layer #
Cos< T >::type cos(const T &t)
void add(std::string const &label, ParameterSetDescription const &psetDescription)
static uint32_t packSquareIndex(int z, int lay, int sec, int subsec, int cell)
Compact representation of the geometrical detector hierarchy.
void fillHitsInfo(std::pair< hitsinfo, energysum > hit_, unsigned int itimeslice, double esum)
std::vector< MonitorElement * > energy_[maxTime_]
int zside() const
get the z-side of the cell (1/-1)
std::vector< MonitorElement * > EtaPhi_Plus_
bool tileTrapezoid() const
ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< double > > DD3Vector
Interface to a Trapezoid.
constexpr int ieta() const
get the cell ieta
void fillOccupancyMap(std::map< int, int > &OccupancyMap, int layer)
unsigned int layers(bool reco) const
constexpr HcalSubdetector subdet() const
get the subdetector
edm::EDGetTokenT< edm::PCaloHitContainer > tok_hits_
std::string nameDetector_
int type() const
get/set the type
MonitorElement * MeanHitOccupancy_Minus_
const HepMC::GenEvent * GetEvent() const
int zside() const
get the z-side of the cell (1/-1)
std::vector< std::pair< float, float > >::iterator itr
DetId relabel(const uint32_t testId) const
constexpr uint32_t rawId() const
get the raw id
int cellU() const
get the cell #'s in u,v or in x,y
double getRZ(const int &subdet, const int &ieta, const int &depth) const
std::vector< MonitorElement * > EtaPhi_Minus_
std::vector< MonitorElement * > HitOccupancy_Minus_
Log< level::Info, true > LogVerbatim
MonitorElement * book2D(TString const &name, TString const &title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, FUNC onbooking=NOOP())
static const unsigned int maxTime_
std::vector< double > times_
int type() const
get the type
A DDSolid represents the shape of a part.
T getParameter(std::string const &) const
int getMaxDepth(const int &type) const
edm::EDGetTokenT< edm::HepMCProduct > tok_hepMC_
double alpha1(void) const
Angle with respect to the y axis from the centre of the side at y=-pDy1 to the centre at y=+pDy1 of t...
const std::string fullname() const
constexpr int ietaAbs() const
get the absolute value of the cell ieta
std::pair< double, double > getEtaPhi(const int &subdet, const int &ieta, const int &iphi) const
std::pair< float, float > locateCell(int cell, int lay, int type, bool reco) const
constexpr int zside() const
get the z-side of the cell (1/-1)
std::pair< T, T > etaphi(T x, T y, T z)
std::string caloHitSource_
MonitorElement * book1D(TString const &name, TString const &title, int const nchX, double const lowX, double const highX, FUNC onbooking=NOOP())
int layer() const
get the layer #