CMS 3D CMS Logo

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

Public Member Functions

void beginRun (const edm::EventSetup &es) final
 
 HGCalSensitiveDetectorBuilder (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

bool doEE_
 
bool doHE_
 
edm::ESHandle< HGCalDDDConstantshgcalEE_
 
edm::ESHandle< HGCalDDDConstantshgcalHE_
 
const edm::ESGetToken< HGCalDDDConstants, IdealGeometryRecordhgcEEToken_
 
const edm::ESGetToken< HGCalDDDConstants, IdealGeometryRecordhgcHEToken_
 

Detailed Description

Definition at line 22 of file HGCalSensitiveDetectorBuilder.cc.

Constructor & Destructor Documentation

◆ HGCalSensitiveDetectorBuilder()

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

Definition at line 24 of file HGCalSensitiveDetectorBuilder.cc.

25  : hgcEEToken_{cc.esConsumes<edm::Transition::BeginRun>(edm::ESInputTag{"", "HGCalEESensitive"})},
26  hgcHEToken_{cc.esConsumes<edm::Transition::BeginRun>(edm::ESInputTag{"", "HGCalHESiliconSensitive"})} {
27  edm::ParameterSet m_HGC = p.getParameter<edm::ParameterSet>("HGCSD");
28  int num = m_HGC.getUntrackedParameter<int>("UseDetector");
29  doEE_ = ((num % 2) == 1);
30  doHE_ = (((num / 2) % 2) == 1);
31  }

References edm::BeginRun.

Member Function Documentation

◆ beginRun()

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

Reimplemented from SensitiveDetectorMakerBase.

Definition at line 33 of file HGCalSensitiveDetectorBuilder.cc.

33  {
34  if (doEE_)
36  if (doHE_)
38  }

References doEE_, doHE_, hgcalEE_, hgcalHE_, hgcEEToken_, and hgcHEToken_.

◆ make()

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

44  {
45  auto hgc =
46  (((iname.find("HitsEE") != std::string::npos) && doEE_ && hgcalEE_.isValid())
47  ? hgcalEE_.product()
48  : (((iname.find("HitsHEfront") != std::string::npos) && doHE_ && hgcalHE_.isValid()) ? hgcalHE_.product()
49  : nullptr));
50  auto sd = std::make_unique<HGCalSD>(iname, hgc, clg, p, man);
52  return sd;
53  }

References doEE_, doHE_, SimActivityRegistryEnroller::enroll(), hgcalEE_, hgcalHE_, edm::ESHandleBase::isValid(), AlCaHLTBitMon_ParallelJobs::p, edm::ESHandle< T >::product(), and sd.

Member Data Documentation

◆ doEE_

bool HGCalSensitiveDetectorBuilder::doEE_
private

Definition at line 58 of file HGCalSensitiveDetectorBuilder.cc.

Referenced by beginRun(), and make().

◆ doHE_

bool HGCalSensitiveDetectorBuilder::doHE_
private

Definition at line 58 of file HGCalSensitiveDetectorBuilder.cc.

Referenced by beginRun(), and make().

◆ hgcalEE_

edm::ESHandle<HGCalDDDConstants> HGCalSensitiveDetectorBuilder::hgcalEE_
private

Definition at line 59 of file HGCalSensitiveDetectorBuilder.cc.

Referenced by beginRun(), and make().

◆ hgcalHE_

edm::ESHandle<HGCalDDDConstants> HGCalSensitiveDetectorBuilder::hgcalHE_
private

Definition at line 59 of file HGCalSensitiveDetectorBuilder.cc.

Referenced by beginRun(), and make().

◆ hgcEEToken_

const edm::ESGetToken<HGCalDDDConstants, IdealGeometryRecord> HGCalSensitiveDetectorBuilder::hgcEEToken_
private

Definition at line 56 of file HGCalSensitiveDetectorBuilder.cc.

Referenced by beginRun().

◆ hgcHEToken_

const edm::ESGetToken<HGCalDDDConstants, IdealGeometryRecord> HGCalSensitiveDetectorBuilder::hgcHEToken_
private

Definition at line 57 of file HGCalSensitiveDetectorBuilder.cc.

Referenced by beginRun().

HGCalSensitiveDetectorBuilder::hgcHEToken_
const edm::ESGetToken< HGCalDDDConstants, IdealGeometryRecord > hgcHEToken_
Definition: HGCalSensitiveDetectorBuilder.cc:57
edm::ESHandle::product
T const * product() const
Definition: ESHandle.h:86
HGCalSensitiveDetectorBuilder::hgcEEToken_
const edm::ESGetToken< HGCalDDDConstants, IdealGeometryRecord > hgcEEToken_
Definition: HGCalSensitiveDetectorBuilder.cc:56
edm::ESInputTag
Definition: ESInputTag.h:87
HGCalSensitiveDetectorBuilder::doEE_
bool doEE_
Definition: HGCalSensitiveDetectorBuilder.cc:58
edm::ParameterSet::getUntrackedParameter
T getUntrackedParameter(std::string const &, T const &) const
hgc_digi
Definition: HGCDigitizerTypes.h:10
edm::ParameterSet
Definition: ParameterSet.h:47
AlCaHLTBitMon_ParallelJobs.p
def p
Definition: AlCaHLTBitMon_ParallelJobs.py:153
HGCalSensitiveDetectorBuilder::hgcalEE_
edm::ESHandle< HGCalDDDConstants > hgcalEE_
Definition: HGCalSensitiveDetectorBuilder.cc:59
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::ESHandleBase::isValid
bool isValid() const
Definition: ESHandle.h:44
EgammaValidation_cff.num
num
Definition: EgammaValidation_cff.py:33
edm::Transition::BeginRun
HGCalSensitiveDetectorBuilder::doHE_
bool doHE_
Definition: HGCalSensitiveDetectorBuilder.cc:58
HGCalSensitiveDetectorBuilder::hgcalHE_
edm::ESHandle< HGCalDDDConstants > hgcalHE_
Definition: HGCalSensitiveDetectorBuilder.cc:59
sd
double sd
Definition: CascadeWrapper.h:113