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

◆ simulate()

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

Definition at line 10 of file CSCStripHitSim.cc.

References CSCGattiFunction::binValue(), funct::cos(), relativeConstraints::geom, CSCGattiFunction::initChamberSpecs(), phase1PixelTopology::layer, SiStripPI::max, SiStripPI::min, newStripHits, CSCChamberSpecs::nNodes(), hltrates_dqm_sourceclient-live_cfg::offset, position, funct::sin(), and theGattiFunction.

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 }
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
double binValue(double x, double stripWidth) const
std::vector< CSCDetectorHit > newStripHits
constexpr std::array< uint8_t, layerIndexSize > layer
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
int nNodes() const
static int position[264][3]
Definition: ReadPGInfo.cc:289
CSCGattiFunction theGattiFunction

Member Data Documentation

◆ newStripHits

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

Definition at line 28 of file CSCStripHitSim.h.

Referenced by simulate().

◆ theGattiFunction

CSCGattiFunction CSCStripHitSim::theGattiFunction
private

Definition at line 27 of file CSCStripHitSim.h.

Referenced by simulate().