CMS 3D CMS Logo

List of all members | Public Member Functions | Private Member Functions | Private Attributes
CSCWireHitSim Class Reference

#include <CSCWireHitSim.h>

Public Member Functions

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

Private Member Functions

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

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 27 of file CSCWireHitSim.h.

Constructor & Destructor Documentation

◆ CSCWireHitSim()

CSCWireHitSim::CSCWireHitSim ( CSCDriftSim driftSim,
const edm::ParameterSet p 
)
explicit

Definition at line 10 of file CSCWireHitSim.cc.

◆ ~CSCWireHitSim()

CSCWireHitSim::~CSCWireHitSim ( )

Definition at line 13 of file CSCWireHitSim.cc.

13 { delete theGasIonizer; }

References theGasIonizer.

Member Function Documentation

◆ driftElectronsToWire()

CSCDetectorHit CSCWireHitSim::driftElectronsToWire ( )
private

◆ getIonizationClusters()

std::vector< LocalPoint > CSCWireHitSim::getIonizationClusters ( const PSimHit hit,
const CSCLayer layer,
CLHEP::HepRandomEngine *  engine 
)
private

Definition at line 40 of file CSCWireHitSim.cc.

42  {
43  const LocalPoint &entryPoint = simHit.entryPoint();
44  const LocalPoint &exitPoint = simHit.exitPoint();
45 
46  LogTrace("CSCWireHitSim") << "CSCWireHitSim:"
47  << " type=" << simHit.particleType() << " mom=" << simHit.pabs() << "\n Local entry "
48  << entryPoint << " exit " << exitPoint;
49 
50  std::vector<LocalPoint> positions;
51  std::vector<int> electrons;
52  theGasIonizer->simulate(simHit, positions, electrons, engine);
53 
54  std::vector<LocalPoint> results; // start empty
55 
56  int j = 0;
57  for (std::vector<LocalPoint>::const_iterator pointItr = positions.begin(); pointItr != positions.end(); ++pointItr) {
58  ++j;
59  // some verification
60  if (layer->geometry()->inside(*pointItr)) {
61  // push the point for each electron at this point
62 
63  for (int ie = 1; ie <= electrons[j - 1]; ++ie) {
64  // probability of getting attached
65  float f_att = 0.5;
66  if (CLHEP::RandFlat::shoot(engine) > f_att) {
67  results.push_back(*pointItr);
68  }
69  }
70  }
71  }
72  LogTrace("CSCWireHitSim") << "CSCWireHitSim: there are " << results.size()
73  << " clusters identified with each electron.";
74  return results;
75 }

References pwdgSkimBPark_cfi::electrons, CSCLayer::geometry(), CSCLayerGeometry::inside(), dqmiolumiharvest::j, LogTrace, bookConverter::results, rpcPointValidation_cfi::simHit, CSCGasCollisions::simulate(), and theGasIonizer.

Referenced by simulate().

◆ setParticleDataTable()

void CSCWireHitSim::setParticleDataTable ( const ParticleDataTable pdt)

◆ simulate()

std::vector< CSCDetectorHit > & CSCWireHitSim::simulate ( const CSCLayer layer,
const edm::PSimHitContainer simHits,
CLHEP::HepRandomEngine *  engine 
)

Definition at line 15 of file CSCWireHitSim.cc.

17  {
18  const CSCLayerGeometry *geom = layer->geometry();
19 
20  theNewWireHits.clear();
21  for (edm::PSimHitContainer::const_iterator hitItr = simHits.begin(); hitItr != simHits.end(); ++hitItr) {
22  std::vector<LocalPoint> ionClusters = getIonizationClusters(*hitItr, layer, engine);
23 
24  unsigned nClusters = ionClusters.size();
25  theNewWireHits.reserve(theNewWireHits.size() + nClusters);
26 
27  for (unsigned icl = 0; icl < nClusters; ++icl) {
28  // Drift the electrons in the cluster to the nearest wire...
29  int nearestWire = geom->nearestWire(ionClusters[icl]);
30 
31  // The wire hit contains wire# and position measured _along the wire_
32  // from where it intersects local y axis.
33 
34  theNewWireHits.push_back(theDriftSim->getWireHit(ionClusters[icl], layer, nearestWire, *hitItr, engine));
35  }
36  }
37  return theNewWireHits;
38 }

References relativeConstraints::geom, CSCLayer::geometry(), getIonizationClusters(), CSCDriftSim::getWireHit(), heavyionUCCDQM_cfi::nClusters, FastTrackerRecHitCombiner_cfi::simHits, theDriftSim, and theNewWireHits.

Referenced by CSCDigitizer::doAction().

Member Data Documentation

◆ theDriftSim

CSCDriftSim* CSCWireHitSim::theDriftSim
private

Definition at line 45 of file CSCWireHitSim.h.

Referenced by simulate().

◆ theGasIonizer

CSCGasCollisions* CSCWireHitSim::theGasIonizer
private

Definition at line 46 of file CSCWireHitSim.h.

Referenced by getIonizationClusters(), setParticleDataTable(), and ~CSCWireHitSim().

◆ theNewWireHits

std::vector<CSCDetectorHit> CSCWireHitSim::theNewWireHits
private

Definition at line 47 of file CSCWireHitSim.h.

Referenced by simulate().

heavyionUCCDQM_cfi.nClusters
nClusters
Definition: heavyionUCCDQM_cfi.py:9
CSCWireHitSim::getIonizationClusters
std::vector< Local3DPoint > getIonizationClusters(const PSimHit &hit, const CSCLayer *, CLHEP::HepRandomEngine *)
Definition: CSCWireHitSim.cc:40
AlCaHLTBitMon_ParallelJobs.p
p
Definition: AlCaHLTBitMon_ParallelJobs.py:153
FastTrackerRecHitCombiner_cfi.simHits
simHits
Definition: FastTrackerRecHitCombiner_cfi.py:5
bookConverter.results
results
Definition: bookConverter.py:144
CSCDriftSim::getWireHit
CSCDetectorHit getWireHit(const Local3DPoint &ionClusterPosition, const CSCLayer *, int wire, const PSimHit &simHit, CLHEP::HepRandomEngine *)
Definition: CSCDriftSim.cc:55
rpcPointValidation_cfi.simHit
simHit
Definition: rpcPointValidation_cfi.py:24
CSCLayerGeometry
Definition: CSCLayerGeometry.h:25
relativeConstraints.geom
geom
Definition: relativeConstraints.py:72
CSCLayer::geometry
const CSCLayerGeometry * geometry() const
Definition: CSCLayer.h:44
Point3DBase< float, LocalTag >
CSCLayerGeometry::inside
bool inside(const Local3DPoint &, const LocalError &, float scale=1.f) const override
Definition: CSCLayerGeometry.cc:282
CSCGasCollisions::simulate
void simulate(const PSimHit &, std::vector< LocalPoint > &clusters, std::vector< int > &electrons, CLHEP::HepRandomEngine *)
Definition: CSCGasCollisions.cc:151
CSCWireHitSim::theDriftSim
CSCDriftSim * theDriftSim
Definition: CSCWireHitSim.h:45
CSCGasCollisions::setParticleDataTable
void setParticleDataTable(const ParticleDataTable *pdt)
Definition: CSCGasCollisions.cc:149
CSCWireHitSim::theNewWireHits
std::vector< CSCDetectorHit > theNewWireHits
Definition: CSCWireHitSim.h:47
pwdgSkimBPark_cfi.electrons
electrons
Definition: pwdgSkimBPark_cfi.py:6
CSCWireHitSim::theGasIonizer
CSCGasCollisions * theGasIonizer
Definition: CSCWireHitSim.h:46
CSCGasCollisions
Definition: CSCGasCollisions.h:27
LogTrace
#define LogTrace(id)
Definition: MessageLogger.h:224
dqmiolumiharvest.j
j
Definition: dqmiolumiharvest.py:66