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.

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

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  }
std::vector< edm::ESGetToken< EcalSimulationParameters, IdealGeometryRecord > > ecToken_
uint32_t cc[maxCellsPerHit]
Definition: gpuFishbone.h:49
T getUntrackedParameter(std::string const &, T const &) const

Member Function Documentation

◆ beginRun()

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

Reimplemented from SensitiveDetectorMakerBase.

Definition at line 31 of file EcalSensitiveDetectorBuilder.cc.

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

31  {
32  for (const auto& token : ecToken_)
33  ecpar_.emplace_back(es.getHandle(token));
34  }
std::vector< edm::ESGetToken< EcalSimulationParameters, IdealGeometryRecord > > ecToken_
ESHandle< T > getHandle(const ESGetToken< T, R > &iToken) const
Definition: EventSetup.h:130
std::vector< edm::ESHandle< EcalSimulationParameters > > ecpar_

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

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

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  }
const bool isValid(const Frame &aFrame, const FrameQuality &aQuality, const uint16_t aExpectedPos)
const std::string name_[nameSize_]
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:19
static void enroll(SimActivityRegistry &iReg, T *iObj)
std::vector< edm::ESHandle< EcalSimulationParameters > > ecpar_

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
staticprivate

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