CMS 3D CMS Logo

List of all members | Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | Static Private Attributes
HGCalHitCalibration Class Reference
Inheritance diagram for HGCalHitCalibration:
DQMEDAnalyzer edm::stream::EDProducer< edm::GlobalCache< DQMEDAnalyzerGlobalCache >, edm::EndRunProducer, edm::EndLuminosityBlockProducer, edm::Accumulator >

Public Member Functions

 HGCalHitCalibration (const edm::ParameterSet &)
 
 ~HGCalHitCalibration () override
 
- 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
 
virtual void dqmBeginRun (edm::Run const &, edm::EventSetup const &)
 
 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 hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndRuns () const final
 

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 &)
 

Private Member Functions

void analyze (const edm::Event &, const edm::EventSetup &) override
 
void bookHistograms (DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
 
void fillWithRecHits (std::map< DetId, const HGCRecHit * > &, DetId, unsigned int, float, int &, float &)
 

Private Attributes

int algo_
 
edm::EDGetTokenT< std::vector< CaloParticle > > caloParticles_
 
int debug_
 
int depletion0_
 
edm::EDGetTokenT< std::vector< reco::GsfElectron > > electrons_
 
std::array< float, layers_Energy_layer_calib_
 
std::array< float, layers_Energy_layer_calib_fraction_
 
std::map< int, MonitorElement * > h_EoP_CPene_calib_fraction_
 
std::map< int, MonitorElement * > hgcal_ele_EoP_CPene_calib_fraction_
 
std::map< int, MonitorElement * > hgcal_EoP_CPene_calib_fraction_
 
std::map< int, MonitorElement * > hgcal_photon_EoP_CPene_calib_fraction_
 
edm::EDGetTokenT< std::vector< reco::PFCluster > > hgcalMultiClusters_
 
MonitorElementLayerOccupancy_
 
edm::EDGetTokenT< std::vector< reco::Photon > > photons_
 
bool rawRecHits_
 
edm::EDGetTokenT< HGCRecHitCollectionrecHitsBH_
 
edm::EDGetTokenT< HGCRecHitCollectionrecHitsEE_
 
edm::EDGetTokenT< HGCRecHitCollectionrecHitsFH_
 
hgcal::RecHitTools recHitTools_
 

Static Private Attributes

static constexpr int depletion1_ = 200
 
static constexpr int depletion2_ = 300
 
static constexpr int layers_ = 60
 
static constexpr int scint_ = 400
 

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
 
- Protected Member Functions inherited from DQMEDAnalyzer
uint64_t meId () const
 
- Protected Attributes inherited from DQMEDAnalyzer
edm::EDPutTokenT< DQMTokenlumiToken_
 
edm::EDPutTokenT< DQMTokenrunToken_
 
unsigned int streamId_
 

Detailed Description

Definition at line 43 of file HGCalHitCalibration.cc.

Constructor & Destructor Documentation

◆ HGCalHitCalibration()

HGCalHitCalibration::HGCalHitCalibration ( const edm::ParameterSet iConfig)
explicit

Definition at line 83 of file HGCalHitCalibration.cc.

84  : rawRecHits_(iConfig.getParameter<bool>("rawRecHits")), debug_(iConfig.getParameter<int>("debug")) {
85  auto detector = iConfig.getParameter<std::string>("detector");
86  auto recHitsEE = iConfig.getParameter<edm::InputTag>("recHitsEE");
87  auto recHitsFH = iConfig.getParameter<edm::InputTag>("recHitsFH");
88  auto recHitsBH = iConfig.getParameter<edm::InputTag>("recHitsBH");
89  auto caloParticles = iConfig.getParameter<edm::InputTag>("caloParticles");
90  auto hgcalMultiClusters = iConfig.getParameter<edm::InputTag>("hgcalMultiClusters");
91  auto electrons = iConfig.getParameter<edm::InputTag>("electrons");
92  auto photons = iConfig.getParameter<edm::InputTag>("photons");
93  if (detector == "all") {
94  recHitsEE_ = consumes<HGCRecHitCollection>(recHitsEE);
95  recHitsFH_ = consumes<HGCRecHitCollection>(recHitsFH);
96  recHitsBH_ = consumes<HGCRecHitCollection>(recHitsBH);
97  algo_ = 1;
98  } else if (detector == "EM") {
99  recHitsEE_ = consumes<HGCRecHitCollection>(recHitsEE);
100  algo_ = 2;
101  } else if (detector == "HAD") {
102  recHitsFH_ = consumes<HGCRecHitCollection>(recHitsFH);
103  recHitsBH_ = consumes<HGCRecHitCollection>(recHitsBH);
104  algo_ = 3;
105  }
106  depletion0_ = iConfig.getParameter<int>("depletionFine");
107  caloParticles_ = consumes<std::vector<CaloParticle> >(caloParticles);
108  hgcalMultiClusters_ = consumes<std::vector<reco::PFCluster> >(hgcalMultiClusters);
109  electrons_ = consumes<std::vector<reco::GsfElectron> >(electrons);
110  photons_ = consumes<std::vector<reco::Photon> >(photons);
111 
112  // size should be HGC layers 52 is enough
113  Energy_layer_calib_.fill(0.);
115 }

References algo_, caloTruthCellsProducer_cfi::caloParticles, caloParticles_, depletion0_, hgcalTestNeighbor_cfi::detector, pwdgSkimBPark_cfi::electrons, electrons_, Energy_layer_calib_, Energy_layer_calib_fraction_, edm::ParameterSet::getParameter(), hgcalMultiClusters_, BPHMonitor_cfi::photons, photons_, recHitsBH_, EcalDeadCellBoundaryEnergyFilter_cfi::recHitsEE, recHitsEE_, recHitsFH_, and AlCaHLTBitMon_QueryRunRegistry::string.

◆ ~HGCalHitCalibration()

HGCalHitCalibration::~HGCalHitCalibration ( )
override

Definition at line 117 of file HGCalHitCalibration.cc.

117  {
118  // do anything here that needs to be done at desctruction time
119  // (e.g. close files, deallocate resources etc.)
120 }

Member Function Documentation

◆ analyze()

void HGCalHitCalibration::analyze ( const edm::Event iEvent,
const edm::EventSetup iSetup 
)
overrideprivatevirtual

Reimplemented from DQMEDAnalyzer.

Definition at line 191 of file HGCalHitCalibration.cc.

191  {
192  using namespace edm;
193 
194  recHitTools_.getEventSetup(iSetup);
195 
196  Handle<HGCRecHitCollection> recHitHandleEE;
197  Handle<HGCRecHitCollection> recHitHandleFH;
198  Handle<HGCRecHitCollection> recHitHandleBH;
199 
200  Handle<std::vector<CaloParticle> > caloParticleHandle;
201  iEvent.getByToken(caloParticles_, caloParticleHandle);
202  const std::vector<CaloParticle>& caloParticles = *caloParticleHandle;
203 
204  Handle<std::vector<reco::PFCluster> > hgcalMultiClustersHandle;
205  iEvent.getByToken(hgcalMultiClusters_, hgcalMultiClustersHandle);
206 
207  Handle<std::vector<reco::GsfElectron> > PFElectronHandle;
208  iEvent.getByToken(electrons_, PFElectronHandle);
209 
210  Handle<std::vector<reco::Photon> > PFPhotonHandle;
211  iEvent.getByToken(photons_, PFPhotonHandle);
212 
213  // make a map detid-rechit
214  std::map<DetId, const HGCRecHit*> hitmap;
215  switch (algo_) {
216  case 1: {
217  iEvent.getByToken(recHitsEE_, recHitHandleEE);
218  iEvent.getByToken(recHitsFH_, recHitHandleFH);
219  iEvent.getByToken(recHitsBH_, recHitHandleBH);
220  const auto& rechitsEE = *recHitHandleEE;
221  const auto& rechitsFH = *recHitHandleFH;
222  const auto& rechitsBH = *recHitHandleBH;
223  for (unsigned int i = 0; i < rechitsEE.size(); ++i) {
224  hitmap[rechitsEE[i].detid()] = &rechitsEE[i];
225  }
226  for (unsigned int i = 0; i < rechitsFH.size(); ++i) {
227  hitmap[rechitsFH[i].detid()] = &rechitsFH[i];
228  }
229  for (unsigned int i = 0; i < rechitsBH.size(); ++i) {
230  hitmap[rechitsBH[i].detid()] = &rechitsBH[i];
231  }
232  break;
233  }
234  case 2: {
235  iEvent.getByToken(recHitsEE_, recHitHandleEE);
236  const HGCRecHitCollection& rechitsEE = *recHitHandleEE;
237  for (unsigned int i = 0; i < rechitsEE.size(); i++) {
238  hitmap[rechitsEE[i].detid()] = &rechitsEE[i];
239  }
240  break;
241  }
242  case 3: {
243  iEvent.getByToken(recHitsFH_, recHitHandleFH);
244  iEvent.getByToken(recHitsBH_, recHitHandleBH);
245  const auto& rechitsFH = *recHitHandleFH;
246  const auto& rechitsBH = *recHitHandleBH;
247  for (unsigned int i = 0; i < rechitsFH.size(); i++) {
248  hitmap[rechitsFH[i].detid()] = &rechitsFH[i];
249  }
250  for (unsigned int i = 0; i < rechitsBH.size(); i++) {
251  hitmap[rechitsBH[i].detid()] = &rechitsBH[i];
252  }
253  break;
254  }
255  default:
256  assert(false);
257  break;
258  }
259 
260  // loop over caloParticles
261  int seedDet = 0;
262  float seedEnergy = 0.;
263  IfLogTrace(debug_ > 0, "HGCalHitCalibration") << "Number of caloParticles: " << caloParticles.size() << std::endl;
264  for (const auto& it_caloPart : caloParticles) {
265  if (it_caloPart.g4Tracks()[0].eventId().event() != 0 or it_caloPart.g4Tracks()[0].eventId().bunchCrossing() != 0) {
266  LogDebug("HGCalHitCalibration") << "Excluding CaloParticles from event: "
267  << it_caloPart.g4Tracks()[0].eventId().event()
268  << " with BX: " << it_caloPart.g4Tracks()[0].eventId().bunchCrossing()
269  << std::endl;
270  continue;
271  }
272 
273  const SimClusterRefVector& simClusterRefVector = it_caloPart.simClusters();
274  Energy_layer_calib_.fill(0.);
276 
277  seedDet = 0;
278  seedEnergy = 0.;
279  for (const auto& it_sc : simClusterRefVector) {
280  const SimCluster& simCluster = (*(it_sc));
281  IfLogTrace(debug_ > 1, "HGCalHitCalibration")
282  << ">>> SC.energy(): " << simCluster.energy() << " SC.simEnergy(): " << simCluster.simEnergy() << std::endl;
283  const std::vector<std::pair<uint32_t, float> >& hits_and_fractions = simCluster.hits_and_fractions();
284 
285  // loop over hits
286  for (const auto& it_haf : hits_and_fractions) {
287  unsigned int hitlayer = recHitTools_.getLayerWithOffset(it_haf.first);
288  DetId hitid = (it_haf.first);
289  // dump raw RecHits and match
290  if (rawRecHits_) {
291  if ((hitid.det() == DetId::Forward &&
292  (hitid.subdetId() == HGCEE || hitid.subdetId() == HGCHEF || hitid.subdetId() == HGCHEB)) ||
293  (hitid.det() == DetId::HGCalEE) || (hitid.det() == DetId::HGCalHSi) || (hitid.det() == DetId::HGCalHSc) ||
294  (hitid.det() == DetId::Hcal && hitid.subdetId() == HcalEndcap))
295  fillWithRecHits(hitmap, hitid, hitlayer, it_haf.second, seedDet, seedEnergy);
296  }
297  } // end simHit
298  } // end simCluster
299 
300  auto sumCalibRecHitCalib_fraction =
301  std::accumulate(Energy_layer_calib_fraction_.begin(), Energy_layer_calib_fraction_.end(), 0.);
302  IfLogTrace(debug_ > 0, "HGCalHitCalibration")
303  << ">>> MC Energy: " << it_caloPart.energy() << " reco energy: " << sumCalibRecHitCalib_fraction << std::endl;
304  if (h_EoP_CPene_calib_fraction_.count(seedDet))
305  h_EoP_CPene_calib_fraction_[seedDet]->Fill(sumCalibRecHitCalib_fraction / it_caloPart.energy());
306 
307  // Loop on reconstructed SC.
308  const auto& clusters = *hgcalMultiClustersHandle;
309  float total_energy = 0.;
310  float max_dR2 = 0.0025;
311  auto closest =
312  std::min_element(clusters.begin(), clusters.end(), [&](const reco::PFCluster& a, const reco::PFCluster& b) {
313  auto dR2_a = reco::deltaR2(it_caloPart, a);
314  auto dR2_b = reco::deltaR2(it_caloPart, b);
315  auto ERatio_a = a.correctedEnergy() / it_caloPart.energy();
316  auto ERatio_b = b.correctedEnergy() / it_caloPart.energy();
317  // If both clusters are within 0.0025, mark as first (min) the
318  // element with the highest ratio against the SimCluster
319  if (dR2_a < max_dR2 && dR2_b < max_dR2)
320  return ERatio_a > ERatio_b;
321  return dR2_a < dR2_b;
322  });
323  if (closest != clusters.end() && reco::deltaR2(*closest, it_caloPart) < 0.01) {
324  total_energy = closest->correctedEnergy();
325  seedDet = recHitTools_.getSiThickness(closest->seed());
326  if (closest->seed().det() == DetId::HGCalHSc) {
327  seedDet = scint_;
328  }
329  if (hgcal_EoP_CPene_calib_fraction_.count(seedDet)) {
330  hgcal_EoP_CPene_calib_fraction_[seedDet]->Fill(total_energy / it_caloPart.energy());
331  }
332  }
333 
334  auto closest_fcn = [&](auto const& a, auto const& b) {
335  auto dR2_a = reco::deltaR2(it_caloPart, a);
336  auto dR2_b = reco::deltaR2(it_caloPart, b);
337  auto ERatio_a = a.energy() / it_caloPart.energy();
338  auto ERatio_b = b.energy() / it_caloPart.energy();
339  // If both clusters are within 0.0025, mark as first (min) the
340  // element with the highest ratio against the SimCluster
341  if (dR2_a < max_dR2 && dR2_b < max_dR2)
342  return ERatio_a > ERatio_b;
343  return dR2_a < dR2_b;
344  };
345  // ELECTRONS in HGCAL
346  if (PFElectronHandle.isValid()) {
347  auto const& ele = (*PFElectronHandle);
348  auto closest = std::min_element(ele.begin(), ele.end(), closest_fcn);
349  if (closest != ele.end() &&
350  (closest->superCluster()->seed()->seed().det() == DetId::Forward ||
351  closest->superCluster()->seed()->seed().det() == DetId::HGCalEE) &&
352  reco::deltaR2(*closest, it_caloPart) < 0.01) {
353  seedDet = recHitTools_.getSiThickness(closest->superCluster()->seed()->seed());
354  if (closest->superCluster()->seed()->seed().det() == DetId::HGCalHSc) {
355  seedDet = scint_;
356  }
357  if (hgcal_ele_EoP_CPene_calib_fraction_.count(seedDet)) {
358  hgcal_ele_EoP_CPene_calib_fraction_[seedDet]->Fill(closest->energy() / it_caloPart.energy());
359  }
360  }
361  }
362 
363  // PHOTONS in HGCAL
364  if (PFPhotonHandle.isValid()) {
365  auto const& photon = (*PFPhotonHandle);
366  auto closest = std::min_element(photon.begin(), photon.end(), closest_fcn);
367  if (closest != photon.end() &&
368  (closest->superCluster()->seed()->seed().det() == DetId::Forward ||
369  closest->superCluster()->seed()->seed().det() == DetId::HGCalEE) &&
370  reco::deltaR2(*closest, it_caloPart) < 0.01) {
371  seedDet = recHitTools_.getSiThickness(closest->superCluster()->seed()->seed());
372  if (hgcal_photon_EoP_CPene_calib_fraction_.count(seedDet)) {
373  hgcal_photon_EoP_CPene_calib_fraction_[seedDet]->Fill(closest->energy() / it_caloPart.energy());
374  }
375  }
376  }
377  } // end caloparticle
378 }

References a, algo_, cms::cuda::assert(), b, caloTruthCellsProducer_cfi::caloParticles, caloParticles_, bsc_activity_cfg::clusters, debug_, reco::deltaR2(), DetId::det(), electrons_, SimCluster::energy(), Energy_layer_calib_, Energy_layer_calib_fraction_, HcalObjRepresent::Fill(), fillWithRecHits(), DetId::Forward, hgcal::RecHitTools::getEventSetup(), hgcal::RecHitTools::getLayerWithOffset(), hgcal::RecHitTools::getSiThickness(), h_EoP_CPene_calib_fraction_, DetId::Hcal, HcalEndcap, hgcal_ele_EoP_CPene_calib_fraction_, hgcal_EoP_CPene_calib_fraction_, hgcal_photon_EoP_CPene_calib_fraction_, DetId::HGCalEE, DetId::HGCalHSc, DetId::HGCalHSi, hgcalMultiClusters_, HGCEE, HGCHEB, HGCHEF, SimCluster::hits_and_fractions(), mps_fire::i, iEvent, IfLogTrace, edm::HandleBase::isValid(), LogDebug, or, muons2muons_cfi::photon, photons_, rawRecHits_, recHitsBH_, recHitsEE_, recHitsFH_, recHitTools_, scint_, SimCluster::simEnergy(), edm::SortedCollection< T, SORT >::size(), and DetId::subdetId().

◆ bookHistograms()

void HGCalHitCalibration::bookHistograms ( DQMStore::IBooker ibooker,
edm::Run const &  iRun,
edm::EventSetup const &   
)
overrideprivatevirtual

Implements DQMEDAnalyzer.

Definition at line 122 of file HGCalHitCalibration.cc.

124  {
125  ibooker.cd();
126  ibooker.setCurrentFolder("HGCalHitCalibration");
127  h_EoP_CPene_calib_fraction_[depletion0_] = ibooker.book1D("h_EoP_CPene_100_calib_fraction", "", 1000, -0.5, 2.5);
128  h_EoP_CPene_calib_fraction_[depletion1_] = ibooker.book1D("h_EoP_CPene_200_calib_fraction", "", 1000, -0.5, 2.5);
129  h_EoP_CPene_calib_fraction_[depletion2_] = ibooker.book1D("h_EoP_CPene_300_calib_fraction", "", 1000, -0.5, 2.5);
130  h_EoP_CPene_calib_fraction_[scint_] = ibooker.book1D("h_EoP_CPene_scint_calib_fraction", "", 1000, -0.5, 2.5);
132  ibooker.book1D("hgcal_EoP_CPene_100_calib_fraction", "", 1000, -0.5, 2.5);
134  ibooker.book1D("hgcal_EoP_CPene_200_calib_fraction", "", 1000, -0.5, 2.5);
136  ibooker.book1D("hgcal_EoP_CPene_300_calib_fraction", "", 1000, -0.5, 2.5);
137  hgcal_EoP_CPene_calib_fraction_[scint_] = ibooker.book1D("hgcal_EoP_CPene_scint_calib_fraction", "", 1000, -0.5, 2.5);
139  ibooker.book1D("hgcal_ele_EoP_CPene_100_calib_fraction", "", 1000, -0.5, 2.5);
141  ibooker.book1D("hgcal_ele_EoP_CPene_200_calib_fraction", "", 1000, -0.5, 2.5);
143  ibooker.book1D("hgcal_ele_EoP_CPene_300_calib_fraction", "", 1000, -0.5, 2.5);
145  ibooker.book1D("hgcal_ele_EoP_CPene_scint_calib_fraction", "", 1000, -0.5, 2.5);
147  ibooker.book1D("hgcal_photon_EoP_CPene_100_calib_fraction", "", 1000, -0.5, 2.5);
149  ibooker.book1D("hgcal_photon_EoP_CPene_200_calib_fraction", "", 1000, -0.5, 2.5);
151  ibooker.book1D("hgcal_photon_EoP_CPene_300_calib_fraction", "", 1000, -0.5, 2.5);
153  ibooker.book1D("hgcal_photon_EoP_CPene_scint_calib_fraction", "", 1000, -0.5, 2.5);
154  LayerOccupancy_ = ibooker.book1D("LayerOccupancy", "", layers_, 0., (float)layers_);
155 }

References dqm::implementation::IBooker::book1D(), dqm::implementation::NavigatorBase::cd(), depletion0_, depletion1_, depletion2_, h_EoP_CPene_calib_fraction_, hgcal_ele_EoP_CPene_calib_fraction_, hgcal_EoP_CPene_calib_fraction_, hgcal_photon_EoP_CPene_calib_fraction_, LayerOccupancy_, layers_, scint_, and dqm::implementation::NavigatorBase::setCurrentFolder().

◆ fillDescriptions()

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

Definition at line 382 of file HGCalHitCalibration.cc.

382  {
384  desc.add<int>("debug", 0);
385  desc.add<bool>("rawRecHits", true);
386  desc.add<std::string>("detector", "all");
387  desc.add<int>("depletionFine", 100);
388  desc.add<edm::InputTag>("caloParticles", edm::InputTag("mix", "MergedCaloTruth"));
389  desc.add<edm::InputTag>("recHitsEE", edm::InputTag("HGCalRecHit", "HGCEERecHits"));
390  desc.add<edm::InputTag>("recHitsFH", edm::InputTag("HGCalRecHit", "HGCHEFRecHits"));
391  desc.add<edm::InputTag>("recHitsBH", edm::InputTag("HGCalRecHit", "HGCHEBRecHits"));
392  desc.add<edm::InputTag>("hgcalMultiClusters", edm::InputTag("particleFlowClusterHGCalFromMultiCl"));
393  desc.add<edm::InputTag>("electrons", edm::InputTag("ecalDrivenGsfElectronsFromMultiCl"));
394  desc.add<edm::InputTag>("photons", edm::InputTag("photonsFromMultiCl"));
395  descriptions.add("hgcalHitCalibrationDefault", desc);
396 }

References edm::ConfigurationDescriptions::add(), edm::ParameterSetDescription::add(), HLT_2018_cff::InputTag, and AlCaHLTBitMon_QueryRunRegistry::string.

◆ fillWithRecHits()

void HGCalHitCalibration::fillWithRecHits ( std::map< DetId, const HGCRecHit * > &  hitmap,
DetId  hitid,
unsigned int  hitlayer,
float  fraction,
int &  seedDet,
float &  seedEnergy 
)
private

Definition at line 157 of file HGCalHitCalibration.cc.

162  {
163  if (hitmap.find(hitid) == hitmap.end()) {
164  // Hit was not reconstructed
165  IfLogTrace(debug_ > 0, "HGCalHitCalibration")
166  << ">>> Failed to find detid " << std::hex << hitid.rawId() << std::dec << " Det " << hitid.det() << " Subdet "
167  << hitid.subdetId() << std::endl;
168  return;
169  }
170  if ((hitid.det() != DetId::Forward) && (hitid.det() != DetId::HGCalEE) && (hitid.det() != DetId::HGCalHSi) &&
171  (hitid.det() != DetId::HGCalHSc)) {
172  IfLogTrace(debug_ > 0, "HGCalHitCalibration")
173  << ">>> Wrong type of detid " << std::hex << hitid.rawId() << std::dec << " Det " << hitid.det() << " Subdet "
174  << hitid.subdetId() << std::endl;
175  return;
176  }
177 
178  unsigned int layer = recHitTools_.getLayerWithOffset(hitid);
179  assert(hitlayer == layer);
180  Energy_layer_calib_fraction_[layer] += hitmap[hitid]->energy() * fraction;
181  LayerOccupancy_->Fill(layer);
182  if (seedEnergy < hitmap[hitid]->energy()) {
183  seedEnergy = hitmap[hitid]->energy();
184  seedDet = recHitTools_.getSiThickness(hitid);
185  if (hitid.det() == DetId::HGCalHSc) {
186  seedDet = scint_;
187  }
188  }
189 }

References cms::cuda::assert(), debug_, TauDecayModes::dec, DetId::det(), HCALHighEnergyHPDFilter_cfi::energy, Energy_layer_calib_fraction_, dqm::impl::MonitorElement::Fill(), DetId::Forward, HLT_2018_cff::fraction, hgcal::RecHitTools::getLayerWithOffset(), hgcal::RecHitTools::getSiThickness(), DetId::HGCalEE, DetId::HGCalHSc, DetId::HGCalHSi, IfLogTrace, LayerOccupancy_, DetId::rawId(), recHitTools_, scint_, and DetId::subdetId().

Referenced by analyze().

Member Data Documentation

◆ algo_

int HGCalHitCalibration::algo_
private

Definition at line 64 of file HGCalHitCalibration.cc.

Referenced by analyze(), and HGCalHitCalibration().

◆ caloParticles_

edm::EDGetTokenT<std::vector<CaloParticle> > HGCalHitCalibration::caloParticles_
private

Definition at line 59 of file HGCalHitCalibration.cc.

Referenced by analyze(), and HGCalHitCalibration().

◆ debug_

int HGCalHitCalibration::debug_
private

Definition at line 66 of file HGCalHitCalibration.cc.

Referenced by analyze(), and fillWithRecHits().

◆ depletion0_

int HGCalHitCalibration::depletion0_
private

Definition at line 64 of file HGCalHitCalibration.cc.

Referenced by bookHistograms(), and HGCalHitCalibration().

◆ depletion1_

constexpr int HGCalHitCalibration::depletion1_ = 200
staticconstexprprivate

Definition at line 68 of file HGCalHitCalibration.cc.

Referenced by bookHistograms().

◆ depletion2_

constexpr int HGCalHitCalibration::depletion2_ = 300
staticconstexprprivate

Definition at line 69 of file HGCalHitCalibration.cc.

Referenced by bookHistograms().

◆ electrons_

edm::EDGetTokenT<std::vector<reco::GsfElectron> > HGCalHitCalibration::electrons_
private

Definition at line 61 of file HGCalHitCalibration.cc.

Referenced by analyze(), and HGCalHitCalibration().

◆ Energy_layer_calib_

std::array<float, layers_> HGCalHitCalibration::Energy_layer_calib_
private

Definition at line 79 of file HGCalHitCalibration.cc.

Referenced by analyze(), and HGCalHitCalibration().

◆ Energy_layer_calib_fraction_

std::array<float, layers_> HGCalHitCalibration::Energy_layer_calib_fraction_
private

Definition at line 80 of file HGCalHitCalibration.cc.

Referenced by analyze(), fillWithRecHits(), and HGCalHitCalibration().

◆ h_EoP_CPene_calib_fraction_

std::map<int, MonitorElement*> HGCalHitCalibration::h_EoP_CPene_calib_fraction_
private

Definition at line 72 of file HGCalHitCalibration.cc.

Referenced by analyze(), and bookHistograms().

◆ hgcal_ele_EoP_CPene_calib_fraction_

std::map<int, MonitorElement*> HGCalHitCalibration::hgcal_ele_EoP_CPene_calib_fraction_
private

Definition at line 74 of file HGCalHitCalibration.cc.

Referenced by analyze(), and bookHistograms().

◆ hgcal_EoP_CPene_calib_fraction_

std::map<int, MonitorElement*> HGCalHitCalibration::hgcal_EoP_CPene_calib_fraction_
private

Definition at line 73 of file HGCalHitCalibration.cc.

Referenced by analyze(), and bookHistograms().

◆ hgcal_photon_EoP_CPene_calib_fraction_

std::map<int, MonitorElement*> HGCalHitCalibration::hgcal_photon_EoP_CPene_calib_fraction_
private

Definition at line 75 of file HGCalHitCalibration.cc.

Referenced by analyze(), and bookHistograms().

◆ hgcalMultiClusters_

edm::EDGetTokenT<std::vector<reco::PFCluster> > HGCalHitCalibration::hgcalMultiClusters_
private

Definition at line 60 of file HGCalHitCalibration.cc.

Referenced by analyze(), and HGCalHitCalibration().

◆ LayerOccupancy_

MonitorElement* HGCalHitCalibration::LayerOccupancy_
private

Definition at line 76 of file HGCalHitCalibration.cc.

Referenced by bookHistograms(), and fillWithRecHits().

◆ layers_

constexpr int HGCalHitCalibration::layers_ = 60
staticconstexprprivate

Definition at line 78 of file HGCalHitCalibration.cc.

Referenced by bookHistograms().

◆ photons_

edm::EDGetTokenT<std::vector<reco::Photon> > HGCalHitCalibration::photons_
private

Definition at line 62 of file HGCalHitCalibration.cc.

Referenced by analyze(), and HGCalHitCalibration().

◆ rawRecHits_

bool HGCalHitCalibration::rawRecHits_
private

Definition at line 65 of file HGCalHitCalibration.cc.

Referenced by analyze().

◆ recHitsBH_

edm::EDGetTokenT<HGCRecHitCollection> HGCalHitCalibration::recHitsBH_
private

Definition at line 58 of file HGCalHitCalibration.cc.

Referenced by analyze(), and HGCalHitCalibration().

◆ recHitsEE_

edm::EDGetTokenT<HGCRecHitCollection> HGCalHitCalibration::recHitsEE_
private

Definition at line 56 of file HGCalHitCalibration.cc.

Referenced by analyze(), and HGCalHitCalibration().

◆ recHitsFH_

edm::EDGetTokenT<HGCRecHitCollection> HGCalHitCalibration::recHitsFH_
private

Definition at line 57 of file HGCalHitCalibration.cc.

Referenced by analyze(), and HGCalHitCalibration().

◆ recHitTools_

hgcal::RecHitTools HGCalHitCalibration::recHitTools_
private

Definition at line 67 of file HGCalHitCalibration.cc.

Referenced by analyze(), and fillWithRecHits().

◆ scint_

constexpr int HGCalHitCalibration::scint_ = 400
staticconstexprprivate

Definition at line 70 of file HGCalHitCalibration.cc.

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

HGCalHitCalibration::recHitsBH_
edm::EDGetTokenT< HGCRecHitCollection > recHitsBH_
Definition: HGCalHitCalibration.cc:58
muons2muons_cfi.photon
photon
Definition: muons2muons_cfi.py:28
mps_fire.i
i
Definition: mps_fire.py:355
edm::ParameterSetDescription::add
ParameterDescriptionBase * add(U const &iLabel, T const &value)
Definition: ParameterSetDescription.h:95
hgcal::RecHitTools::getSiThickness
std::float_t getSiThickness(const DetId &) const
Definition: RecHitTools.cc:181
HGCalHitCalibration::algo_
int algo_
Definition: HGCalHitCalibration.cc:64
edm
HLT enums.
Definition: AlignableModifier.h:19
DetId::det
constexpr Detector det() const
get the detector field from this detid
Definition: DetId.h:46
DetId::Hcal
Definition: DetId.h:28
edm::ParameterSetDescription
Definition: ParameterSetDescription.h:52
cms::cuda::assert
assert(be >=bs)
HGCalHitCalibration::fillWithRecHits
void fillWithRecHits(std::map< DetId, const HGCRecHit * > &, DetId, unsigned int, float, int &, float &)
Definition: HGCalHitCalibration.cc:157
edm::SortedCollection
Definition: SortedCollection.h:49
edm::SortedCollection::size
size_type size() const
Definition: SortedCollection.h:215
edm::RefVector< SimClusterCollection >
SimCluster::energy
float energy() const
Energy. Note this is taken from the first SimTrack only.
Definition: SimCluster.h:104
SimCluster
Monte Carlo truth information used for tracking validation.
Definition: SimCluster.h:29
HGCalHitCalibration::debug_
int debug_
Definition: HGCalHitCalibration.cc:66
HGCalHitCalibration::scint_
static constexpr int scint_
Definition: HGCalHitCalibration.cc:70
HGCalHitCalibration::hgcal_photon_EoP_CPene_calib_fraction_
std::map< int, MonitorElement * > hgcal_photon_EoP_CPene_calib_fraction_
Definition: HGCalHitCalibration.cc:75
edm::Handle
Definition: AssociativeIterator.h:50
HGCalHitCalibration::h_EoP_CPene_calib_fraction_
std::map< int, MonitorElement * > h_EoP_CPene_calib_fraction_
Definition: HGCalHitCalibration.cc:72
DetId
Definition: DetId.h:17
HGCalHitCalibration::recHitsEE_
edm::EDGetTokenT< HGCRecHitCollection > recHitsEE_
Definition: HGCalHitCalibration.cc:56
HGCalHitCalibration::hgcal_EoP_CPene_calib_fraction_
std::map< int, MonitorElement * > hgcal_EoP_CPene_calib_fraction_
Definition: HGCalHitCalibration.cc:73
DetId::HGCalHSi
Definition: DetId.h:33
DetId::HGCalEE
Definition: DetId.h:32
HGCalHitCalibration::LayerOccupancy_
MonitorElement * LayerOccupancy_
Definition: HGCalHitCalibration.cc:76
HGCalHitCalibration::depletion1_
static constexpr int depletion1_
Definition: HGCalHitCalibration.cc:68
edm::ConfigurationDescriptions::add
void add(std::string const &label, ParameterSetDescription const &psetDescription)
Definition: ConfigurationDescriptions.cc:57
caloTruthCellsProducer_cfi.caloParticles
caloParticles
Definition: caloTruthCellsProducer_cfi.py:6
dqm::impl::MonitorElement::Fill
void Fill(long long x)
Definition: MonitorElement.h:290
HGCalHitCalibration::Energy_layer_calib_
std::array< float, layers_ > Energy_layer_calib_
Definition: HGCalHitCalibration.cc:79
HCALHighEnergyHPDFilter_cfi.energy
energy
Definition: HCALHighEnergyHPDFilter_cfi.py:5
IfLogTrace
#define IfLogTrace(cond, cat)
Definition: MessageLogger.h:699
HGCalHitCalibration::photons_
edm::EDGetTokenT< std::vector< reco::Photon > > photons_
Definition: HGCalHitCalibration.cc:62
b
double b
Definition: hdecay.h:118
HGCalHitCalibration::depletion0_
int depletion0_
Definition: HGCalHitCalibration.cc:64
DetId::subdetId
constexpr int subdetId() const
get the contents of the subdetector field (not cast into any detector's numbering enum)
Definition: DetId.h:48
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
HGCEE
Definition: ForwardSubdetector.h:8
bsc_activity_cfg.clusters
clusters
Definition: bsc_activity_cfg.py:36
HGCalHitCalibration::rawRecHits_
bool rawRecHits_
Definition: HGCalHitCalibration.cc:65
HLT_2018_cff.InputTag
InputTag
Definition: HLT_2018_cff.py:79016
LogDebug
#define LogDebug(id)
Definition: MessageLogger.h:670
a
double a
Definition: hdecay.h:119
HGCalHitCalibration::hgcal_ele_EoP_CPene_calib_fraction_
std::map< int, MonitorElement * > hgcal_ele_EoP_CPene_calib_fraction_
Definition: HGCalHitCalibration.cc:74
hgcal::RecHitTools::getLayerWithOffset
unsigned int getLayerWithOffset(const DetId &) const
Definition: RecHitTools.cc:357
reco::deltaR2
constexpr auto deltaR2(const T1 &t1, const T2 &t2) -> decltype(t1.eta())
Definition: deltaR.h:16
iEvent
int iEvent
Definition: GenABIO.cc:224
HGCalHitCalibration::Energy_layer_calib_fraction_
std::array< float, layers_ > Energy_layer_calib_fraction_
Definition: HGCalHitCalibration.cc:80
BPHMonitor_cfi.photons
photons
Definition: BPHMonitor_cfi.py:91
hgcal::RecHitTools::getEventSetup
void getEventSetup(const edm::EventSetup &)
Definition: RecHitTools.cc:70
HcalObjRepresent::Fill
void Fill(HcalDetId &id, double val, std::vector< TH2F > &depth)
Definition: HcalObjRepresent.h:1053
HGCalHitCalibration::hgcalMultiClusters_
edm::EDGetTokenT< std::vector< reco::PFCluster > > hgcalMultiClusters_
Definition: HGCalHitCalibration.cc:60
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
EcalDeadCellBoundaryEnergyFilter_cfi.recHitsEE
recHitsEE
Definition: EcalDeadCellBoundaryEnergyFilter_cfi.py:18
DetId::rawId
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:57
SimCluster::simEnergy
float simEnergy() const
returns the accumulated sim energy in the cluster
Definition: SimCluster.h:213
pwdgSkimBPark_cfi.electrons
electrons
Definition: pwdgSkimBPark_cfi.py:6
HcalEndcap
Definition: HcalAssistant.h:34
DetId::HGCalHSc
Definition: DetId.h:34
HGCalHitCalibration::layers_
static constexpr int layers_
Definition: HGCalHitCalibration.cc:78
HGCalHitCalibration::depletion2_
static constexpr int depletion2_
Definition: HGCalHitCalibration.cc:69
reco::PFCluster
Particle flow cluster, see clustering algorithm in PFClusterAlgo.
Definition: PFCluster.h:46
HGCalHitCalibration::caloParticles_
edm::EDGetTokenT< std::vector< CaloParticle > > caloParticles_
Definition: HGCalHitCalibration.cc:59
or
The Signals That Services Can Subscribe To This is based on ActivityRegistry and is current per Services can connect to the signals distributed by the ActivityRegistry in order to monitor the activity of the application Each possible callback has some defined which we here list in angle e< void, edm::EventID const &, edm::Timestamp const & > We also list in braces which AR_WATCH_USING_METHOD_ is used for those or
Definition: Activities.doc:12
hgcalTestNeighbor_cfi.detector
detector
Definition: hgcalTestNeighbor_cfi.py:6
SimCluster::hits_and_fractions
std::vector< std::pair< uint32_t, float > > hits_and_fractions() const
Returns list of rechit IDs and fractions for this SimCluster.
Definition: SimCluster.h:184
HGCalHitCalibration::recHitsFH_
edm::EDGetTokenT< HGCRecHitCollection > recHitsFH_
Definition: HGCalHitCalibration.cc:57
HGCHEF
Definition: ForwardSubdetector.h:9
HGCalHitCalibration::electrons_
edm::EDGetTokenT< std::vector< reco::GsfElectron > > electrons_
Definition: HGCalHitCalibration.cc:61
DetId::Forward
Definition: DetId.h:30
edm::HandleBase::isValid
bool isValid() const
Definition: HandleBase.h:70
HLT_2018_cff.fraction
fraction
Definition: HLT_2018_cff.py:51317
TauDecayModes.dec
dec
Definition: TauDecayModes.py:143
edm::InputTag
Definition: InputTag.h:15
HGCHEB
Definition: ForwardSubdetector.h:10
HGCalHitCalibration::recHitTools_
hgcal::RecHitTools recHitTools_
Definition: HGCalHitCalibration.cc:67