#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< Local3DPoint > | getIonizationClusters (const PSimHit &hit, const CSCLayer *) |
Private Attributes | |
CSCDriftSim * | theDriftSim |
CSCGasCollisions * | theGasIonizer |
std::vector< CSCDetectorHit > | theNewWireHits |
Class used to simulate hit on wire in Endcap Muon CSC.
Definition at line 24 of file CSCWireHitSim.h.
CSCWireHitSim::CSCWireHitSim | ( | CSCDriftSim * | driftSim | ) | [explicit] |
Definition at line 9 of file CSCWireHitSim.cc.
: theDriftSim(driftSim), theGasIonizer( new CSCGasCollisions() ) , theNewWireHits() { }
CSCWireHitSim::~CSCWireHitSim | ( | ) |
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().
{ const LocalPoint & entryPoint = simHit.entryPoint(); const LocalPoint & exitPoint = simHit.exitPoint(); LogTrace("CSCWireHitSim") << "CSCWireHitSim:" << " type=" << simHit.particleType() << " mom=" << simHit.pabs() << "\n Local entry " << entryPoint << " exit " << exitPoint; std::vector<LocalPoint> positions; std::vector<int> electrons; theGasIonizer->simulate( simHit, layer, positions, electrons ); std::vector<LocalPoint> results; // start empty int j = 0; for( std::vector<LocalPoint>::const_iterator pointItr = positions.begin(); pointItr != positions.end(); ++pointItr ) { ++j; // some verification if(layer->geometry()->inside(*pointItr) ) { // push the point for each electron at this point for( int ie = 1; ie <= electrons[j-1]; ++ie ) { results.push_back(*pointItr); } } } LogTrace("CSCWireHitSim") << "CSCWireHitSim: there are " << results.size() << " clusters identified with each electron."; return results; }
void CSCWireHitSim::setParticleDataTable | ( | const ParticleDataTable * | pdt | ) |
Definition at line 94 of file CSCWireHitSim.cc.
References CSCGasCollisions::setParticleDataTable(), and theGasIonizer.
Referenced by CSCDigitizer::setParticleDataTable().
{ theGasIonizer->setParticleDataTable(pdt); }
void CSCWireHitSim::setRandomEngine | ( | CLHEP::HepRandomEngine & | engine | ) |
Definition at line 100 of file CSCWireHitSim.cc.
References CSCDriftSim::setRandomEngine(), CSCGasCollisions::setRandomEngine(), theDriftSim, and theGasIonizer.
Referenced by CSCDigitizer::setRandomEngine().
{ theDriftSim->setRandomEngine(engine); theGasIonizer->setRandomEngine(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().
{ const CSCLayerGeometry * geom = layer->geometry(); theNewWireHits.clear(); for (edm::PSimHitContainer::const_iterator hitItr = simHits.begin(); hitItr != simHits.end(); ++hitItr) { std::vector<LocalPoint> ionClusters = getIonizationClusters(*hitItr, layer); unsigned nClusters = ionClusters.size(); theNewWireHits.reserve(theNewWireHits.size()+nClusters); for(unsigned icl = 0; icl < nClusters; ++icl) { // Drift the electrons in the cluster to the nearest wire... int nearestWire=geom->nearestWire(ionClusters[icl]); // The wire hit contains wire# and position measured _along the wire_ // from where it intersects local y axis. theNewWireHits.push_back( theDriftSim->getWireHit(ionClusters[icl], layer, nearestWire, *hitItr) ); } } return theNewWireHits; }
CSCDriftSim* CSCWireHitSim::theDriftSim [private] |
Definition at line 45 of file CSCWireHitSim.h.
Referenced by setRandomEngine(), and simulate().
CSCGasCollisions* CSCWireHitSim::theGasIonizer [private] |
Definition at line 46 of file CSCWireHitSim.h.
Referenced by getIonizationClusters(), setParticleDataTable(), setRandomEngine(), and ~CSCWireHitSim().
std::vector<CSCDetectorHit> CSCWireHitSim::theNewWireHits [private] |
Definition at line 47 of file CSCWireHitSim.h.
Referenced by simulate().