45 static constexpr
float inv_sqrt_12 = 0.2886751;
55 int wg_left = wgroups[0];
57 int wg_right = wgroups[wgroups.size() - 1];
65 int centerWire_left = (
int)(Mwire1 - Nwires1 / 2. + 0.5);
66 int centerWire_right = (
int)(Mwire2 + Nwires2 / 2.);
68 float centerWire = (centerWire_left + centerWire_right) / 2.;
74 if (wHit.
deadWG() > 0 || wgroups.size() > 2) {
76 for (
unsigned int iWG = 0; iWG < wgroups.size(); iWG++) {
79 }
else if (2 == wgroups.size()) {
87 }
else if (1 == wgroups.size()) {
96 int nStrip =
strips.size();
97 int idCenterStrip = nStrip / 2;
98 int centerStrip =
strips[idCenterStrip];
101 const std::vector<float>&
adc = sHit.
s_adc();
102 const std::vector<float>& adcRaw = sHit.
s_adcRaw();
104 std::vector<float> adc2;
105 std::vector<float> adc2Raw;
107 LogTrace(
"CSCMake2DRecHit") <<
"[CSCMake2DRecHit] dump of adc values to be added to rechit follows...";
109 for (
int iStrip = 0; iStrip < nStrip; ++iStrip) {
114 for (
int t = 0;
t < 4; ++
t) {
115 adc2.push_back(
adc[
t + iStrip * 4]);
116 adc2Raw.push_back(adcRaw[
t + iStrip * 4]);
119 adcMap.
put(
strips[iStrip], adc2.begin(), adc2.end());
123 LogTrace(
"CSCMake2DRecHit") <<
"[CSCMake2DRecHit] strip = " <<
strips[iStrip] <<
" adcs= " << adc2Raw[0] <<
" " 124 << adc2Raw[1] <<
" " << adc2Raw[2] <<
" " << adc2Raw[3];
130 for (
int t = 0;
t < 4; ++
t) {
131 int k =
t + 4 * (idCenterStrip);
132 adcArray[
t] =
adc[
k];
136 LogTrace(
"CSCRecHit") <<
"[CSCMake2DRecHit] " <<
id <<
" strip=" << centerStrip <<
", t_zero=" << tpeak - 133.f
137 <<
", tpeak=" << tpeak;
139 float positionWithinTheStrip = -99.;
140 float sigmaWithinTheStrip = -99.;
151 float stripWidth = -99.f;
153 if (centerStrip == 1 || centerStrip ==
specs_->
nStrips() || nStrip < 2) {
155 positionWithinTheStrip = 0.f;
157 sigmaWithinTheStrip = stripWidth * inv_sqrt_12;
162 float ymiddle = lp11.
y();
166 float xWithinChamber = lp11.
x();
177 positionWithinTheStrip,
190 float phaseCorrection = (sHit.
stripsl1a()[0] >> (15 - 0) & 0
x1) * 25.;
194 float tofCorrection = gp0.
mag() / 29.9792458;
195 float signalPropagationSpeed[11] = {0.0, -78, -76, -188, -262, -97, -99, -90, -99, -99, -113};
202 tpeak = tpeak + chipCorrection + phaseCorrection + chamberCorrection - tofCorrection + yCorrection;
212 float gasGainCorrection = -999.f;
225 float energyDeposit = -999.f;
226 if (gasGainCorrection < -998.
f) {
228 energyDeposit = -998.f;
230 }
else if (gasGainCorrection < 0.
f) {
232 energyDeposit = -997.f;
236 if (adcMap.
size() == 12) {
237 energyDeposit = adcMap[0] * gasGainCorrection + adcMap[1] * gasGainCorrection + adcMap[2] * gasGainCorrection +
238 adcMap[4] * gasGainCorrection + adcMap[5] * gasGainCorrection + adcMap[6] * gasGainCorrection +
239 adcMap[8] * gasGainCorrection + adcMap[9] * gasGainCorrection + adcMap[10] * gasGainCorrection;
241 }
else if (adcMap.
size() == 4) {
243 energyDeposit = -996.f;
263 positionWithinTheStrip,
264 sigmaWithinTheStrip / stripWidth,
274 LogTrace(
"CSCRecHit") <<
"[CSCMake2DRecHit] rechit created in layer " <<
id <<
"... \n" << rechit;
280 bool isInFiducial =
true;
288 isInFiducial =
false;
306 float timeGuess = tpeak / 25.f + anode_bx_offset;
307 float diffMin = 9999.f;
309 for (
int j = 0;
j < (
int)timeBinsOn.size();
j++) {
310 auto diff = timeGuess - timeBinsOn[
j];
315 wireBx = timeBinsOn[
j];
318 int side = diffMin > 0 ? 1 : -1;
319 bool unchanged =
true;
322 (
bestMatch + side) < (
int)timeBinsOn.size()) {
326 wireBx = wireBx + 0.5f * side;
334 wireBx = wireBx - 0.5f * side;
337 return wireBx - anode_bx_offset;
const StripHitADCContainer & s_adc() const
L1A.
T getParameter(std::string const &) const
float chamberTimingCorrection(const CSCDetId &id) const
Point3DBase< Scalar, LocalTag > LocalPoint
const ChannelContainer & strips() const
L1A.
bool useGasGainCorrections
float middleWireOfGroup(int wireGroup) const
float chipCorrection(const CSCDetId &detId, int channel) const
All other functions are accessed by geometrical strip label (i.e. strip number according to local coo...
const ChannelContainer & stripsl1a() const
L1A.
Sin< T >::type sin(const T &t)
short int deadWG() const
a dead WG in the cluster?
const CSCChamberSpecs * specs_
unsigned short iChamberType() const
float findWireBx(const std::vector< int > &timeBinsOn, float tpeak, const CSCDetId &id)
float stripAngle(int strip) const
void setConditions(const CSCRecoConditions *reco)
Pass pointer to conditions data onwards.
size_t size() const
return number of contained object
short int deadStrip() const
is a neighbouring string a dead strip?
ChannelContainer wgroupsBXandWire() const
The BX + wire group number.
const CSCLayerGeometry * geometry() const
float yResolution(int wireGroup=1) const
std::vector< int > timeBinsOn() const
Vector of time bins ON for central wire digi, lower of center pair if even number.
void setConditions(const CSCRecoConditions *reco)
Cache pointer to conditions data.
std::pair< LocalPoint, float > possibleRecHitPosition(float s, int w1, int w2) const
CSCXonStrip_MatchGatti * xMatchGatti_
const StripHitADCContainer & s_adcRaw() const
the raw ADC counts for each of the strip within cluster
ChannelContainer wgroups() const
The wire groups used for forming the cluster.
Abs< T >::type abs(const T &t)
float gasGainCorrection(const CSCDetId &id, int strip, int wireGroup) const
returns gas-gain correction
bool isHitInFiducial(const CSCLayer *layer, const CSCRecHit2D &rh)
Test if rechit is in fiducial volume.
GlobalPoint toGlobal(const Local2DPoint &lp) const
Conversion to the global R.F. from the R.F. of the GeomDet.
void put(ID id, CI begin, CI end)
insert an object range with specified identifier
LocalPoint localPosition() const override
static const double tmax[3]
const CSCRecoConditions * recoConditions_
int numberOfWiresPerGroup(int wireGroup) const
const CSCLayerGeometry * layergeom_
def bestMatch(object, matchCollection)
const ChannelContainer & stripsTotal() const
The strips used in cluster to produce strip hit (total content)
void findXOnStrip(const CSCDetId &id, const CSCLayer *layer, const CSCStripHit &stripHit, int centralStrip, float &xWithinChamber, float &stripWidth, const float &tpeak, float &xWithinStrip, float &sigma, int &quality_flag)
Returns fitted local x position and its estimated error.
float anodeBXoffset(const CSCDetId &detId) const
CSCRecHit2D hitFromStripAndWire(const CSCDetId &id, const CSCLayer *layer, const CSCWireHit &wHit, const CSCStripHit &sHit)
Make 2D hits when have both wire and strip hit available in same layer.
int tmax() const
Strip hit maximum time bin.
static int position[264][3]
bool useTimingCorrections
strips
#turn off noise in all subdetectors simHcalUnsuppressedDigis.doNoise = False mix.digitizers.hcal.doNoise = False simEcalUnsuppressedDigis.doNoise = False mix.digitizers.ecal.doNoise = False simEcalUnsuppressedDigis.doESNoise = False simSiPixelDigis.AddNoise = False mix.digitizers.pixel.AddNoise = False simSiStripDigis.Noise = False mix.digitizers.strip.AddNoise = False
const std::unique_ptr< CSCFindPeakTime > peakTimeFinder_
LocalError localError(int strip, float sigmaStrip, float sigmaWire) const
bool inside(const Local3DPoint &, const LocalError &, float scale=1.f) const override
CSCMake2DRecHit(const edm::ParameterSet &)
uint16_t *__restrict__ uint16_t const *__restrict__ adc
std::vector< int > ChannelContainer