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

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

Referenced by simulate().

CSCGattiFunction CSCStripHitSim::theGattiFunction
private

Definition at line 27 of file CSCStripHitSim.h.

Referenced by simulate().