|
|
Go to the documentation of this file.
36 #include "CLHEP/Units/GlobalSystemOfUnits.h"
64 template <
class T1,
class T2>
90 : nameDetector_(iConfig.getParameter<
std::
string>(
"DetectorName")),
91 ifHCAL_(iConfig.getParameter<
bool>(
"ifHCAL")),
92 verbosity_(iConfig.getUntrackedParameter<
int>(
"Verbosity", 0)),
105 <<
"\"HGCalHESiliconSensitive\", \"HGCalHESiliconSensitive\", "
106 <<
"\"HGCalHEScintillatorSensitive\", or \"HCal\"!";
114 desc.add<
bool>(
"ifHCAL",
false);
115 desc.addUntracked<
int>(
"Verbosity", 0);
116 descriptions.
add(
"hgcalRecHitValidationEE",
desc);
124 unsigned int ntot(0), nused(0);
128 if (!
geom.isValid()) {
139 for (
const auto& it : *(hbhecoll.
product())) {
140 DetId detId = it.id();
151 <<
"Handle does not exist !!!";
159 for (
const auto& it : *(hbhecoll.
product())) {
160 DetId detId = it.id();
169 <<
"Handle does not exist !!!";
176 if (!
geom.isValid()) {
181 int geomType = ((
geom0->topology().waferHexagon8()) ? 1 : ((
geom0->topology().tileTrapezoid()) ? 2 : 0));
185 if (theRecHitContainers.
isValid()) {
189 for (
const auto& it : *(theRecHitContainers.
product())) {
192 DetId detId = it.id();
193 int layer = ((geomType == 0)
201 <<
"does not exist !!!";
212 template <
class T1,
class T2>
215 double energy = it->energy();
217 float globalx = global.
x();
218 float globaly = global.
y();
219 float globalz = global.
z();
231 edm::LogVerbatim(
"HGCalValidation") <<
"-------------------------- gx = " << globalx <<
" gy = " << globaly
232 <<
" gz = " << globalz <<
" phi = " <<
hinfo.phi <<
" eta = " <<
hinfo.eta
233 <<
" lay = " <<
hinfo.layer;
244 if (OccupancyMap.find(
layer) != OccupancyMap.end())
245 OccupancyMap[
layer]++;
247 OccupancyMap[
layer] = 1;
252 int layer = itr.first;
253 int occupancy = itr.second;
258 int layer = itr.first;
259 int occupancy = itr.second;
265 unsigned int ilayer =
hits.layer;
289 std::ostringstream histoname;
290 for (
unsigned int il = 0; il <
layers_; ++il) {
292 auto istr1 = std::to_string(ilayer);
293 while (istr1.size() < 2) {
294 istr1.insert(0,
"0");
297 histoname <<
"HitOccupancy_Plus_layer_" << istr1;
300 histoname <<
"HitOccupancy_Minus_layer_" << istr1;
304 histoname <<
"EtaPhi_Plus_"
305 <<
"layer_" << istr1;
308 histoname <<
"EtaPhi_Minus_"
309 <<
"layer_" << istr1;
314 histoname <<
"energy_layer_" << istr1;
315 energy_.push_back(iB.
book1D(histoname.str().c_str(),
"energy_", 500, 0, 1));
319 histoname <<
"SUMOfRecHitOccupancy_Plus";
323 histoname <<
"SUMOfRecHitOccupancy_Minus";
~HGCalRecHitValidation() override
std::string nameDetector_
T const * product() const
MonitorElement * MeanHitOccupancy_Minus_
void fillOccupancyMap(std::map< int, int > &OccupancyMap, int layer)
std::vector< MonitorElement * > EtaPhi_Minus_
virtual void setCurrentFolder(std::string const &fullpath)
edm::EDGetToken recHitSource_
void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
constexpr int depth() const
get the tower depth
std::map< int, int > OccupancyMap_plus
int layer() const
get the layer #
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
int layer() const
get the layer #
void analyze(const edm::Event &, const edm::EventSetup &) override
#define DEFINE_FWK_MODULE(type)
std::vector< MonitorElement * > HitOccupancy_Plus_
void add(std::string const &label, ParameterSetDescription const &psetDescription)
HGCalRecHitValidation(const edm::ParameterSet &)
constexpr int subdetId() const
get the contents of the subdetector field (not cast into any detector's numbering enum)
void recHitValidation(DetId &detId, int layer, const T1 *geom, T2 it)
constexpr std::array< uint8_t, layerIndexSize > layer
std::vector< MonitorElement * > EtaPhi_Plus_
std::vector< MonitorElement * > HitOccupancy_Minus_
void dqmBeginRun(const edm::Run &, const edm::EventSetup &) override
unsigned int layers(bool reco) const
std::vector< MonitorElement * > energy_
MonitorElement * MeanHitOccupancy_Plus_
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())
std::map< int, int > OccupancyMap_minus
T getParameter(std::string const &) const
int getMaxDepth(const int &type) const
Geom::Phi< T > phi() 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 #