CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Member Functions | Private Attributes
CSCWireHitSim Class Reference

#include <CSCWireHitSim.h>

Public Member Functions

 CSCWireHitSim (CSCDriftSim *driftSim)
 
void setParticleDataTable (const ParticleDataTable *pdt)
 
void setRandomEngine (CLHEP::HepRandomEngine &engine)
 
std::vector< CSCDetectorHit > & simulate (const CSCLayer *layer, const edm::PSimHitContainer &simHits)
 
 ~CSCWireHitSim ()
 

Private Member Functions

CSCDetectorHit driftElectronsToWire ()
 
std::vector< Local3DPointgetIonizationClusters (const PSimHit &hit, const CSCLayer *)
 

Private Attributes

CSCDriftSimtheDriftSim
 
CSCGasCollisionstheGasIonizer
 
std::vector< CSCDetectorHittheNewWireHits
 

Detailed Description

Class used to simulate hit on wire in Endcap Muon CSC.

Author
Rick Wilkinson
Tim Cox

Definition at line 24 of file CSCWireHitSim.h.

Constructor & Destructor Documentation

CSCWireHitSim::CSCWireHitSim ( CSCDriftSim driftSim)
explicit

Definition at line 9 of file CSCWireHitSim.cc.

10 : theDriftSim(driftSim),
13 {
14 }
CSCDriftSim * theDriftSim
Definition: CSCWireHitSim.h:45
CSCGasCollisions * theGasIonizer
Definition: CSCWireHitSim.h:46
std::vector< CSCDetectorHit > theNewWireHits
Definition: CSCWireHitSim.h:47
CSCWireHitSim::~CSCWireHitSim ( )

Definition at line 17 of file CSCWireHitSim.cc.

References theGasIonizer.

17  {
18  delete theGasIonizer;
19 }
CSCGasCollisions * theGasIonizer
Definition: CSCWireHitSim.h:46

Member Function Documentation

CSCDetectorHit CSCWireHitSim::driftElectronsToWire ( )
private
std::vector< LocalPoint > CSCWireHitSim::getIonizationClusters ( const PSimHit hit,
const CSCLayer layer 
)
private

Definition at line 57 of file CSCWireHitSim.cc.

References PSimHit::entryPoint(), PSimHit::exitPoint(), CSCLayer::geometry(), CSCLayerGeometry::inside(), j, LogTrace, PSimHit::pabs(), PSimHit::particleType(), python.entryComment::results, CSCGasCollisions::simulate(), and theGasIonizer.

Referenced by simulate().

59 {
60  const LocalPoint & entryPoint = simHit.entryPoint();
61  const LocalPoint & exitPoint = simHit.exitPoint();
62 
63  LogTrace("CSCWireHitSim") << "CSCWireHitSim:"
64  << " type=" << simHit.particleType()
65  << " mom=" << simHit.pabs()
66  << "\n Local entry " << entryPoint << " exit " << exitPoint;
67 
68  std::vector<LocalPoint> positions;
69  std::vector<int> electrons;
70  theGasIonizer->simulate( simHit, layer, positions, electrons );
71 
72  std::vector<LocalPoint> results; // start empty
73 
74  int j = 0;
75  for( std::vector<LocalPoint>::const_iterator pointItr = positions.begin();
76  pointItr != positions.end(); ++pointItr )
77  {
78  ++j;
79  // some verification
80  if(layer->geometry()->inside(*pointItr) ) {
81  // push the point for each electron at this point
82 
83  for( int ie = 1; ie <= electrons[j-1]; ++ie ) {
84  results.push_back(*pointItr);
85  }
86  }
87  }
88  LogTrace("CSCWireHitSim") << "CSCWireHitSim: there are " << results.size()
89  << " clusters identified with each electron.";
90  return results;
91 }
int j
Definition: DBlmapReader.cc:9
#define LogTrace(id)
void simulate(const PSimHit &, const CSCLayer *layer, std::vector< LocalPoint > &clusters, std::vector< int > &electrons)
CSCGasCollisions * theGasIonizer
Definition: CSCWireHitSim.h:46
bool inside(const Local3DPoint &, const LocalError &, float scale=1.f) const
const CSCLayerGeometry * geometry() const
Definition: CSCLayer.h:47
void CSCWireHitSim::setParticleDataTable ( const ParticleDataTable pdt)

Definition at line 94 of file CSCWireHitSim.cc.

References CSCGasCollisions::setParticleDataTable(), and theGasIonizer.

Referenced by CSCDigitizer::setParticleDataTable().

95 {
97 }
void setParticleDataTable(const ParticleDataTable *pdt)
CSCGasCollisions * theGasIonizer
Definition: CSCWireHitSim.h:46
void CSCWireHitSim::setRandomEngine ( CLHEP::HepRandomEngine &  engine)

Definition at line 100 of file CSCWireHitSim.cc.

References CSCGasCollisions::setRandomEngine(), CSCDriftSim::setRandomEngine(), theDriftSim, and theGasIonizer.

Referenced by CSCDigitizer::setRandomEngine().

101 {
102  theDriftSim->setRandomEngine(engine);
104 }
CSCDriftSim * theDriftSim
Definition: CSCWireHitSim.h:45
void setRandomEngine(CLHEP::HepRandomEngine &engine)
Definition: CSCDriftSim.cc:60
CSCGasCollisions * theGasIonizer
Definition: CSCWireHitSim.h:46
void setRandomEngine(CLHEP::HepRandomEngine &engine)
std::vector< CSCDetectorHit > & CSCWireHitSim::simulate ( const CSCLayer layer,
const edm::PSimHitContainer simHits 
)

Definition at line 23 of file CSCWireHitSim.cc.

References relativeConstraints::geom, CSCLayer::geometry(), getIonizationClusters(), CSCDriftSim::getWireHit(), CSCLayerGeometry::nearestWire(), theDriftSim, and theNewWireHits.

Referenced by CSCDigitizer::doAction().

25 {
26  const CSCLayerGeometry * geom = layer->geometry();
27 
28  theNewWireHits.clear();
29  for (edm::PSimHitContainer::const_iterator hitItr = simHits.begin();
30  hitItr != simHits.end(); ++hitItr)
31  {
32 
33  std::vector<LocalPoint> ionClusters
34  = getIonizationClusters(*hitItr, layer);
35 
36  unsigned nClusters = ionClusters.size();
37  theNewWireHits.reserve(theNewWireHits.size()+nClusters);
38 
39  for(unsigned icl = 0; icl < nClusters; ++icl) {
40 
41  // Drift the electrons in the cluster to the nearest wire...
42  int nearestWire=geom->nearestWire(ionClusters[icl]);
43 
44  // The wire hit contains wire# and position measured _along the wire_
45  // from where it intersects local y axis.
46 
47  theNewWireHits.push_back(
48  theDriftSim->getWireHit(ionClusters[icl], layer, nearestWire,
49  *hitItr) );
50 
51  }
52  }
53  return theNewWireHits;
54 }
int nearestWire(const LocalPoint &lp) const
std::vector< Local3DPoint > getIonizationClusters(const PSimHit &hit, const CSCLayer *)
CSCDriftSim * theDriftSim
Definition: CSCWireHitSim.h:45
tuple simHits
Definition: trackerHits.py:16
CSCDetectorHit getWireHit(const Local3DPoint &ionClusterPosition, const CSCLayer *, int wire, const PSimHit &simHit)
Definition: CSCDriftSim.cc:68
std::vector< CSCDetectorHit > theNewWireHits
Definition: CSCWireHitSim.h:47
const CSCLayerGeometry * geometry() const
Definition: CSCLayer.h:47

Member Data Documentation

CSCDriftSim* CSCWireHitSim::theDriftSim
private

Definition at line 45 of file CSCWireHitSim.h.

Referenced by setRandomEngine(), and simulate().

CSCGasCollisions* CSCWireHitSim::theGasIonizer
private
std::vector<CSCDetectorHit> CSCWireHitSim::theNewWireHits
private

Definition at line 47 of file CSCWireHitSim.h.

Referenced by simulate().