CMS 3D CMS Logo

HcalHBHEMuonSimAnalyzer.cc
Go to the documentation of this file.
1 #include <memory>
2 #include <iostream>
3 #include <vector>
4 
5 #include <TTree.h>
6 
7 // user include files
16 
25 
29 
40 
41 #define EDM_ML_DEBUG
42 
43 class HcalHBHEMuonSimAnalyzer : public edm::one::EDAnalyzer<edm::one::WatchRuns,edm::one::SharedResources> {
44 
45 public:
47  ~HcalHBHEMuonSimAnalyzer() override;
48 
49  static void fillDescriptions(edm::ConfigurationDescriptions& descriptions);
50 
51 private:
52  void beginJob() override;
53  void analyze(edm::Event const&, edm::EventSetup const&) override;
54  void beginRun(edm::Run const&, edm::EventSetup const&) override;
55  void endRun(edm::Run const&, edm::EventSetup const&) override {}
58  void clearVectors();
59  unsigned int matchId(const HcalDetId&, const HcalDetId&);
60  double activeLength(const DetId&);
61 
65  double etaMax_;
66  std::vector<HcalDDDRecConstants::HcalActiveLength> actHB_, actHE_;
67 
74 
75  static const int depthMax_=7;
76  const int idMuon_=13;
77  TTree *tree_;
79  std::vector<double> ptGlob_, etaGlob_, phiGlob_, pMuon_;
80  std::vector<double> ecal3x3Energy_, hcal1x1Energy_;
81  std::vector<unsigned int> ecalDetId_, hcalDetId_, hcalHot_;
82  std::vector<double> matchedId_;
83  std::vector<double> hcalDepthEnergy_[depthMax_];
84  std::vector<double> hcalDepthActiveLength_[depthMax_];
85  std::vector<double> hcalDepthEnergyHot_[depthMax_];
86  std::vector<double> hcalDepthActiveLengthHot_[depthMax_];
88 };
89 
91 
92  usesResource(TFileService::kSharedResource);
93 
94  //now do what ever initialization is needed
95  g4Label_ = iConfig.getParameter<std::string>("ModuleLabel");
96  ebLabel_ = iConfig.getParameter<std::string>("EBCollection");
97  eeLabel_ = iConfig.getParameter<std::string>("EECollection");
98  hcLabel_ = iConfig.getParameter<std::string>("HCCollection");
99  verbosity_ = iConfig.getUntrackedParameter<int>("Verbosity",0);
100  maxDepth_ = iConfig.getUntrackedParameter<int>("MaxDepth",4);
101  etaMax_ = iConfig.getUntrackedParameter<double>("EtaMax", 3.0);
102  tMinE_ = iConfig.getUntrackedParameter<double>("TimeMinCutECAL", -500.);
103  tMaxE_ = iConfig.getUntrackedParameter<double>("TimeMaxCutECAL", 500.);
104  tMinH_ = iConfig.getUntrackedParameter<double>("TimeMinCutHCAL", -500.);
105  tMaxH_ = iConfig.getUntrackedParameter<double>("TimeMaxCutHCAL", 500.);
106 
107  tok_SimTk_ = consumes<edm::SimTrackContainer>(edm::InputTag(g4Label_));
108  tok_SimVtx_ = consumes<edm::SimVertexContainer>(edm::InputTag(g4Label_));
109  tok_caloEB_ = consumes<edm::PCaloHitContainer>(edm::InputTag(g4Label_,ebLabel_));
110  tok_caloEE_ = consumes<edm::PCaloHitContainer>(edm::InputTag(g4Label_,eeLabel_));
111  tok_caloHH_ = consumes<edm::PCaloHitContainer>(edm::InputTag(g4Label_,hcLabel_));
112  if (maxDepth_ > depthMax_) maxDepth_ = depthMax_;
113  else if (maxDepth_ < 1) maxDepth_ = 4;
114 #ifdef EDM_ML_DEBUG
115  std::cout << "Labels: " << g4Label_ << ":" << ebLabel_ << ":" << eeLabel_
116  << ":" << hcLabel_ << "\nVerbosity " << verbosity_ << " MaxDepth "
117  << maxDepth_ << " Maximum Eta " << etaMax_ << " tMin|tMax "
118  << tMinE_ << ":" << tMaxE_ << ":" << tMinH_ << ":" << tMaxH_
119  << std::endl;
120 #endif
121 }
122 
124 
126  const edm::EventSetup& iSetup) {
127 
128  clearVectors();
129  bool debug(false);
130 #ifdef EDM_ML_DEBUG
131  debug = ((verbosity_/10)>0);
132 #endif
133 
135  iSetup.get<HcalRecNumberingRecord>().get(pHRNDC);
136  const HcalDDDRecConstants* hcons = &(*pHRNDC);
137 
138  runNumber_ = iEvent.id().run();
139  eventNumber_ = iEvent.id().event();
140  lumiNumber_ = iEvent.id().luminosityBlock();
141  bxNumber_ = iEvent.bunchCrossing();
142 
143  //get Handles to SimTracks and SimHits
145  iEvent.getByToken(tok_SimTk_,SimTk);
146  edm::SimTrackContainer::const_iterator simTrkItr;
148  iEvent.getByToken(tok_SimVtx_,SimVtx);
149 
150  //get Handles to PCaloHitContainers of eb/ee/hbhe
152  iEvent.getByToken(tok_caloEB_, pcaloeb);
154  iEvent.getByToken(tok_caloEE_, pcaloee);
156  iEvent.getByToken(tok_caloHH_, pcalohh);
157  std::vector<PCaloHit> calohh;
158  bool testN(false);
159  for (unsigned int k=1; k<pcalohh->size(); ++k) {
160  // if it is a standard DetId bits 28..31 will carry the det #
161  // for HCAL det # is 4 and if there is at least one hit in the collection
162  // have det # which is not 4 this collection is created using TestNumbering
163  int det = ((((*pcalohh)[k].id())>>28)&0xF);
164  if (det != 4) {testN = true; break;}
165  }
166  if (testN) {
167  for (edm::PCaloHitContainer::const_iterator itr=pcalohh->begin(); itr != pcalohh->end(); ++itr) {
168  PCaloHit hit(*itr);
169  DetId newid = HcalHitRelabeller::relabel(hit.id(),hcons);
170 #ifdef EDM_ML_DEBUG
171  std::cout << "Old ID " << std::hex << hit.id() << std::dec << " New "
172  << HcalDetId(newid) << std::endl;
173 #endif
174  hit.setID(newid.rawId());
175  calohh.push_back(hit);
176  }
177  } else {
178  calohh.insert(calohh.end(),pcalohh->begin(),pcalohh->end());
179  }
180 
181  // get handles to calogeometry and calotopology
183  iSetup.get<CaloGeometryRecord>().get(pG);
184  const CaloGeometry* geo = pG.product();
185 
187  iSetup.get<IdealMagneticFieldRecord>().get(bFieldH);
188  const MagneticField* bField = bFieldH.product();
189 
190  edm::ESHandle<CaloTopology> theCaloTopology;
191  iSetup.get<CaloTopologyRecord>().get(theCaloTopology);
192  const CaloTopology *caloTopology = theCaloTopology.product();
193 
195  iSetup.get<HcalRecNumberingRecord>().get(htopo);
196  const HcalTopology* theHBHETopology = htopo.product();
197 
198  // Loop over all SimTracks
199  for (edm::SimTrackContainer::const_iterator simTrkItr=SimTk->begin();
200  simTrkItr!= SimTk->end(); simTrkItr++) {
201  if ((std::abs(simTrkItr->type()) == idMuon_) && (simTrkItr->vertIndex() == 0) &&
202  (std::abs(simTrkItr->momentum().eta()) < etaMax_)) {
203  unsigned int thisTrk = simTrkItr->trackId();
204  spr::propagatedTrackDirection trkD = spr::propagateCALO(thisTrk, SimTk, SimVtx, geo, bField, debug);
205 
206  double eEcal(0), eHcal(0), activeLengthTot(0), activeLengthHotTot(0);
207  double eHcalDepth[depthMax_], eHcalDepthHot[depthMax_];
208  double activeL[depthMax_], activeHotL[depthMax_];
209  unsigned int isHot(0);
210  bool tmpmatch(false);
211  for (int i=0; i<depthMax_; ++i)
212  eHcalDepth[i] = eHcalDepthHot[i] = activeL[i] = activeHotL[i] = -10000;
213 
214 #ifdef EDM_ML_DEBUG
215  if ((verbosity_%10) > 0)
216  std::cout << "Track Type " << simTrkItr->type() << " Vertex "
217  << simTrkItr->vertIndex() << " Charge " << simTrkItr->charge()
218  << " Momentum " << simTrkItr->momentum().P() << ":"
219  << simTrkItr->momentum().eta() << ":"
220  << simTrkItr->momentum().phi() << " ECAL|HCAL " << trkD.okECAL
221  << ":" << trkD.okHCAL << " Point " << trkD.pointECAL << ":"
222  << trkD.pointHCAL << " Direction " << trkD.directionECAL.eta()
223  << ":" << trkD.directionECAL.phi() << " | "
224  << trkD.directionHCAL.eta() << ":" << trkD.directionHCAL.phi()
225  << std::endl;
226 #endif
227  bool propageback(false);
228  spr::propagatedTrackDirection trkD_back = spr::propagateHCALBack(thisTrk, SimTk, SimVtx, geo, bField, debug);
229  HcalDetId closestCell_back;
230  if(trkD_back.okHCAL) {
231  closestCell_back = (HcalDetId) (trkD_back.detIdHCAL);
232  propageback = true;
233  }
234  if (trkD.okHCAL) {
235  // Muon properties
236  spr::trackAtOrigin tkvx = spr::simTrackAtOrigin(thisTrk, SimTk, SimVtx, debug);
237  ptGlob_.push_back(tkvx.momentum.perp());
238  etaGlob_.push_back(tkvx.momentum.eta());
239  phiGlob_.push_back(tkvx.momentum.phi());
240  pMuon_.push_back(tkvx.momentum.mag());
241 #ifdef EDM_ML_DEBUG
242  if ((verbosity_%10) > 0)
243  std::cout << "Track at vertex " << tkvx.ok << " position "
244  << tkvx.position << " Momentum " << tkvx.momentum.mag()
245  << ":" << tkvx.momentum.eta() << ":"
246  << tkvx.momentum.phi() << " Charge " << tkvx.charge
247  << std::endl;
248 #endif
249 
250 
251  // Energy in ECAL
252  DetId isoCell;
253  if (trkD.okECAL) {
254  isoCell = trkD.detIdECAL;
255  eEcal = spr::eECALmatrix(isoCell, pcaloeb, pcaloee, geo, caloTopology, 1, 1, -100.0, -100.0, tMinE_, tMaxE_, debug);
256  }
257 
258  // Energy in Hcal
259  const DetId closestCell(trkD.detIdHCAL);
260  if ((propageback) &&
261  (HcalDetId(closestCell).ieta()==HcalDetId(closestCell_back).ieta()) &&
262  (HcalDetId(closestCell).iphi() == HcalDetId(closestCell_back).iphi()))
263  tmpmatch= true;
264 
265  eHcal = spr::eHCALmatrix(theHBHETopology, closestCell, calohh,0,0, false, -100.0, -100.0, -100.0, -100.0, tMinH_, tMaxH_, debug);
266 #ifdef EDM_ML_DEBUG
267  if ((verbosity_%10) > 0)
268  std::cout << "eEcal " << trkD.okECAL << ":" << eEcal << " eHcal "
269  << eHcal << std::endl;
270 #endif
271 
272  HcalSubdetector subdet = HcalDetId(closestCell).subdet();
273  int ieta = HcalDetId(closestCell).ieta();
274  int iphi = HcalDetId(closestCell).iphi();
275  int zside = HcalDetId(closestCell).zside();
276  bool hbhe = (std::abs(ieta) == 16);
277  int depthHE= hcons->getMinDepth(1,16,iphi,zside);
278  std::vector<std::pair<double,int> > ehdepth;
279  spr::energyHCALCell((HcalDetId)closestCell, calohh, ehdepth, maxDepth_, -100.0, -100.0, -100.0, -100.0, -500.0, 500.0, depthHE, debug);
280  for (unsigned int i=0; i<ehdepth.size(); ++i) {
281  eHcalDepth[ehdepth[i].second-1] = ehdepth[i].first;
282  HcalSubdetector subdet0 = (hbhe) ? ((ehdepth[i].second >= depthHE) ? HcalEndcap : HcalBarrel) : subdet;
283  HcalDetId hcid0(subdet0,ieta,iphi,ehdepth[i].second);
284  double actL = activeLength(DetId(hcid0));
285  activeL[ehdepth[i].second-1] = actL;
286  activeLengthTot += actL;
287 #ifdef EDM_ML_DEBUG
288  if ((verbosity_%10) > 0)
289  std::cout << hcid0 << " E " << ehdepth[i].first << " L " << actL
290  << std::endl;
291 #endif
292  }
293 
294  HcalDetId hotCell;
295 #ifdef EDM_ML_DEBUG
296  double h3x3 =
297 #endif
298  spr::eHCALmatrix(geo,theHBHETopology, closestCell, calohh, 1,1, hotCell, debug);
299  isHot = matchId(closestCell,hotCell);
300 #ifdef EDM_ML_DEBUG
301  if ((verbosity_%10) > 0)
302  std::cout << "hcal 3X3 < " << h3x3 << ">" << " ClosestCell <"
303  << (HcalDetId)(closestCell) << "> hotCell id < " << hotCell
304  << "> isHot" << isHot << std::endl;
305 #endif
306 
307  if (hotCell != HcalDetId()) {
308  subdet = HcalDetId(hotCell).subdet();
309  ieta = HcalDetId(hotCell).ieta();
310  iphi = HcalDetId(hotCell).iphi();
311  zside = HcalDetId(hotCell).zside();
312  hbhe = (std::abs(ieta) == 16);
313  depthHE= hcons->getMinDepth(1,16,iphi,zside);
314  std::vector<std::pair<double,int> > ehdepth;
315  spr::energyHCALCell(hotCell, calohh, ehdepth, maxDepth_, -100.0, -100.0, -100.0, -100.0, tMinH_, tMaxH_, depthHE, debug);
316  for (unsigned int i=0; i<ehdepth.size(); ++i) {
317  eHcalDepthHot[ehdepth[i].second-1] = ehdepth[i].first;
318  HcalSubdetector subdet0 = (hbhe) ? ((ehdepth[i].second >= depthHE) ? HcalEndcap : HcalBarrel) : subdet;
319  HcalDetId hcid0(subdet0,ieta,iphi,ehdepth[i].second);
320  double actL = activeLength(DetId(hcid0));
321  activeHotL[ehdepth[i].second-1] = actL;
322  activeLengthHotTot += actL;
323 #ifdef EDM_ML_DEBUG
324  if ((verbosity_%10) > 0)
325  std::cout << hcid0 << " E " << ehdepth[i].first << " L "
326  << actL << std::endl;
327 #endif
328  }
329  }
330 #ifdef EDM_ML_DEBUG
331  if ((verbosity_%10) > 0) {
332  for (int k=0; k<depthMax_; ++k)
333  std::cout << "Depth " << k << " E " << eHcalDepth[k] << ":"
334  << eHcalDepthHot[k] << std::endl;
335  }
336 #endif
337  matchedId_.push_back(tmpmatch);
338  ecal3x3Energy_.push_back(eEcal);
339  ecalDetId_.push_back(isoCell.rawId());
340  hcal1x1Energy_.push_back(eHcal);
341  hcalDetId_.push_back(closestCell.rawId());
342  for (int k=0; k<depthMax_; ++k) {
343  hcalDepthEnergy_[k].push_back(eHcalDepth[k]);
344  hcalDepthActiveLength_[k].push_back(activeL[k]);
345  hcalDepthEnergyHot_[k].push_back(eHcalDepthHot[k]);
346  hcalDepthActiveLengthHot_[k].push_back(activeHotL[k]);
347  }
348  hcalHot_.push_back(isHot);
349  hcalActiveLengthHot_.push_back(activeLengthHotTot);
350  }
351  }
352  }
353  if (!hcalHot_.empty()) tree_->Fill();
354 }
355 
357 
358  tree_ = fs_->make<TTree>("TREE", "TREE");
359  tree_->Branch("Run_No", &runNumber_);
360  tree_->Branch("Event_No", &eventNumber_);
361  tree_->Branch("LumiNumber", &lumiNumber_);
362  tree_->Branch("BXNumber", &bxNumber_);
363  tree_->Branch("pt_of_muon", &ptGlob_);
364  tree_->Branch("eta_of_muon", &etaGlob_);
365  tree_->Branch("phi_of_muon", &phiGlob_);
366  tree_->Branch("p_of_muon", &pMuon_);
367  tree_->Branch("matchedId", &matchedId_);
368 
369  tree_->Branch("ecal_3x3", &ecal3x3Energy_);
370  tree_->Branch("ecal_detID", &ecalDetId_);
371  tree_->Branch("hcal_1x1", &hcal1x1Energy_);
372  tree_->Branch("hcal_detID", &hcalDetId_);
373  tree_->Branch("hcal_cellHot", &hcalHot_);
374  tree_->Branch("activeLength", &hcalActiveLength_);
375  tree_->Branch("activeLengthHot", &hcalActiveLengthHot_);
376  char name[100];
377  for (int k=0; k<maxDepth_; ++k) {
378  sprintf (name, "hcal_edepth%d", (k+1));
379  tree_->Branch(name, &hcalDepthEnergy_[k]);
380  sprintf (name, "hcal_activeL%d", (k+1));
381  tree_->Branch(name, &hcalDepthActiveLength_[k]);
382  sprintf (name, "hcal_edepthHot%d", (k+1));
383  tree_->Branch(name, &hcalDepthEnergyHot_[k]);
384  sprintf (name, "hcal_activeHotL%d", (k+1));
385  tree_->Branch(name, &hcalDepthActiveLength_[k]);
386  }
387 }
388 
390  edm::EventSetup const& iSetup) {
391 
393  iSetup.get<HcalRecNumberingRecord>().get(pHRNDC);
394  const HcalDDDRecConstants & hdc = (*pHRNDC);
395  actHB_.clear();
396  actHE_.clear();
397  actHB_ = hdc.getThickActive(0);
398  actHE_ = hdc.getThickActive(1);
399 }
400 
401 
403 
405  desc.add<std::string>("ModuleLabel","g4SimHits");
406  desc.add<std::string>("EBCollection","EcalHitsEB");
407  desc.add<std::string>("EECollection","EcalHitsEE");
408  desc.add<std::string>("HCCollection","HcalHits");
409  desc.addUntracked<int>("Verbosity",0);
410  desc.addUntracked<int>("MaxDepth",4);
411  desc.addUntracked<double>("EtaMax",3.0);
412  desc.addUntracked<double>("TimeMinCutECAL",-500.);
413  desc.addUntracked<double>("TimeMaxCutECAL",500.);
414  desc.addUntracked<double>("TimeMinCutHCAL",-500.);
415  desc.addUntracked<double>("TimeMaxCutHCAL",500.);
416  descriptions.add("hcalHBHEMuonSim",desc);
417 }
418 
420 
422  runNumber_ = -99999;
423  eventNumber_ = -99999;
424  lumiNumber_ = -99999;
425  bxNumber_ = -99999;
426 
427  ptGlob_.clear();
428  etaGlob_.clear();
429  phiGlob_.clear();
430  pMuon_.clear();
431  matchedId_.clear();
432  ecal3x3Energy_.clear();
433  ecalDetId_.clear();
434  hcal1x1Energy_.clear();
435  hcalDetId_.clear();
436  hcalHot_.clear();
437  hcalActiveLength_.clear();
438  hcalActiveLengthHot_.clear();
439  for (int k=0; k<depthMax_; ++k) {
440  hcalDepthEnergy_[k].clear();
441  hcalDepthActiveLength_[k].clear();
442  hcalDepthEnergyHot_[k].clear();
443  hcalDepthActiveLengthHot_[k].clear();
444  }
445 }
446 
448  const HcalDetId& id2) {
449 
450  HcalDetId kd1(id1.subdet(),id1.ieta(),id1.iphi(),1);
451  HcalDetId kd2(id2.subdet(),id2.ieta(),id2.iphi(),1);
452  unsigned int match = ((kd1 == kd2) ? 1 : 0);
453  return match;
454 }
455 
457  HcalDetId id(id_);
458  int ieta = id.ietaAbs();
459  int depth= id.depth();
460  double lx(0);
461  if (id.subdet() == HcalBarrel) {
462  for (unsigned int i=0; i<actHB_.size(); ++i) {
463  if (ieta == actHB_[i].ieta && depth == actHB_[i].depth) {
464  lx = actHB_[i].thick;
465  break;
466  }
467  }
468  } else {
469  for (unsigned int i=0; i<actHE_.size(); ++i) {
470  if (ieta == actHE_[i].ieta && depth == actHE_[i].depth) {
471  lx = actHE_[i].thick;
472  break;
473  }
474  }
475  }
476  return lx;
477 }
478 
479 //define this as a plug-in
RunNumber_t run() const
Definition: EventID.h:39
static const std::string kSharedResource
Definition: TFileService.h:76
std::vector< double > hcalDepthActiveLengthHot_[depthMax_]
T getParameter(std::string const &) const
EventNumber_t event() const
Definition: EventID.h:41
T getUntrackedParameter(std::string const &, T const &) const
edm::EDGetTokenT< edm::PCaloHitContainer > tok_caloEE_
std::vector< spr::propagatedTrackID > propagateCALO(edm::Handle< reco::TrackCollection > &trkCollection, const CaloGeometry *geo, const MagneticField *bField, const std::string &theTrackQuality, bool debug=false)
std::vector< double > ecal3x3Energy_
T perp() const
Definition: PV3DBase.h:72
HcalSubdetector subdet() const
get the subdetector
Definition: HcalDetId.h:49
ParameterDescriptionBase * addUntracked(U const &iLabel, T const &value)
std::vector< double > hcalDepthEnergyHot_[depthMax_]
std::vector< unsigned int > hcalDetId_
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:519
int zside() const
get the z-side of the cell (1/-1)
Definition: HcalDetId.cc:93
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:17
std::vector< double > hcal1x1Energy_
Geom::Phi< T > phi() const
Definition: PV3DBase.h:69
int bunchCrossing() const
Definition: EventBase.h:66
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
edm::EDGetTokenT< edm::SimVertexContainer > tok_SimVtx_
T * make(const Args &...args) const
make new ROOT object
Definition: TFileService.h:64
spr::trackAtOrigin simTrackAtOrigin(unsigned int thisTrk, edm::Handle< edm::SimTrackContainer > &SimTk, edm::Handle< edm::SimVertexContainer > &SimVtx, bool debug=false)
std::vector< double > ptGlob_
int zside(DetId const &)
LuminosityBlockNumber_t luminosityBlock() const
Definition: EventID.h:40
edm::Service< TFileService > fs_
virtual void beginLuminosityBlock(edm::LuminosityBlock const &, edm::EventSetup const &)
std::vector< double > matchedId_
std::vector< double > hcalActiveLengthHot_
double activeLength(const DetId &)
uint32_t rawId() const
get the raw id
Definition: DetId.h:44
U second(std::pair< T, U > const &p)
int iEvent
Definition: GenABIO.cc:230
T mag() const
Definition: PV3DBase.h:67
edm::EDGetTokenT< edm::SimTrackContainer > tok_SimTk_
spr::propagatedTrackDirection propagateHCALBack(unsigned int thisTrk, edm::Handle< edm::SimTrackContainer > &SimTk, edm::Handle< edm::SimVertexContainer > &SimVtx, const CaloGeometry *geo, const MagneticField *bField, bool debug=false)
int getMinDepth(const int &itype, const int &ieta, const int &iphi, const int &zside) const
std::vector< double > hcalActiveLength_
int ieta() const
get the cell ieta
Definition: HcalDetId.h:56
std::vector< double > hcalDepthEnergy_[depthMax_]
HcalSubdetector
Definition: HcalAssistant.h:31
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
unsigned int id() const
Definition: PCaloHit.h:43
ParameterDescriptionBase * add(U const &iLabel, T const &value)
void endRun(edm::Run const &, edm::EventSetup const &) override
std::vector< double > phiGlob_
std::vector< HcalDDDRecConstants::HcalActiveLength > actHE_
int k[5][pyjets_maxn]
void beginRun(edm::Run const &, edm::EventSetup const &) override
edm::EDGetTokenT< edm::PCaloHitContainer > tok_caloHH_
int iphi() const
get the cell iphi
Definition: HcalDetId.cc:103
Definition: DetId.h:18
#define debug
Definition: HDRShower.cc:19
edm::EDGetTokenT< edm::PCaloHitContainer > tok_caloEB_
const T & get() const
Definition: EventSetup.h:59
std::vector< double > etaGlob_
void add(std::string const &label, ParameterSetDescription const &psetDescription)
virtual void endLuminosityBlock(edm::LuminosityBlock const &, edm::EventSetup const &)
std::vector< HcalDDDRecConstants::HcalActiveLength > actHB_
std::vector< double > pMuon_
T eta() const
Definition: PV3DBase.h:76
edm::EventID id() const
Definition: EventBase.h:60
void setID(unsigned int id)
Definition: PCaloHit.h:42
unsigned int matchId(const HcalDetId &, const HcalDetId &)
HcalHBHEMuonSimAnalyzer(const edm::ParameterSet &)
std::vector< HcalActiveLength > getThickActive(const int &type) const
std::pair< typename Association::data_type::first_type, double > match(Reference key, Association association, bool bestMatchByMaxValue)
Generic matching function.
Definition: Utils.h:10
DetId relabel(const uint32_t testId) const
T const * product() const
Definition: ESHandle.h:86
void analyze(edm::Event const &, edm::EventSetup const &) override
std::vector< unsigned int > hcalHot_
void energyHCALCell(HcalDetId detId, edm::Handle< T > &hits, std::vector< std::pair< double, int > > &energyCell, int maxDepth=1, double hbThr=-100, double heThr=-100, double hfThr=-100, double hoThr=-100, double tMin=-500, double tMax=500, int useRaw=0, int depthHE=3, bool debug=false)
Definition: Run.h:43
std::vector< unsigned int > ecalDetId_
std::vector< double > hcalDepthActiveLength_[depthMax_]
double eECALmatrix(const DetId &detId, edm::Handle< T > &hitsEB, edm::Handle< T > &hitsEE, const CaloGeometry *geo, const CaloTopology *caloTopology, int ieta, int iphi, double ebThr=-100, double eeThr=-100, double tMin=-500, double tMax=500, bool debug=false)
double eHCALmatrix(const HcalTopology *topology, const DetId &det, edm::Handle< T > &hits, int ieta, int iphi, bool includeHO=false, bool algoNew=true, double hbThr=-100, double heThr=-100, double hfThr=-100, double hoThr=-100, double tMin=-500, double tMax=500, int useRaw=0, bool debug=false)