|
|
Definition at line 50 of file HGCalSimHitValidation.cc.
◆ HGCalSimHitValidation()
Definition at line 111 of file HGCalSimHitValidation.cc.
117 tok_hgcal_(esConsumes<HGCalDDDConstants, IdealGeometryRecord, edm::Transition::BeginRun>(
119 tok_cpv_(esConsumes<DDCompactView, IdealGeometryRecord, edm::Transition::BeginRun>()),
120 tok_cpvc_(esConsumes<cms::DDCompactView, IdealGeometryRecord, edm::Transition::BeginRun>()),
References nameDetector_.
◆ ~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());
References analyzeHits(), edm::HepMCProduct::GetEvent(), iEvent, edm::HandleBase::isValid(), dqmdumpme::k, AlCaHLTBitMon_ParallelJobs::p, tok_hepMC_, tok_hits_, and verbosity_.
◆ analyzeHits()
void HGCalSimHitValidation::analyzeHits |
( |
std::vector< PCaloHit > & |
hits | ) |
|
|
private |
Definition at line 172 of file HGCalSimHitValidation.cc.
173 std::map<int, int> OccupancyMap_plus, OccupancyMap_minus;
174 OccupancyMap_plus.clear();
175 OccupancyMap_minus.clear();
177 std::map<uint32_t, std::pair<hitsinfo, energysum> > map_hits;
182 unsigned int nused(0);
183 for (
unsigned int i = 0;
i <
hits.size();
i++) {
186 uint32_t id_ =
hits[
i].id();
192 cell = detId.
cellU();
195 subsector = detId.
waferV();
214 <<
"Detector " <<
nameDetector_ <<
" zside = " <<
zside <<
" sector|wafer = " << sector <<
":" << subsector
215 <<
" type = " <<
type <<
" layer = " <<
layer <<
" cell = " << cell <<
":" <<
cell2 <<
" energy = " <<
energy
216 <<
" energyem = " <<
hits[
i].energyEM() <<
" energyhad = " <<
hits[
i].energyHad() <<
" time = " <<
time;
218 HepGeom::Point3D<float> gcoord;
219 std::pair<float, float>
xy;
230 float xp = (zp < 0) ? -
xy.first :
xy.first;
231 gcoord = HepGeom::Point3D<float>(xp,
xy.second, zp);
232 double tof = (gcoord.mag() * CLHEP::mm) / CLHEP::c_light;
235 << std::hex << id_ <<
std::dec <<
" global coordinate " << gcoord <<
" time " <<
time <<
":" << tof;
240 if (map_hits.count(id_) != 0) {
241 hinfo = map_hits[id_].first;
242 esum = map_hits[id_].second;
244 hinfo.x = gcoord.x();
245 hinfo.y = gcoord.y();
246 hinfo.z = gcoord.z();
247 hinfo.sector = sector;
248 hinfo.sector2 = subsector;
253 hinfo.phi = gcoord.getPhi();
254 hinfo.eta = gcoord.getEta();
264 <<
" gz = " <<
hinfo.z <<
" phi = " <<
hinfo.phi <<
" eta = " <<
hinfo.eta;
265 map_hits[id_] = std::pair<hitsinfo, energysum>(
hinfo, esum);
269 <<
" detector elements being hit";
271 std::map<uint32_t, std::pair<hitsinfo, energysum> >::iterator itr;
272 for (itr = map_hits.begin(); itr != map_hits.end(); ++itr) {
273 hitsinfo
hinfo = (*itr).second.first;
274 energysum esum = (*itr).second.second;
278 for (
unsigned int itimeslice = 0; itimeslice <
nTimes_; itimeslice++) {
279 fillHitsInfo((*itr).second, itimeslice, esum.eTime[itimeslice]);
288 edm::LogVerbatim(
"HGCalValidation") <<
"With map:used:total " <<
hits.size() <<
"|" << nused <<
"|"
289 << map_hits.size() <<
" hits";
291 for (
auto const& itr : OccupancyMap_plus) {
292 int layer = itr.first;
293 int occupancy = itr.second;
296 for (
auto const& itr : OccupancyMap_minus) {
297 int layer = itr.first;
298 int occupancy = itr.second;
References hgcalTopologyTester_cfi::cell2, HGCSiliconDetId::cellU(), HGCSiliconDetId::cellV(), TauDecayModes::dec, HCALHighEnergyHPDFilter_cfi::energy, PVValHelper::eta, HGCalSimHitValidation::energysum::eTime, HGCalSimHitValidation::energysum::etotal, fillHitsInfo(), fillOccupancyMap(), firstLayer_, ForwardEmpty, hgcons_, HitOccupancy_Minus_, HitOccupancy_Plus_, hfClusterShapes_cfi::hits, mps_fire::i, HGCScintillatorDetId::ietaAbs(), HGCScintillatorDetId::iphi(), dqmdumpme::k, HGCScintillatorDetId::layer(), HGCSiliconDetId::layer(), phase1PixelTopology::layer, HGCalDDDConstants::locateCell(), HGCalDDDConstants::locateCellTrap(), nameDetector_, nTimes_, HGCalDDDConstants::tileTrapezoid(), protons_cff::time, times_, HGCScintillatorDetId::type(), HGCSiliconDetId::type(), HGCalTestNumbering::unpackHexagonIndex(), verbosity_, HGCalDDDConstants::waferHexagon8(), HGCSiliconDetId::waferU(), HGCSiliconDetId::waferV(), HGCalDDDConstants::waferZ(), geometryCSVtoXML::xy, HGCScintillatorDetId::zside(), HGCSiliconDetId::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;
449 histoname <<
"HitOccupancy_Minus_layer_" << istr1;
453 histoname <<
"EtaPhi_Plus_"
454 <<
"layer_" << istr1;
457 histoname <<
"EtaPhi_Minus_"
458 <<
"layer_" << istr1;
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() [1/2]
Definition at line 376 of file HGCalSimHitValidation.cc.
386 while (fv.firstChild()) {
387 const auto&
name = fv.name();
390 const auto&
copy = fv.copyNos();
391 int nsiz = static_cast<int>(
copy.size());
392 int lay = (nsiz > 0) ?
copy[0] : -1;
393 int sec = (nsiz > 1) ?
copy[1] : -1;
394 int zp = (nsiz > 3) ?
copy[3] : -1;
397 const auto& pars = fv.parameters();
398 int subs = (pars[6] > 0 ? 1 : 0);
402 fv.rotation().GetComponents(
x,
y,
z);
403 const CLHEP::HepRep3x3
rotation(
x.X(),
y.X(),
z.X(),
x.Y(),
y.Y(),
z.Y(),
x.Z(),
y.Z(),
z.Z());
404 const CLHEP::HepRotation hr(
rotation);
405 const CLHEP::Hep3Vector h3v(fv.translation().X(), fv.translation().Y(), fv.translation().Z());
406 const HepGeom::Transform3D ht3d(hr, h3v);
407 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]
bool HGCalSimHitValidation::defineGeometry |
( |
const DDCompactView * |
ddViewH | ) |
|
|
private |
Definition at line 328 of file HGCalSimHitValidation.cc.
340 bool dodet = fv.firstChild();
343 const DDSolid& sol = fv.logicalPart().solid();
347 std::vector<int>
copy = fv.copyNumbers();
348 int nsiz = static_cast<int>(
copy.size());
349 int lay = (nsiz > 0) ?
copy[nsiz - 1] : -1;
350 int sec = (nsiz > 1) ?
copy[nsiz - 2] : -1;
351 int zp = (nsiz > 3) ?
copy[nsiz - 4] : -1;
354 const DDTrap& trp = static_cast<DDTrap>(sol);
355 int subs = (trp.
alpha1() > 0 ? 1 : 0);
359 fv.rotation().GetComponents(
x,
y,
z);
360 const CLHEP::HepRep3x3
rotation(
x.X(),
y.X(),
z.X(),
x.Y(),
y.Y(),
z.Y(),
x.Z(),
y.Z(),
z.Z());
361 const CLHEP::HepRotation hr(
rotation);
362 const CLHEP::Hep3Vector h3v(fv.translation().X(), fv.translation().Y(), fv.translation().Z());
363 const HepGeom::Transform3D ht3d(hr, h3v);
364 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 419 of file HGCalSimHitValidation.cc.
References defineGeometry(), HGCalDDDConstants::firstLayer(), firstLayer_, fromDDD_, edm::EventSetup::getData(), hgcons_, HGCalDDDConstants::layers(), layers_, nameDetector_, tok_cpv_, tok_cpvc_, tok_hgcal_, 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_
const std::string HGCalSimHitValidation::caloHitSource_ |
|
private |
◆ energy_
◆ EtaPhi_Minus_
◆ EtaPhi_Plus_
◆ firstLayer_
int HGCalSimHitValidation::firstLayer_ |
|
private |
◆ fromDDD_
const bool HGCalSimHitValidation::fromDDD_ |
|
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_
const std::string HGCalSimHitValidation::nameDetector_ |
|
private |
◆ nTimes_
unsigned int HGCalSimHitValidation::nTimes_ |
|
private |
◆ symmDet_
bool HGCalSimHitValidation::symmDet_ |
|
private |
◆ times_
const std::vector<double> HGCalSimHitValidation::times_ |
|
private |
◆ tok_cpv_
◆ tok_cpvc_
◆ tok_hepMC_
◆ tok_hgcal_
◆ tok_hits_
◆ transMap_
std::map<uint32_t, HepGeom::Transform3D> HGCalSimHitValidation::transMap_ |
|
private |
◆ verbosity_
const int HGCalSimHitValidation::verbosity_ |
|
private |
std::vector< MonitorElement * > HitOccupancy_Plus_
int iphi() const
get the phi index
std::pair< float, float > locateCellTrap(int lay, int ieta, int iphi, bool reco) const
MonitorElement * MeanHitOccupancy_Plus_
HGCalGeometryMode::GeometryMode geomMode() const
const edm::ESGetToken< cms::DDCompactView, IdealGeometryRecord > tok_cpvc_
const HGCalDDDConstants * hgcons_
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)
T getUntrackedParameter(std::string const &, T const &) const
const std::string nameDetector_
std::map< uint32_t, HepGeom::Transform3D > transMap_
int layer() const
get the layer #
bool defineGeometry(const DDCompactView *ddViewH)
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_
constexpr std::array< uint8_t, layerIndexSize > layer
bool tileTrapezoid() const
ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< double > > DD3Vector
Interface to a Trapezoid.
void fillOccupancyMap(std::map< int, int > &OccupancyMap, int layer)
unsigned int layers(bool reco) const
edm::EDGetTokenT< edm::PCaloHitContainer > tok_hits_
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)
bool getData(T &iHolder) const
int cellU() const
get the cell #'s in u,v or in x,y
std::vector< MonitorElement * > EtaPhi_Minus_
const std::string caloHitSource_
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_
const std::vector< double > times_
const edm::ESGetToken< DDCompactView, IdealGeometryRecord > tok_cpv_
int type() const
get the type
A DDSolid represents the shape of a part.
T getParameter(std::string const &) const
edm::EDGetTokenT< edm::HepMCProduct > tok_hepMC_
const edm::ESGetToken< HGCalDDDConstants, IdealGeometryRecord > tok_hgcal_
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
std::pair< float, float > locateCell(int cell, int lay, int type, bool reco) const
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 #