8 #include "CLHEP/Random/RandFlat.h"
11 : theDriftSim(driftSim),
23 std::vector<CSCDetectorHit> &
26 CLHEP::HepRandomEngine* engine)
31 for (edm::PSimHitContainer::const_iterator hitItr = simHits.begin();
32 hitItr != simHits.end(); ++hitItr)
35 std::vector<LocalPoint> ionClusters
38 unsigned nClusters = ionClusters.size();
41 for(
unsigned icl = 0; icl < nClusters; ++icl) {
44 int nearestWire=geom->
nearestWire(ionClusters[icl]);
58 std::vector<LocalPoint>
61 CLHEP::HepRandomEngine* engine)
66 LogTrace(
"CSCWireHitSim") <<
"CSCWireHitSim:"
68 <<
" mom=" << simHit.
pabs()
69 <<
"\n Local entry " << entryPoint <<
" exit " << exitPoint;
71 std::vector<LocalPoint> positions;
75 std::vector<LocalPoint>
results;
78 for( std::vector<LocalPoint>::const_iterator pointItr = positions.begin();
79 pointItr != positions.end(); ++pointItr )
86 for(
int ie = 1; ie <= electrons[j-1]; ++ie ) {
89 if(CLHEP::RandFlat::shoot(engine) > f_att) {
90 results.push_back(*pointItr);
95 LogTrace(
"CSCWireHitSim") <<
"CSCWireHitSim: there are " << results.size()
96 <<
" clusters identified with each electron.";
int nearestWire(const LocalPoint &lp) const
CSCWireHitSim(CSCDriftSim *driftSim, const edm::ParameterSet &p)
HepPDT::ParticleDataTable ParticleDataTable
std::vector< CSCDetectorHit > & simulate(const CSCLayer *layer, const edm::PSimHitContainer &simHits, CLHEP::HepRandomEngine *)
CSCDetectorHit getWireHit(const Local3DPoint &ionClusterPosition, const CSCLayer *, int wire, const PSimHit &simHit, CLHEP::HepRandomEngine *)
CSCDriftSim * theDriftSim
Local3DPoint exitPoint() const
Exit point in the local Det frame.
float pabs() const
fast and more accurate access to momentumAtEntry().mag()
void setParticleDataTable(const ParticleDataTable *pdt)
std::vector< Local3DPoint > getIonizationClusters(const PSimHit &hit, const CSCLayer *, CLHEP::HepRandomEngine *)
CSCGasCollisions * theGasIonizer
bool inside(const Local3DPoint &, const LocalError &, float scale=1.f) const
std::vector< PSimHit > PSimHitContainer
std::vector< CSCDetectorHit > theNewWireHits
void simulate(const PSimHit &, std::vector< LocalPoint > &clusters, std::vector< int > &electrons, CLHEP::HepRandomEngine *)
Local3DPoint entryPoint() const
Entry point in the local Det frame.
void setParticleDataTable(const ParticleDataTable *pdt)
const CSCLayerGeometry * geometry() const