CMS 3D CMS Logo

List of all members | Public Member Functions
CSCNeutronReader Class Reference

#include <CSCNeutronReader.h>

Inheritance diagram for CSCNeutronReader:
SubsystemNeutronReader

Public Member Functions

void addHits (std::map< int, edm::PSimHitContainer > &hitMap, CLHEP::HepRandomEngine *)
 
int chamberId (int globalDetId) const
 
int chamberType (int globalDetId) const
 
 CSCNeutronReader (const edm::ParameterSet &pset)
 
int detId (int chamberIndex, int localDetId) override
 
int localDetId (int globalDetId) const
 
 ~CSCNeutronReader () override
 
- Public Member Functions inherited from SubsystemNeutronReader
void clear ()
 
void generateChamberNoise (int chamberType, int chamberIndex, edm::PSimHitContainer &result, CLHEP::HepRandomEngine *)
 
 SubsystemNeutronReader (const edm::ParameterSet &pset)
 
virtual ~SubsystemNeutronReader ()
 

Additional Inherited Members

Detailed Description

Definition at line 10 of file CSCNeutronReader.h.

Constructor & Destructor Documentation

◆ CSCNeutronReader()

CSCNeutronReader::CSCNeutronReader ( const edm::ParameterSet pset)
inline

Definition at line 12 of file CSCNeutronReader.h.

◆ ~CSCNeutronReader()

CSCNeutronReader::~CSCNeutronReader ( )
inlineoverride

Definition at line 13 of file CSCNeutronReader.h.

13 {}

Member Function Documentation

◆ addHits()

void CSCNeutronReader::addHits ( std::map< int, edm::PSimHitContainer > &  hitMap,
CLHEP::HepRandomEngine *  engine 
)

Definition at line 6 of file CSCNeutronReader.cc.

6  {
7  std::vector<int> chambersDone;
8 
9  std::map<int, edm::PSimHitContainer> signalHits = hitMap;
10  for (std::map<int, edm::PSimHitContainer>::const_iterator signalHitItr = signalHits.begin();
11  signalHitItr != signalHits.end();
12  ++signalHitItr) {
13  int chamberIndex = chamberId(signalHitItr->first);
14 
15  // see if this chamber has been done yet
16  if (find(chambersDone.begin(), chambersDone.end(), chamberIndex) == chambersDone.end()) {
17  edm::PSimHitContainer neutronHits;
18  generateChamberNoise(chamberType(chamberIndex), chamberIndex, neutronHits, engine);
19 
20  // add these hits to the original map
21  for (edm::PSimHitContainer::const_iterator neutronHitItr = neutronHits.begin();
22  neutronHitItr != neutronHits.end();
23  ++neutronHitItr) {
24  uint32_t layerId = neutronHitItr->detUnitId();
25  hitMap[layerId].push_back(*neutronHitItr);
26  }
27  // mark chamber as done
28  chambersDone.push_back(chamberIndex);
29  }
30  }
31 }

References chamberId(), chamberType(), spr::find(), and SubsystemNeutronReader::generateChamberNoise().

Referenced by CSCDigitizer::doAction().

◆ chamberId()

int CSCNeutronReader::chamberId ( int  globalDetId) const

Definition at line 45 of file CSCNeutronReader.cc.

45 { return CSCDetId(globalDetId).chamberId().rawId(); }

References CSCDetId::chamberId(), and DetId::rawId().

Referenced by addHits().

◆ chamberType()

int CSCNeutronReader::chamberType ( int  globalDetId) const

Definition at line 40 of file CSCNeutronReader.cc.

40  {
41  CSCDetId id(globalDetId);
43 }

References triggerObjects_cff::id, relativeConstraints::ring, relativeConstraints::station, and CSCChamberSpecs::whatChamberType().

Referenced by addHits().

◆ detId()

int CSCNeutronReader::detId ( int  chamberIndex,
int  localDetId 
)
overridevirtual

detector-specific way to get the global detector ID, given the local one.

Implements SubsystemNeutronReader.

Definition at line 33 of file CSCNeutronReader.cc.

33  {
34  // add the layer bits
35  return chamberIndex + localDetId;
36 }

References localDetId().

◆ localDetId()

int CSCNeutronReader::localDetId ( int  globalDetId) const

Definition at line 38 of file CSCNeutronReader.cc.

38 { return CSCDetId(globalDetId).layer(); }

References CSCDetId::layer().

Referenced by detId().

SubsystemNeutronReader::generateChamberNoise
void generateChamberNoise(int chamberType, int chamberIndex, edm::PSimHitContainer &result, CLHEP::HepRandomEngine *)
Definition: SubsystemNeutronReader.cc:35
relativeConstraints.station
station
Definition: relativeConstraints.py:67
spr::find
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:19
CSCNeutronReader::chamberType
int chamberType(int globalDetId) const
Definition: CSCNeutronReader.cc:40
CSCDetId::layer
int layer() const
Definition: CSCDetId.h:56
CSCDetId
Definition: CSCDetId.h:26
CSCDetId::chamberId
CSCDetId chamberId() const
Definition: CSCDetId.h:47
CSCNeutronReader::localDetId
int localDetId(int globalDetId) const
Definition: CSCNeutronReader.cc:38
CSCChamberSpecs::whatChamberType
static int whatChamberType(int istation, int iring)
Definition: CSCChamberSpecs.cc:164
DetId::rawId
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:57
triggerObjects_cff.id
id
Definition: triggerObjects_cff.py:29
relativeConstraints.ring
ring
Definition: relativeConstraints.py:68
edm::PSimHitContainer
std::vector< PSimHit > PSimHitContainer
Definition: PSimHitContainer.h:11
SubsystemNeutronReader::SubsystemNeutronReader
SubsystemNeutronReader(const edm::ParameterSet &pset)
Definition: SubsystemNeutronReader.cc:13
CSCNeutronReader::chamberId
int chamberId(int globalDetId) const
Definition: CSCNeutronReader.cc:45
muonDTDigis_cfi.pset
pset
Definition: muonDTDigis_cfi.py:27