CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes | Static Private Attributes
HGCSensitiveDetectorBuilder Class Reference
Inheritance diagram for HGCSensitiveDetectorBuilder:
SensitiveDetectorMakerBase

Public Member Functions

void beginRun (const edm::EventSetup &es) final
 
 HGCSensitiveDetectorBuilder (edm::ParameterSet const &p, edm::ConsumesCollector cc)
 
std::unique_ptr< SensitiveDetectormake (const std::string &iname, const SensitiveDetectorCatalog &clg, const edm::ParameterSet &p, const SimTrackManager *man, SimActivityRegistry &reg) const final
 
- Public Member Functions inherited from SensitiveDetectorMakerBase
virtual std::unique_ptr< SensitiveDetectormake (const std::string &iname, const edm::EventSetup &es, const SensitiveDetectorCatalog &clg, const edm::ParameterSet &p, const SimTrackManager *man, SimActivityRegistry &reg) const
 
const SensitiveDetectorMakerBaseoperator= (const SensitiveDetectorMakerBase &)=delete
 
 SensitiveDetectorMakerBase ()=default
 
 SensitiveDetectorMakerBase (const SensitiveDetectorMakerBase &)=delete
 
virtual ~SensitiveDetectorMakerBase ()
 

Private Attributes

std::vector< edm::ESHandle< HGCalDDDConstants > > hgcons_
 
std::vector< edm::ESGetToken< HGCalDDDConstants, IdealGeometryRecord > > hgcToken_
 
const std::string name0_ [nameSize_] = {"HGCalEESensitive", "HGCalHESiliconSensitive", "HGCalHEScintillatorSensitive"}
 
const std::string name1_ [nameSize_] = {"HitsEE", "HitsHEfront", "HitsHEback"}
 
int num_
 

Static Private Attributes

static constexpr unsigned int nameSize_ = 3
 

Detailed Description

Definition at line 22 of file HGCSensitiveDetectorBuilder.cc.

Constructor & Destructor Documentation

◆ HGCSensitiveDetectorBuilder()

HGCSensitiveDetectorBuilder::HGCSensitiveDetectorBuilder ( edm::ParameterSet const &  p,
edm::ConsumesCollector  cc 
)
inlineexplicit

Definition at line 24 of file HGCSensitiveDetectorBuilder.cc.

References edm::BeginRun, edm::ConsumesCollector::esConsumes(), edm::ParameterSet::getUntrackedParameter(), hgcToken_, dqmdumpme::k, name0_, num_, and AlCaHLTBitMon_ParallelJobs::p.

24  {
25  edm::ParameterSet m_HGC = p.getParameter<edm::ParameterSet>("HGCSD");
26  num_ = m_HGC.getUntrackedParameter<int>("Detectors");
27  for (int k = 0; k < num_; ++k) {
28  hgcToken_.emplace_back(cc.esConsumes<edm::Transition::BeginRun>(edm::ESInputTag{"", name0_[k]}));
29  edm::LogVerbatim("HGCSim") << "HGCSensitiveDetectorBuilder::Initailize Token[" << k << "] for " << name0_[k];
30  }
31  }
Log< level::Info, true > LogVerbatim
T getUntrackedParameter(std::string const &, T const &) const
const std::string name0_[nameSize_]
std::vector< edm::ESGetToken< HGCalDDDConstants, IdealGeometryRecord > > hgcToken_

Member Function Documentation

◆ beginRun()

void HGCSensitiveDetectorBuilder::beginRun ( const edm::EventSetup es)
inlinefinalvirtual

Reimplemented from SensitiveDetectorMakerBase.

Definition at line 33 of file HGCSensitiveDetectorBuilder.cc.

References hgcons_, hgcToken_, and unpackBuffers-CaloStage2::token.

33  {
34  for (const auto& token : hgcToken_)
35  hgcons_.emplace_back(es.getHandle(token));
36  }
std::vector< edm::ESGetToken< HGCalDDDConstants, IdealGeometryRecord > > hgcToken_
ESHandle< T > getHandle(const ESGetToken< T, R > &iToken) const
Definition: EventSetup.h:151
std::vector< edm::ESHandle< HGCalDDDConstants > > hgcons_

◆ make()

std::unique_ptr<SensitiveDetector> HGCSensitiveDetectorBuilder::make ( const std::string &  iname,
const SensitiveDetectorCatalog clg,
const edm::ParameterSet p,
const SimTrackManager man,
SimActivityRegistry reg 
) const
inlinefinalvirtual

Reimplemented from SensitiveDetectorMakerBase.

Definition at line 38 of file HGCSensitiveDetectorBuilder.cc.

References SimActivityRegistryEnroller::enroll(), caloTruthProducer_cfi::hgc, hgcons_, sistrip::SpyUtilities::isValid(), dqmdumpme::k, name1_, num_, and AlCaHLTBitMon_ParallelJobs::p.

42  {
43  const HGCalDDDConstants* hgc = nullptr;
44  for (int k = 0; k < num_; ++k) {
45  if (iname.find(name1_[k]) != std::string::npos) {
46  if (hgcons_[k].isValid())
47  hgc = hgcons_[k].product();
48  break;
49  }
50  }
51  auto sd = std::make_unique<HGCSD>(iname, hgc, clg, p, man);
53  return sd;
54  }
const bool isValid(const Frame &aFrame, const FrameQuality &aQuality, const uint16_t aExpectedPos)
static void enroll(SimActivityRegistry &iReg, T *iObj)
std::vector< edm::ESHandle< HGCalDDDConstants > > hgcons_
const std::string name1_[nameSize_]

Member Data Documentation

◆ hgcons_

std::vector<edm::ESHandle<HGCalDDDConstants> > HGCSensitiveDetectorBuilder::hgcons_
private

Definition at line 62 of file HGCSensitiveDetectorBuilder.cc.

Referenced by beginRun(), and make().

◆ hgcToken_

std::vector<edm::ESGetToken<HGCalDDDConstants, IdealGeometryRecord> > HGCSensitiveDetectorBuilder::hgcToken_
private

Definition at line 61 of file HGCSensitiveDetectorBuilder.cc.

Referenced by beginRun(), and HGCSensitiveDetectorBuilder().

◆ name0_

const std::string HGCSensitiveDetectorBuilder::name0_[nameSize_] = {"HGCalEESensitive", "HGCalHESiliconSensitive", "HGCalHEScintillatorSensitive"}
private

Definition at line 58 of file HGCSensitiveDetectorBuilder.cc.

Referenced by HGCSensitiveDetectorBuilder().

◆ name1_

const std::string HGCSensitiveDetectorBuilder::name1_[nameSize_] = {"HitsEE", "HitsHEfront", "HitsHEback"}
private

Definition at line 59 of file HGCSensitiveDetectorBuilder.cc.

Referenced by make().

◆ nameSize_

constexpr unsigned int HGCSensitiveDetectorBuilder::nameSize_ = 3
staticprivate

Definition at line 57 of file HGCSensitiveDetectorBuilder.cc.

◆ num_

int HGCSensitiveDetectorBuilder::num_
private

Definition at line 60 of file HGCSensitiveDetectorBuilder.cc.

Referenced by HGCSensitiveDetectorBuilder(), and make().