35 #include "CLHEP/Units/GlobalSystemOfUnits.h" 42 nameDetector_(iConfig.getParameter<
std::
string>(
"DetectorName")),
43 verbosity_(iConfig.getUntrackedParameter<
int>(
"Verbosity",0)) {
55 <<
"HGCal DetectorName given as " <<
nameDetector_ <<
" must be: " 56 <<
"\"HGCalHESiliconSensitive\", \"HGCalHESiliconSensitive\", " 57 <<
"\"HGCalHEScintillatorSensitive\", or \"HCal\"!";
70 unsigned int ntot(0), nused(0);
83 << hbhecoll->
size() <<
" element(s)";
85 it != hbhecoll->
end(); ++it) {
86 DetId detId = it->id();
96 edm::LogWarning(
"HGCalValidation") <<
"HBHERecHitCollection Handle does not exist !!!";
104 << hbhecoll->
size() <<
" element(s)";
106 it != hbhecoll->
end(); ++it) {
107 DetId detId = it->id();
114 edm::LogWarning(
"HGCalValidation") <<
"HGChebRecHitCollection Handle does not exist !!!";
125 if (theRecHitContainers.
isValid()) {
128 << theRecHitContainers->
size()
131 it !=theRecHitContainers->
end(); ++it) {
133 DetId detId = it->id();
139 edm::LogWarning(
"HGCalValidation") <<
"HGCRecHitCollection Handle does not exist !!!";
144 <<
" with " << ntot <<
" total and " 145 << nused <<
" used recHits";
148 template<
class T1,
class T2>
150 const T1*
geom, T2 it) {
153 double energy = it->energy();
155 float globalx = global.
x();
156 float globaly = global.
y();
157 float globalz = global.
z();
169 edm::LogInfo(
"HGCalValidation") <<
" -------------------------- gx = " 170 << globalx <<
" gy = " << globaly
171 <<
" gz = " << globalz <<
" phi = " 172 << hinfo.
phi <<
" eta = " << hinfo.
eta;
182 if (OccupancyMap.find(layer) != OccupancyMap.end()) OccupancyMap[layer]++;
183 else OccupancyMap[layer] = 1;
189 int layer = (*itr).first;
190 int occupancy = (*itr).second;
195 int layer = (*itr).first;
196 int occupancy = (*itr).second;
204 unsigned int ilayer = hits.
layer -1;
233 std::ostringstream histoname;
234 for (
unsigned int ilayer = 0; ilayer <
layers_; ilayer++ ) {
235 histoname.str(
""); histoname <<
"HitOccupancy_Plus_layer_" << ilayer;
237 histoname.str(
""); histoname <<
"HitOccupancy_Minus_layer_" << ilayer;
240 histoname.str(
""); histoname <<
"EtaPhi_Plus_" <<
"layer_" << ilayer;
242 histoname.str(
""); histoname <<
"EtaPhi_Minus_" <<
"layer_" << ilayer;
245 histoname.str(
""); histoname <<
"energy_layer_" << ilayer;
246 energy_.push_back(iB.
book1D(histoname.str().c_str(),
"energy_",100,0,0.002));
249 histoname.str(
""); histoname <<
"SUMOfRecHitOccupancy_Plus";
251 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_
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
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 dqmBeginRun(const edm::Run &, const edm::EventSetup &) override
const_iterator end() const
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)
void analyze(const edm::Event &, const edm::EventSetup &) override
MonitorElement * book2D(Args &&...args)
std::map< int, int > OccupancyMap_plus
std::vector< MonitorElement * > HitOccupancy_Plus_
T const * product() const
void recHitValidation(DetId &detId, int layer, const T1 *geom, T2 it)
std::vector< MonitorElement * > energy_
const_iterator begin() const