66 std::map<unsigned int, HGCHitTuple>&);
70 std::vector<const HGCalDDDConstants*>
hgcCons_;
80 const std::vector<edm::ESGetToken<HGCalDDDConstants, IdealGeometryRecord>>
tok_ddd_;
81 const std::vector<edm::ESGetToken<HGCalGeometry, IdealGeometryRecord>>
tok_geom_;
110 return esConsumes<HGCalDDDConstants, IdealGeometryRecord, edm::Transition::BeginRun>(
114 return esConsumes<HGCalGeometry, IdealGeometryRecord, edm::Transition::BeginRun>(
edm::ESInputTag{
"",
name});
117 edm::LogInfo(
"HGCalValid") <<
"Exclude the following " << ietaExcludeBH_.size() <<
" ieta values from BH plots";
118 for (
unsigned int k = 0;
k < ietaExcludeBH_.size(); ++
k)
119 edm::LogInfo(
"HGCalValid") <<
" [" <<
k <<
"] " << ietaExcludeBH_[
k];
125 std::vector<std::string>
source = {
"HGCalEESensitive",
"HGCalHESiliconSensitive",
"HGCalHEScintillatorSensitive"};
126 desc.add<std::vector<std::string>>(
"geometrySource",
source);
133 std::vector<int>
dummy;
134 desc.add<std::vector<int>>(
"ietaExcludeBH",
dummy);
135 descriptions.
add(
"hgcalHitValidation",
desc);
142 heedzVsZ = iB.
book2D(
"heedzVsZ",
"", 720, -360, 360, 100, -0.1, 0.1);
143 heedyVsY = iB.
book2D(
"heedyVsY",
"", 400, -200, 200, 100, -0.02, 0.02);
144 heedxVsX = iB.
book2D(
"heedxVsX",
"", 400, -200, 200, 100, -0.02, 0.02);
149 hefdzVsZ = iB.
book2D(
"hefdzVsZ",
"", 820, -410, 410, 100, -0.1, 0.1);
150 hefdyVsY = iB.
book2D(
"hefdyVsY",
"", 400, -200, 200, 100, -0.02, 0.02);
151 hefdxVsX = iB.
book2D(
"hefdxVsX",
"", 400, -200, 200, 100, -0.02, 0.02);
156 hebdzVsZ = iB.
book2D(
"hebdzVsZ",
"", 1080, -540, 540, 100, -1.0, 1.0);
195 std::map<unsigned int, HGCHitTuple> eeHitRefs, fhHitRefs, bhHitRefs;
203 for (std::map<unsigned int, HGCHitTuple>::iterator itr = eeHitRefs.begin(); itr != eeHitRefs.end(); ++itr) {
206 << std::get<0>(itr->second) <<
"; Position (" << std::get<1>(itr->second).x() <<
", " 207 << std::get<1>(itr->second).
y() <<
", " << std::get<1>(itr->second).
z() <<
")";
219 for (std::map<unsigned int, HGCHitTuple>::iterator itr = fhHitRefs.begin(); itr != fhHitRefs.end(); ++itr) {
222 << std::get<0>(itr->second) <<
"; Position (" << std::get<1>(itr->second).x() <<
", " 223 << std::get<1>(itr->second).
y() <<
", " << std::get<1>(itr->second).
z() <<
")";
235 for (std::map<unsigned int, HGCHitTuple>::iterator itr = bhHitRefs.begin(); itr != bhHitRefs.end(); ++itr) {
238 << std::get<0>(itr->second) <<
"; Position (" << std::get<1>(itr->second).x() <<
", " 239 << std::get<1>(itr->second).
y() <<
", " << std::get<1>(itr->second).
z() <<
")";
253 std::map<unsigned int, HGCHitTuple>::const_iterator itr = eeHitRefs.find(
it->id().rawId());
254 if (itr != eeHitRefs.end()) {
259 heedxVsX->
Fill(std::get<1>(itr->second).x(), (xyz.
x() - std::get<1>(itr->second).
x()));
260 heedyVsY->
Fill(std::get<1>(itr->second).y(), (xyz.
y() - std::get<1>(itr->second).
y()));
261 heedzVsZ->
Fill(std::get<1>(itr->second).z(), (xyz.
z() - std::get<1>(itr->second).
z()));
265 << std::get<0>(itr->second) <<
", " << std::get<1>(itr->second) <<
") Rec (" 266 <<
energy <<
", " << xyz.
x() <<
", " << xyz.
y() <<
", " << xyz.
z() <<
")";
281 std::map<unsigned int, HGCHitTuple>::const_iterator itr = fhHitRefs.find(
it->id().rawId());
282 if (itr != fhHitRefs.end()) {
288 hefdxVsX->
Fill(std::get<1>(itr->second).x(), (xyz.
x() - std::get<1>(itr->second).
x()));
289 hefdyVsY->
Fill(std::get<1>(itr->second).y(), (xyz.
y() - std::get<1>(itr->second).
y()));
290 hefdzVsZ->
Fill(std::get<1>(itr->second).z(), (xyz.
z() - std::get<1>(itr->second).
z()));
294 << std::get<0>(itr->second) <<
", " << std::get<1>(itr->second) <<
") Rec (" 295 <<
energy <<
"," << xyz.
x() <<
", " << xyz.
y() <<
", " << xyz.
z() <<
")";
310 std::map<unsigned int, HGCHitTuple>::const_iterator itr = bhHitRefs.find(
it->id().rawId());
312 if (itr != bhHitRefs.end()) {
314 float ang3s = std::get<1>(itr->second).
phi().value();
320 hebdzVsZ->
Fill(std::get<1>(itr->second).z(), (xyz.
z() - std::get<1>(itr->second).
z()));
325 << std::get<0>(itr->second) <<
", " << std::get<1>(itr->second) <<
") Rec (" 326 <<
energy <<
", " << xyz.
x() <<
", " << xyz.
y() <<
", " << xyz.
z() <<
")\n";
338 std::map<unsigned int, HGCHitTuple>& hitRefs) {
345 if (hitRefs.count(
id.rawId()) != 0)
346 energySum += std::get<0>(hitRefs[
id.rawId()]);
347 hitRefs[
id.rawId()] = std::make_tuple(
energySum,
p);
Log< level::Info, true > LogVerbatim
const edm::EDGetTokenT< HGChefRecHitCollection > fhRecHitToken_
MonitorElement * hebRecVsSimX
MonitorElement * hefRecVsSimY
MonitorElement * hefRecVsSimX
virtual void setCurrentFolder(std::string const &fullpath)
void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
MonitorElement * hebRecVsSimY
Geom::Phi< T > phi() const
const std::vector< edm::ESGetToken< HGCalDDDConstants, IdealGeometryRecord > > tok_ddd_
T const * product() const
MonitorElement * hefEnSimRec
MonitorElement * heedzVsZ
~HGCalHitValidation() override=default
auto vector_transform(std::vector< InputType > const &input, Function predicate) -> std::vector< typename std::remove_cv< typename std::remove_reference< decltype(predicate(input.front()))>::type >::type >
MonitorElement * heeRecVsSimX
std::vector< const HGCalDDDConstants * > hgcCons_
MonitorElement * heeRecVsSimZ
MonitorElement * heeRecVsSimY
const edm::EDGetTokenT< std::vector< PCaloHit > > eeSimHitToken_
MonitorElement * heeEnRec
const std::vector< int > ietaExcludeBH_
std::tuple< float, GlobalPoint > HGCHitTuple
std::vector< const HGCalGeometry * > hgcGeometry_
MonitorElement * hebEnRec
T const * product() const
MonitorElement * hebEnSim
MonitorElement * hefdyVsY
MonitorElement * heeEnSimRec
MonitorElement * hefEnSim
MonitorElement * hebRecVsSimZ
MonitorElement * hefEnRec
MonitorElement * heedxVsX
#define DEFINE_FWK_MODULE(type)
void analyze(const edm::Event &, const edm::EventSetup &) override
MonitorElement * heeEnSim
ESHandle< T > getHandle(const ESGetToken< T, R > &iToken) const
MonitorElement * hebdPhiVsPhi
const edm::EDGetTokenT< HGChebRecHitCollection > bhRecHitToken_
const std::vector< edm::ESGetToken< HGCalGeometry, IdealGeometryRecord > > tok_geom_
MonitorElement * hebEnSimRec
Log< level::Info, false > LogInfo
HGCalHitValidation(const edm::ParameterSet &)
MonitorElement * hefdxVsX
void dqmBeginRun(edm::Run const &, edm::EventSetup const &) 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)
const edm::EDGetTokenT< std::vector< PCaloHit > > bhSimHitToken_
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
const edm::EDGetTokenT< std::vector< PCaloHit > > fhSimHitToken_
void analyzeHGCalSimHit(edm::Handle< std::vector< PCaloHit >> const &simHits, int idet, MonitorElement *hist, std::map< unsigned int, HGCHitTuple > &)
MonitorElement * hefRecVsSimZ
const edm::EDGetTokenT< HGCeeRecHitCollection > eeRecHitToken_
MonitorElement * hefdzVsZ
double energySum(const DataFrame &df, int fs, int ls)
Log< level::Warning, false > LogWarning
T1 value() const
Explicit access to value in case implicit conversion not OK.
MonitorElement * book1D(TString const &name, TString const &title, int const nchX, double const lowX, double const highX, FUNC onbooking=NOOP())
const std::vector< std::string > geometrySource_
MonitorElement * hebdzVsZ
static std::string const source
MonitorElement * heedyVsY
MonitorElement * hebdEtaVsEta