|
|
Definition at line 54 of file HGCalSimHitValidation.cc.
◆ HGCalSimHitValidation()
◆ ~HGCalSimHitValidation()
HGCalSimHitValidation::~HGCalSimHitValidation |
( |
| ) |
|
|
inlineoverride |
◆ analyze()
Reimplemented from DQMEDAnalyzer.
Definition at line 136 of file HGCalSimHitValidation.cc.
146 for (HepMC::GenEvent::particle_const_iterator
p = myGenEvent->particles_begin();
p != myGenEvent->particles_end();
148 edm::LogVerbatim(
"HGCalValidation") <<
"Particle[" <<
k <<
"] with pt " << (*p)->momentum().perp() <<
" eta "
149 << (*p)->momentum().eta() <<
" phi " << (*p)->momentum().phi();
157 if (theCaloHitContainers.
isValid()) {
159 edm::LogVerbatim(
"HGCalValidation") <<
" PcalohitItr = " << theCaloHitContainers->size();
160 std::vector<PCaloHit> caloHits;
161 caloHits.insert(caloHits.end(), theCaloHitContainers->begin(), theCaloHitContainers->end());
163 for (
unsigned int i = 0;
i < caloHits.size(); ++
i) {
164 unsigned int id_ = caloHits[
i].
id();
168 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 179 of file HGCalSimHitValidation.cc.
180 std::map<int, int> OccupancyMap_plus, OccupancyMap_minus;
181 OccupancyMap_plus.clear();
182 OccupancyMap_minus.clear();
184 std::map<uint32_t, std::pair<hitsinfo, energysum> > map_hits;
189 unsigned int nused(0);
190 for (
unsigned int i = 0;
i <
hits.size();
i++) {
193 uint32_t id_ =
hits[
i].id();
194 int cell, sector, subsector(0), layer,
zside;
202 sector = detId.
iphi();
204 layer = detId.
depth();
210 cell = detId.
cellU();
213 subsector = detId.
waferV();
215 layer = detId.
layer();
226 layer = detId.
layer();
234 <<
"Detector " <<
nameDetector_ <<
" zside = " <<
zside <<
" sector|wafer = " << sector <<
":" << subsector
235 <<
" type = " <<
type <<
" layer = " << layer <<
" cell = " << cell <<
":" <<
cell2 <<
" energy = " <<
energy
236 <<
" energyem = " <<
hits[
i].energyEM() <<
" energyhad = " <<
hits[
i].energyHad() <<
" time = " <<
time;
238 HepGeom::Point3D<float> gcoord;
243 edm::LogVerbatim(
"HGCalValidation") <<
"i/p " << subdet <<
":" <<
zside <<
":" << cell <<
":" << sector <<
":"
244 << layer <<
" o/p " <<
etaphi.first <<
":" <<
etaphi.second <<
":" << rz;
245 gcoord = HepGeom::Point3D<float>(rz *
cos(
etaphi.second) / cosh(
etaphi.first),
250 const HepGeom::Point3D<float> lcoord(
xy.first,
xy.second, 0);
251 int subs = (
symmDet_ ? 0 : subsector);
255 std::pair<float, float>
xy;
267 float xp = (zp < 0) ? -
xy.first :
xy.first;
268 gcoord = HepGeom::Point3D<float>(xp,
xy.second, zp);
270 double tof = (gcoord.mag() * CLHEP::mm) / CLHEP::c_light;
273 << std::hex << id_ <<
std::dec <<
" global coordinate " << gcoord <<
" time " <<
time <<
":" << tof;
278 if (map_hits.count(id_) != 0) {
279 hinfo = map_hits[id_].first;
280 esum = map_hits[id_].second;
282 hinfo.x = gcoord.x();
283 hinfo.y = gcoord.y();
284 hinfo.z = gcoord.z();
285 hinfo.sector = sector;
286 hinfo.sector2 = subsector;
291 hinfo.phi = gcoord.getPhi();
292 hinfo.eta = gcoord.getEta();
302 <<
" gz = " <<
hinfo.z <<
" phi = " <<
hinfo.phi <<
" eta = " <<
hinfo.eta;
303 map_hits[id_] = std::pair<hitsinfo, energysum>(
hinfo, esum);
307 <<
" detector elements being hit";
309 std::map<uint32_t, std::pair<hitsinfo, energysum> >::iterator
itr;
310 for (
itr = map_hits.begin();
itr != map_hits.end(); ++
itr) {
311 hitsinfo
hinfo = (*itr).second.first;
312 energysum esum = (*itr).second.second;
313 int layer =
hinfo.layer;
316 for (
unsigned int itimeslice = 0; itimeslice <
nTimes_; itimeslice++) {
317 fillHitsInfo((*itr).second, itimeslice, esum.eTime[itimeslice]);
326 edm::LogVerbatim(
"HGCalValidation") <<
"With map:used:total " <<
hits.size() <<
"|" << nused <<
"|"
327 << map_hits.size() <<
" hits";
329 for (
auto const&
itr : OccupancyMap_plus) {
330 int layer =
itr.first;
331 int occupancy =
itr.second;
334 for (
auto const&
itr : OccupancyMap_minus) {
335 int layer =
itr.first;
336 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_, HGCalGeometryMode::Hexagon8, HGCalGeometryMode::Hexagon8Full, 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_, ntuplemaker::time, times_, transMap_, HGCalGeometryMode::Trapezoid, HGCScintillatorDetId::type(), HGCSiliconDetId::type(), HGCalTestNumbering::unpackHexagonIndex(), HGCalTestNumbering::unpackSquareIndex(), verbosity_, 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 435 of file HGCalSimHitValidation.cc.
438 std::ostringstream histoname;
439 for (
unsigned int il = 0; il <
layers_; ++il) {
441 auto istr1 = std::to_string(ilayer);
442 while (istr1.size() < 2) {
443 istr1.insert(0,
"0");
446 histoname <<
"HitOccupancy_Plus_layer_" << istr1;
447 HitOccupancy_Plus_.push_back(iB.book1D(histoname.str().c_str(),
"HitOccupancy_Plus", 501, -0.5, 500.5));
449 histoname <<
"HitOccupancy_Minus_layer_" << istr1;
450 HitOccupancy_Minus_.push_back(iB.book1D(histoname.str().c_str(),
"HitOccupancy_Minus", 501, -0.5, 500.5));
453 histoname <<
"EtaPhi_Plus_"
454 <<
"layer_" << istr1;
457 histoname <<
"EtaPhi_Minus_"
458 <<
"layer_" << istr1;
460 iB.book2D(histoname.str().c_str(),
"Occupancy", 31, -3.0, -1.45, 72, -
CLHEP::pi,
CLHEP::pi));
462 for (
unsigned int itimeslice = 0; itimeslice <
nTimes_; itimeslice++) {
464 histoname <<
"energy_time_" << itimeslice <<
"_layer_" << istr1;
465 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()
Definition at line 366 of file HGCalSimHitValidation.cc.
377 bool dodet = fv.firstChild();
380 const DDSolid& sol = fv.logicalPart().solid();
384 std::vector<int>
copy = fv.copyNumbers();
385 int nsiz = static_cast<int>(
copy.size());
386 int lay = (nsiz > 0) ?
copy[nsiz - 1] : -1;
387 int sec = (nsiz > 1) ?
copy[nsiz - 2] : -1;
388 int zp = (nsiz > 3) ?
copy[nsiz - 4] : -1;
391 const DDTrap& trp = static_cast<DDTrap>(sol);
392 int subs = (trp.
alpha1() > 0 ? 1 : 0);
396 fv.rotation().GetComponents(
x,
y,
z);
397 const CLHEP::HepRep3x3
rotation(
x.X(),
y.X(),
z.X(),
x.Y(),
y.Y(),
z.Y(),
x.Z(),
y.Z(),
z.Z());
398 const CLHEP::HepRotation hr(
rotation);
399 const CLHEP::Hep3Vector h3v(fv.translation().X(), fv.translation().Y(), fv.translation().Z());
400 const HepGeom::Transform3D ht3d(hr, h3v);
401 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 414 of file HGCalSimHitValidation.cc.
References defineGeometry(), HGCalDDDConstants::firstLayer(), firstLayer_, 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 |
◆ 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_
ParameterDescriptionBase * add(U const &iLabel, T const &value)
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)
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)
ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< double > > DD3Vector
A DD Translation is currently implemented with Root Vector3D.
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_
Interface to a Trapezoid.
ParameterDescriptionBase * addUntracked(U const &iLabel, T const &value)
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 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
T getParameter(std::string const &) const
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_
static const unsigned int maxTime_
std::vector< double > times_
int type() const
get the type
A DDSolid represents the shape of a part.
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_
int layer() const
get the layer #