35 #include "CLHEP/Units/GlobalSystemOfUnits.h"
42 nameDetector_(iConfig.getParameter<std::
string>(
"DetectorName")),
43 verbosity_(iConfig.getUntrackedParameter<int>(
"Verbosity",0)) {
51 consumes<HBHERecHitCollection>(
temp);
54 <<
"HGCal DetectorName given as " <<
nameDetector_ <<
" must be: "
55 <<
"\"HGCalHESiliconSensitive\", \"HGCalHESiliconSensitive\", "
56 <<
"\"HGCalHEScintillatorSensitive\", or \"HCal\"!";
69 unsigned int ntot(0), nused(0);
81 << hbhecoll->size() <<
" element(s)";
83 it != hbhecoll->end(); ++it) {
84 DetId detId = it->id();
94 edm::LogWarning(
"HGCalValidation") <<
"HBHERecHitCollection Handle does not exist !!!";
104 if (theRecHitContainers.
isValid()) {
107 << theRecHitContainers->size()
110 it !=theRecHitContainers->end(); ++it) {
112 DetId detId = it->id();
118 edm::LogWarning(
"HGCalValidation") <<
"HGCRecHitCollection Handle does not exist !!!";
123 <<
" with " << ntot <<
" total and "
124 << nused <<
" used recHits";
127 template<
class T1,
class T2>
129 const T1*
geom, T2 it) {
132 double energy = it->energy();
134 float globalx = global.
x();
135 float globaly = global.
y();
136 float globalz = global.
z();
148 edm::LogInfo(
"HGCalValidation") <<
" -------------------------- gx = "
149 << globalx <<
" gy = " << globaly
150 <<
" gz = " << globalz <<
" phi = "
151 << hinfo.
phi <<
" eta = " << hinfo.
eta;
161 if (OccupancyMap.find(layer) != OccupancyMap.end()) OccupancyMap[layer]++;
162 else OccupancyMap[layer] = 1;
168 int layer = (*itr).first;
169 int occupancy = (*itr).second;
174 int layer = (*itr).first;
175 int occupancy = (*itr).second;
183 unsigned int ilayer = hits.
layer -1;
212 std::ostringstream histoname;
213 for (
unsigned int ilayer = 0; ilayer <
layers_; ilayer++ ) {
214 histoname.str(
""); histoname <<
"HitOccupancy_Plus_layer_" << ilayer;
216 histoname.str(
""); histoname <<
"HitOccupancy_Minus_layer_" << ilayer;
219 histoname.str(
""); histoname <<
"EtaPhi_Plus_" <<
"layer_" << ilayer;
220 EtaPhi_Plus_.push_back(iB.
book2D(histoname.str().c_str(),
"Occupancy", 31, 1.45, 3.0, 72, -3.15, 3.15));
221 histoname.str(
""); histoname <<
"EtaPhi_Minus_" <<
"layer_" << ilayer;
222 EtaPhi_Minus_.push_back(iB.
book2D(histoname.str().c_str(),
"Occupancy", 31, -3.0, -1.45, 72, -3.15, 3.15));
224 histoname.str(
""); histoname <<
"energy_layer_" << ilayer;
225 energy_.push_back(iB.
book1D(histoname.str().c_str(),
"energy_",100,0,0.002));
228 histoname.str(
""); histoname <<
"SUMOfRecHitOccupancy_Plus";
230 histoname.str(
""); histoname <<
"SUMOfRecHitOccupancy_Minus";
T getParameter(std::string const &) const
EventNumber_t event() const
HGCalRecHitValidation(const edm::ParameterSet &)
std::vector< MonitorElement * > EtaPhi_Minus_
edm::EDGetToken recHitSource_
bool getByToken(EDGetToken token, Handle< PROD > &result) const
#define DEFINE_FWK_MODULE(type)
Geom::Phi< T > phi() const
std::vector< HBHERecHit >::const_iterator const_iterator
std::vector< MonitorElement * > EtaPhi_Plus_
int layer() const
get the layer #
std::vector< MonitorElement * > HitOccupancy_Minus_
void dqmBeginRun(const edm::Run &, const edm::EventSetup &)
std::string nameDetector_
MonitorElement * MeanHitOccupancy_Plus_
int getMaxDepth(const int type) const
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
int depth() const
get the tower depth
std::map< int, int > OccupancyMap_minus
void addDefault(ParameterSetDescription const &psetDescription)
unsigned int layers(bool reco) const
void analyze(const edm::Event &, const edm::EventSetup &)
MonitorElement * book1D(Args &&...args)
MonitorElement * MeanHitOccupancy_Minus_
int subdetId() const
get the contents of the subdetector field (not cast into any detector's numbering enum) ...
void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
int layer() const
get the layer #
void setCurrentFolder(const std::string &fullpath)
void fillOccupancyMap(std::map< int, int > &OccupancyMap, int layer)
MonitorElement * book2D(Args &&...args)
T const * product() const
std::map< int, int > OccupancyMap_plus
std::vector< MonitorElement * > HitOccupancy_Plus_
void recHitValidation(DetId &detId, int layer, const T1 *geom, T2 it)
std::vector< MonitorElement * > energy_