Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2023-03-17 11:26:32

0001 #ifndef TrackAssociator_HcalDetIdAssociator_h
0002 #define TrackAssociator_HcalDetIdAssociator_h 1
0003 // -*- C++ -*-
0004 //
0005 // Package:    TrackAssociator
0006 // Class:      HcalDetIdAssociator
0007 //
0008 /*
0009 
0010  Description: <one line class summary>
0011 
0012  Implementation:
0013      <Notes on implementation>
0014 */
0015 //
0016 // Original Author:  Dmytro Kovalskyi
0017 //         Created:  Fri Apr 21 10:59:41 PDT 2006
0018 //
0019 //
0020 
0021 #include "CaloDetIdAssociator.h"
0022 #include "DataFormats/HcalDetId/interface/HcalSubdetector.h"
0023 class HcalDetIdAssociator : public CaloDetIdAssociator {
0024 public:
0025   HcalDetIdAssociator() : CaloDetIdAssociator(72, 70, 0.087, nullptr){};
0026 
0027   HcalDetIdAssociator(int hcalReg, int nPhi, int nEta, double etaBinSize, CaloGeometry const* geom)
0028       : CaloDetIdAssociator(nPhi, nEta, etaBinSize, geom), hcalReg_{hcalReg} {}
0029 
0030   const char* name() const override { return "HCAL"; }
0031 
0032 protected:
0033   int hcalReg_;
0034   const unsigned int getNumberOfSubdetectors() const override { return hcalReg_; }
0035   void getValidDetIds(unsigned int subDetectorIndex, std::vector<DetId>& validIds) const override {
0036     if (subDetectorIndex == 0)
0037       validIds = geometry_->getValidDetIds(DetId::Hcal, HcalBarrel);  //HB
0038     else
0039       validIds = geometry_->getValidDetIds(DetId::Hcal, HcalEndcap);  //HE
0040   };
0041 };
0042 #endif