29 #include "CLHEP/Units/GlobalSystemOfUnits.h" 57 template <
class T1,
class T2>
84 : nameDetector_(iConfig.getParameter<
std::
string>(
"DetectorName")),
88 verbosity_(iConfig.getUntrackedParameter<
int>(
"Verbosity", 0)),
96 <<
"\"HGCalHESiliconSensitive\", \"HGCalHESiliconSensitive\", or " 97 <<
"\"HGCalHEScintillatorSensitive\"!";
105 desc.addUntracked<
int>(
"Verbosity", 0);
106 descriptions.
add(
"hgcalRecHitValidationEE",
desc);
114 unsigned int ntot(0), nused(0);
121 int geomType = ((
geom0->topology().waferHexagon8()) ? 1 : ((
geom0->topology().tileTrapezoid()) ? 2 : 0));
125 if (theRecHitContainers.
isValid()) {
129 for (
const auto& it : *(theRecHitContainers.
product())) {
132 DetId detId = it.id();
133 int layer = ((geomType == 0)
141 <<
"does not exist !!!";
151 template <
class T1,
class T2>
154 double energy = it->energy();
156 float globalx = global.
x();
157 float globaly = global.
y();
158 float globalz = global.
z();
170 edm::LogVerbatim(
"HGCalValidation") <<
"-------------------------- gx = " << globalx <<
" gy = " << globaly
171 <<
" gz = " << globalz <<
" phi = " <<
hinfo.phi <<
" eta = " <<
hinfo.eta
172 <<
" lay = " <<
hinfo.layer;
183 if (OccupancyMap.find(
layer) != OccupancyMap.end())
184 OccupancyMap[
layer]++;
186 OccupancyMap[
layer] = 1;
191 int layer = itr.first;
192 int occupancy = itr.second;
197 int layer = itr.first;
198 int occupancy = itr.second;
204 unsigned int ilayer =
hits.layer;
226 std::ostringstream histoname;
227 for (
unsigned int il = 0; il <
layers_; ++il) {
230 while (istr1.size() < 2) {
231 istr1.insert(0,
"0");
234 histoname <<
"HitOccupancy_Plus_layer_" << istr1;
237 histoname <<
"HitOccupancy_Minus_layer_" << istr1;
241 histoname <<
"EtaPhi_Plus_" 242 <<
"layer_" << istr1;
245 histoname <<
"EtaPhi_Minus_" 246 <<
"layer_" << istr1;
251 histoname <<
"energy_layer_" << istr1;
252 energy_.push_back(iB.
book1D(histoname.str().c_str(),
"energy_", 500, 0, 1));
256 histoname <<
"SUMOfRecHitOccupancy_Plus";
260 histoname <<
"SUMOfRecHitOccupancy_Minus";
Log< level::Info, true > LogVerbatim
HGCalRecHitValidation(const edm::ParameterSet &)
std::vector< MonitorElement * > EtaPhi_Minus_
T getParameter(std::string const &) const
edm::EDGetToken recHitSource_
edm::ESGetToken< HGCalGeometry, IdealGeometryRecord > geometry_token_
~HGCalRecHitValidation() override
virtual void setCurrentFolder(std::string const &fullpath)
#define DEFINE_FWK_MODULE(type)
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_
edm::ESGetToken< HGCalGeometry, IdealGeometryRecord > geometry_beginRun_token_
std::string nameDetector_
constexpr std::array< uint8_t, layerIndexSize > layer
MonitorElement * MeanHitOccupancy_Plus_
int layer() const
get the layer #
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
T const * product() const
std::map< int, int > OccupancyMap_minus
int layer() const
get the layer #
MonitorElement * MeanHitOccupancy_Minus_
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())
int layer() const
get the layer #
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_