29 #include "CLHEP/Units/GlobalSystemOfUnits.h" 57 template <
class T1,
class T2>
84 : nameDetector_(iConfig.getParameter<
std::
string>(
"DetectorName")),
85 verbosity_(iConfig.getUntrackedParameter<
int>(
"Verbosity", 0)),
89 recHitSource_(consumes(iConfig.getParameter<
edm::
InputTag>(
"RecHitSource"))),
96 desc.addUntracked<
int>(
"Verbosity", 0);
97 descriptions.
add(
"hgcalRecHitValidationEE",
desc);
105 unsigned int ntot(0), nused(0);
112 int geomType = ((
geom0->topology().waferHexagon8()) ? 1 : ((
geom0->topology().tileTrapezoid()) ? 2 : 0));
115 if (theRecHitContainers.
isValid()) {
119 for (
const auto& it : *(theRecHitContainers.
product())) {
122 DetId detId = it.id();
129 <<
"does not exist !!!";
139 template <
class T1,
class T2>
142 double energy = it->energy();
144 float globalx = global.
x();
145 float globaly = global.
y();
146 float globalz = global.
z();
158 edm::LogVerbatim(
"HGCalValidation") <<
"-------------------------- gx = " << globalx <<
" gy = " << globaly
159 <<
" gz = " << globalz <<
" phi = " <<
hinfo.phi <<
" eta = " <<
hinfo.eta
160 <<
" lay = " <<
hinfo.layer;
171 if (OccupancyMap.find(
layer) != OccupancyMap.end())
172 OccupancyMap[
layer]++;
174 OccupancyMap[
layer] = 1;
179 int layer = itr.first;
180 int occupancy = itr.second;
185 int layer = itr.first;
186 int occupancy = itr.second;
192 unsigned int ilayer =
hits.layer;
214 std::ostringstream histoname;
215 for (
unsigned int il = 0; il <
layers_; ++il) {
218 while (istr1.size() < 2) {
219 istr1.insert(0,
"0");
222 histoname <<
"HitOccupancy_Plus_layer_" << istr1;
225 histoname <<
"HitOccupancy_Minus_layer_" << istr1;
229 histoname <<
"EtaPhi_Plus_" 230 <<
"layer_" << istr1;
233 histoname <<
"EtaPhi_Minus_" 234 <<
"layer_" << istr1;
239 histoname <<
"energy_layer_" << istr1;
240 energy_.push_back(iB.
book1D(histoname.str().c_str(),
"energy_", 500, 0, 1));
244 histoname <<
"SUMOfRecHitOccupancy_Plus";
248 histoname <<
"SUMOfRecHitOccupancy_Minus";
Log< level::Info, true > LogVerbatim
HGCalRecHitValidation(const edm::ParameterSet &)
std::vector< MonitorElement * > EtaPhi_Minus_
const edm::ESGetToken< HGCalGeometry, IdealGeometryRecord > geometry_token_
virtual void setCurrentFolder(std::string const &fullpath)
Geom::Phi< T > phi() const
T const * product() const
std::vector< MonitorElement * > EtaPhi_Plus_
std::string to_string(const V &value)
std::vector< MonitorElement * > HitOccupancy_Minus_
constexpr std::array< uint8_t, layerIndexSize > layer
MonitorElement * MeanHitOccupancy_Plus_
const std::string nameDetector_
int layer() const
get the layer #
const edm::EDGetTokenT< HGCRecHitCollection > recHitSource_
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
~HGCalRecHitValidation() override=default
T const * product() const
std::map< int, int > OccupancyMap_minus
const edm::ESGetToken< HGCalGeometry, IdealGeometryRecord > geometry_beginRun_token_
int layer() const
get the layer #
MonitorElement * MeanHitOccupancy_Minus_
#define DEFINE_FWK_MODULE(type)
unsigned int layers(bool reco) const
ESHandle< T > getHandle(const ESGetToken< T, R > &iToken) const
void dqmBeginRun(const edm::Run &, const edm::EventSetup &) override
void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
void fillOccupancyMap(std::map< int, int > &OccupancyMap, int layer)
void analyze(const edm::Event &, const edm::EventSetup &) override
MonitorElement * book2D(TString const &name, TString const &title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, FUNC onbooking=NOOP())
void add(std::string const &label, ParameterSetDescription const &psetDescription)
std::map< int, int > OccupancyMap_plus
std::vector< MonitorElement * > HitOccupancy_Plus_
MonitorElement * book1D(TString const &name, TString const &title, int const nchX, double const lowX, double const highX, FUNC onbooking=NOOP())
void recHitValidation(DetId &detId, int layer, const T1 *geom, T2 it)
std::vector< MonitorElement * > energy_