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.

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  }

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

Member Function Documentation

◆ beginRun()

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

Reimplemented from SensitiveDetectorMakerBase.

Definition at line 33 of file HGCSensitiveDetectorBuilder.cc.

33  {
34  for (const auto& token : hgcToken_)
35  hgcons_.emplace_back(es.getHandle(token));
36  }

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

◆ 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.

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  }

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

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
staticconstexprprivate

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().

HGCSensitiveDetectorBuilder::name0_
const std::string name0_[nameSize_]
Definition: HGCSensitiveDetectorBuilder.cc:58
edm::ESInputTag
Definition: ESInputTag.h:87
edm::ParameterSet::getUntrackedParameter
T getUntrackedParameter(std::string const &, T const &) const
HGCalDDDConstants
Definition: HGCalDDDConstants.h:27
hgc_digi
Definition: HGCDigitizerTypes.h:10
HGCSensitiveDetectorBuilder::hgcons_
std::vector< edm::ESHandle< HGCalDDDConstants > > hgcons_
Definition: HGCSensitiveDetectorBuilder.cc:62
dqmdumpme.k
k
Definition: dqmdumpme.py:60
sistrip::SpyUtilities::isValid
const bool isValid(const Frame &aFrame, const FrameQuality &aQuality, const uint16_t aExpectedPos)
Definition: SiStripSpyUtilities.cc:124
edm::ParameterSet
Definition: ParameterSet.h:47
AlCaHLTBitMon_ParallelJobs.p
def p
Definition: AlCaHLTBitMon_ParallelJobs.py:153
SimActivityRegistryEnroller::enroll
static void enroll(SimActivityRegistry &iReg, T *iObj)
Definition: SimActivityRegistryEnroller.h:50
edm::EventSetup::getHandle
ESHandle< T > getHandle(const ESGetToken< T, R > &iToken) const
Definition: EventSetup.h:155
cc
edm::LogVerbatim
Log< level::Info, true > LogVerbatim
Definition: MessageLogger.h:128
HGCSensitiveDetectorBuilder::hgcToken_
std::vector< edm::ESGetToken< HGCalDDDConstants, IdealGeometryRecord > > hgcToken_
Definition: HGCSensitiveDetectorBuilder.cc:61
edm::Transition::BeginRun
sd
double sd
Definition: CascadeWrapper.h:113
HGCSensitiveDetectorBuilder::num_
int num_
Definition: HGCSensitiveDetectorBuilder.cc:60
HGCSensitiveDetectorBuilder::name1_
const std::string name1_[nameSize_]
Definition: HGCSensitiveDetectorBuilder.cc:59
unpackBuffers-CaloStage2.token
token
Definition: unpackBuffers-CaloStage2.py:316