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.

SubsystemNeutronReader(const edm::ParameterSet &pset)

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

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

Referenced by CSCDigitizer::doAction().

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 }
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:19
int chamberId(int globalDetId) const
void generateChamberNoise(int chamberType, int chamberIndex, edm::PSimHitContainer &result, CLHEP::HepRandomEngine *)
int chamberType(int globalDetId) const
std::vector< PSimHit > PSimHitContainer

◆ chamberId()

int CSCNeutronReader::chamberId ( int  globalDetId) const

Definition at line 45 of file CSCNeutronReader.cc.

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

Referenced by addHits().

45 { return CSCDetId(globalDetId).chamberId().rawId(); }
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:57
CSCDetId chamberId() const
Definition: CSCDetId.h:47

◆ chamberType()

int CSCNeutronReader::chamberType ( int  globalDetId) const

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

References localDetId().

33  {
34  // add the layer bits
35  return chamberIndex + localDetId;
36 }
int localDetId(int globalDetId) const

◆ localDetId()

int CSCNeutronReader::localDetId ( int  globalDetId) const

Definition at line 38 of file CSCNeutronReader.cc.

References CSCDetId::layer().

Referenced by detId().

38 { return CSCDetId(globalDetId).layer(); }
int layer() const
Definition: CSCDetId.h:56