CMS 3D CMS Logo

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

Public Member Functions

void beginRun (const edm::EventSetup &es) final
 
 EcalSensitiveDetectorBuilder (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< EcalSimulationParameters > > ecpar_
 
std::vector< edm::ESGetToken< EcalSimulationParameters, IdealGeometryRecord > > ecToken_
 
const std::string name_ [nameSize_] = {"EcalHitsEB", "EcalHitsEE", "EcalHitsES"}
 
int num_
 

Static Private Attributes

static constexpr unsigned int nameSize_ = 3
 

Detailed Description

Definition at line 22 of file EcalSensitiveDetectorBuilder.cc.

Constructor & Destructor Documentation

◆ EcalSensitiveDetectorBuilder()

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

Definition at line 24 of file EcalSensitiveDetectorBuilder.cc.

24  {
25  edm::ParameterSet m_EC = p.getParameter<edm::ParameterSet>("ECalSD");
26  num_ = m_EC.getUntrackedParameter<int>("Detectors");
27  for (int k = 0; k < num_; ++k)
28  ecToken_.emplace_back(cc.esConsumes<edm::Transition::BeginRun>(edm::ESInputTag{"", name_[k]}));
29  }

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

Member Function Documentation

◆ beginRun()

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

Reimplemented from SensitiveDetectorMakerBase.

Definition at line 31 of file EcalSensitiveDetectorBuilder.cc.

31  {
32  for (const auto& token : ecToken_)
33  ecpar_.emplace_back(es.getHandle(token));
34  }

References ecpar_, ecToken_, and unpackBuffers-CaloStage2::token.

◆ make()

std::unique_ptr<SensitiveDetector> EcalSensitiveDetectorBuilder::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 36 of file EcalSensitiveDetectorBuilder.cc.

40  {
41  int k = static_cast<int>(std::find(name_, name_ + num_, iname) - name_);
42  auto const& par = ((k < num_) && ecpar_[k].isValid()) ? ecpar_[k].product() : nullptr;
43  auto sd = std::make_unique<ECalSD>(iname, par, clg, p, man);
45  return sd;
46  }

References ecpar_, SimActivityRegistryEnroller::enroll(), spr::find(), sistrip::SpyUtilities::isValid(), dqmdumpme::k, name_, num_, AlCaHLTBitMon_ParallelJobs::p, and sd.

Member Data Documentation

◆ ecpar_

std::vector<edm::ESHandle<EcalSimulationParameters> > EcalSensitiveDetectorBuilder::ecpar_
private

Definition at line 53 of file EcalSensitiveDetectorBuilder.cc.

Referenced by beginRun(), and make().

◆ ecToken_

std::vector<edm::ESGetToken<EcalSimulationParameters, IdealGeometryRecord> > EcalSensitiveDetectorBuilder::ecToken_
private

Definition at line 52 of file EcalSensitiveDetectorBuilder.cc.

Referenced by beginRun(), and EcalSensitiveDetectorBuilder().

◆ name_

const std::string EcalSensitiveDetectorBuilder::name_[nameSize_] = {"EcalHitsEB", "EcalHitsEE", "EcalHitsES"}
private

Definition at line 50 of file EcalSensitiveDetectorBuilder.cc.

Referenced by make().

◆ nameSize_

constexpr unsigned int EcalSensitiveDetectorBuilder::nameSize_ = 3
staticconstexprprivate

Definition at line 49 of file EcalSensitiveDetectorBuilder.cc.

◆ num_

int EcalSensitiveDetectorBuilder::num_
private

Definition at line 51 of file EcalSensitiveDetectorBuilder.cc.

Referenced by EcalSensitiveDetectorBuilder(), and make().

edm::ESInputTag
Definition: ESInputTag.h:87
edm::ParameterSet::getUntrackedParameter
T getUntrackedParameter(std::string const &, T const &) const
spr::find
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:19
EcalSensitiveDetectorBuilder::num_
int num_
Definition: EcalSensitiveDetectorBuilder.cc:51
EcalSensitiveDetectorBuilder::ecToken_
std::vector< edm::ESGetToken< EcalSimulationParameters, IdealGeometryRecord > > ecToken_
Definition: EcalSensitiveDetectorBuilder.cc:52
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
EcalSensitiveDetectorBuilder::ecpar_
std::vector< edm::ESHandle< EcalSimulationParameters > > ecpar_
Definition: EcalSensitiveDetectorBuilder.cc:53
edm::ParameterSet
Definition: ParameterSet.h:47
AlCaHLTBitMon_ParallelJobs.p
def p
Definition: AlCaHLTBitMon_ParallelJobs.py:153
EcalSensitiveDetectorBuilder::name_
const std::string name_[nameSize_]
Definition: EcalSensitiveDetectorBuilder.cc:50
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::Transition::BeginRun
sd
double sd
Definition: CascadeWrapper.h:113
unpackBuffers-CaloStage2.token
token
Definition: unpackBuffers-CaloStage2.py:316