CMS 3D CMS Logo

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

Public Member Functions

void beginRun (const edm::EventSetup &es) final
 
std::unique_ptr< SensitiveDetectormake (const std::string &iname, const SensitiveDetectorCatalog &clg, const edm::ParameterSet &p, const SimTrackManager *man, SimActivityRegistry &reg) const final
 
 MuonSensitiveDetectorBuilder (edm::ParameterSet const &p, edm::ConsumesCollector cc)
 
- 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 allMuonsPersistent_
 
bool dd4hep_
 
double ePersistentCutGeV_
 
const edm::ESGetToken< MuonGeometryConstants, IdealGeometryRecordgeomConstantsToken_
 
const MuonGeometryConstantsmdc_
 
const MuonOffsetMapoffmap_
 
const edm::ESGetToken< MuonOffsetMap, IdealGeometryRecordoffsetToken_
 
bool printHits_
 

Detailed Description

Definition at line 32 of file MuonSensitiveDetectorBuilder.cc.

Constructor & Destructor Documentation

◆ MuonSensitiveDetectorBuilder()

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

Definition at line 34 of file MuonSensitiveDetectorBuilder.cc.

35  : offmap_{nullptr},
36  mdc_{nullptr},
39  edm::ParameterSet muonSD = p.getParameter<edm::ParameterSet>("MuonSD");
40  ePersistentCutGeV_ = muonSD.getParameter<double>("EnergyThresholdForPersistency") / CLHEP::GeV; //Default 1. GeV
41  allMuonsPersistent_ = muonSD.getParameter<bool>("AllMuonsPersistent");
42  printHits_ = muonSD.getParameter<bool>("PrintHits");
43  dd4hep_ = p.getParameter<bool>("g4GeometryDD4hepSource");
44  }

Member Function Documentation

◆ beginRun()

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

Reimplemented from SensitiveDetectorMakerBase.

Definition at line 46 of file MuonSensitiveDetectorBuilder.cc.

46  {
48  offmap_ = (mom.isValid()) ? mom.product() : nullptr;
49  edm::LogVerbatim("MuonSim") << "Finds the offset map at " << offmap_;
51  }

References geomConstantsToken_, edm::ESHandleBase::isValid(), mdc_, offmap_, offsetToken_, and edm::ESHandle< T >::product().

◆ make()

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

57  {
58  auto sd = std::make_unique<MuonSensitiveDetector>(
61  return sd;
62  }

References allMuonsPersistent_, dd4hep_, SimActivityRegistryEnroller::enroll(), ePersistentCutGeV_, mdc_, offmap_, printHits_, and sd.

Member Data Documentation

◆ allMuonsPersistent_

bool MuonSensitiveDetectorBuilder::allMuonsPersistent_
private

Definition at line 70 of file MuonSensitiveDetectorBuilder.cc.

Referenced by make().

◆ dd4hep_

bool MuonSensitiveDetectorBuilder::dd4hep_
private

Definition at line 72 of file MuonSensitiveDetectorBuilder.cc.

Referenced by make().

◆ ePersistentCutGeV_

double MuonSensitiveDetectorBuilder::ePersistentCutGeV_
private

Definition at line 69 of file MuonSensitiveDetectorBuilder.cc.

Referenced by make().

◆ geomConstantsToken_

const edm::ESGetToken<MuonGeometryConstants, IdealGeometryRecord> MuonSensitiveDetectorBuilder::geomConstantsToken_
private

Definition at line 68 of file MuonSensitiveDetectorBuilder.cc.

Referenced by beginRun().

◆ mdc_

const MuonGeometryConstants* MuonSensitiveDetectorBuilder::mdc_
private

Definition at line 66 of file MuonSensitiveDetectorBuilder.cc.

Referenced by beginRun(), and make().

◆ offmap_

const MuonOffsetMap* MuonSensitiveDetectorBuilder::offmap_
private

Definition at line 65 of file MuonSensitiveDetectorBuilder.cc.

Referenced by beginRun(), and make().

◆ offsetToken_

const edm::ESGetToken<MuonOffsetMap, IdealGeometryRecord> MuonSensitiveDetectorBuilder::offsetToken_
private

Definition at line 67 of file MuonSensitiveDetectorBuilder.cc.

Referenced by beginRun().

◆ printHits_

bool MuonSensitiveDetectorBuilder::printHits_
private

Definition at line 71 of file MuonSensitiveDetectorBuilder.cc.

Referenced by make().

edm::ESHandle::product
T const * product() const
Definition: ESHandle.h:86
MuonSensitiveDetectorBuilder::printHits_
bool printHits_
Definition: MuonSensitiveDetectorBuilder.cc:71
MuonSensitiveDetectorBuilder::ePersistentCutGeV_
double ePersistentCutGeV_
Definition: MuonSensitiveDetectorBuilder.cc:69
MuonSensitiveDetectorBuilder::allMuonsPersistent_
bool allMuonsPersistent_
Definition: MuonSensitiveDetectorBuilder.cc:70
MuonSensitiveDetectorBuilder::offmap_
const MuonOffsetMap * offmap_
Definition: MuonSensitiveDetectorBuilder.cc:65
edm::ESHandle
Definition: DTSurvey.h:22
edm::ParameterSet
Definition: ParameterSet.h:47
AlCaHLTBitMon_ParallelJobs.p
def p
Definition: AlCaHLTBitMon_ParallelJobs.py:153
GeV
const double GeV
Definition: MathUtil.h:16
MuonSensitiveDetectorBuilder::offsetToken_
const edm::ESGetToken< MuonOffsetMap, IdealGeometryRecord > offsetToken_
Definition: MuonSensitiveDetectorBuilder.cc:67
MuonSensitiveDetectorBuilder::mdc_
const MuonGeometryConstants * mdc_
Definition: MuonSensitiveDetectorBuilder.cc:66
SimActivityRegistryEnroller::enroll
static void enroll(SimActivityRegistry &iReg, T *iObj)
Definition: SimActivityRegistryEnroller.h:50
MuonSensitiveDetectorBuilder::dd4hep_
bool dd4hep_
Definition: MuonSensitiveDetectorBuilder.cc:72
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
edm::EventSetup::getData
bool getData(T &iHolder) const
Definition: EventSetup.h:127
edm::LogVerbatim
Log< level::Info, true > LogVerbatim
Definition: MessageLogger.h:128
edm::Transition::BeginRun
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
sd
double sd
Definition: CascadeWrapper.h:113
MuonSensitiveDetectorBuilder::geomConstantsToken_
const edm::ESGetToken< MuonGeometryConstants, IdealGeometryRecord > geomConstantsToken_
Definition: MuonSensitiveDetectorBuilder.cc:68