CMS 3D CMS Logo

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

#include <EcalDigisValidation.h>

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

Public Member Functions

void bookHistograms (DQMStore::IBooker &i, edm::Run const &, edm::EventSetup const &) override
 
 EcalDigisValidation (const edm::ParameterSet &ps)
 Constructor. More...
 
 ~EcalDigisValidation () override
 Destructor. More...
 
- 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
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginProcessBlocks () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndProcessBlocks () const final
 
bool hasAbilityToProduceInEndRuns () const final
 

Protected Member Functions

void analyze (edm::Event const &e, edm::EventSetup const &c) override
 Analyze. More...
 
void dqmBeginRun (edm::Run const &, edm::EventSetup const &) override
 
- Protected Member Functions inherited from DQMEDAnalyzer
uint64_t meId () const
 

Private Types

typedef std::map< uint32_t, float, std::less< uint32_t > > MapType
 

Private Member Functions

void checkCalibrations (edm::EventSetup const &c)
 

Private Attributes

double barrelADCtoGeV_
 
edm::EDGetTokenT< CrossingFrame< PCaloHit > > crossingFramePCaloHitEBToken_
 
edm::EDGetTokenT< CrossingFrame< PCaloHit > > crossingFramePCaloHitEEToken_
 
edm::EDGetTokenT< CrossingFrame< PCaloHit > > crossingFramePCaloHitESToken_
 
edm::EDGetTokenT< EBDigiCollectionEBdigiCollectionToken_
 
edm::EDGetTokenT< EEDigiCollectionEEdigiCollectionToken_
 
double endcapADCtoGeV_
 
edm::EDGetTokenT< ESDigiCollectionESdigiCollectionToken_
 
edm::EDGetTokenT< edm::SimTrackContainerg4TkInfoToken_
 
edm::EDGetTokenT< edm::SimVertexContainerg4VtxInfoToken_
 
std::map< int, double, std::less< int > > gainConv_
 
edm::EDGetTokenT< edm::HepMCProductHepMCToken_
 
MonitorElementmeEBDigiSimRatio_
 
MonitorElementmeEBDigiSimRatiogt100ADC_
 
MonitorElementmeEBDigiSimRatiogt10ADC_
 
MonitorElementmeEEDigiSimRatio_
 
MonitorElementmeEEDigiSimRatiogt100ADC_
 
MonitorElementmeEEDigiSimRatiogt20ADC_
 
MonitorElementmeGunEnergy_
 
MonitorElementmeGunEta_
 
MonitorElementmeGunPhi_
 
std::string outputFile_
 
bool verbose_
 

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 >
typedef CacheContexts< T... > CacheTypes
 
typedef CacheTypes::GlobalCache GlobalCache
 
typedef AbilityChecker< T... > HasAbility
 
typedef CacheTypes::LuminosityBlockCache LuminosityBlockCache
 
typedef LuminosityBlockContextT< LuminosityBlockCache, RunCache, GlobalCacheLuminosityBlockContext
 
typedef CacheTypes::LuminosityBlockSummaryCache LuminosityBlockSummaryCache
 
typedef CacheTypes::RunCache RunCache
 
typedef RunContextT< RunCache, GlobalCacheRunContext
 
typedef CacheTypes::RunSummaryCache RunSummaryCache
 
- 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 Attributes inherited from DQMEDAnalyzer
edm::EDPutTokenT< DQMTokenlumiToken_
 
edm::EDPutTokenT< DQMTokenrunToken_
 
unsigned int streamId_
 

Detailed Description

Definition at line 47 of file EcalDigisValidation.h.

Member Typedef Documentation

◆ MapType

typedef std::map<uint32_t, float, std::less<uint32_t> > EcalDigisValidation::MapType
private

Definition at line 48 of file EcalDigisValidation.h.

Constructor & Destructor Documentation

◆ EcalDigisValidation()

EcalDigisValidation::EcalDigisValidation ( const edm::ParameterSet ps)

Constructor.

Definition at line 14 of file EcalDigisValidation.cc.

15  : HepMCToken_(consumes<edm::HepMCProduct>(edm::InputTag(ps.getParameter<std::string>("moduleLabelMC")))),
16  g4TkInfoToken_(consumes<edm::SimTrackContainer>(edm::InputTag(ps.getParameter<std::string>("moduleLabelG4")))),
17  g4VtxInfoToken_(consumes<edm::SimVertexContainer>(edm::InputTag(ps.getParameter<std::string>("moduleLabelG4")))),
18  EBdigiCollectionToken_(consumes<EBDigiCollection>(ps.getParameter<edm::InputTag>("EBdigiCollection"))),
19  EEdigiCollectionToken_(consumes<EEDigiCollection>(ps.getParameter<edm::InputTag>("EEdigiCollection"))),
20  ESdigiCollectionToken_(consumes<ESDigiCollection>(ps.getParameter<edm::InputTag>("ESdigiCollection"))),
22  std::string("mix"), ps.getParameter<std::string>("moduleLabelG4") + std::string("EcalHitsEB")))),
24  std::string("mix"), ps.getParameter<std::string>("moduleLabelG4") + std::string("EcalHitsEE")))),
26  std::string("mix"), ps.getParameter<std::string>("moduleLabelG4") + std::string("EcalHitsES")))) {
27  // DQM ROOT output
28  outputFile_ = ps.getUntrackedParameter<std::string>("outputFile", "");
29 
30  if (!outputFile_.empty()) {
31  edm::LogInfo("OutputInfo") << " Ecal Digi Task histograms will be saved to '" << outputFile_.c_str() << "'";
32  } else {
33  edm::LogInfo("OutputInfo") << " Ecal Digi Task histograms will NOT be saved";
34  }
35 
36  // verbosity switch
37  verbose_ = ps.getUntrackedParameter<bool>("verbose", false);
38 
39  gainConv_[1] = 1.;
40  gainConv_[2] = 2.;
41  gainConv_[3] = 12.;
42  gainConv_[0] = 12.; // saturated channels
43  barrelADCtoGeV_ = 0.035;
44  endcapADCtoGeV_ = 0.06;
45 
46  meGunEnergy_ = nullptr;
47  meGunEta_ = nullptr;
48  meGunPhi_ = nullptr;
49 
50  meEBDigiSimRatio_ = nullptr;
51  meEEDigiSimRatio_ = nullptr;
52 
53  meEBDigiSimRatiogt10ADC_ = nullptr;
54  meEEDigiSimRatiogt20ADC_ = nullptr;
55 
56  meEBDigiSimRatiogt100ADC_ = nullptr;
57  meEEDigiSimRatiogt100ADC_ = nullptr;
58 }

References barrelADCtoGeV_, endcapADCtoGeV_, gainConv_, edm::ParameterSet::getUntrackedParameter(), meEBDigiSimRatio_, meEBDigiSimRatiogt100ADC_, meEBDigiSimRatiogt10ADC_, meEEDigiSimRatio_, meEEDigiSimRatiogt100ADC_, meEEDigiSimRatiogt20ADC_, meGunEnergy_, meGunEta_, meGunPhi_, outputFile_, AlCaHLTBitMon_QueryRunRegistry::string, and verbose_.

◆ ~EcalDigisValidation()

EcalDigisValidation::~EcalDigisValidation ( )
override

Destructor.

Definition at line 60 of file EcalDigisValidation.cc.

60 {}

Member Function Documentation

◆ analyze()

void EcalDigisValidation::analyze ( edm::Event const &  e,
edm::EventSetup const &  c 
)
overrideprotectedvirtual

Analyze.

Reimplemented from DQMEDAnalyzer.

Definition at line 97 of file EcalDigisValidation.cc.

97  {
98  edm::LogInfo("EventInfo") << " Run = " << e.id().run() << " Event = " << e.id().event();
99 
100  std::vector<SimTrack> theSimTracks;
101  std::vector<SimVertex> theSimVertexes;
102 
106  edm::Handle<CrossingFrame<PCaloHit> > crossingFrame;
110 
111  bool skipMC = false;
112  e.getByToken(HepMCToken_, MCEvt);
113  if (!MCEvt.isValid()) {
114  skipMC = true;
115  }
116  e.getByToken(g4TkInfoToken_, SimTk);
117  e.getByToken(g4VtxInfoToken_, SimVtx);
118 
119  const EBDigiCollection* EBdigis = nullptr;
120  const EEDigiCollection* EEdigis = nullptr;
121  const ESDigiCollection* ESdigis = nullptr;
122 
123  bool isBarrel = true;
124  e.getByToken(EBdigiCollectionToken_, EcalDigiEB);
125  if (EcalDigiEB.isValid()) {
126  EBdigis = EcalDigiEB.product();
127  LogDebug("DigiInfo") << "total # EBdigis: " << EBdigis->size();
128  if (EBdigis->empty())
129  isBarrel = false;
130  } else {
131  isBarrel = false;
132  }
133 
134  bool isEndcap = true;
135  e.getByToken(EEdigiCollectionToken_, EcalDigiEE);
136  if (EcalDigiEE.isValid()) {
137  EEdigis = EcalDigiEE.product();
138  LogDebug("DigiInfo") << "total # EEdigis: " << EEdigis->size();
139  if (EEdigis->empty())
140  isEndcap = false;
141  } else {
142  isEndcap = false;
143  }
144 
145  bool isPreshower = true;
146  e.getByToken(ESdigiCollectionToken_, EcalDigiES);
147  if (EcalDigiES.isValid()) {
148  ESdigis = EcalDigiES.product();
149  LogDebug("DigiInfo") << "total # ESdigis: " << ESdigis->size();
150  if (ESdigis->empty())
151  isPreshower = false;
152  } else {
153  isPreshower = false;
154  }
155 
156  theSimTracks.insert(theSimTracks.end(), SimTk->begin(), SimTk->end());
157  theSimVertexes.insert(theSimVertexes.end(), SimVtx->begin(), SimVtx->end());
158 
159  if (!skipMC) {
160  double theGunEnergy = 0.;
161  for (HepMC::GenEvent::particle_const_iterator p = MCEvt->GetEvent()->particles_begin();
162  p != MCEvt->GetEvent()->particles_end();
163  ++p) {
164  theGunEnergy = (*p)->momentum().e();
165  double htheta = (*p)->momentum().theta();
166  double heta = -log(tan(htheta * 0.5));
167  double hphi = (*p)->momentum().phi();
168  hphi = (hphi >= 0) ? hphi : hphi + 2 * M_PI;
169  hphi = hphi / M_PI * 180.;
170  LogDebug("EventInfo") << "Particle gun type form MC = " << abs((*p)->pdg_id()) << "\n"
171  << "Energy = " << (*p)->momentum().e() << " Eta = " << heta << " Phi = " << hphi;
172 
173  if (meGunEnergy_)
174  meGunEnergy_->Fill(theGunEnergy);
175  if (meGunEta_)
176  meGunEta_->Fill(heta);
177  if (meGunPhi_)
178  meGunPhi_->Fill(hphi);
179  }
180  }
181 
182  int nvtx = 0;
183  for (std::vector<SimVertex>::iterator isimvtx = theSimVertexes.begin(); isimvtx != theSimVertexes.end(); ++isimvtx) {
184  LogDebug("EventInfo") << " Vertex index = " << nvtx << " event Id = " << isimvtx->eventId().rawId() << "\n"
185  << " vertex dump: " << *isimvtx;
186  ++nvtx;
187  }
188 
189  int ntrk = 0;
190  for (std::vector<SimTrack>::iterator isimtrk = theSimTracks.begin(); isimtrk != theSimTracks.end(); ++isimtrk) {
191  LogDebug("EventInfo") << " Track index = " << ntrk << " track Id = " << isimtrk->trackId()
192  << " event Id = " << isimtrk->eventId().rawId() << "\n"
193  << " track dump: " << *isimtrk;
194  ++ntrk;
195  }
196 
197  // BARREL
198 
199  // loop over simHits
200 
201  if (isBarrel) {
202  e.getByToken(crossingFramePCaloHitEBToken_, crossingFrame);
203  const MixCollection<PCaloHit> barrelHits(crossingFrame.product());
204 
205  MapType ebSimMap;
206  for (auto const& iHit : barrelHits) {
207  EBDetId ebid = EBDetId(iHit.id());
208 
209  LogDebug("HitInfo") << " CaloHit " << iHit.getName() << "\n"
210  << " DetID = " << iHit.id() << " EBDetId = " << ebid.ieta() << " " << ebid.iphi() << "\n"
211  << " Time = " << iHit.time() << " Event id. = " << iHit.eventId().rawId() << "\n"
212  << " Track Id = " << iHit.geantTrackId() << "\n"
213  << " Energy = " << iHit.energy();
214 
215  uint32_t crystid = ebid.rawId();
216  ebSimMap[crystid] += iHit.energy();
217  }
218 
219  // loop over Digis
220 
221  const EBDigiCollection* barrelDigi = EcalDigiEB.product();
222 
223  std::vector<double> ebAnalogSignal;
224  std::vector<double> ebADCCounts;
225  std::vector<double> ebADCGains;
226  ebAnalogSignal.reserve(EBDataFrame::MAXSAMPLES);
227  ebADCCounts.reserve(EBDataFrame::MAXSAMPLES);
228  ebADCGains.reserve(EBDataFrame::MAXSAMPLES);
229 
230  for (unsigned int digis = 0; digis < EcalDigiEB->size(); ++digis) {
231  EBDataFrame ebdf = (*barrelDigi)[digis];
232  int nrSamples = ebdf.size();
233 
234  EBDetId ebid = ebdf.id();
235 
236  double Emax = 0.;
237  int Pmax = 0;
238  double pedestalPreSample = 0.;
239  double pedestalPreSampleAnalog = 0.;
240 
241  for (int sample = 0; sample < nrSamples; ++sample) {
242  ebAnalogSignal[sample] = 0.;
243  ebADCCounts[sample] = 0.;
244  ebADCGains[sample] = -1.;
245  }
246 
247  for (int sample = 0; sample < nrSamples; ++sample) {
249 
250  ebADCCounts[sample] = (mySample.adc());
251  ebADCGains[sample] = (mySample.gainId());
252  ebAnalogSignal[sample] = (ebADCCounts[sample] * gainConv_[(int)ebADCGains[sample]] * barrelADCtoGeV_);
253  if (Emax < ebAnalogSignal[sample]) {
254  Emax = ebAnalogSignal[sample];
255  Pmax = sample;
256  }
257  if (sample < 3) {
258  pedestalPreSample += ebADCCounts[sample];
259  pedestalPreSampleAnalog += ebADCCounts[sample] * gainConv_[(int)ebADCGains[sample]] * barrelADCtoGeV_;
260  }
261  LogDebug("DigiInfo") << "EB sample " << sample << " ADC counts = " << ebADCCounts[sample]
262  << " Gain Id = " << ebADCGains[sample] << " Analog eq = " << ebAnalogSignal[sample];
263  }
264 
265  pedestalPreSample /= 3.;
266  pedestalPreSampleAnalog /= 3.;
267  double Erec = Emax - pedestalPreSampleAnalog * gainConv_[(int)ebADCGains[Pmax]];
268 
269  if (ebSimMap[ebid.rawId()] != 0.) {
270  LogDebug("DigiInfo") << " Digi / Hit = " << Erec << " / " << ebSimMap[ebid.rawId()] << " gainConv "
271  << gainConv_[(int)ebADCGains[Pmax]];
272  if (meEBDigiSimRatio_)
273  meEBDigiSimRatio_->Fill(Erec / ebSimMap[ebid.rawId()]);
274  if (Erec > 10. * barrelADCtoGeV_ && meEBDigiSimRatiogt10ADC_)
275  meEBDigiSimRatiogt10ADC_->Fill(Erec / ebSimMap[ebid.rawId()]);
276  if (Erec > 100. * barrelADCtoGeV_ && meEBDigiSimRatiogt100ADC_)
277  meEBDigiSimRatiogt100ADC_->Fill(Erec / ebSimMap[ebid.rawId()]);
278  }
279  }
280  }
281 
282  // ENDCAP
283 
284  // loop over simHits
285 
286  if (isEndcap) {
287  e.getByToken(crossingFramePCaloHitEEToken_, crossingFrame);
288  const MixCollection<PCaloHit> endcapHits(crossingFrame.product());
289 
290  MapType eeSimMap;
291  for (auto const& iHit : endcapHits) {
292  EEDetId eeid = EEDetId(iHit.id());
293 
294  LogDebug("HitInfo") << " CaloHit " << iHit.getName() << "\n"
295  << " DetID = " << iHit.id() << " EEDetId side = " << eeid.zside() << " = " << eeid.ix() << " "
296  << eeid.iy() << "\n"
297  << " Time = " << iHit.time() << " Event id. = " << iHit.eventId().rawId() << "\n"
298  << " Track Id = " << iHit.geantTrackId() << "\n"
299  << " Energy = " << iHit.energy();
300 
301  uint32_t crystid = eeid.rawId();
302  eeSimMap[crystid] += iHit.energy();
303  }
304 
305  // loop over Digis
306 
307  const EEDigiCollection* endcapDigi = EcalDigiEE.product();
308 
309  std::vector<double> eeAnalogSignal;
310  std::vector<double> eeADCCounts;
311  std::vector<double> eeADCGains;
312  eeAnalogSignal.reserve(EEDataFrame::MAXSAMPLES);
313  eeADCCounts.reserve(EEDataFrame::MAXSAMPLES);
314  eeADCGains.reserve(EEDataFrame::MAXSAMPLES);
315 
316  for (unsigned int digis = 0; digis < EcalDigiEE->size(); ++digis) {
317  EEDataFrame eedf = (*endcapDigi)[digis];
318  int nrSamples = eedf.size();
319 
320  EEDetId eeid = eedf.id();
321 
322  double Emax = 0.;
323  int Pmax = 0;
324  double pedestalPreSample = 0.;
325  double pedestalPreSampleAnalog = 0.;
326 
327  for (int sample = 0; sample < nrSamples; ++sample) {
328  eeAnalogSignal[sample] = 0.;
329  eeADCCounts[sample] = 0.;
330  eeADCGains[sample] = -1.;
331  }
332 
333  for (int sample = 0; sample < nrSamples; ++sample) {
335 
336  eeADCCounts[sample] = (mySample.adc());
337  eeADCGains[sample] = (mySample.gainId());
338  eeAnalogSignal[sample] = (eeADCCounts[sample] * gainConv_[(int)eeADCGains[sample]] * endcapADCtoGeV_);
339  if (Emax < eeAnalogSignal[sample]) {
340  Emax = eeAnalogSignal[sample];
341  Pmax = sample;
342  }
343  if (sample < 3) {
344  pedestalPreSample += eeADCCounts[sample];
345  pedestalPreSampleAnalog += eeADCCounts[sample] * gainConv_[(int)eeADCGains[sample]] * endcapADCtoGeV_;
346  }
347  LogDebug("DigiInfo") << "EE sample " << sample << " ADC counts = " << eeADCCounts[sample]
348  << " Gain Id = " << eeADCGains[sample] << " Analog eq = " << eeAnalogSignal[sample];
349  }
350  pedestalPreSample /= 3.;
351  pedestalPreSampleAnalog /= 3.;
352  double Erec = Emax - pedestalPreSampleAnalog * gainConv_[(int)eeADCGains[Pmax]];
353 
354  if (eeSimMap[eeid.rawId()] != 0.) {
355  LogDebug("DigiInfo") << " Digi / Hit = " << Erec << " / " << eeSimMap[eeid.rawId()] << " gainConv "
356  << gainConv_[(int)eeADCGains[Pmax]];
357  if (meEEDigiSimRatio_)
358  meEEDigiSimRatio_->Fill(Erec / eeSimMap[eeid.rawId()]);
359  if (Erec > 20. * endcapADCtoGeV_ && meEEDigiSimRatiogt20ADC_)
360  meEEDigiSimRatiogt20ADC_->Fill(Erec / eeSimMap[eeid.rawId()]);
361  if (Erec > 100. * endcapADCtoGeV_ && meEEDigiSimRatiogt100ADC_)
362  meEEDigiSimRatiogt100ADC_->Fill(Erec / eeSimMap[eeid.rawId()]);
363  }
364  }
365  }
366 
367  if (isPreshower) {
368  e.getByToken(crossingFramePCaloHitESToken_, crossingFrame);
369  const MixCollection<PCaloHit> preshowerHits(crossingFrame.product());
370  for (auto const& iHit : preshowerHits) {
371  ESDetId esid = ESDetId(iHit.id());
372 
373  LogDebug("HitInfo") << " CaloHit " << iHit.getName() << "\n"
374  << " DetID = " << iHit.id() << "ESDetId: z side " << esid.zside() << " plane "
375  << esid.plane() << esid.six() << ',' << esid.siy() << ':' << esid.strip() << "\n"
376  << " Time = " << iHit.time() << " Event id. = " << iHit.eventId().rawId() << "\n"
377  << " Track Id = " << iHit.geantTrackId() << "\n"
378  << " Energy = " << iHit.energy();
379  }
380  }
381 }

References funct::abs(), barrelADCtoGeV_, HLT_FULL_cff::barrelHits, crossingFramePCaloHitEBToken_, crossingFramePCaloHitEEToken_, crossingFramePCaloHitESToken_, MillePedeFileConverter_cfg::e, EBdigiCollectionToken_, EEdigiCollectionToken_, edm::DataFrameContainer::empty(), endcapADCtoGeV_, HLT_FULL_cff::endcapHits, ESdigiCollectionToken_, dqm::impl::MonitorElement::Fill(), g4TkInfoToken_, g4VtxInfoToken_, gainConv_, edm::HepMCProduct::GetEvent(), HepMCToken_, EEDataFrame::id(), EBDataFrame::id(), EBDetId::ieta(), createfilelist::int, EBDetId::iphi(), PixelPluginsPhase0_cfi::isBarrel, GeomDetEnumerators::isEndcap(), edm::HandleBase::isValid(), EEDetId::ix(), EEDetId::iy(), dqm-mbProfile::log, LogDebug, M_PI, EcalDataFrame::MAXSAMPLES, meEBDigiSimRatio_, meEBDigiSimRatiogt100ADC_, meEBDigiSimRatiogt10ADC_, meEEDigiSimRatio_, meEEDigiSimRatiogt100ADC_, meEEDigiSimRatiogt20ADC_, meGunEnergy_, meGunEta_, meGunPhi_, ecalTB2006H4_GenSimDigiReco_cfg::mySample, AlCaHLTBitMon_ParallelJobs::p, ESDetId::plane(), dataAnalyzerFineBiningParameters_cff::Pmax, gedPhotons_cfi::preshowerHits, edm::Handle< T >::product(), DetId::rawId(), edm::DataFrameContainer::reserve(), simplePhotonAnalyzer_cfi::sample, ESDetId::six(), ESDetId::siy(), EcalDataFrame::size(), edm::DataFrameContainer::size(), ESDetId::strip(), funct::tan(), ESDetId::zside(), and EEDetId::zside().

◆ bookHistograms()

void EcalDigisValidation::bookHistograms ( DQMStore::IBooker i,
edm::Run const &  ,
edm::EventSetup const &   
)
overridevirtual

Implements DQMEDAnalyzer.

Definition at line 64 of file EcalDigisValidation.cc.

64  {
65  Char_t histo[200];
66 
67  ibooker.setCurrentFolder("EcalDigisV/EcalDigiTask");
68 
69  sprintf(histo, "EcalDigiTask Gun Momentum");
70  meGunEnergy_ = ibooker.book1D(histo, histo, 100, 0., 1000.);
71 
72  sprintf(histo, "EcalDigiTask Gun Eta");
73  meGunEta_ = ibooker.book1D(histo, histo, 700, -3.5, 3.5);
74 
75  sprintf(histo, "EcalDigiTask Gun Phi");
76  meGunPhi_ = ibooker.book1D(histo, histo, 360, 0., 360.);
77 
78  sprintf(histo, "EcalDigiTask Barrel maximum Digi over Sim ratio");
79  meEBDigiSimRatio_ = ibooker.book1D(histo, histo, 100, 0., 2.);
80 
81  sprintf(histo, "EcalDigiTask Endcap maximum Digi over Sim ratio");
82  meEEDigiSimRatio_ = ibooker.book1D(histo, histo, 100, 0., 2.);
83 
84  sprintf(histo, "EcalDigiTask Barrel maximum Digi over Sim ratio gt 10 ADC");
85  meEBDigiSimRatiogt10ADC_ = ibooker.book1D(histo, histo, 100, 0., 2.);
86 
87  sprintf(histo, "EcalDigiTask Endcap maximum Digi over Sim ratio gt 20 ADC");
88  meEEDigiSimRatiogt20ADC_ = ibooker.book1D(histo, histo, 100, 0., 2.);
89 
90  sprintf(histo, "EcalDigiTask Barrel maximum Digi over Sim ratio gt 100 ADC");
91  meEBDigiSimRatiogt100ADC_ = ibooker.book1D(histo, histo, 100, 0., 2.);
92 
93  sprintf(histo, "EcalDigiTask Endcap maximum Digi over Sim ratio gt 100 ADC");
94  meEEDigiSimRatiogt100ADC_ = ibooker.book1D(histo, histo, 100, 0., 2.);
95 }

References dqm::implementation::IBooker::book1D(), timingPdfMaker::histo, meEBDigiSimRatio_, meEBDigiSimRatiogt100ADC_, meEBDigiSimRatiogt10ADC_, meEEDigiSimRatio_, meEEDigiSimRatiogt100ADC_, meEEDigiSimRatiogt20ADC_, meGunEnergy_, meGunEta_, meGunPhi_, and dqm::implementation::NavigatorBase::setCurrentFolder().

◆ checkCalibrations()

void EcalDigisValidation::checkCalibrations ( edm::EventSetup const &  c)
private

Definition at line 383 of file EcalDigisValidation.cc.

383  {
384  // ADC -> GeV Scale
386  eventSetup.get<EcalADCToGeVConstantRcd>().get(pAgc);
387  const EcalADCToGeVConstant* agc = pAgc.product();
388 
389  EcalMGPAGainRatio* defaultRatios = new EcalMGPAGainRatio();
390 
391  gainConv_[1] = 1.;
392  gainConv_[2] = defaultRatios->gain12Over6();
393  gainConv_[3] = gainConv_[2] * (defaultRatios->gain6Over1());
394  gainConv_[0] = gainConv_[2] * (defaultRatios->gain6Over1()); // saturated channels
395 
396  LogDebug("EcalDigi") << " Gains conversions: "
397  << "\n"
398  << " g1 = " << gainConv_[1] << "\n"
399  << " g2 = " << gainConv_[2] << "\n"
400  << " g3 = " << gainConv_[3];
401  LogDebug("EcalDigi") << " Gains conversions: "
402  << "\n"
403  << " saturation = " << gainConv_[0];
404 
405  delete defaultRatios;
406 
407  const double barrelADCtoGeV_ = agc->getEBValue();
408  LogDebug("EcalDigi") << " Barrel GeV/ADC = " << barrelADCtoGeV_;
409  const double endcapADCtoGeV_ = agc->getEEValue();
410  LogDebug("EcalDigi") << " Endcap GeV/ADC = " << endcapADCtoGeV_;
411 }

References barrelADCtoGeV_, endcapADCtoGeV_, EcalMGPAGainRatio::gain12Over6(), EcalMGPAGainRatio::gain6Over1(), gainConv_, edm::EventSetup::get(), get, EcalADCToGeVConstant::getEBValue(), EcalADCToGeVConstant::getEEValue(), LogDebug, and edm::ESHandle< T >::product().

Referenced by dqmBeginRun().

◆ dqmBeginRun()

void EcalDigisValidation::dqmBeginRun ( edm::Run const &  ,
edm::EventSetup const &  c 
)
overrideprotectedvirtual

Reimplemented from DQMEDAnalyzer.

Definition at line 62 of file EcalDigisValidation.cc.

62 { checkCalibrations(c); }

References c, and checkCalibrations().

Member Data Documentation

◆ barrelADCtoGeV_

double EcalDigisValidation::barrelADCtoGeV_
private

Definition at line 84 of file EcalDigisValidation.h.

Referenced by analyze(), checkCalibrations(), and EcalDigisValidation().

◆ crossingFramePCaloHitEBToken_

edm::EDGetTokenT<CrossingFrame<PCaloHit> > EcalDigisValidation::crossingFramePCaloHitEBToken_
private

Definition at line 79 of file EcalDigisValidation.h.

Referenced by analyze().

◆ crossingFramePCaloHitEEToken_

edm::EDGetTokenT<CrossingFrame<PCaloHit> > EcalDigisValidation::crossingFramePCaloHitEEToken_
private

Definition at line 79 of file EcalDigisValidation.h.

Referenced by analyze().

◆ crossingFramePCaloHitESToken_

edm::EDGetTokenT<CrossingFrame<PCaloHit> > EcalDigisValidation::crossingFramePCaloHitESToken_
private

Definition at line 79 of file EcalDigisValidation.h.

Referenced by analyze().

◆ EBdigiCollectionToken_

edm::EDGetTokenT<EBDigiCollection> EcalDigisValidation::EBdigiCollectionToken_
private

Definition at line 75 of file EcalDigisValidation.h.

Referenced by analyze().

◆ EEdigiCollectionToken_

edm::EDGetTokenT<EEDigiCollection> EcalDigisValidation::EEdigiCollectionToken_
private

Definition at line 76 of file EcalDigisValidation.h.

Referenced by analyze().

◆ endcapADCtoGeV_

double EcalDigisValidation::endcapADCtoGeV_
private

Definition at line 85 of file EcalDigisValidation.h.

Referenced by analyze(), checkCalibrations(), and EcalDigisValidation().

◆ ESdigiCollectionToken_

edm::EDGetTokenT<ESDigiCollection> EcalDigisValidation::ESdigiCollectionToken_
private

Definition at line 77 of file EcalDigisValidation.h.

Referenced by analyze().

◆ g4TkInfoToken_

edm::EDGetTokenT<edm::SimTrackContainer> EcalDigisValidation::g4TkInfoToken_
private

Definition at line 72 of file EcalDigisValidation.h.

Referenced by analyze().

◆ g4VtxInfoToken_

edm::EDGetTokenT<edm::SimVertexContainer> EcalDigisValidation::g4VtxInfoToken_
private

Definition at line 73 of file EcalDigisValidation.h.

Referenced by analyze().

◆ gainConv_

std::map<int, double, std::less<int> > EcalDigisValidation::gainConv_
private

Definition at line 82 of file EcalDigisValidation.h.

Referenced by analyze(), checkCalibrations(), and EcalDigisValidation().

◆ HepMCToken_

edm::EDGetTokenT<edm::HepMCProduct> EcalDigisValidation::HepMCToken_
private

Definition at line 71 of file EcalDigisValidation.h.

Referenced by analyze().

◆ meEBDigiSimRatio_

MonitorElement* EcalDigisValidation::meEBDigiSimRatio_
private

Definition at line 91 of file EcalDigisValidation.h.

Referenced by analyze(), bookHistograms(), and EcalDigisValidation().

◆ meEBDigiSimRatiogt100ADC_

MonitorElement* EcalDigisValidation::meEBDigiSimRatiogt100ADC_
private

Definition at line 97 of file EcalDigisValidation.h.

Referenced by analyze(), bookHistograms(), and EcalDigisValidation().

◆ meEBDigiSimRatiogt10ADC_

MonitorElement* EcalDigisValidation::meEBDigiSimRatiogt10ADC_
private

Definition at line 94 of file EcalDigisValidation.h.

Referenced by analyze(), bookHistograms(), and EcalDigisValidation().

◆ meEEDigiSimRatio_

MonitorElement* EcalDigisValidation::meEEDigiSimRatio_
private

Definition at line 92 of file EcalDigisValidation.h.

Referenced by analyze(), bookHistograms(), and EcalDigisValidation().

◆ meEEDigiSimRatiogt100ADC_

MonitorElement* EcalDigisValidation::meEEDigiSimRatiogt100ADC_
private

Definition at line 98 of file EcalDigisValidation.h.

Referenced by analyze(), bookHistograms(), and EcalDigisValidation().

◆ meEEDigiSimRatiogt20ADC_

MonitorElement* EcalDigisValidation::meEEDigiSimRatiogt20ADC_
private

Definition at line 95 of file EcalDigisValidation.h.

Referenced by analyze(), bookHistograms(), and EcalDigisValidation().

◆ meGunEnergy_

MonitorElement* EcalDigisValidation::meGunEnergy_
private

Definition at line 87 of file EcalDigisValidation.h.

Referenced by analyze(), bookHistograms(), and EcalDigisValidation().

◆ meGunEta_

MonitorElement* EcalDigisValidation::meGunEta_
private

Definition at line 88 of file EcalDigisValidation.h.

Referenced by analyze(), bookHistograms(), and EcalDigisValidation().

◆ meGunPhi_

MonitorElement* EcalDigisValidation::meGunPhi_
private

Definition at line 89 of file EcalDigisValidation.h.

Referenced by analyze(), bookHistograms(), and EcalDigisValidation().

◆ outputFile_

std::string EcalDigisValidation::outputFile_
private

Definition at line 69 of file EcalDigisValidation.h.

Referenced by EcalDigisValidation().

◆ verbose_

bool EcalDigisValidation::verbose_
private

Definition at line 67 of file EcalDigisValidation.h.

Referenced by EcalDigisValidation().

EcalDataFrame::MAXSAMPLES
static constexpr int MAXSAMPLES
Definition: EcalDataFrame.h:48
EcalDigisValidation::g4TkInfoToken_
edm::EDGetTokenT< edm::SimTrackContainer > g4TkInfoToken_
Definition: EcalDigisValidation.h:72
EcalDigisValidation::EEdigiCollectionToken_
edm::EDGetTokenT< EEDigiCollection > EEdigiCollectionToken_
Definition: EcalDigisValidation.h:76
edm::ESHandle::product
T const * product() const
Definition: ESHandle.h:86
EcalDigisValidation::meEBDigiSimRatio_
MonitorElement * meEBDigiSimRatio_
Definition: EcalDigisValidation.h:91
EBDetId::ieta
int ieta() const
get the crystal ieta
Definition: EBDetId.h:49
EcalDigisValidation::ESdigiCollectionToken_
edm::EDGetTokenT< ESDigiCollection > ESdigiCollectionToken_
Definition: EcalDigisValidation.h:77
EcalDigisValidation::meGunEta_
MonitorElement * meGunEta_
Definition: EcalDigisValidation.h:88
HLT_FULL_cff.endcapHits
endcapHits
Definition: HLT_FULL_cff.py:84476
edm::Handle::product
T const * product() const
Definition: Handle.h:70
EcalDigisValidation::crossingFramePCaloHitEBToken_
edm::EDGetTokenT< CrossingFrame< PCaloHit > > crossingFramePCaloHitEBToken_
Definition: EcalDigisValidation.h:79
simplePhotonAnalyzer_cfi.sample
sample
Definition: simplePhotonAnalyzer_cfi.py:12
EBDetId
Definition: EBDetId.h:17
EcalDigisValidation::meEEDigiSimRatio_
MonitorElement * meEEDigiSimRatio_
Definition: EcalDigisValidation.h:92
EBDataFrame
Definition: EBDataFrame.h:11
AlCaHLTBitMon_ParallelJobs.p
p
Definition: AlCaHLTBitMon_ParallelJobs.py:153
ESDetId::strip
int strip() const
Definition: ESDetId.h:47
timingPdfMaker.histo
histo
Definition: timingPdfMaker.py:279
EcalDigisValidation::meEEDigiSimRatiogt20ADC_
MonitorElement * meEEDigiSimRatiogt20ADC_
Definition: EcalDigisValidation.h:95
EcalADCToGeVConstant
Definition: EcalADCToGeVConstant.h:13
edm::ParameterSet::getUntrackedParameter
T getUntrackedParameter(std::string const &, T const &) const
ESDetId
Definition: ESDetId.h:15
EcalDigisValidation::verbose_
bool verbose_
Definition: EcalDigisValidation.h:67
edm::LogInfo
Log< level::Info, false > LogInfo
Definition: MessageLogger.h:125
EEDetId::ix
int ix() const
Definition: EEDetId.h:77
edm::Handle< edm::HepMCProduct >
EBDataFrame::id
key_type id() const
Definition: EBDataFrame.h:28
CrossingFrame
Definition: CrossingFrame.h:37
EcalDigisValidation::meGunPhi_
MonitorElement * meGunPhi_
Definition: EcalDigisValidation.h:89
EcalDigisValidation::meEBDigiSimRatiogt100ADC_
MonitorElement * meEBDigiSimRatiogt100ADC_
Definition: EcalDigisValidation.h:97
MixCollection
Definition: MixCollection.h:10
EcalDigisValidation::outputFile_
std::string outputFile_
Definition: EcalDigisValidation.h:69
edm::DataFrameContainer::empty
bool empty() const
Definition: DataFrameContainer.h:160
dqm::impl::MonitorElement::Fill
void Fill(long long x)
Definition: MonitorElement.h:290
edm::ESHandle< EcalADCToGeVConstant >
EEDataFrame::id
key_type id() const
Definition: EEDataFrame.h:24
EcalDigisValidation::gainConv_
std::map< int, double, std::less< int > > gainConv_
Definition: EcalDigisValidation.h:82
EEDetId::zside
int zside() const
Definition: EEDetId.h:71
EcalDigisValidation::meEBDigiSimRatiogt10ADC_
MonitorElement * meEBDigiSimRatiogt10ADC_
Definition: EcalDigisValidation.h:94
EcalMGPAGainRatio::gain12Over6
float gain12Over6() const
Definition: EcalMGPAGainRatio.h:19
edm::DataFrameContainer::reserve
void reserve(size_t isize)
Definition: DataFrameContainer.h:86
EEDetId
Definition: EEDetId.h:14
ESDigiCollection
Definition: EcalDigiCollections.h:82
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
HLT_FULL_cff.barrelHits
barrelHits
Definition: HLT_FULL_cff.py:84491
PixelPluginsPhase0_cfi.isBarrel
isBarrel
Definition: PixelPluginsPhase0_cfi.py:17
LogDebug
#define LogDebug(id)
Definition: MessageLogger.h:233
EcalDigisValidation::HepMCToken_
edm::EDGetTokenT< edm::HepMCProduct > HepMCToken_
Definition: EcalDigisValidation.h:71
EcalADCToGeVConstant::getEEValue
float getEEValue() const
Definition: EcalADCToGeVConstant.h:21
EcalDigisValidation::meGunEnergy_
MonitorElement * meGunEnergy_
Definition: EcalDigisValidation.h:87
EBDigiCollection
Definition: EcalDigiCollections.h:56
EEDigiCollection
Definition: EcalDigiCollections.h:69
funct::tan
Tan< T >::type tan(const T &t)
Definition: Tan.h:22
createfilelist.int
int
Definition: createfilelist.py:10
ecalTB2006H4_GenSimDigiReco_cfg.mySample
mySample
Definition: ecalTB2006H4_GenSimDigiReco_cfg.py:5
M_PI
#define M_PI
Definition: BXVectorInputProducer.cc:49
EcalDigisValidation::crossingFramePCaloHitESToken_
edm::EDGetTokenT< CrossingFrame< PCaloHit > > crossingFramePCaloHitESToken_
Definition: EcalDigisValidation.h:79
EcalDigisValidation::EBdigiCollectionToken_
edm::EDGetTokenT< EBDigiCollection > EBdigiCollectionToken_
Definition: EcalDigisValidation.h:75
EcalDigisValidation::endcapADCtoGeV_
double endcapADCtoGeV_
Definition: EcalDigisValidation.h:85
edm::HepMCProduct::GetEvent
const HepMC::GenEvent * GetEvent() const
Definition: HepMCProduct.h:37
get
#define get
EEDetId::iy
int iy() const
Definition: EEDetId.h:83
EcalMGPASample
Definition: EcalMGPASample.h:22
ESDetId::plane
int plane() const
Definition: ESDetId.h:41
ESDetId::six
int six() const
Definition: ESDetId.h:43
DetId::rawId
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:57
EcalDigisValidation::g4VtxInfoToken_
edm::EDGetTokenT< edm::SimVertexContainer > g4VtxInfoToken_
Definition: EcalDigisValidation.h:73
dataAnalyzerFineBiningParameters_cff.Pmax
Pmax
Definition: dataAnalyzerFineBiningParameters_cff.py:10
EcalDigisValidation::crossingFramePCaloHitEEToken_
edm::EDGetTokenT< CrossingFrame< PCaloHit > > crossingFramePCaloHitEEToken_
Definition: EcalDigisValidation.h:79
EcalMGPAGainRatio::gain6Over1
float gain6Over1() const
Definition: EcalMGPAGainRatio.h:20
ESDetId::siy
int siy() const
Definition: ESDetId.h:45
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
dqm-mbProfile.log
log
Definition: dqm-mbProfile.py:17
EcalDataFrame::size
int size() const
Definition: EcalDataFrame.h:26
EBDetId::iphi
int iphi() const
get the crystal iphi
Definition: EBDetId.h:51
EcalDigisValidation::checkCalibrations
void checkCalibrations(edm::EventSetup const &c)
Definition: EcalDigisValidation.cc:383
funct::abs
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
c
auto & c
Definition: CAHitNtupletGeneratorKernelsImpl.h:46
edm::HandleBase::isValid
bool isValid() const
Definition: HandleBase.h:70
EEDataFrame
Definition: EEDataFrame.h:12
EcalDigisValidation::MapType
std::map< uint32_t, float, std::less< uint32_t > > MapType
Definition: EcalDigisValidation.h:48
gedPhotons_cfi.preshowerHits
preshowerHits
Definition: gedPhotons_cfi.py:47
GeomDetEnumerators::isEndcap
bool isEndcap(GeomDetEnumerators::SubDetector m)
Definition: GeomDetEnumerators.cc:62
EcalADCToGeVConstant::getEBValue
float getEBValue() const
Definition: EcalADCToGeVConstant.h:20
EcalADCToGeVConstantRcd
Definition: EcalADCToGeVConstantRcd.h:5
edm::InputTag
Definition: InputTag.h:15
ESDetId::zside
int zside() const
Definition: ESDetId.h:39
EcalMGPAGainRatio
Definition: EcalMGPAGainRatio.h:13
edm::DataFrameContainer::size
size_type size() const
Definition: DataFrameContainer.h:162
EcalDigisValidation::barrelADCtoGeV_
double barrelADCtoGeV_
Definition: EcalDigisValidation.h:84
MillePedeFileConverter_cfg.e
e
Definition: MillePedeFileConverter_cfg.py:37
EcalDigisValidation::meEEDigiSimRatiogt100ADC_
MonitorElement * meEEDigiSimRatiogt100ADC_
Definition: EcalDigisValidation.h:98