CMS 3D CMS Logo

List of all members | Public Member Functions | Static Public Member Functions | Protected Types | Protected Member Functions | Private Attributes
HGCalHitValidation Class Reference

#include <Validation/HGCalValidation/plugins/HGCalHitValidation.cc>

Inheritance diagram for HGCalHitValidation:
DQMEDAnalyzer edm::stream::EDProducer< edm::GlobalCache< DQMEDAnalyzerGlobalCache >, edm::EndRunProducer, edm::EndLuminosityBlockProducer, edm::Accumulator >

Public Member Functions

 HGCalHitValidation (const edm::ParameterSet &)
 
 ~HGCalHitValidation () override=default
 
- Public Member Functions inherited from DQMEDAnalyzer
void accumulate (edm::Event const &event, edm::EventSetup const &setup) final
 
void beginLuminosityBlock (edm::LuminosityBlock const &lumi, edm::EventSetup const &setup) final
 
void beginRun (edm::Run const &run, edm::EventSetup const &setup) final
 
void beginStream (edm::StreamID id) final
 
 DQMEDAnalyzer ()
 
void endLuminosityBlock (edm::LuminosityBlock const &lumi, edm::EventSetup const &setup) final
 
void endRun (edm::Run const &run, edm::EventSetup const &setup) final
 
virtual bool getCanSaveByLumi ()
 
- Public Member Functions inherited from edm::stream::EDProducer< edm::GlobalCache< DQMEDAnalyzerGlobalCache >, edm::EndRunProducer, edm::EndLuminosityBlockProducer, edm::Accumulator >
 EDProducer ()=default
 
 EDProducer (const EDProducer &)=delete
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginProcessBlocks () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndProcessBlocks () const final
 
bool hasAbilityToProduceInEndRuns () const final
 
const EDProduceroperator= (const EDProducer &)=delete
 

Static Public Member Functions

static void fillDescriptions (edm::ConfigurationDescriptions &descriptions)
 
- Static Public Member Functions inherited from DQMEDAnalyzer
static void globalEndJob (DQMEDAnalyzerGlobalCache const *)
 
static void globalEndLuminosityBlockProduce (edm::LuminosityBlock &lumi, edm::EventSetup const &setup, LuminosityBlockContext const *context)
 
static void globalEndRunProduce (edm::Run &run, edm::EventSetup const &setup, RunContext const *context)
 
static std::unique_ptr< DQMEDAnalyzerGlobalCacheinitializeGlobalCache (edm::ParameterSet const &)
 

Protected Types

typedef std::tuple< float, GlobalPointHGCHitTuple
 

Protected Member Functions

void analyze (const edm::Event &, const edm::EventSetup &) override
 
void analyzeHGCalSimHit (edm::Handle< std::vector< PCaloHit >> const &simHits, int idet, MonitorElement *hist, std::map< unsigned int, HGCHitTuple > &)
 
void bookHistograms (DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
 
void dqmBeginRun (edm::Run const &, edm::EventSetup const &) override
 
- Protected Member Functions inherited from DQMEDAnalyzer
uint64_t meId () const
 

Private Attributes

const edm::EDGetTokenT< HGChebRecHitCollectionbhRecHitToken_
 
const edm::EDGetTokenT< std::vector< PCaloHit > > bhSimHitToken_
 
const edm::EDGetTokenT< HGCeeRecHitCollectioneeRecHitToken_
 
const edm::EDGetTokenT< std::vector< PCaloHit > > eeSimHitToken_
 
const edm::EDGetTokenT< HGChefRecHitCollectionfhRecHitToken_
 
const edm::EDGetTokenT< std::vector< PCaloHit > > fhSimHitToken_
 
const std::vector< std::string > geometrySource_
 
MonitorElementhebdEtaVsEta
 
MonitorElementhebdPhiVsPhi
 
MonitorElementhebdzVsZ
 
MonitorElementhebEnRec
 
MonitorElementhebEnSim
 
MonitorElementhebEnSimRec
 
MonitorElementhebRecVsSimX
 
MonitorElementhebRecVsSimY
 
MonitorElementhebRecVsSimZ
 
MonitorElementheedxVsX
 
MonitorElementheedyVsY
 
MonitorElementheedzVsZ
 
MonitorElementheeEnRec
 
MonitorElementheeEnSim
 
MonitorElementheeEnSimRec
 
MonitorElementheeRecVsSimX
 
MonitorElementheeRecVsSimY
 
MonitorElementheeRecVsSimZ
 
MonitorElementhefdxVsX
 
MonitorElementhefdyVsY
 
MonitorElementhefdzVsZ
 
MonitorElementhefEnRec
 
MonitorElementhefEnSim
 
MonitorElementhefEnSimRec
 
MonitorElementhefRecVsSimX
 
MonitorElementhefRecVsSimY
 
MonitorElementhefRecVsSimZ
 
std::vector< const HGCalDDDConstants * > hgcCons_
 
std::vector< const HGCalGeometry * > hgcGeometry_
 
const std::vector< int > ietaExcludeBH_
 
const std::vector< edm::ESGetToken< HGCalDDDConstants, IdealGeometryRecord > > tok_ddd_
 
const std::vector< edm::ESGetToken< HGCalGeometry, IdealGeometryRecord > > tok_geom_
 

Additional Inherited Members

- Public Types inherited from DQMEDAnalyzer
typedef dqm::reco::DQMStore DQMStore
 
typedef dqm::reco::MonitorElement MonitorElement
 
- Public Types inherited from edm::stream::EDProducer< edm::GlobalCache< DQMEDAnalyzerGlobalCache >, edm::EndRunProducer, edm::EndLuminosityBlockProducer, edm::Accumulator >
using CacheTypes = CacheContexts< T... >
 
using GlobalCache = typename CacheTypes::GlobalCache
 
using HasAbility = AbilityChecker< T... >
 
using InputProcessBlockCache = typename CacheTypes::InputProcessBlockCache
 
using LuminosityBlockCache = typename CacheTypes::LuminosityBlockCache
 
using LuminosityBlockContext = LuminosityBlockContextT< LuminosityBlockCache, RunCache, GlobalCache >
 
using LuminosityBlockSummaryCache = typename CacheTypes::LuminosityBlockSummaryCache
 
using RunCache = typename CacheTypes::RunCache
 
using RunContext = RunContextT< RunCache, GlobalCache >
 
using RunSummaryCache = typename CacheTypes::RunSummaryCache
 
- Protected Attributes inherited from DQMEDAnalyzer
edm::EDPutTokenT< DQMTokenlumiToken_
 
edm::EDPutTokenT< DQMTokenrunToken_
 
unsigned int streamId_
 

Detailed Description

Description: [one line class summary]

Implementation: [Notes on implementation]

Definition at line 51 of file HGCalHitValidation.cc.

Member Typedef Documentation

◆ HGCHitTuple

typedef std::tuple<float, GlobalPoint> HGCalHitValidation::HGCHitTuple
protected

Definition at line 58 of file HGCalHitValidation.cc.

Constructor & Destructor Documentation

◆ HGCalHitValidation()

HGCalHitValidation::HGCalHitValidation ( const edm::ParameterSet cfg)
explicit

Definition at line 98 of file HGCalHitValidation.cc.

References geometrySource_, Skims_PA_cff::name, AlCaHLTBitMon_QueryRunRegistry::string, and edm::vector_transform().

99  : geometrySource_(cfg.getParameter<std::vector<std::string>>("geometrySource")),
100  ietaExcludeBH_(cfg.getParameter<std::vector<int>>("ietaExcludeBH")),
101  eeSimHitToken_(consumes<std::vector<PCaloHit>>(cfg.getParameter<edm::InputTag>("eeSimHitSource"))),
102  fhSimHitToken_(consumes<std::vector<PCaloHit>>(cfg.getParameter<edm::InputTag>("fhSimHitSource"))),
103  bhSimHitToken_(consumes<std::vector<PCaloHit>>(cfg.getParameter<edm::InputTag>("bhSimHitSource"))),
104  eeRecHitToken_(consumes<HGCeeRecHitCollection>(cfg.getParameter<edm::InputTag>("eeRecHitSource"))),
105  fhRecHitToken_(consumes<HGChefRecHitCollection>(cfg.getParameter<edm::InputTag>("fhRecHitSource"))),
106  bhRecHitToken_(consumes<HGChebRecHitCollection>(cfg.getParameter<edm::InputTag>("bhRecHitSource"))),
107  tok_ddd_{
109  [this](const std::string& name) {
110  return esConsumes<HGCalDDDConstants, IdealGeometryRecord, edm::Transition::BeginRun>(
111  edm::ESInputTag{"", name});
112  })},
114  return esConsumes<HGCalGeometry, IdealGeometryRecord, edm::Transition::BeginRun>(edm::ESInputTag{"", name});
115  })} {
116 #ifdef EDM_ML_DEBUG
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];
120 #endif
121 }
const edm::EDGetTokenT< HGChefRecHitCollection > fhRecHitToken_
const std::vector< edm::ESGetToken< HGCalDDDConstants, IdealGeometryRecord > > tok_ddd_
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 >
Definition: transform.h:11
const edm::EDGetTokenT< std::vector< PCaloHit > > eeSimHitToken_
const std::vector< int > ietaExcludeBH_
const edm::EDGetTokenT< HGChebRecHitCollection > bhRecHitToken_
const std::vector< edm::ESGetToken< HGCalGeometry, IdealGeometryRecord > > tok_geom_
Log< level::Info, false > LogInfo
const edm::EDGetTokenT< std::vector< PCaloHit > > bhSimHitToken_
const edm::EDGetTokenT< std::vector< PCaloHit > > fhSimHitToken_
const edm::EDGetTokenT< HGCeeRecHitCollection > eeRecHitToken_
const std::vector< std::string > geometrySource_

◆ ~HGCalHitValidation()

HGCalHitValidation::~HGCalHitValidation ( )
overridedefault

Member Function Documentation

◆ analyze()

void HGCalHitValidation::analyze ( const edm::Event iEvent,
const edm::EventSetup iSetup 
)
overrideprotectedvirtual

Reimplemented from DQMEDAnalyzer.

Definition at line 194 of file HGCalHitValidation.cc.

References analyzeHGCalSimHit(), bhRecHitToken_, hgcalTriggerNtuples_cfi::bhSimHits, bhSimHitToken_, TauDecayModes::dec, HLT_2024v12_cff::distance, eeRecHitToken_, hgcalTriggerNtuples_cfi::eeSimHits, eeSimHitToken_, hcalRecHitTable_cff::energy, PVValHelper::eta, PV3DBase< T, PVType, FrameType >::eta(), fhRecHitToken_, hgcalTriggerNtuples_cfi::fhSimHits, fhSimHitToken_, dqm::impl::MonitorElement::Fill(), hebdEtaVsEta, hebdPhiVsPhi, hebdzVsZ, hebEnRec, hebEnSim, hebEnSimRec, hebRecVsSimX, hebRecVsSimY, hebRecVsSimZ, heedxVsX, heedyVsY, heedzVsZ, heeEnRec, heeEnSim, heeEnSimRec, heeRecVsSimX, heeRecVsSimY, heeRecVsSimZ, hefdxVsX, hefdyVsY, hefdzVsZ, hefEnRec, hefEnSim, hefEnSimRec, hefRecVsSimX, hefRecVsSimY, hefRecVsSimZ, hgcGeometry_, heavyIonCSV_trainingSettings::idx, iEvent, edm::HandleBase::isValid(), ALPAKA_ACCELERATOR_NAMESPACE::vertexFinder::it, phi, PV3DBase< T, PVType, FrameType >::phi(), edm::Handle< T >::product(), bscTrigger_cfi::theHits, Geom::Phi< T1, Range >::value(), x, PV3DBase< T, PVType, FrameType >::x(), y, PV3DBase< T, PVType, FrameType >::y(), z, and PV3DBase< T, PVType, FrameType >::z().

194  {
195  std::map<unsigned int, HGCHitTuple> eeHitRefs, fhHitRefs, bhHitRefs;
196 
197  //Accesing ee simhits
199 
200  if (eeSimHits.isValid()) {
201  analyzeHGCalSimHit(eeSimHits, 0, heeEnSim, eeHitRefs);
202 #ifdef EDM_ML_DEBUG
203  for (std::map<unsigned int, HGCHitTuple>::iterator itr = eeHitRefs.begin(); itr != eeHitRefs.end(); ++itr) {
204  int idx = std::distance(eeHitRefs.begin(), itr);
205  edm::LogInfo("HGCalValid") << "EEHit[" << idx << "] " << std::hex << itr->first << std::dec << "; Energy "
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() << ")";
208  }
209 #endif
210  } else {
211  edm::LogVerbatim("HGCalValid") << "No EE SimHit Found ";
212  }
213 
214  //Accesing fh simhits
216  if (fhSimHits.isValid()) {
217  analyzeHGCalSimHit(fhSimHits, 1, hefEnSim, fhHitRefs);
218 #ifdef EDM_ML_DEBUG
219  for (std::map<unsigned int, HGCHitTuple>::iterator itr = fhHitRefs.begin(); itr != fhHitRefs.end(); ++itr) {
220  int idx = std::distance(fhHitRefs.begin(), itr);
221  edm::LogInfo("HGCalValid") << "FHHit[" << idx << "] " << std::hex << itr->first << std::dec << "; Energy "
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() << ")";
224  }
225 #endif
226  } else {
227  edm::LogVerbatim("HGCalValid") << "No FH SimHit Found ";
228  }
229 
230  //Accessing bh simhits
232  if (bhSimHits.isValid()) {
233  analyzeHGCalSimHit(bhSimHits, 2, hebEnSim, bhHitRefs);
234 #ifdef EDM_ML_DEBUG
235  for (std::map<unsigned int, HGCHitTuple>::iterator itr = bhHitRefs.begin(); itr != bhHitRefs.end(); ++itr) {
236  int idx = std::distance(bhHitRefs.begin(), itr);
237  edm::LogInfo("HGCalValid") << "BHHit[" << idx << "] " << std::hex << itr->first << std::dec << "; Energy "
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() << ")";
240  }
241 #endif
242  } else {
243  edm::LogVerbatim("HGCalValid") << "No BH SimHit Found ";
244  }
245 
246  //accessing EE Rechit information
247  const edm::Handle<HGCeeRecHitCollection>& eeRecHit = iEvent.getHandle(eeRecHitToken_);
248  if (eeRecHit.isValid()) {
249  const HGCeeRecHitCollection* theHits = (eeRecHit.product());
250  for (auto it = theHits->begin(); it != theHits->end(); ++it) {
251  double energy = it->energy();
252  heeEnRec->Fill(energy);
253  std::map<unsigned int, HGCHitTuple>::const_iterator itr = eeHitRefs.find(it->id().rawId());
254  if (itr != eeHitRefs.end()) {
255  GlobalPoint xyz = hgcGeometry_[0]->getPosition(it->id());
256  heeRecVsSimX->Fill(std::get<1>(itr->second).x(), xyz.x());
257  heeRecVsSimY->Fill(std::get<1>(itr->second).y(), xyz.y());
258  heeRecVsSimZ->Fill(std::get<1>(itr->second).z(), xyz.z());
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()));
262  heeEnSimRec->Fill(std::get<0>(itr->second), energy);
263 #ifdef EDM_ML_DEBUG
264  edm::LogInfo("HGCalValid") << "EEHit: " << std::hex << it->id().rawId() << std::dec << " Sim ("
265  << std::get<0>(itr->second) << ", " << std::get<1>(itr->second) << ") Rec ("
266  << energy << ", " << xyz.x() << ", " << xyz.y() << ", " << xyz.z() << ")";
267 #endif
268  }
269  }
270  } else {
271  edm::LogVerbatim("HGCalValid") << "No EE RecHit Found ";
272  }
273 
274  //accessing FH Rechit information
275  const edm::Handle<HGChefRecHitCollection>& fhRecHit = iEvent.getHandle(fhRecHitToken_);
276  if (fhRecHit.isValid()) {
277  const HGChefRecHitCollection* theHits = (fhRecHit.product());
278  for (auto it = theHits->begin(); it != theHits->end(); ++it) {
279  double energy = it->energy();
280  hefEnRec->Fill(energy);
281  std::map<unsigned int, HGCHitTuple>::const_iterator itr = fhHitRefs.find(it->id().rawId());
282  if (itr != fhHitRefs.end()) {
283  GlobalPoint xyz = hgcGeometry_[1]->getPosition(it->id());
284 
285  hefRecVsSimX->Fill(std::get<1>(itr->second).x(), xyz.x());
286  hefRecVsSimY->Fill(std::get<1>(itr->second).y(), xyz.y());
287  hefRecVsSimZ->Fill(std::get<1>(itr->second).z(), xyz.z());
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()));
291  hefEnSimRec->Fill(std::get<0>(itr->second), energy);
292 #ifdef EDM_ML_DEBUG
293  edm::LogInfo("HGCalValid") << "FHHit: " << std::hex << it->id().rawId() << std::dec << " Sim ("
294  << std::get<0>(itr->second) << ", " << std::get<1>(itr->second) << ") Rec ("
295  << energy << "," << xyz.x() << ", " << xyz.y() << ", " << xyz.z() << ")";
296 #endif
297  }
298  }
299  } else {
300  edm::LogVerbatim("HGCalValid") << "No FH RecHit Found ";
301  }
302 
303  //accessing BH Rechit information
304  const edm::Handle<HGChebRecHitCollection>& bhRecHit = iEvent.getHandle(bhRecHitToken_);
305  if (bhRecHit.isValid()) {
306  const HGChebRecHitCollection* theHits = (bhRecHit.product());
307  for (auto it = theHits->begin(); it != theHits->end(); ++it) {
308  double energy = it->energy();
309  hebEnRec->Fill(energy);
310  std::map<unsigned int, HGCHitTuple>::const_iterator itr = bhHitRefs.find(it->id().rawId());
311  GlobalPoint xyz = hgcGeometry_[2]->getPosition(it->id());
312  if (itr != bhHitRefs.end()) {
313  float ang3 = xyz.phi().value(); // returns the phi in radians
314  float ang3s = std::get<1>(itr->second).phi().value();
315  hebRecVsSimX->Fill(std::get<1>(itr->second).x(), xyz.x());
316  hebRecVsSimY->Fill(std::get<1>(itr->second).y(), xyz.y());
317  hebRecVsSimZ->Fill(std::get<1>(itr->second).z(), xyz.z());
318  hebdEtaVsEta->Fill(std::get<1>(itr->second).eta(), (xyz.eta() - std::get<1>(itr->second).eta()));
319  hebdPhiVsPhi->Fill(std::get<1>(itr->second).phi(), (ang3 - ang3s));
320  hebdzVsZ->Fill(std::get<1>(itr->second).z(), (xyz.z() - std::get<1>(itr->second).z()));
321  hebEnSimRec->Fill(std::get<0>(itr->second), energy);
322 
323 #ifdef EDM_ML_DEBUG
324  edm::LogInfo("HGCalValid") << "BHHit: " << std::hex << it->id().rawId() << std::dec << " Sim ("
325  << std::get<0>(itr->second) << ", " << std::get<1>(itr->second) << ") Rec ("
326  << energy << ", " << xyz.x() << ", " << xyz.y() << ", " << xyz.z() << ")\n";
327 #endif
328  }
329  }
330  } else {
331  edm::LogVerbatim("HGCalValid") << "No BH RecHit Found ";
332  }
333 }
Log< level::Info, true > LogVerbatim
const edm::EDGetTokenT< HGChefRecHitCollection > fhRecHitToken_
MonitorElement * hebRecVsSimX
MonitorElement * hefRecVsSimY
MonitorElement * hefRecVsSimX
T z() const
Definition: PV3DBase.h:61
MonitorElement * hebRecVsSimY
Geom::Phi< T > phi() const
Definition: PV3DBase.h:66
T eta() const
Definition: PV3DBase.h:73
T const * product() const
Definition: Handle.h:70
MonitorElement * hefEnSimRec
MonitorElement * heedzVsZ
MonitorElement * heeRecVsSimX
MonitorElement * heeRecVsSimZ
MonitorElement * heeRecVsSimY
const edm::EDGetTokenT< std::vector< PCaloHit > > eeSimHitToken_
MonitorElement * heeEnRec
std::vector< const HGCalGeometry * > hgcGeometry_
MonitorElement * hebEnRec
void Fill(long long x)
T x() const
Definition: PV3DBase.h:59
T y() const
Definition: PV3DBase.h:60
int iEvent
Definition: GenABIO.cc:224
MonitorElement * hebEnSim
MonitorElement * hefdyVsY
MonitorElement * heeEnSimRec
MonitorElement * hefEnSim
MonitorElement * hebRecVsSimZ
MonitorElement * hefEnRec
MonitorElement * heedxVsX
MonitorElement * heeEnSim
MonitorElement * hebdPhiVsPhi
const edm::EDGetTokenT< HGChebRecHitCollection > bhRecHitToken_
MonitorElement * hebEnSimRec
Log< level::Info, false > LogInfo
MonitorElement * hefdxVsX
const edm::EDGetTokenT< std::vector< PCaloHit > > bhSimHitToken_
bool isValid() const
Definition: HandleBase.h:70
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
T1 value() const
Explicit access to value in case implicit conversion not OK.
Definition: Phi.h:75
MonitorElement * hebdzVsZ
MonitorElement * heedyVsY
MonitorElement * hebdEtaVsEta

◆ analyzeHGCalSimHit()

void HGCalHitValidation::analyzeHGCalSimHit ( edm::Handle< std::vector< PCaloHit >> const &  simHits,
int  idet,
MonitorElement hist,
std::map< unsigned int, HGCHitTuple > &  hitRefs 
)
protected

Definition at line 335 of file HGCalHitValidation.cc.

References hcalRecHitTable_cff::energy, CastorDataFrameFilter_impl::energySum(), hgcGeometry_, compareTotals::hist, l1ctLayer2EG_cff::id, AlCaHLTBitMon_ParallelJobs::p, rpcPointValidation_cfi::simHit, and FastTrackerRecHitCombiner_cfi::simHits.

Referenced by analyze().

338  {
339  for (std::vector<PCaloHit>::const_iterator simHit = simHits->begin(); simHit != simHits->end(); ++simHit) {
340  DetId id(simHit->id());
341  GlobalPoint p = hgcGeometry_[idet]->getPosition(id);
342  float energy = simHit->energy();
343 
344  float energySum(energy);
345  if (hitRefs.count(id.rawId()) != 0)
346  energySum += std::get<0>(hitRefs[id.rawId()]);
347  hitRefs[id.rawId()] = std::make_tuple(energySum, p);
348  hist->Fill(energy);
349  }
350 }
std::vector< const HGCalGeometry * > hgcGeometry_
Definition: DetId.h:17
double energySum(const DataFrame &df, int fs, int ls)

◆ bookHistograms()

void HGCalHitValidation::bookHistograms ( DQMStore::IBooker iB,
edm::Run const &  ,
edm::EventSetup const &   
)
overrideprotectedvirtual

Implements DQMEDAnalyzer.

Definition at line 138 of file HGCalHitValidation.cc.

References dqm::implementation::IBooker::book1D(), dqm::implementation::IBooker::book2D(), hebdEtaVsEta, hebdPhiVsPhi, hebdzVsZ, hebEnRec, hebEnSim, hebEnSimRec, hebRecVsSimX, hebRecVsSimY, hebRecVsSimZ, heedxVsX, heedyVsY, heedzVsZ, heeEnRec, heeEnSim, heeEnSimRec, heeRecVsSimX, heeRecVsSimY, heeRecVsSimZ, hefdxVsX, hefdyVsY, hefdzVsZ, hefEnRec, hefEnSim, hefEnSimRec, hefRecVsSimX, hefRecVsSimY, hefRecVsSimZ, M_PI, and dqm::implementation::NavigatorBase::setCurrentFolder().

138  {
139  iB.setCurrentFolder("HGCAL/HGCalSimHitsV/HitValidation");
140 
141  //initiating histograms
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);
145  heeRecVsSimZ = iB.book2D("heeRecVsSimZ", "", 720, -360, 360, 720, -360, 360);
146  heeRecVsSimY = iB.book2D("heeRecVsSimY", "", 400, -200, 200, 400, -200, 200);
147  heeRecVsSimX = iB.book2D("heeRecVsSimX", "", 400, -200, 200, 400, -200, 200);
148 
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);
152  hefRecVsSimZ = iB.book2D("hefRecVsSimZ", "", 820, -410, 410, 820, -410, 410);
153  hefRecVsSimY = iB.book2D("hefRecVsSimY", "", 400, -200, 200, 400, -200, 200);
154  hefRecVsSimX = iB.book2D("hefRecVsSimX", "", 400, -200, 200, 400, -200, 200);
155 
156  hebdzVsZ = iB.book2D("hebdzVsZ", "", 1080, -540, 540, 100, -1.0, 1.0);
157  hebdPhiVsPhi = iB.book2D("hebdPhiVsPhi", "", M_PI * 100, -0.5, M_PI + 0.5, 200, -0.2, 0.2);
158  hebdEtaVsEta = iB.book2D("hebdEtaVsEta", "", 1000, -5, 5, 200, -0.1, 0.1);
159  hebRecVsSimZ = iB.book2D("hebRecVsSimZ", "", 1080, -540, 540, 1080, -540, 540);
160  hebRecVsSimY = iB.book2D("hebRecVsSimY", "", 400, -200, 200, 400, -200, 200);
161  hebRecVsSimX = iB.book2D("hebRecVsSimX", "", 400, -200, 200, 400, -200, 200);
162 
163  heeEnRec = iB.book1D("heeEnRec", "", 1000, 0, 10);
164  heeEnSim = iB.book1D("heeEnSim", "", 1000, 0, 0.01);
165  heeEnSimRec = iB.book2D("heeEnSimRec", "", 200, 0, 0.002, 200, 0, 0.2);
166 
167  hefEnRec = iB.book1D("hefEnRec", "", 1000, 0, 10);
168  hefEnSim = iB.book1D("hefEnSim", "", 1000, 0, 0.01);
169  hefEnSimRec = iB.book2D("hefEnSimRec", "", 200, 0, 0.001, 200, 0, 0.5);
170 
171  hebEnRec = iB.book1D("hebEnRec", "", 1000, 0, 15);
172  hebEnSim = iB.book1D("hebEnSim", "", 1000, 0, 0.01);
173  hebEnSimRec = iB.book2D("hebEnSimRec", "", 200, 0, 0.02, 200, 0, 4);
174 }
MonitorElement * hebRecVsSimX
MonitorElement * hefRecVsSimY
MonitorElement * hefRecVsSimX
virtual void setCurrentFolder(std::string const &fullpath)
Definition: DQMStore.cc:36
MonitorElement * hebRecVsSimY
MonitorElement * hefEnSimRec
MonitorElement * heedzVsZ
MonitorElement * heeRecVsSimX
MonitorElement * heeRecVsSimZ
MonitorElement * heeRecVsSimY
MonitorElement * heeEnRec
MonitorElement * hebEnRec
MonitorElement * hebEnSim
MonitorElement * hefdyVsY
MonitorElement * heeEnSimRec
MonitorElement * hefEnSim
MonitorElement * hebRecVsSimZ
MonitorElement * hefEnRec
MonitorElement * heedxVsX
MonitorElement * heeEnSim
MonitorElement * hebdPhiVsPhi
#define M_PI
MonitorElement * hebEnSimRec
MonitorElement * hefdxVsX
MonitorElement * book2D(TString const &name, TString const &title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, FUNC onbooking=NOOP())
Definition: DQMStore.h:212
MonitorElement * hefRecVsSimZ
MonitorElement * hefdzVsZ
MonitorElement * book1D(TString const &name, TString const &title, int const nchX, double const lowX, double const highX, FUNC onbooking=NOOP())
Definition: DQMStore.h:98
MonitorElement * hebdzVsZ
MonitorElement * heedyVsY
MonitorElement * hebdEtaVsEta

◆ dqmBeginRun()

void HGCalHitValidation::dqmBeginRun ( edm::Run const &  iRun,
edm::EventSetup const &  iSetup 
)
overrideprotectedvirtual

Reimplemented from DQMEDAnalyzer.

Definition at line 176 of file HGCalHitValidation.cc.

References geometrySource_, edm::EventSetup::getHandle(), hgcCons_, hgcGeometry_, mps_fire::i, edm::ESHandleBase::isValid(), edm::ESHandle< T >::product(), tok_ddd_, and tok_geom_.

176  {
177  //initiating hgc Geometry
178  for (size_t i = 0; i < geometrySource_.size(); i++) {
179  const edm::ESHandle<HGCalDDDConstants>& hgcCons = iSetup.getHandle(tok_ddd_[i]);
180  if (hgcCons.isValid()) {
181  hgcCons_.push_back(hgcCons.product());
182  } else {
183  edm::LogWarning("HGCalValid") << "Cannot initiate HGCalDDDConstants for " << geometrySource_[i] << std::endl;
184  }
185  const edm::ESHandle<HGCalGeometry>& hgcGeom = iSetup.getHandle(tok_geom_[i]);
186  if (hgcGeom.isValid()) {
187  hgcGeometry_.push_back(hgcGeom.product());
188  } else {
189  edm::LogWarning("HGCalValid") << "Cannot initiate HGCalGeometry for " << geometrySource_[i] << std::endl;
190  }
191  }
192 }
const std::vector< edm::ESGetToken< HGCalDDDConstants, IdealGeometryRecord > > tok_ddd_
std::vector< const HGCalDDDConstants * > hgcCons_
std::vector< const HGCalGeometry * > hgcGeometry_
T const * product() const
Definition: ESHandle.h:86
const std::vector< edm::ESGetToken< HGCalGeometry, IdealGeometryRecord > > tok_geom_
bool isValid() const
Definition: ESHandle.h:44
Log< level::Warning, false > LogWarning
const std::vector< std::string > geometrySource_

◆ fillDescriptions()

void HGCalHitValidation::fillDescriptions ( edm::ConfigurationDescriptions descriptions)
static

Definition at line 123 of file HGCalHitValidation.cc.

References edm::ConfigurationDescriptions::add(), submitPVResolutionJobs::desc, ProducerED_cfi::InputTag, and source.

123  {
125  std::vector<std::string> source = {"HGCalEESensitive", "HGCalHESiliconSensitive", "HGCalHEScintillatorSensitive"};
126  desc.add<std::vector<std::string>>("geometrySource", source);
127  desc.add<edm::InputTag>("eeSimHitSource", edm::InputTag("g4SimHits", "HGCHitsEE"));
128  desc.add<edm::InputTag>("fhSimHitSource", edm::InputTag("g4SimHits", "HGCHitsHEfront"));
129  desc.add<edm::InputTag>("bhSimHitSource", edm::InputTag("g4SimHits", "HGCHitsHEback"));
130  desc.add<edm::InputTag>("eeRecHitSource", edm::InputTag("HGCalRecHit", "HGCEERecHits"));
131  desc.add<edm::InputTag>("fhRecHitSource", edm::InputTag("HGCalRecHit", "HGCHEFRecHits"));
132  desc.add<edm::InputTag>("bhRecHitSource", edm::InputTag("HGCalRecHit", "HGCHEBRecHits"));
133  std::vector<int> dummy;
134  desc.add<std::vector<int>>("ietaExcludeBH", dummy);
135  descriptions.add("hgcalHitValidation", desc);
136 }
void add(std::string const &label, ParameterSetDescription const &psetDescription)
static std::string const source
Definition: EdmProvDump.cc:49

Member Data Documentation

◆ bhRecHitToken_

const edm::EDGetTokenT<HGChebRecHitCollection> HGCalHitValidation::bhRecHitToken_
private

Definition at line 79 of file HGCalHitValidation.cc.

Referenced by analyze().

◆ bhSimHitToken_

const edm::EDGetTokenT<std::vector<PCaloHit> > HGCalHitValidation::bhSimHitToken_
private

Definition at line 76 of file HGCalHitValidation.cc.

Referenced by analyze().

◆ eeRecHitToken_

const edm::EDGetTokenT<HGCeeRecHitCollection> HGCalHitValidation::eeRecHitToken_
private

Definition at line 77 of file HGCalHitValidation.cc.

Referenced by analyze().

◆ eeSimHitToken_

const edm::EDGetTokenT<std::vector<PCaloHit> > HGCalHitValidation::eeSimHitToken_
private

Definition at line 74 of file HGCalHitValidation.cc.

Referenced by analyze().

◆ fhRecHitToken_

const edm::EDGetTokenT<HGChefRecHitCollection> HGCalHitValidation::fhRecHitToken_
private

Definition at line 78 of file HGCalHitValidation.cc.

Referenced by analyze().

◆ fhSimHitToken_

const edm::EDGetTokenT<std::vector<PCaloHit> > HGCalHitValidation::fhSimHitToken_
private

Definition at line 75 of file HGCalHitValidation.cc.

Referenced by analyze().

◆ geometrySource_

const std::vector<std::string> HGCalHitValidation::geometrySource_
private

Definition at line 72 of file HGCalHitValidation.cc.

Referenced by dqmBeginRun(), and HGCalHitValidation().

◆ hebdEtaVsEta

MonitorElement * HGCalHitValidation::hebdEtaVsEta
private

Definition at line 86 of file HGCalHitValidation.cc.

Referenced by analyze(), and bookHistograms().

◆ hebdPhiVsPhi

MonitorElement * HGCalHitValidation::hebdPhiVsPhi
private

Definition at line 86 of file HGCalHitValidation.cc.

Referenced by analyze(), and bookHistograms().

◆ hebdzVsZ

MonitorElement* HGCalHitValidation::hebdzVsZ
private

Definition at line 86 of file HGCalHitValidation.cc.

Referenced by analyze(), and bookHistograms().

◆ hebEnRec

MonitorElement* HGCalHitValidation::hebEnRec
private

Definition at line 93 of file HGCalHitValidation.cc.

Referenced by analyze(), and bookHistograms().

◆ hebEnSim

MonitorElement * HGCalHitValidation::hebEnSim
private

Definition at line 93 of file HGCalHitValidation.cc.

Referenced by analyze(), and bookHistograms().

◆ hebEnSimRec

MonitorElement * HGCalHitValidation::hebEnSimRec
private

Definition at line 91 of file HGCalHitValidation.cc.

Referenced by analyze(), and bookHistograms().

◆ hebRecVsSimX

MonitorElement * HGCalHitValidation::hebRecVsSimX
private

Definition at line 90 of file HGCalHitValidation.cc.

Referenced by analyze(), and bookHistograms().

◆ hebRecVsSimY

MonitorElement * HGCalHitValidation::hebRecVsSimY
private

Definition at line 90 of file HGCalHitValidation.cc.

Referenced by analyze(), and bookHistograms().

◆ hebRecVsSimZ

MonitorElement* HGCalHitValidation::hebRecVsSimZ
private

Definition at line 90 of file HGCalHitValidation.cc.

Referenced by analyze(), and bookHistograms().

◆ heedxVsX

MonitorElement * HGCalHitValidation::heedxVsX
private

Definition at line 84 of file HGCalHitValidation.cc.

Referenced by analyze(), and bookHistograms().

◆ heedyVsY

MonitorElement * HGCalHitValidation::heedyVsY
private

Definition at line 84 of file HGCalHitValidation.cc.

Referenced by analyze(), and bookHistograms().

◆ heedzVsZ

MonitorElement* HGCalHitValidation::heedzVsZ
private

Definition at line 84 of file HGCalHitValidation.cc.

Referenced by analyze(), and bookHistograms().

◆ heeEnRec

MonitorElement* HGCalHitValidation::heeEnRec
private

Definition at line 95 of file HGCalHitValidation.cc.

Referenced by analyze(), and bookHistograms().

◆ heeEnSim

MonitorElement * HGCalHitValidation::heeEnSim
private

Definition at line 95 of file HGCalHitValidation.cc.

Referenced by analyze(), and bookHistograms().

◆ heeEnSimRec

MonitorElement* HGCalHitValidation::heeEnSimRec
private

Definition at line 91 of file HGCalHitValidation.cc.

Referenced by analyze(), and bookHistograms().

◆ heeRecVsSimX

MonitorElement * HGCalHitValidation::heeRecVsSimX
private

Definition at line 88 of file HGCalHitValidation.cc.

Referenced by analyze(), and bookHistograms().

◆ heeRecVsSimY

MonitorElement * HGCalHitValidation::heeRecVsSimY
private

Definition at line 88 of file HGCalHitValidation.cc.

Referenced by analyze(), and bookHistograms().

◆ heeRecVsSimZ

MonitorElement* HGCalHitValidation::heeRecVsSimZ
private

Definition at line 88 of file HGCalHitValidation.cc.

Referenced by analyze(), and bookHistograms().

◆ hefdxVsX

MonitorElement * HGCalHitValidation::hefdxVsX
private

Definition at line 85 of file HGCalHitValidation.cc.

Referenced by analyze(), and bookHistograms().

◆ hefdyVsY

MonitorElement * HGCalHitValidation::hefdyVsY
private

Definition at line 85 of file HGCalHitValidation.cc.

Referenced by analyze(), and bookHistograms().

◆ hefdzVsZ

MonitorElement* HGCalHitValidation::hefdzVsZ
private

Definition at line 85 of file HGCalHitValidation.cc.

Referenced by analyze(), and bookHistograms().

◆ hefEnRec

MonitorElement* HGCalHitValidation::hefEnRec
private

Definition at line 94 of file HGCalHitValidation.cc.

Referenced by analyze(), and bookHistograms().

◆ hefEnSim

MonitorElement * HGCalHitValidation::hefEnSim
private

Definition at line 94 of file HGCalHitValidation.cc.

Referenced by analyze(), and bookHistograms().

◆ hefEnSimRec

MonitorElement * HGCalHitValidation::hefEnSimRec
private

Definition at line 91 of file HGCalHitValidation.cc.

Referenced by analyze(), and bookHistograms().

◆ hefRecVsSimX

MonitorElement * HGCalHitValidation::hefRecVsSimX
private

Definition at line 89 of file HGCalHitValidation.cc.

Referenced by analyze(), and bookHistograms().

◆ hefRecVsSimY

MonitorElement * HGCalHitValidation::hefRecVsSimY
private

Definition at line 89 of file HGCalHitValidation.cc.

Referenced by analyze(), and bookHistograms().

◆ hefRecVsSimZ

MonitorElement* HGCalHitValidation::hefRecVsSimZ
private

Definition at line 89 of file HGCalHitValidation.cc.

Referenced by analyze(), and bookHistograms().

◆ hgcCons_

std::vector<const HGCalDDDConstants*> HGCalHitValidation::hgcCons_
private

Definition at line 70 of file HGCalHitValidation.cc.

Referenced by dqmBeginRun().

◆ hgcGeometry_

std::vector<const HGCalGeometry*> HGCalHitValidation::hgcGeometry_
private

Definition at line 71 of file HGCalHitValidation.cc.

Referenced by analyze(), analyzeHGCalSimHit(), and dqmBeginRun().

◆ ietaExcludeBH_

const std::vector<int> HGCalHitValidation::ietaExcludeBH_
private

Definition at line 73 of file HGCalHitValidation.cc.

◆ tok_ddd_

const std::vector<edm::ESGetToken<HGCalDDDConstants, IdealGeometryRecord> > HGCalHitValidation::tok_ddd_
private

Definition at line 80 of file HGCalHitValidation.cc.

Referenced by dqmBeginRun().

◆ tok_geom_

const std::vector<edm::ESGetToken<HGCalGeometry, IdealGeometryRecord> > HGCalHitValidation::tok_geom_
private

Definition at line 81 of file HGCalHitValidation.cc.

Referenced by dqmBeginRun().