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 " 147 it != hbhecoll->
end(); ++it) {
148 DetId detId = it->id();
158 edm::LogWarning(
"HGCalValidation") <<
"HBHERecHitCollection Handle does not exist !!!";
169 it != hbhecoll->
end(); ++it) {
170 DetId detId = it->id();
177 edm::LogWarning(
"HGCalValidation") <<
"HGChebRecHitCollection Handle does not exist !!!";
188 if (theRecHitContainers.
isValid()) {
191 << theRecHitContainers->
size()
194 it !=theRecHitContainers->
end(); ++it) {
196 DetId detId = it->id();
202 edm::LogWarning(
"HGCalValidation") <<
"HGCRecHitCollection Handle does not exist !!!";
207 <<
" with " << ntot <<
" total and " 208 << nused <<
" used recHits";
211 template<
class T1,
class T2>
213 const T1*
geom, T2 it) {
215 const GlobalPoint& global = geom->getPosition(detId);
216 double energy = it->energy();
218 float globalx = global.
x();
219 float globaly = global.
y();
220 float globalz = global.
z();
233 << globalx <<
" gy = " << globaly
234 <<
" gz = " << globalz <<
" phi = " 235 << hinfo.
phi <<
" eta = " << hinfo.
eta;
245 if (OccupancyMap.find(layer) != OccupancyMap.end()) OccupancyMap[layer]++;
246 else OccupancyMap[layer] = 1;
252 int layer = (*itr).first;
253 int occupancy = (*itr).second;
258 int layer = (*itr).first;
259 int occupancy = (*itr).second;
267 unsigned int ilayer = hits.
layer -1;
296 std::ostringstream histoname;
297 for (
unsigned int ilayer = 0; ilayer <
layers_; ilayer++ ) {
298 histoname.str(
""); histoname <<
"HitOccupancy_Plus_layer_" << ilayer;
300 histoname.str(
""); histoname <<
"HitOccupancy_Minus_layer_" << ilayer;
303 histoname.str(
""); histoname <<
"EtaPhi_Plus_" <<
"layer_" << ilayer;
305 histoname.str(
""); histoname <<
"EtaPhi_Minus_" <<
"layer_" << ilayer;
308 histoname.str(
""); histoname <<
"energy_layer_" << ilayer;
309 energy_.push_back(iB.
book1D(histoname.str().c_str(),
"energy_",100,0,0.002));
312 histoname.str(
""); histoname <<
"SUMOfRecHitOccupancy_Plus";
314 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< 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_
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
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)
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_
const_iterator begin() const