CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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
< SensitiveDetector
make (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
< SensitiveDetector
make (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 ( edm::ParameterSet const &  p,
edm::ConsumesCollector  cc 
)
inlineexplicit

Definition at line 24 of file HGCSensitiveDetectorBuilder.cc.

References edm::BeginRun, edm::ConsumesCollector::esConsumes(), edm::ParameterSet::getParameter(), edm::ParameterSet::getUntrackedParameter(), hgcToken_, isotrackApplyRegressor::k, name0_, and num_.

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) {
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

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

Reimplemented from SensitiveDetectorMakerBase.

Definition at line 33 of file HGCSensitiveDetectorBuilder.cc.

References 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_
std::vector< edm::ESHandle< HGCalDDDConstants > > hgcons_
ESHandle< T > getHandle(const ESGetToken< T, R > &iToken) const
Definition: EventSetup.h:151
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(), sistrip::SpyUtilities::isValid(), isotrackApplyRegressor::k, AlCaHLTBitMon_ParallelJobs::p, and sd.

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_
double sd
const std::string name1_[nameSize_]

Member Data Documentation

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

Definition at line 62 of file HGCSensitiveDetectorBuilder.cc.

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

Definition at line 61 of file HGCSensitiveDetectorBuilder.cc.

Referenced by HGCSensitiveDetectorBuilder().

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

Definition at line 58 of file HGCSensitiveDetectorBuilder.cc.

Referenced by HGCSensitiveDetectorBuilder().

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

Definition at line 59 of file HGCSensitiveDetectorBuilder.cc.

constexpr unsigned int HGCSensitiveDetectorBuilder::nameSize_ = 3
staticprivate

Definition at line 57 of file HGCSensitiveDetectorBuilder.cc.

int HGCSensitiveDetectorBuilder::num_
private

Definition at line 60 of file HGCSensitiveDetectorBuilder.cc.

Referenced by HGCSensitiveDetectorBuilder().