#include <SimMuon/CSCDigitizer/src/CSCStripHitSim.h>
Public Member Functions | |
std::vector< CSCDetectorHit > & | simulate (const CSCLayer *layer, const std::vector< CSCDetectorHit > &wireHits) |
Private Attributes | |
std::vector< CSCDetectorHit > | newStripHits |
CSCGattiFunction | theGattiFunction |
Definition at line 21 of file CSCStripHitSim.h.
std::vector< CSCDetectorHit > & CSCStripHitSim::simulate | ( | const CSCLayer * | layer, | |
const std::vector< CSCDetectorHit > & | wireHits | |||
) |
Definition at line 12 of file CSCStripHitSim.cc.
References CSCGattiFunction::binValue(), CSCLayer::chamber(), funct::cos(), CSCLayer::geometry(), CSCGattiFunction::initChamberSpecs(), max, min, CSCLayerGeometry::nearestStrip(), newStripHits, CSCChamberSpecs::nNodes(), CSCLayerGeometry::numberOfStrips(), offset, funct::sin(), CSCChamber::specs(), CSCLayerGeometry::stripAngle(), CSCLayerGeometry::stripPitch(), theGattiFunction, CSCLayerGeometry::wireAngle(), CSCLayerGeometry::xOfStrip(), and CSCLayerGeometry::yOfWire().
Referenced by CSCDigitizer::doAction().
00014 { 00015 // make sure the gatti function is initialized 00016 const CSCChamberSpecs * chamberSpecs = layer->chamber()->specs(); 00017 const CSCLayerGeometry* geom = layer->geometry(); 00018 theGattiFunction.initChamberSpecs(*chamberSpecs); 00019 const int nNodes = chamberSpecs->nNodes(); 00020 00021 // for every wire hit, induce a Gatti-distributed charge on the 00022 // cathode strips 00023 newStripHits.clear(); 00024 newStripHits.reserve((2*nNodes+1)*wireHits.size()); 00025 std::vector<CSCDetectorHit>::const_iterator wireHitI; 00026 for(wireHitI = wireHits.begin(); wireHitI != wireHits.end(); ++wireHitI){ 00027 int wire = (*wireHitI).getElement(); 00028 float wireCharge = (*wireHitI).getCharge(); 00029 float wireHitTime = (*wireHitI).getTime(); 00030 // The wire hit position is _along the wire_, measured from where 00031 // the wire intersects local y axis, so convert to local x... 00032 float hitX = (*wireHitI).getPosition() * cos(geom->wireAngle()); 00033 float hitY = geom->yOfWire(wire, hitX); 00034 const LocalPoint wireHitPos(hitX, hitY); 00035 00036 int centerStrip = geom->nearestStrip(wireHitPos); 00037 int firstStrip = std::max(centerStrip - nNodes, 1); 00038 int lastStrip = std::min(centerStrip + nNodes, geom->numberOfStrips()); 00039 for(int istrip = firstStrip; istrip <= lastStrip; istrip++) { 00040 float offset = hitX - geom->xOfStrip(istrip, hitY); 00041 float stripWidth = geom->stripPitch(wireHitPos); 00042 float binValue = theGattiFunction.binValue(offset, stripWidth); 00043 // we divide by 2 because charge goes on either cathode. 00044 // if you're following the TDR, we already multiplied the 00045 // charge by 0.82 in the WireHitSim (well, DriftSim), so that explains 00046 // their f_ind=0.41. 00047 00048 // this seems to be folded in the Amp response, which peaks 00049 // around 0.14. The difference may be because the amp response 00050 // convolutes in different drift times. 00051 //float collectionFraction = 0.19; 00052 const float igain = 1./0.9; // mv/fC 00053 float stripCharge = wireCharge * binValue * igain * 0.5; 00054 float stripTime = wireHitTime; 00055 float position = hitY / sin(geom->stripAngle(istrip)); 00056 CSCDetectorHit newStripHit(istrip, stripCharge, position, stripTime, 00057 (*wireHitI).getSimHit()); 00058 newStripHits.push_back(newStripHit); 00059 } 00060 } // loop over wire hits 00061 return newStripHits; 00062 }
std::vector<CSCDetectorHit> CSCStripHitSim::newStripHits [private] |