51 const float sqrt_12 = 3.4641;
61 int wg_left = wgroups[0];;
62 int wg_right = wgroups[wgroups.size()-1];
70 int centerWire_left = (int) (Mwire1 - Nwires1 / 2. + 0.5);
71 int centerWire_right = (int) (Mwire2 + Nwires2 / 2.);
73 float centerWire = (centerWire_left + centerWire_right) / 2.;
79 if(wHit.
deadWG()>0 || wgroups.size()>2){
81 for(
unsigned int iWG=0;iWG<wgroups.size();iWG++){
85 else if(2==wgroups.size()){
95 else if(1==wgroups.size()){
104 int nStrip = strips.size();
105 int idCenterStrip = nStrip/2;
106 int centerStrip = strips[idCenterStrip];
109 const std::vector<float>&
adc = sHit.
s_adc();
110 const std::vector<float>& adcRaw = sHit.
s_adcRaw();
112 std::vector<float> adc2;
113 std::vector<float> adc2Raw;
115 LogTrace(
"CSCRecHit") <<
"CSCMake2DRecHit: dump of adc values to be added to rechit follows...";
117 for (
int iStrip = 0; iStrip < nStrip; ++iStrip) {
121 for (
int t = 0;
t < 4; ++
t ){
122 adc2.push_back(adc[
t+iStrip*4]);
123 adc2Raw.push_back(adcRaw[
t+iStrip*4]);
128 adcMap.
put( strips[iStrip], adc2Raw.begin(), adc2Raw.end() );
130 LogTrace(
"CSCRecHit") <<
"CSCMake2DRecHit: strip = " << strips[iStrip] <<
131 " adcs= " << adc2Raw[0] <<
" " << adc2Raw[1] <<
" " << adc2Raw[2] <<
" " << adc2Raw[3];
138 for (
int t = 0;
t < 4; ++
t ) {
139 int k =
t+4*(idCenterStrip);
140 adcArray[
t] = adc[
k];
144 float t_zero = tpeak - 133.;
145 LogTrace(
"CSCRecHit|CSCMake2DRecHit") <<
"CSCMake2DRecHit: " <<
146 id <<
" strip=" << centerStrip <<
", t_zero=" << t_zero <<
", tpeak=" << tpeak;
149 float positionWithinTheStrip= -99.;
150 float sigmaWithinTheStrip = -99.;
154 float stripWidth = -99.;
156 if ( centerStrip == 1 || centerStrip ==
specs_->
nStrips() || nStrip < 2 ) {
158 positionWithinTheStrip = 0.;
160 sigmaWithinTheStrip = stripWidth / sqrt_12;
169 float xWithinChamber = lp11.
x();
175 stripWidth, tpeak, positionWithinTheStrip,
176 sigmaWithinTheStrip, quality);
185 sigmaWithinTheStrip, sigmaWire );
190 float phaseCorrection = (sHit.
stripsl1a()[0]>> (15-0) & 0x1)*25.;
194 float tofCorrection = gp0.
mag()/29.9792458;
200 tpeak = tpeak + chipCorrection + phaseCorrection + chamberCorrection-tofCorrection;
216 CSCRecHit2D rechit(
id, lp0, localerr, L1A_and_strips,
218 adcMap, BX_and_wgroups, tpeak, positionWithinTheStrip,
219 sigmaWithinTheStrip/stripWidth, quality, sHit.
deadStrip(), wHit.
deadWG(), scaledWireTime);
224 LogTrace(
"CSCRecHit") <<
"CSCMake2DRecHit: rechit created in layer " <<
id <<
"... \n" << rechit <<
"\n";
233 bool isInFiducial =
true;
240 if(!layergeom_->
inside(rhPosition)){
241 isInFiducial =
false;
260 float timeGuess=tpeak/25.+ anode_bx_offset;
263 for (
int j=0;
j<(int)timeBinsOn.size();
j++) {
264 double diff=timeGuess-timeBinsOn[
j];
266 if (fabs(diff)<fabs(diffMin)) {
269 wireBx=timeBinsOn[
j];
272 int side=diffMin/fabs(diffMin);
275 if ((bestMatch+side)>-1 && (bestMatch+side)<(
int)timeBinsOn.size()) {
276 if (timeBinsOn[bestMatch]==(timeBinsOn[bestMatch+side]-side)) {
278 wireBx=wireBx+(float)side/2.;
283 if ((bestMatch-side)>-1 && (bestMatch-side)<(
int)timeBinsOn.size() && unchanged) {
284 if (timeBinsOn[bestMatch]==(timeBinsOn[bestMatch-side]+side)) {
285 wireBx=wireBx-(double)side/2.;
289 return wireBx - anode_bx_offset;
int adc(sample_type sample)
get the ADC sample (12 bits)
T getParameter(std::string const &) const
ChannelContainer wgroups() const
The wire groups used for forming the cluster.
const ChannelContainer & stripsl1a() const
L1A.
std::vector< int > timeBinsOn() const
Vector of time bins ON for central wire digi, lower of center pair if even number.
const StripHitADCContainer & s_adcRaw() const
the raw ADC counts for each of the strip within cluster
GlobalPoint toGlobal(const Local2DPoint &lp) const
Conversion to the global R.F. from the R.F. of the GeomDet.
const StripHitADCContainer & s_adc() const
L1A.
int numberOfWiresPerGroup(int wireGroup) const
const CSCChamberSpecs * specs_
ChannelContainer wgroupsBXandWire() const
The BX + wire group number.
void setConditions(const CSCRecoConditions *reco)
Pass pointer to conditions data onwards.
LocalError localError(int strip, float sigmaStrip, float sigmaWire) const
short int deadStrip() const
is a neighbouring string a dead strip?
void setConditions(const CSCRecoConditions *reco)
Cache pointer to conditions data.
CSCXonStrip_MatchGatti * xMatchGatti_
float yOfWire(float wire, float x=0.) const
const CSCChamberSpecs * specs() const
float middleWireOfGroup(int wireGroup) const
float yResolution(int wireGroup=1) const
bool isHitInFiducial(const CSCLayer *layer, const CSCRecHit2D &rh)
Test if rechit is in fiducial volume.
void put(ID id, CI begin, CI end)
insert an object range with specified identifier
float chipCorrection(const CSCDetId &detId, int channel) const
static const double tmax[3]
int tmax() const
Strip hit maximum time bin.
float findWireBx(std::vector< int > timeBinsOn, float tpeak, const CSCDetId &id)
const CSCRecoConditions * recoConditions_
const ChannelContainer & stripsTotal() const
The strips used in cluster to produce strip hit (total content)
float anodeBXoffset(const CSCDetId &detId) const
const CSCLayerGeometry * layergeom_
const std::auto_ptr< CSCFindPeakTime > peakTimeFinder_
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.
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.
const ChannelContainer & strips() const
L1A.
LocalPoint stripWireIntersection(int strip, float wire) const
bool useTimingCorrections
bool inside(const Local3DPoint &, const LocalError &, float scale=1.f) const
LocalPoint localPosition() const
CSCMake2DRecHit(const edm::ParameterSet &)
const CSCChamber * chamber() const
const CSCLayerGeometry * geometry() const
short int deadWG() const
a dead WG in the cluster?
float chamberTimingCorrection(const CSCDetId &detId) const
std::vector< int > ChannelContainer