#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 |
CLHEP::RandFlat * | theRandFlat |
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.
: theRandFlat(0), theDriftSim(driftSim), theGasIonizer( new CSCGasCollisions() ) , theNewWireHits() { }
CSCWireHitSim::~CSCWireHitSim | ( | ) |
Definition at line 18 of file CSCWireHitSim.cc.
References theGasIonizer, and theRandFlat.
{ delete theRandFlat; delete theGasIonizer; }
CSCDetectorHit CSCWireHitSim::driftElectronsToWire | ( | ) | [private] |
std::vector< LocalPoint > CSCWireHitSim::getIonizationClusters | ( | const PSimHit & | hit, |
const CSCLayer * | layer | ||
) | [private] |
Definition at line 59 of file CSCWireHitSim.cc.
References HI_PhotonSkim_cff::electrons, PSimHit::entryPoint(), PSimHit::exitPoint(), CSCLayer::geometry(), CSCLayerGeometry::inside(), j, LogTrace, PSimHit::pabs(), PSimHit::particleType(), python::entryComment::results, CSCGasCollisions::simulate(), theGasIonizer, and theRandFlat.
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, 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 ) { // probability of getting attached float f_att = 0.5; if(theRandFlat->fire() > f_att) { 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 100 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 106 of file CSCWireHitSim.cc.
References CSCDriftSim::setRandomEngine(), CSCGasCollisions::setRandomEngine(), theDriftSim, theGasIonizer, and theRandFlat.
Referenced by CSCDigitizer::setRandomEngine().
{ theRandFlat = new CLHEP::RandFlat(engine); theDriftSim->setRandomEngine(engine); theGasIonizer->setRandomEngine(engine); }
std::vector< CSCDetectorHit > & CSCWireHitSim::simulate | ( | const CSCLayer * | layer, |
const edm::PSimHitContainer & | simHits | ||
) |
Definition at line 25 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 46 of file CSCWireHitSim.h.
Referenced by setRandomEngine(), and simulate().
CSCGasCollisions* CSCWireHitSim::theGasIonizer [private] |
Definition at line 47 of file CSCWireHitSim.h.
Referenced by getIonizationClusters(), setParticleDataTable(), setRandomEngine(), and ~CSCWireHitSim().
std::vector<CSCDetectorHit> CSCWireHitSim::theNewWireHits [private] |
Definition at line 48 of file CSCWireHitSim.h.
Referenced by simulate().
CLHEP::RandFlat* CSCWireHitSim::theRandFlat [private] |
Definition at line 45 of file CSCWireHitSim.h.
Referenced by getIonizationClusters(), setRandomEngine(), and ~CSCWireHitSim().