CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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)
 
int chamberId (int globalDetId) const
 
int chamberType (int globalDetId) const
 
 CSCNeutronReader (const edm::ParameterSet &pset)
 
virtual int detId (int chamberIndex, int localDetId)
 
int localDetId (int globalDetId) const
 
virtual ~CSCNeutronReader ()
 
- Public Member Functions inherited from SubsystemNeutronReader
void clear ()
 
void generateChamberNoise (int chamberType, int chamberIndex, edm::PSimHitContainer &result)
 
void setRandomEngine (CLHEP::HepRandomEngine &engine)
 
 SubsystemNeutronReader (const edm::ParameterSet &pset)
 
virtual ~SubsystemNeutronReader ()
 

Additional Inherited Members

Detailed Description

Definition at line 6 of file CSCNeutronReader.h.

Constructor & Destructor Documentation

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

Definition at line 9 of file CSCNeutronReader.h.

10  : SubsystemNeutronReader(pset) {}
SubsystemNeutronReader(const edm::ParameterSet &pset)
virtual CSCNeutronReader::~CSCNeutronReader ( )
inlinevirtual

Definition at line 11 of file CSCNeutronReader.h.

11 {}

Member Function Documentation

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

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);
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:7
int chamberType(int globalDetId) const
std::vector< PSimHit > PSimHitContainer
void generateChamberNoise(int chamberType, int chamberIndex, edm::PSimHitContainer &result)
int CSCNeutronReader::chamberId ( int  globalDetId) const

Definition at line 57 of file CSCNeutronReader.cc.

References CSCDetId.

Referenced by addHits().

58 {
59  return CSCDetId(globalDetId).chamberId().rawId();
60 }
int CSCNeutronReader::chamberType ( int  globalDetId) const

Definition at line 50 of file CSCNeutronReader.cc.

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

Referenced by addHits().

51 {
52  CSCDetId id(globalDetId);
54 }
static int whatChamberType(int istation, int iring)
int CSCNeutronReader::detId ( int  chamberIndex,
int  localDetId 
)
virtual

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.

Referenced by detId().

45 {
46  return CSCDetId(globalDetId).layer();
47 }