Go to the documentation of this file.00001 #include "SimMuon/CSCDigitizer/src/CSCStripHitSim.h"
00002 #include "Geometry/CSCGeometry/interface/CSCLayer.h"
00003 #include "Geometry/CSCGeometry/interface/CSCChamberSpecs.h"
00004 #include "Geometry/CSCGeometry/interface/CSCLayerGeometry.h"
00005 #include "DataFormats/GeometryVector/interface/LocalPoint.h"
00006
00007
00008
00009
00010
00011 std::vector<CSCDetectorHit> &
00012 CSCStripHitSim::simulate(const CSCLayer * layer,
00013 const std::vector<CSCDetectorHit> & wireHits)
00014 {
00015
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
00022
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
00031
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
00044
00045
00046
00047
00048
00049
00050
00051
00052 const float igain = 1./0.9;
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 }
00061 return newStripHits;
00062 }