CMS 3D CMS Logo

Public Member Functions | Private Member Functions | Private Attributes

CSCWireHitSim Class Reference

#include <CSCWireHitSim.h>

List of all members.

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.

CSCWireHitSim::~CSCWireHitSim ( )

Definition at line 17 of file CSCWireHitSim.cc.

References theGasIonizer.

                              {
  delete theGasIonizer;
}

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().

{
  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)
void CSCWireHitSim::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().

{
  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;
}

Member Data Documentation

Definition at line 45 of file CSCWireHitSim.h.

Referenced by setRandomEngine(), and simulate().

Definition at line 47 of file CSCWireHitSim.h.

Referenced by simulate().