30 #include "CLHEP/Units/GlobalSystemOfUnits.h"
58 template <
class T1,
class T2>
85 : nameDetector_(iConfig.getParameter<std::
string>(
"DetectorName")),
89 verbosity_(iConfig.getUntrackedParameter<int>(
"Verbosity", 0)),
97 <<
"\"HGCalHESiliconSensitive\", \"HGCalHESiliconSensitive\", or "
98 <<
"\"HGCalHEScintillatorSensitive\"!";
107 descriptions.
add(
"hgcalRecHitValidationEE", desc);
115 unsigned int ntot(0), nused(0);
126 if (theRecHitContainers.
isValid()) {
129 <<
nameDetector_ <<
" with " << theRecHitContainers->size() <<
" element(s)";
130 for (
const auto& it : *(theRecHitContainers.
product())) {
133 DetId detId = it.id();
134 int layer = ((geomType == 0)
142 <<
"does not exist !!!";
152 template <
class T1,
class T2>
154 const GlobalPoint& global = geom->getPosition(detId);
155 double energy = it->energy();
157 float globalx = global.
x();
158 float globaly = global.
y();
159 float globalz = global.
z();
171 edm::LogVerbatim(
"HGCalValidation") <<
"-------------------------- gx = " << globalx <<
" gy = " << globaly
172 <<
" gz = " << globalz <<
" phi = " << hinfo.
phi <<
" eta = " << hinfo.
eta
173 <<
" lay = " << hinfo.
layer;
184 if (OccupancyMap.find(layer) != OccupancyMap.end())
185 OccupancyMap[layer]++;
187 OccupancyMap[
layer] = 1;
192 int layer = itr.first;
193 int occupancy = itr.second;
198 int layer = itr.first;
199 int occupancy = itr.second;
205 unsigned int ilayer = hits.
layer;
227 std::ostringstream histoname;
228 for (
unsigned int il = 0; il <
layers_; ++il) {
230 auto istr1 = std::to_string(ilayer);
231 while (istr1.size() < 2) {
232 istr1.insert(0,
"0");
235 histoname <<
"HitOccupancy_Plus_layer_" << istr1;
238 histoname <<
"HitOccupancy_Minus_layer_" << istr1;
242 histoname <<
"EtaPhi_Plus_"
243 <<
"layer_" << istr1;
246 histoname <<
"EtaPhi_Minus_"
247 <<
"layer_" << istr1;
252 histoname <<
"energy_layer_" << istr1;
253 energy_.push_back(iB.
book1D(histoname.str().c_str(),
"energy_", 500, 0, 1));
257 histoname <<
"SUMOfRecHitOccupancy_Plus";
259 iB.
book1D(histoname.str().c_str(),
"SUMOfRecHitOccupancy_Plus",
layers_, -0.5, layers_ - 0.5);
261 histoname <<
"SUMOfRecHitOccupancy_Minus";
263 iB.
book1D(histoname.str().c_str(),
"SUMOfRecHitOccupancy_Minus",
layers_, -0.5, layers_ - 0.5);
Log< level::Info, true > LogVerbatim
EventNumber_t event() const
HGCalRecHitValidation(const edm::ParameterSet &)
std::vector< MonitorElement * > EtaPhi_Minus_
edm::EDGetToken recHitSource_
edm::ESGetToken< HGCalGeometry, IdealGeometryRecord > geometry_token_
~HGCalRecHitValidation() override
ParameterDescriptionBase * addUntracked(U const &iLabel, T const &value)
virtual void setCurrentFolder(std::string const &fullpath)
bool getByToken(EDGetToken token, Handle< PROD > &result) const
bool tileTrapezoid() const
#define DEFINE_FWK_MODULE(type)
Geom::Phi< T > phi() const
std::vector< MonitorElement * > EtaPhi_Plus_
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_
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
std::map< int, int > OccupancyMap_minus
unsigned int layers(bool reco) const
int layer() const
get the layer #
const HGCalTopology & topology() const
MonitorElement * MeanHitOccupancy_Minus_
ParameterDescriptionBase * add(U const &iLabel, T const &value)
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
T const * product() const
const HGCalDDDConstants & dddConstants() const
MonitorElement * book2D(TString const &name, TString const &title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, FUNC onbooking=NOOP())
T const * product() const
T getParameter(std::string const &) const
void add(std::string const &label, ParameterSetDescription const &psetDescription)
int layer() const
get the layer #
std::map< int, int > OccupancyMap_plus
std::vector< MonitorElement * > HitOccupancy_Plus_
bool waferHexagon8() const
ESHandle< T > getHandle(const ESGetToken< T, R > &iToken) const
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_
int layer() const
get the layer #