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 ( const edm::ParameterSet pset)
inline

Definition at line 13 of file CSCNeutronReader.h.

14  : SubsystemNeutronReader(pset) {}
SubsystemNeutronReader(const edm::ParameterSet &pset)
CSCNeutronReader::~CSCNeutronReader ( )
inlineoverride

Definition at line 15 of file CSCNeutronReader.h.

15 {}

Member Function Documentation

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

Definition at line 7 of file CSCNeutronReader.cc.

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

Referenced by CSCDigitizer::doAction().

8 {
9  std::vector<int> chambersDone;
10 
11  std::map<int, edm::PSimHitContainer> signalHits = hitMap;
12  for(std::map<int, edm::PSimHitContainer>::const_iterator signalHitItr = signalHits.begin();
13  signalHitItr != signalHits.end(); ++signalHitItr)
14  {
15  int chamberIndex = chamberId(signalHitItr->first);
16 
17  // see if this chamber has been done yet
18  if(find(chambersDone.begin(), chambersDone.end(), chamberIndex) == chambersDone.end())
19  {
20  edm::PSimHitContainer neutronHits;
21  generateChamberNoise(chamberType(chamberIndex), chamberIndex, neutronHits, engine);
22 
23  // add these hits to the original map
24  for(edm::PSimHitContainer::const_iterator neutronHitItr = neutronHits.begin();
25  neutronHitItr != neutronHits.end(); ++neutronHitItr)
26  {
27  uint32_t layerId = neutronHitItr->detUnitId();
28  hitMap[layerId].push_back(*neutronHitItr);
29  }
30  // mark chamber as done
31  chambersDone.push_back(chamberIndex);
32  }
33  }
34 }
int chamberId(int globalDetId) const
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:20
int chamberType(int globalDetId) const
void generateChamberNoise(int chamberType, int chamberIndex, edm::PSimHitContainer &result, CLHEP::HepRandomEngine *)
std::vector< PSimHit > PSimHitContainer
int CSCNeutronReader::chamberId ( int  globalDetId) const

Definition at line 57 of file CSCNeutronReader.cc.

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

Referenced by addHits().

58 {
59  return CSCDetId(globalDetId).chamberId().rawId();
60 }
uint32_t rawId() const
get the raw id
Definition: DetId.h:44
CSCDetId chamberId() const
Definition: CSCDetId.h:53
int CSCNeutronReader::chamberType ( int  globalDetId) const
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 37 of file CSCNeutronReader.cc.

References localDetId().

38 {
39  // add the layer bits
40  return chamberIndex + localDetId;
41 }
int localDetId(int globalDetId) const
int CSCNeutronReader::localDetId ( int  globalDetId) const

Definition at line 44 of file CSCNeutronReader.cc.

References CSCDetId::layer().

Referenced by detId().

45 {
46  return CSCDetId(globalDetId).layer();
47 }
int layer() const
Definition: CSCDetId.h:61