CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
CSCStripHitSim Class Reference

#include <CSCStripHitSim.h>

Public Member Functions

std::vector< CSCDetectorHit > & simulate (const CSCLayer *layer, const std::vector< CSCDetectorHit > &wireHits)
 

Private Attributes

std::vector< CSCDetectorHitnewStripHits
 
CSCGattiFunction theGattiFunction
 

Detailed Description

Class which builds simulated strip hits from wire hits during digitization of Endcap Muon CSCs.

Author
Rick Wilkinson

Definition at line 21 of file CSCStripHitSim.h.

Member Function Documentation

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(), relativeConstraints::geom, CSCLayer::geometry(), CSCGattiFunction::initChamberSpecs(), SiStripPI::max, min(), CSCLayerGeometry::nearestStrip(), newStripHits, CSCChamberSpecs::nNodes(), CSCLayerGeometry::numberOfStrips(), PFRecoTauDiscriminationByIsolation_cfi::offset, position, funct::sin(), CSCChamber::specs(), CSCLayerGeometry::stripAngle(), CSCLayerGeometry::stripPitch(), theGattiFunction, CSCLayerGeometry::wireAngle(), CSCLayerGeometry::xOfStrip(), and CSCLayerGeometry::yOfWire().

Referenced by CSCDigitizer::doAction().

14 {
15  // make sure the gatti function is initialized
16  const CSCChamberSpecs * chamberSpecs = layer->chamber()->specs();
17  const CSCLayerGeometry* geom = layer->geometry();
18  theGattiFunction.initChamberSpecs(*chamberSpecs);
19  const int nNodes = chamberSpecs->nNodes();
20 
21  // for every wire hit, induce a Gatti-distributed charge on the
22  // cathode strips
23  newStripHits.clear();
24  newStripHits.reserve((2*nNodes+1)*wireHits.size());
25  std::vector<CSCDetectorHit>::const_iterator wireHitI;
26  for(wireHitI = wireHits.begin(); wireHitI != wireHits.end(); ++wireHitI){
27  int wire = (*wireHitI).getElement();
28  float wireCharge = (*wireHitI).getCharge();
29  float wireHitTime = (*wireHitI).getTime();
30  // The wire hit position is _along the wire_, measured from where
31  // the wire intersects local y axis, so convert to local x...
32  float hitX = (*wireHitI).getPosition() * cos(geom->wireAngle());
33  float hitY = geom->yOfWire(wire, hitX);
34  const LocalPoint wireHitPos(hitX, hitY);
35 
36  int centerStrip = geom->nearestStrip(wireHitPos);
37  int firstStrip = std::max(centerStrip - nNodes, 1);
38  int lastStrip = std::min(centerStrip + nNodes, geom->numberOfStrips());
39  for(int istrip = firstStrip; istrip <= lastStrip; istrip++) {
40  float offset = hitX - geom->xOfStrip(istrip, hitY);
41  float stripWidth = geom->stripPitch(wireHitPos);
42  float binValue = theGattiFunction.binValue(offset, stripWidth);
43  // we divide by 2 because charge goes on either cathode.
44  // if you're following the TDR, we already multiplied the
45  // charge by 0.82 in the WireHitSim (well, DriftSim), so that explains
46  // their f_ind=0.41.
47 
48  // this seems to be folded in the Amp response, which peaks
49  // around 0.14. The difference may be because the amp response
50  // convolutes in different drift times.
51  //float collectionFraction = 0.19;
52  const float igain = 1./0.9; // mv/fC
53  float stripCharge = wireCharge * binValue * igain * 0.5;
54  float stripTime = wireHitTime;
55  float position = hitY / sin(geom->stripAngle(istrip));
56  CSCDetectorHit newStripHit(istrip, stripCharge, position, stripTime,
57  (*wireHitI).getSimHit());
58  newStripHits.push_back(newStripHit);
59  }
60  } // loop over wire hits
61  return newStripHits;
62 }
double binValue(double x, double stripWidth) const
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
std::vector< CSCDetectorHit > newStripHits
int numberOfStrips() const
float stripPitch() const
float wireAngle() const
float xOfStrip(int strip, float y=0.) const
int nNodes() const
float yOfWire(float wire, float x=0.) const
const CSCChamberSpecs * specs() const
Definition: CSCChamber.h:42
void initChamberSpecs(const CSCChamberSpecs &)
Calculates k1, k2, k3, h per chamber type, if necessary.
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
T min(T a, T b)
Definition: MathUtil.h:58
int nearestStrip(const LocalPoint &lp) const
static int position[264][3]
Definition: ReadPGInfo.cc:509
float stripAngle(int strip) const
const CSCChamber * chamber() const
Definition: CSCLayer.h:52
const CSCLayerGeometry * geometry() const
Definition: CSCLayer.h:47
CSCGattiFunction theGattiFunction

Member Data Documentation

std::vector<CSCDetectorHit> CSCStripHitSim::newStripHits
private

Definition at line 29 of file CSCStripHitSim.h.

Referenced by simulate().

CSCGattiFunction CSCStripHitSim::theGattiFunction
private

Definition at line 28 of file CSCStripHitSim.h.

Referenced by simulate().