38 #include "CLHEP/Units/GlobalSystemOfUnits.h" 68 template<
class T1,
class T2>
95 verbosity_(iConfig.getUntrackedParameter<
int>(
"Verbosity",0)) {
107 <<
"HGCal DetectorName given as " <<
nameDetector_ <<
" must be: " 108 <<
"\"HGCalHESiliconSensitive\", \"HGCalHESiliconSensitive\", " 109 <<
"\"HGCalHEScintillatorSensitive\", or \"HCal\"!";
118 desc.
add<
bool>(
"ifHCAL",
false);
120 descriptions.
add(
"hgcalRecHitValidationEE",desc);
129 unsigned int ntot(0), nused(0);
134 edm::LogWarning(
"HGCalValidation") <<
"Cannot get valid HGCalGeometry " 146 for (
const auto & it : *(hbhecoll.
product())) {
147 DetId detId = it.id();
157 edm::LogWarning(
"HGCalValidation") <<
"HBHERecHitCollection Handle does not exist !!!";
167 for (
const auto & it : *(hbhecoll.
product())) {
168 DetId detId = it.id();
175 edm::LogWarning(
"HGCalValidation") <<
"HGChebRecHitCollection Handle does not exist !!!";
186 if (theRecHitContainers.
isValid()) {
189 << theRecHitContainers->
size()
191 for (
const auto & it : *(theRecHitContainers.
product())) {
193 DetId detId = it.id();
199 edm::LogWarning(
"HGCalValidation") <<
"HGCRecHitCollection Handle does not exist !!!";
204 <<
" with " << ntot <<
" total and " 205 << nused <<
" used recHits";
208 template<
class T1,
class T2>
210 const T1*
geom, T2 it) {
212 const GlobalPoint& global = geom->getPosition(detId);
213 double energy = it->energy();
215 float globalx = global.
x();
216 float globaly = global.
y();
217 float globalz = global.
z();
230 << globalx <<
" gy = " << globaly
231 <<
" gz = " << globalz <<
" phi = " 232 << hinfo.
phi <<
" eta = " << hinfo.
eta;
242 if (OccupancyMap.find(layer) != OccupancyMap.end()) OccupancyMap[layer]++;
243 else OccupancyMap[layer] = 1;
249 int layer = (*itr).first;
250 int occupancy = (*itr).second;
255 int layer = (*itr).first;
256 int occupancy = (*itr).second;
264 unsigned int ilayer = hits.
layer -1;
293 std::ostringstream histoname;
294 for (
unsigned int ilayer = 0; ilayer <
layers_; ilayer++ ) {
295 histoname.str(
""); histoname <<
"HitOccupancy_Plus_layer_" << ilayer;
297 histoname.str(
""); histoname <<
"HitOccupancy_Minus_layer_" << ilayer;
300 histoname.str(
""); histoname <<
"EtaPhi_Plus_" <<
"layer_" << ilayer;
302 histoname.str(
""); histoname <<
"EtaPhi_Minus_" <<
"layer_" << ilayer;
305 histoname.str(
""); histoname <<
"energy_layer_" << ilayer;
306 energy_.push_back(iB.
book1D(histoname.str().c_str(),
"energy_",100,0,0.002));
309 histoname.str(
""); histoname <<
"SUMOfRecHitOccupancy_Plus";
311 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_
~HGCalRecHitValidation() override
ParameterDescriptionBase * addUntracked(U const &iLabel, T const &value)
bool getByToken(EDGetToken token, Handle< PROD > &result) const
#define DEFINE_FWK_MODULE(type)
Geom::Phi< T > phi() const
std::vector< MonitorElement * > EtaPhi_Plus_
std::vector< MonitorElement * > HitOccupancy_Minus_
std::string nameDetector_
MonitorElement * MeanHitOccupancy_Plus_
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
int depth() const
get the tower depth
std::map< int, int > OccupancyMap_minus
unsigned int layers(bool reco) const
MonitorElement * book1D(Args &&...args)
MonitorElement * MeanHitOccupancy_Minus_
ParameterDescriptionBase * add(U const &iLabel, T const &value)
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
void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
void setCurrentFolder(const std::string &fullpath)
void fillOccupancyMap(std::map< int, int > &OccupancyMap, int layer)
void analyze(const edm::Event &, const edm::EventSetup &) override
T const * product() const
MonitorElement * book2D(Args &&...args)
int getMaxDepth(const int &type) const
void add(std::string const &label, ParameterSetDescription const &psetDescription)
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_
int layer() const
get the layer #