CMS 3D CMS Logo

List of all members | Public Member Functions | Private Member Functions | Private Attributes
DTSegmentUpdator Class Reference

#include <DTSegmentUpdator.h>

Public Member Functions

void calculateT0corr (DTRecSegment2D *seg) const
 
void calculateT0corr (DTRecSegment4D *seg) const
 
 DTSegmentUpdator (const edm::ParameterSet &config)
 Constructor. More...
 
bool fit (DTSegmentCand *seg, bool allow3par, const bool fitdebug) const
 
void fit (DTRecSegment2D *seg, bool allow3par, bool block3par) const
 
void fit (DTRecSegment4D *seg, bool allow3par) const
 
void setES (const edm::EventSetup &setup)
 set the setup More...
 
void update (DTRecSegment4D *seg, const bool calcT0, bool allow3par) const
 recompute hits position and refit the segment4D More...
 
void update (DTRecSegment2D *seg, bool allow3par) const
 recompute hits position and refit the segment2D More...
 
 ~DTSegmentUpdator ()
 Destructor. More...
 

Private Member Functions

void fit (const std::vector< float > &x, const std::vector< float > &y, const std::vector< int > &lfit, const std::vector< double > &dist, const std::vector< float > &sigy, LocalPoint &pos, LocalVector &dir, float &cminf, float &vminf, AlgebraicSymMatrix &covMat, double &chi2, const bool allow3par=false, const bool block3par=false) const
 interface to LinearFit More...
 
void rejectBadHits (DTChamberRecSegment2D *) const
 
void updateHits (DTRecSegment2D *seg, GlobalPoint &gpos, GlobalVector &gdir, const int step=2) const
 

Private Attributes

bool debug
 
double intime_cut
 
bool perform_delta_rejecting
 
double T0_hit_resolution
 
std::unique_ptr< DTRecHitBaseAlgotheAlgo
 
std::unique_ptr< DTLinearFittheFitter
 
edm::ESHandle< DTGeometrytheGeom
 
bool vdrift_4parfit
 

Detailed Description

Perform linear fit and hits update for DT segments. Update a segment by improving the hits thanks to the refined knowledge of impact angle and position (also along the wire) and perform linear fit on improved hits.

Author
Stefano Lacaprara - INFN Legnaro stefa.nosp@m.no.l.nosp@m.acapr.nosp@m.ara@.nosp@m.pd.in.nosp@m.fn.i.nosp@m.t
Riccardo Bellan - INFN TO ricca.nosp@m.rdo..nosp@m.bella.nosp@m.n@ce.nosp@m.rn.ch
M.Meneghelli - INFN BO marco.nosp@m..men.nosp@m.eghel.nosp@m.li@c.nosp@m.ern.c.nosp@m.h

Definition at line 40 of file DTSegmentUpdator.h.

Constructor & Destructor Documentation

DTSegmentUpdator::DTSegmentUpdator ( const edm::ParameterSet config)

Constructor.

Definition at line 47 of file DTSegmentUpdator.cc.

References gather_cfg::cout, debug, reco::get(), intime_cut, perform_delta_rejecting, T0_hit_resolution, theAlgo, vdrift_4parfit, and ~DTSegmentUpdator().

47  :
48  theFitter{std::make_unique<DTLinearFit>()},
49  theAlgo{DTRecHitAlgoFactory::get()->create(config.getParameter<string>("recAlgo"),
50  config.getParameter<ParameterSet>("recAlgoConfig"))},
51  vdrift_4parfit(config.getParameter<bool>("performT0_vdriftSegCorrection")),
52  T0_hit_resolution(config.getParameter<double>("hit_afterT0_resolution")),
53  perform_delta_rejecting(config.getParameter<bool>("perform_delta_rejecting")),
54  debug(config.getUntrackedParameter<bool>("debug",false))
55 {
56  intime_cut=20.;
57  if (config.exists("intime_cut"))
58  intime_cut = config.getParameter<double>("intime_cut");
59 
60  if(debug)
61  cout << "[DTSegmentUpdator] Constructor called" << endl;
62 }
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
bool exists(std::string const &parameterName) const
checks if a parameter exists
std::unique_ptr< DTRecHitBaseAlgo > theAlgo
std::unique_ptr< DTLinearFit > theFitter
T get(const Candidate &c)
Definition: component.h:55
DTSegmentUpdator::~DTSegmentUpdator ( )
default

Destructor.

Referenced by DTSegmentUpdator().

Member Function Documentation

void DTSegmentUpdator::calculateT0corr ( DTRecSegment2D seg) const

Definition at line 622 of file DTSegmentUpdator.cc.

References a, b, gather_cfg::cout, debug, SoftLeptonByDistance_cfi::distance, TrackingRecHit::geographicalId(), hfClusterShapes_cfi::hits, DTGeometry::idToDet(), DTGeometry::layer(), DTEnums::Left, DTRecSegment2D::setT0(), DTRecSegment2D::setVdrift(), DTRecSegment2D::specificRecHits(), DTLayer::specificTopology(), theFitter, theGeom, vdrift_4parfit, DTTopology::wirePosition(), x, PV3DBase< T, PVType, FrameType >::x(), hit::x, y, and PV3DBase< T, PVType, FrameType >::z().

Referenced by calculateT0corr(), DTMeantimerPatternReco4D::reconstruct(), DTCombinatorialPatternReco4D::reconstruct(), and update().

622  {
623  // WARNING: since this method is called both with a 2D and a 2DPhi as argument
624  // seg->geographicalId() can be a superLayerId or a chamberId
625  if(debug) cout << "[DTSegmentUpdator] CalculateT0corr DTRecSegment4D" << endl;
626 
627  vector<double> d_drift;
628  vector<float> x;
629  vector<float> y;
630  vector<int> lc;
631 
632  vector<DTRecHit1D> hits=seg->specificRecHits();
633 
634  DTWireId wireId;
635  int nptfit = 0;
636 
637  for (vector<DTRecHit1D>::const_iterator hit=hits.begin();
638  hit!=hits.end(); ++hit) {
639 
640  // I have to get the hits position (the hit is in the layer rf) in SL frame...
641  GlobalPoint glbPos = ( theGeom->layer( hit->wireId().layerId() ) )->toGlobal(hit->localPosition());
642  LocalPoint pos = ( theGeom->idToDet(seg->geographicalId()) )->toLocal(glbPos);
643 
644  const DTLayer* layer = theGeom->layer( hit->wireId().layerId() );
645  float xwire = layer->specificTopology().wirePosition(hit->wireId().wire());
646  float distance = fabs(hit->localPosition().x() - xwire);
647 
648  int ilc = ( hit->lrSide() == DTEnums::Left ) ? 1 : -1;
649 
650  nptfit++;
651  x.push_back(pos.z());
652  y.push_back(pos.x());
653  lc.push_back(ilc);
654  d_drift.push_back(distance);
655 
656  // cout << " d_drift "<<distance <<" npt= " <<npt<<endl;
657  }
658 
659  double chi2fit = 0.;
660  float cminf = 0.;
661  float vminf = 0.;
662  float a,b;
663 
664  if ( nptfit > 2 ) {
665  //NB chi2fit is normalized
666  theFitter->fit4Var(x,y,lc,d_drift,nptfit,a,b,cminf,vminf,chi2fit,vdrift_4parfit,debug);
667 
668  double t0cor = -999.;
669  if(cminf > -998.) t0cor = - cminf/0.00543 ; // in ns
670 
671  //cout << "In calculateT0corr: t0 = " << t0cor << endl;
672  //cout << "In calculateT0corr: vminf = " << vminf << endl;
673  //cout << "In calculateT0corr: cminf = " << cminf << endl;
674  //cout << "In calculateT0corr: chi2 = " << chi2fit << endl;
675 
676  seg->setT0(t0cor); // time and
677  seg->setVdrift(vminf); // vdrift correction are recorded in the segment
678  }
679 }
float wirePosition(int wireNumber) const
Returns the x position in the layer of a given wire number.
Definition: DTTopology.cc:86
edm::ESHandle< DTGeometry > theGeom
const DTTopology & specificTopology() const
Definition: DTLayer.cc:42
T z() const
Definition: PV3DBase.h:64
std::unique_ptr< DTLinearFit > theFitter
std::vector< DTRecHit1D > specificRecHits() const
Access to specific components.
double b
Definition: hdecay.h:120
void setT0(const double &t0)
double a
Definition: hdecay.h:121
const GeomDet * idToDet(DetId) const override
Definition: DTGeometry.cc:93
void setVdrift(const double &vdrift)
const DTLayer * layer(const DTLayerId &id) const
Return a layer given its id.
Definition: DTGeometry.cc:127
DetId geographicalId() const
T x() const
Definition: PV3DBase.h:62
void DTSegmentUpdator::calculateT0corr ( DTRecSegment4D seg) const

Definition at line 617 of file DTSegmentUpdator.cc.

References calculateT0corr(), DTRecSegment4D::hasPhi(), DTRecSegment4D::hasZed(), DTRecSegment4D::phiSegment(), and DTRecSegment4D::zSegment().

617  {
618  if(seg->hasPhi()) calculateT0corr(seg->phiSegment());
619  if(seg->hasZed()) calculateT0corr(seg->zSegment());
620 }
void calculateT0corr(DTRecSegment2D *seg) const
const DTChamberRecSegment2D * phiSegment() const
The superPhi segment: 0 if no phi projection available.
bool hasPhi() const
Does it have the Phi projection?
bool hasZed() const
Does it have the Z projection?
const DTSLRecSegment2D * zSegment() const
The Z segment: 0 if not zed projection available.
bool DTSegmentUpdator::fit ( DTSegmentCand seg,
bool  allow3par,
const bool  fitdebug 
) const

do the linear fit on the hits of the segment candidate and update it. Returns false if the segment candidate is not good()

Definition at line 212 of file DTSegmentUpdator.cc.

References vertices_cff::chi2, gather_cfg::cout, debug, dir, SoftLeptonByDistance_cfi::distance, DTSegmentCand::hits(), mps_fire::i, DTEnums::Left, DTEnums::Right, DTSegmentCand::setChi2(), DTSegmentCand::setCovMatrix(), DTSegmentCand::setDirection(), DTSegmentCand::setPosition(), DTSegmentCand::sett0(), mathSSE::sqrt(), x, PV3DBase< T, PVType, FrameType >::x(), y, and PV3DBase< T, PVType, FrameType >::z().

Referenced by DTCombinatorialPatternReco::buildPointsCollection(), DTCombinatorialExtendedPatternReco::buildPointsCollection(), DTCombinatorialExtendedPatternReco::extendCandidates(), fit(), DTMeantimerPatternReco::fitWithT0(), trackingPlots.Iteration::modules(), DTRefitAndCombineReco4D::refitSuperSegments(), and update().

212  {
213 
214 // if (debug && fitdebug) cout << "[DTSegmentUpdator] Fit DTRecSegment2D" << endl;
215 // if (!seg->good()) return false;
216 
217 // DTSuperLayerId DTid = (DTSuperLayerId)seg->superLayer()->id();
218 // if (DTid.superlayer()==2)
219 // allow3par = 0;
220 
221  vector<float> x;
222  vector<float> y;
223  vector<float> sigy;
224  vector <int> lfit;
225  vector <double> dist;
226  int i=0;
227 
228  x.reserve(8);
229  y.reserve(8);
230  sigy.reserve(8);
231  lfit.reserve(8);
232  dist.reserve(8);
233 
234  for (DTSegmentCand::AssPointCont::const_iterator iter=seg->hits().begin(); iter!=seg->hits().end(); ++iter) {
235  LocalPoint pos = (*iter).first->localPosition((*iter).second);
236  float xwire = (((*iter).first)->localPosition(DTEnums::Left).x() + ((*iter).first)->localPosition(DTEnums::Right).x()) /2.;
237  float distance = pos.x() - xwire;
238 
239  if ((*iter).second==DTEnums::Left) lfit.push_back(1);
240  else lfit.push_back(-1);
241 
242  dist.push_back(distance);
243  sigy.push_back(sqrt((*iter).first->localPositionError().xx()));
244  x.push_back(pos.z());
245  y.push_back(pos.x());
246  i++;
247  }
248 
249  LocalPoint pos;
251  AlgebraicSymMatrix covMat(2);
252  float cminf =0.;
253  float vminf =0.;
254  double chi2 = 0.;
255  double t0_corr = 0.;
256 
257  fit(x,y,lfit,dist,sigy,pos,dir,cminf,vminf,covMat,chi2,allow3par);
258  if (cminf!=0) t0_corr=-cminf/0.00543; // convert drift distance to time
259 
260  if (debug && fitdebug)
261  cout << " DTcand chi2: " << chi2 << "/" << x.size() << " t0: " << t0_corr << endl;
262 
263  seg->setPosition(pos);
264  seg->setDirection(dir);
265  seg->sett0(t0_corr);
266  seg->setCovMatrix(covMat);
267  seg->setChi2(chi2);
268 
269  // cout << "pos " << pos << endl;
270  // cout << "dir " << dir << endl;
271  // cout << "Mat " << covMat << endl;
272 
273  return true;
274 }
virtual const AssPointCont & hits() const
the used hits
virtual void setChi2(double &chi2)
set chi2
T sqrt(T t)
Definition: SSEVec.h:18
T z() const
Definition: PV3DBase.h:64
virtual void setCovMatrix(AlgebraicSymMatrix &cov)
set the cov matrix
virtual void sett0(double &t0)
set t0
virtual void setDirection(LocalVector &dir)
set direction
Definition: DTSegmentCand.h:96
CLHEP::HepSymMatrix AlgebraicSymMatrix
dbl *** dir
Definition: mlp_gen.cc:35
virtual void setPosition(LocalPoint &pos)
set position
Definition: DTSegmentCand.h:93
T x() const
Definition: PV3DBase.h:62
bool fit(DTSegmentCand *seg, bool allow3par, const bool fitdebug) const
void DTSegmentUpdator::fit ( DTRecSegment2D seg,
bool  allow3par,
bool  block3par 
) const

ditto for true segment: since the fit is applied on a true segment, by definition the segment is "good", while it's not the case for just candidates

Definition at line 276 of file DTSegmentUpdator.cc.

References vertices_cff::chi2, gather_cfg::cout, debug, dir, SoftLeptonByDistance_cfi::distance, fit(), TrackingRecHit::geographicalId(), hfClusterShapes_cfi::hits, DTGeometry::idToDet(), DTGeometry::layer(), DTEnums::Left, DTRecSegment2D::setChi2(), DTRecSegment2D::setCovMatrix(), DTRecSegment2D::setDirection(), DTRecSegment2D::setPosition(), DTRecSegment2D::setT0(), DTRecSegment2D::specificRecHits(), DTLayer::specificTopology(), mathSSE::sqrt(), theGeom, ErrorFrameTransformer::transform(), DTTopology::wirePosition(), x, PV3DBase< T, PVType, FrameType >::x(), hit::x, LocalError::xx(), y, and PV3DBase< T, PVType, FrameType >::z().

Referenced by trackingPlots.Iteration::modules().

276  {
277 
278  if(debug) cout << "[DTSegmentUpdator] Fit DTRecSegment2D - 3par: " << allow3par << endl;
279 
280  vector<float> x;
281  vector<float> y;
282  vector<float> sigy;
283  vector <int> lfit;
284  vector <double> dist;
285  x.reserve(8);
286  y.reserve(8);
287  sigy.reserve(8);
288  lfit.reserve(8);
289  dist.reserve(8);
290 
291 // DTSuperLayerId DTid = (DTSuperLayerId)seg->geographicalId();
292 // if (DTid.superlayer()==2)
293 // allow3par = 0;
294 
295  vector<DTRecHit1D> hits=seg->specificRecHits();
296  for (vector<DTRecHit1D>::const_iterator hit=hits.begin();
297  hit!=hits.end(); ++hit) {
298 
299  // I have to get the hits position (the hit is in the layer rf) in SL frame...
300  GlobalPoint glbPos = ( theGeom->layer( hit->wireId().layerId() ) )->toGlobal(hit->localPosition());
301  LocalPoint pos = ( theGeom->idToDet(seg->geographicalId()) )->toLocal(glbPos);
302  x.push_back(pos.z());
303  y.push_back(pos.x());
304 
305  const DTLayer* layer = theGeom->layer( hit->wireId().layerId() );
306  float xwire = layer->specificTopology().wirePosition(hit->wireId().wire());
307  float distance = fabs(hit->localPosition().x() - xwire);
308  dist.push_back(distance);
309 
310  int ilc = ( hit->lrSide() == DTEnums::Left ) ? 1 : -1;
311  lfit.push_back(ilc);
312 
313  // Get local error in SL frame
314  //RB: is it right in this way?
316  GlobalError glbErr = tran.transform( hit->localPositionError(),(theGeom->layer( hit->wireId().layerId() ))->surface());
317  LocalError slErr = tran.transform( glbErr, (theGeom->idToDet(seg->geographicalId()))->surface());
318  sigy.push_back(sqrt(slErr.xx()));
319  }
320 
321  LocalPoint pos;
323  AlgebraicSymMatrix covMat(2);
324  double chi2 = 0.;
325  float cminf=0.;
326  float vminf=0.;
327  double t0_corr = 0.;
328 
329  fit(x,y,lfit,dist,sigy,pos,dir,cminf,vminf,covMat,chi2,allow3par,block3par);
330  if (cminf!=0) t0_corr=-cminf/0.00543; // convert drift distance to time
331 
332  if (debug) cout << " DTSeg2d chi2: " << chi2 << endl;
333  if (debug) cout << " DTSeg2d Fit t0: " << t0_corr << endl;
334  // cout << "pos " << segPosition << endl;
335  // cout << "dir " << segDirection << endl;
336  // cout << "Mat " << mat << endl;
337 
338  seg->setPosition(pos);
339  seg->setDirection(dir);
340  seg->setCovMatrix(covMat);
341  seg->setChi2(chi2);
342  seg->setT0(t0_corr);
343 }
float wirePosition(int wireNumber) const
Returns the x position in the layer of a given wire number.
Definition: DTTopology.cc:86
static GlobalError transform(const LocalError &le, const Surface &surf)
float xx() const
Definition: LocalError.h:24
void setChi2(const double &chi2)
void setCovMatrix(const AlgebraicSymMatrix &cov)
edm::ESHandle< DTGeometry > theGeom
const DTTopology & specificTopology() const
Definition: DTLayer.cc:42
T sqrt(T t)
Definition: SSEVec.h:18
T z() const
Definition: PV3DBase.h:64
std::vector< DTRecHit1D > specificRecHits() const
Access to specific components.
void setT0(const double &t0)
const GeomDet * idToDet(DetId) const override
Definition: DTGeometry.cc:93
void setPosition(const LocalPoint &pos)
CLHEP::HepSymMatrix AlgebraicSymMatrix
void setDirection(const LocalVector &dir)
const DTLayer * layer(const DTLayerId &id) const
Return a layer given its id.
Definition: DTGeometry.cc:127
DetId geographicalId() const
dbl *** dir
Definition: mlp_gen.cc:35
T x() const
Definition: PV3DBase.h:62
bool fit(DTSegmentCand *seg, bool allow3par, const bool fitdebug) const
void DTSegmentUpdator::fit ( DTRecSegment4D seg,
bool  allow3par 
) const

ditto for true segment 4D, the fit is done on either projection and then the 4D direction and position is built. Since the fit is applied on a true segment, by definition the segment is "good", while it's not the case for just candidates

Definition at line 109 of file DTSegmentUpdator.cc.

References DTGeometry::chamber(), DTSuperLayerId::chamberId(), DTRecSegment4D::chamberId(), DTRecSegment2D::chi2(), funct::cos(), gather_cfg::cout, debug, dir, fit(), DTRecSegment4D::hasPhi(), DTRecSegment4D::hasZed(), intime_cut, DTRecSegment2D::localDirection(), DTRecSegment2D::localPosition(), DTRecSegment2D::parametersError(), DTRecSegment4D::phiSegment(), DTRecSegment4D::setCovMatrix(), DTRecSegment4D::setCovMatrixForZed(), DTRecSegment4D::setDirection(), DTRecSegment4D::setPosition(), DTGeometry::superLayer(), DTSLRecSegment2D::superLayerId(), DTRecSegment2D::t0(), theGeom, PV3DBase< T, PVType, FrameType >::theta(), GeomDet::toGlobal(), GeomDet::toLocal(), PV3DBase< T, PVType, FrameType >::x(), y, PV3DBase< T, PVType, FrameType >::y(), PV3DBase< T, PVType, FrameType >::z(), and DTRecSegment4D::zSegment().

Referenced by trackingPlots.Iteration::modules().

109  {
110  if(debug) cout << "[DTSegmentUpdator] Fit DTRecSegment4D:" << endl;
111  // after the update must refit the segments
112 
113  if (debug) {
114  if(seg->hasPhi()) cout << " 4D Segment contains a Phi segment. t0= " << seg->phiSegment()->t0() << " chi2= " << seg->phiSegment()->chi2() << endl;
115  if(seg->hasZed()) cout << " 4D Segment contains a Zed segment. t0= " << seg->zSegment()->t0() << " chi2= " << seg->zSegment()->chi2() << endl;
116  }
117 
118 
119  // If both phi and zed projections are present and the phi segment is in time (segment t0<intime_cut) the 3-par fit is blocked and
120  // segments are fit with the 2-par fit. Setting intime_cut to -1 results in the 3-par fit being used always.
121  if(seg->hasPhi()) {
122  if(seg->hasZed()) {
123  if (fabs(seg->phiSegment()->t0())<intime_cut) {
124  fit(seg->phiSegment(),allow3par,true);
125  fit(seg->zSegment(),allow3par,true);
126  } else {
127  fit(seg->phiSegment(),allow3par,false);
128  fit(seg->zSegment(),allow3par,false);
129  }
130  } else fit(seg->phiSegment(),allow3par,false);
131  } else fit(seg->zSegment(),allow3par,false);
132 
133  const DTChamber* theChamber = theGeom->chamber(seg->chamberId());
134 
135  if(seg->hasPhi() && seg->hasZed() ) {
136 
137  DTChamberRecSegment2D *segPhi=seg->phiSegment();
138  DTSLRecSegment2D *segZed=seg->zSegment();
139 
140  // NB Phi seg is already in chamber ref
141  LocalPoint posPhiInCh = segPhi->localPosition();
142  LocalVector dirPhiInCh= segPhi->localDirection();
143 
144  // Zed seg is in SL one
145  const DTSuperLayer* zSL = theChamber->superLayer(segZed->superLayerId());
146  LocalPoint zPos(segZed->localPosition().x(),
147  (zSL->toLocal(theChamber->toGlobal(segPhi->localPosition()))).y(),
148  0.);
149 
150  LocalPoint posZInCh = theChamber->toLocal(zSL->toGlobal(zPos));
151 
152  LocalVector dirZInCh = theChamber->toLocal(zSL->toGlobal(segZed->localDirection()));
153 
154  LocalPoint posZAt0 = posZInCh + dirZInCh*(-posZInCh.z())/cos(dirZInCh.theta());
155 
156  // given the actual definition of chamber refFrame, (with z poiniting to IP),
157  // the zed component of direction is negative.
158  LocalVector dir=LocalVector(dirPhiInCh.x()/fabs(dirPhiInCh.z()),dirZInCh.y()/fabs(dirZInCh.z()),-1.);
159 
160  seg->setPosition(LocalPoint(posPhiInCh.x(),posZAt0.y(),0.));
161  seg->setDirection(dir.unit());
162 
163  AlgebraicSymMatrix mat(4);
164 
165  // set cov matrix
166  mat[0][0] = segPhi->parametersError()[0][0]; //sigma (dx/dz)
167  mat[0][2] = segPhi->parametersError()[0][1]; //cov(dx/dz,x)
168  mat[2][2] = segPhi->parametersError()[1][1]; //sigma (x)
169 
170  seg->setCovMatrix(mat);
171  seg->setCovMatrixForZed(posZInCh);
172  }
173  else if (seg->hasPhi()) {
174  DTChamberRecSegment2D *segPhi=seg->phiSegment();
175 
176  seg->setPosition(segPhi->localPosition());
177  seg->setDirection(segPhi->localDirection());
178 
179  AlgebraicSymMatrix mat(4);
180  // set cov matrix
181  mat[0][0] = segPhi->parametersError()[0][0]; //sigma (dx/dz)
182  mat[0][2] = segPhi->parametersError()[0][1]; //cov(dx/dz,x)
183  mat[2][2] = segPhi->parametersError()[1][1]; //sigma (x)
184 
185  seg->setCovMatrix(mat);
186  }
187  else if (seg->hasZed()) {
188  DTSLRecSegment2D *segZed = seg->zSegment();
189 
190  // Zed seg is in SL one
191  GlobalPoint glbPosZ = ( theGeom->superLayer(segZed->superLayerId()) )->toGlobal(segZed->localPosition());
192  LocalPoint posZInCh = ( theGeom->chamber(segZed->superLayerId().chamberId()) )->toLocal(glbPosZ);
193 
194  GlobalVector glbDirZ = (theGeom->superLayer(segZed->superLayerId()) )->toGlobal(segZed->localDirection());
195  LocalVector dirZInCh = (theGeom->chamber(segZed->superLayerId().chamberId()) )->toLocal(glbDirZ);
196 
197  LocalPoint posZAt0 = posZInCh+
198  dirZInCh*(-posZInCh.z())/cos(dirZInCh.theta());
199 
200  seg->setPosition(posZAt0);
201  seg->setDirection(dirZInCh);
202 
203  AlgebraicSymMatrix mat(4);
204  // set cov matrix
205  seg->setCovMatrix(mat);
206  seg->setCovMatrixForZed(posZInCh);
207  }
208 }
Local3DVector LocalVector
Definition: LocalVector.h:12
Point3DBase< Scalar, LocalTag > LocalPoint
Definition: Definitions.h:32
const DTChamber * chamber(const DTChamberId &id) const
Return a DTChamber given its id.
Definition: DTGeometry.cc:117
DTChamberId chamberId() const
Return the corresponding ChamberId.
const DTChamberRecSegment2D * phiSegment() const
The superPhi segment: 0 if no phi projection available.
GlobalPoint toGlobal(const Local2DPoint &lp) const
Conversion to the global R.F. from the R.F. of the GeomDet.
Definition: GeomDet.h:54
T y() const
Definition: PV3DBase.h:63
LocalPoint toLocal(const GlobalPoint &gp) const
Conversion to the R.F. of the GeomDet.
Definition: GeomDet.h:69
AlgebraicSymMatrix parametersError() const override
virtual DTChamberId chamberId() const
The (specific) DetId of the chamber on which the segment resides.
void setCovMatrixForZed(const LocalPoint &posZInCh)
edm::ESHandle< DTGeometry > theGeom
void setCovMatrix(const AlgebraicSymMatrix &mat)
Set covariance matrix.
Geom::Theta< T > theta() const
Definition: PV3DBase.h:75
T z() const
Definition: PV3DBase.h:64
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
void setDirection(LocalVector dir)
Set direction.
double chi2() const override
the chi2 of the fit
bool hasPhi() const
Does it have the Phi projection?
DTSuperLayerId superLayerId() const
The id of the superlayer on which reside the segment.
bool hasZed() const
Does it have the Z projection?
const DTSLRecSegment2D * zSegment() const
The Z segment: 0 if not zed projection available.
LocalPoint localPosition() const override
local position in SL frame
LocalVector localDirection() const override
the local direction in SL frame
CLHEP::HepSymMatrix AlgebraicSymMatrix
void setPosition(LocalPoint pos)
Set position.
dbl *** dir
Definition: mlp_gen.cc:35
double t0() const
Get the segment t0 (if recomputed, 0 is returned otherwise)
T x() const
Definition: PV3DBase.h:62
bool fit(DTSegmentCand *seg, bool allow3par, const bool fitdebug) const
const DTSuperLayer * superLayer(const DTSuperLayerId &id) const
Return a DTSuperLayer given its id.
Definition: DTGeometry.cc:122
void DTSegmentUpdator::fit ( const std::vector< float > &  x,
const std::vector< float > &  y,
const std::vector< int > &  lfit,
const std::vector< double > &  dist,
const std::vector< float > &  sigy,
LocalPoint pos,
LocalVector dir,
float &  cminf,
float &  vminf,
AlgebraicSymMatrix covMat,
double &  chi2,
const bool  allow3par = false,
const bool  block3par = false 
) const
private

interface to LinearFit

Definition at line 345 of file DTSegmentUpdator.cc.

References vertices_cff::chi2, debug, mps_fire::i, intime_cut, slope, theFitter, and Vector3DBase< T, FrameTag >::unit().

Referenced by trackingPlots.Iteration::modules().

357  {
358 
359  float slope = 0.;
360  float intercept = 0.;
361  float covss = 0.;
362  float covii = 0.;
363  float covsi = 0.;
364 
365  cminf=0;
366  vminf=0;
367 
368  int leftHits=0, rightHits=0;
369  for (unsigned int i=0; i<lfit.size(); i++)
370  if (lfit[i]==1) leftHits++; else rightHits++;
371 
372  theFitter->fit(x,y,x.size(),sigy,slope,intercept,chi2,covss,covii,covsi);
373 
374  // If we have at least one left and one right hit we can try the 3 parameter fit (if it is switched on)
375  // FIXME: currently the covariance matrix from the 2-par fit is kept
376  if (leftHits && rightHits && (leftHits+rightHits>3) && allow3par) {
377  theFitter->fitNpar(3,x,y,lfit,dist,sigy,slope,intercept,cminf,vminf,chi2,debug);
378  double t0_corr=-cminf/0.00543;
379  if (fabs(t0_corr)<intime_cut && block3par) {
380  theFitter->fit(x,y,x.size(),sigy,slope,intercept,chi2,covss,covii,covsi);
381  cminf=0;
382  }
383  }
384 
385  // cout << "slope " << slope << endl;
386  // cout << "intercept " << intercept << endl;
387 
388  // intercept is the x() in chamber frame when the segment cross the chamber
389  // plane (at z()=0), the y() is not measured, so let's put the center of the
390  // chamber.
391  pos = LocalPoint(intercept,0.,0.);
392 
393  // slope is dx()/dz(), while dy()/dz() is by definition 0, finally I want the
394  // segment to point outward, so opposite to local z
395  dir = LocalVector(-slope,0.,-1.).unit();
396 
397  covMatrix = AlgebraicSymMatrix(2);
398  covMatrix[0][0] = covss; // this is var(dy/dz)
399  covMatrix[1][1] = covii; // this is var(y)
400  covMatrix[1][0] = covsi; // this is cov(dy/dz,y)
401 }
Local3DVector LocalVector
Definition: LocalVector.h:12
Point3DBase< Scalar, LocalTag > LocalPoint
Definition: Definitions.h:32
static const double slope[3]
std::unique_ptr< DTLinearFit > theFitter
Vector3DBase unit() const
Definition: Vector3DBase.h:57
CLHEP::HepSymMatrix AlgebraicSymMatrix
void DTSegmentUpdator::rejectBadHits ( DTChamberRecSegment2D phiSeg) const
private

Definition at line 482 of file DTSegmentUpdator.cc.

References gather_cfg::cout, debug, delta, TrackingRecHit::geographicalId(), hfClusterShapes_cfi::hits, mps_fire::i, DTGeometry::idToDet(), DTGeometry::layer(), N, DTRecSegment2D::specificRecHits(), theGeom, DTRecSegment2D::update(), x, PV3DBase< T, PVType, FrameType >::x(), y, and PV3DBase< T, PVType, FrameType >::z().

Referenced by update().

482  {
483 
484  vector<float> x;
485  vector<float> y;
486 
487  if(debug) cout << " Inside the segment updator, now loop on hits: ( x == z_loc , y == x_loc) " << endl;
488 
489  vector<DTRecHit1D> hits = phiSeg->specificRecHits();
490  for (vector<DTRecHit1D>::const_iterator hit=hits.begin();
491  hit!=hits.end(); ++hit) {
492 
493  // I have to get the hits position (the hit is in the layer rf) in SL frame...
494  GlobalPoint glbPos = ( theGeom->layer( hit->wireId().layerId() ) )->toGlobal(hit->localPosition());
495  LocalPoint pos = ( theGeom->idToDet(phiSeg->geographicalId()) )->toLocal(glbPos);
496 
497  x.push_back(pos.z());
498  y.push_back(pos.x());
499  }
500 
501  if(debug){
502  cout << " end of segment! " << endl;
503  cout << " size = Number of Hits: " << x.size() << " " << y.size() << endl;
504  }
505 
506  // Perform the 2 par fit:
507  float par[2]={0.,0.}; // q , m
508 
509  //variables to perform the fit:
510  float Sx = 0.;
511  float Sy = 0.;
512  float Sx2 = 0.;
513  float Sy2 = 0.;
514  float Sxy = 0.;
515 
516  size_t N = x.size();
517 
518  if (N == 0)
519  return;
520 
521  for(size_t i = 0; i < N;++i){
522  Sx += x.at(i);
523  Sy += y.at(i);
524  Sx2 += x.at(i)*x.at(i);
525  Sy2 += y.at(i)*y.at(i);
526  Sxy += x.at(i)*y.at(i);
527 
528  }
529 
530  const float delta = N*Sx2 - Sx*Sx;
531  par[0] = ( Sx2*Sy - Sx*Sxy )/delta;
532  par[1] = ( N*Sxy - Sx*Sy )/delta;
533 
534  if(debug) cout << "fit 2 parameters done ----> par0: "<< par[0] << " par1: "<< par[1] << endl;
535 
536  // Calc residuals:
537  float residuals[N];
538 
539  for(size_t i = 0; i < N;++i)
540  residuals[i] = 0;
541 
542  for(size_t i = 0; i < N;++i){
543  residuals[i] = y.at(i) - par[1]*x.at(i) - par[0];
544  if(debug){
545  cout<<" i: "<<i<<" y_i "<<y.at(i)<<" x_i "<<x.at(i)<<" res_i "<<residuals[i];
546  if (i==N-1) cout<<endl;
547  }
548  }
549 
550  if(debug) cout << " Residuals computed! "<< endl;
551 
552  // Perform bad hit rejecting -- update hits
553  vector<DTRecHit1D> updatedRecHits;
554 
555  float mean_residual = 0.; //mean of the absolute values of residuals
556 
557  for (size_t i = 0; i < N; ++i)
558  mean_residual += fabs(residuals[i]);
559 
560  mean_residual = mean_residual/(N - 2);
561 
562  if(debug) cout << " mean_residual: "<< mean_residual << endl;
563 
564  int i = 0;
565 
566  for (vector<DTRecHit1D>::const_iterator hit=hits.begin();
567  hit!=hits.end(); ++hit) {
568 
569  DTRecHit1D newHit1D = (*hit);
570 
571  float normResidual = mean_residual > 0 ? fabs(residuals[i])/mean_residual : 0;
572  if(normResidual < 1.5){
573 
574  updatedRecHits.push_back(newHit1D);
575  if(debug) cout << " accepted "<< i+1 << "th hit" <<" Irej: " << normResidual << endl;
576  ++i;
577  }
578  else {
579  if(debug) cout << " rejected "<< i+1 << "th hit" <<" Irej: " << normResidual << endl;
580  ++i;
581  continue;
582  }
583  }
584 
585  phiSeg->update(updatedRecHits);
586 
587  //final check!
588  if(debug){
589 
590  vector<float> x_upd;
591  vector<float> y_upd;
592 
593  cout << " Check the update action: " << endl;
594 
595  vector<DTRecHit1D> hits_upd = phiSeg->specificRecHits();
596  for (vector<DTRecHit1D>::const_iterator hit=hits_upd.begin();
597  hit!=hits_upd.end(); ++hit) {
598 
599  // I have to get the hits position (the hit is in the layer rf) in SL frame...
600  GlobalPoint glbPos = ( theGeom->layer( hit->wireId().layerId() ) )->toGlobal(hit->localPosition());
601  LocalPoint pos = ( theGeom->idToDet(phiSeg->geographicalId()) )->toLocal(glbPos);
602 
603  x_upd.push_back(pos.z());
604  y_upd.push_back(pos.x());
605 
606  cout << " x_upd: "<< pos.z() << " y_upd: "<< pos.x() << endl;
607  }
608 
609  cout << " end of segment! " << endl;
610  cout << " size = Number of Hits: " << x_upd.size() << " " << y_upd.size() << endl;
611 
612  }// end debug
613 
614  return;
615 } //end DTSegmentUpdator::rejectBadHits
dbl * delta
Definition: mlp_gen.cc:36
void update(std::vector< DTRecHit1D > &updatedRecHits)
edm::ESHandle< DTGeometry > theGeom
T z() const
Definition: PV3DBase.h:64
std::vector< DTRecHit1D > specificRecHits() const
Access to specific components.
#define N
Definition: blowfish.cc:9
const GeomDet * idToDet(DetId) const override
Definition: DTGeometry.cc:93
const DTLayer * layer(const DTLayerId &id) const
Return a layer given its id.
Definition: DTGeometry.cc:127
DetId geographicalId() const
T x() const
Definition: PV3DBase.h:62
void DTSegmentUpdator::setES ( const edm::EventSetup setup)
void DTSegmentUpdator::update ( DTRecSegment4D seg,
const bool  calcT0,
bool  allow3par 
) const

recompute hits position and refit the segment4D

Definition at line 74 of file DTSegmentUpdator.cc.

References calculateT0corr(), gather_cfg::cout, debug, dir, fit(), TrackingRecHit::geographicalId(), DTRecSegment4D::hasPhi(), DTRecSegment4D::hasZed(), DTGeometry::idToDet(), DTRecSegment4D::localDirection(), DTRecSegment4D::localPosition(), perform_delta_rejecting, DTRecSegment4D::phiSegment(), rejectBadHits(), theGeom, updateHits(), and DTRecSegment4D::zSegment().

Referenced by progressbar.ProgressBar::__next__(), MatrixUtil.Matrix::__setitem__(), MatrixUtil.Steps::__setitem__(), Vispa.Gui.VispaWidget.VispaWidget::autosize(), Vispa.Views.LineDecayView.LineDecayContainer::createObject(), Vispa.Views.LineDecayView.LineDecayContainer::deselectAllObjects(), Vispa.Gui.VispaWidgetOwner.VispaWidgetOwner::deselectAllWidgets(), Vispa.Gui.VispaWidget.VispaWidget::enableAutosizing(), progressbar.ProgressBar::finish(), Vispa.Gui.MenuWidget.MenuWidget::leaveEvent(), Vispa.Gui.VispaWidgetOwner.VispaWidgetOwner::mouseMoveEvent(), Vispa.Gui.MenuWidget.MenuWidget::mouseMoveEvent(), Vispa.Views.LineDecayView.LineDecayContainer::mouseMoveEvent(), Vispa.Gui.VispaWidgetOwner.VispaWidgetOwner::mouseReleaseEvent(), Vispa.Views.LineDecayView.LineDecayContainer::objectMoved(), MatrixUtil.Steps::overwrite(), DTMeantimerPatternReco4D::reconstruct(), DTCombinatorialPatternReco4D::reconstruct(), DTRefitAndCombineReco4D::reconstruct(), DTCombinatorialPatternReco::reconstruct(), DTCombinatorialExtendedPatternReco::reconstruct(), DTMeantimerPatternReco::reconstruct(), Vispa.Views.LineDecayView.LineDecayContainer::removeObject(), Vispa.Gui.ConnectableWidget.ConnectableWidget::removePorts(), Vispa.Gui.FindDialog.FindDialog::reset(), Vispa.Gui.PortConnection.PointToPointConnection::select(), Vispa.Gui.VispaWidget.VispaWidget::select(), Vispa.Views.LineDecayView.LineDecayContainer::select(), Vispa.Gui.VispaWidget.VispaWidget::setText(), Vispa.Gui.VispaWidget.VispaWidget::setTitle(), Vispa.Gui.ZoomableWidget.ZoomableWidget::setZoom(), Vispa.Views.LineDecayView.LineDecayContainer::setZoom(), and Vispa.Gui.PortConnection.PointToPointConnection::updateConnection().

74  {
75 
76  if(debug) cout << "[DTSegmentUpdator] Starting to update the DTRecSegment4D" << endl;
77 
78  const bool hasPhi = seg->hasPhi();
79  const bool hasZed = seg->hasZed();
80 
81  //reject the bad hits (due to delta rays)
82  if(perform_delta_rejecting && hasPhi) rejectBadHits(seg->phiSegment());
83 
84  int step = (hasPhi && hasZed) ? 3 : 2;
85  if(calcT0) step = 4;
86 
87  if(debug) cout << "Step of update is " << step << endl;
88 
89  GlobalPoint pos = theGeom->idToDet(seg->geographicalId())->toGlobal(seg->localPosition());
90  GlobalVector dir = theGeom->idToDet(seg->geographicalId())->toGlobal(seg->localDirection());
91 
92  if(calcT0) calculateT0corr(seg);
93 
94  if(hasPhi) updateHits(seg->phiSegment(),pos,dir,step);
95  if(hasZed) updateHits(seg->zSegment() ,pos,dir,step);
96 
97  fit(seg,allow3par);
98 }
void rejectBadHits(DTChamberRecSegment2D *) const
LocalPoint localPosition() const override
Local position in Chamber frame.
void updateHits(DTRecSegment2D *seg, GlobalPoint &gpos, GlobalVector &gdir, const int step=2) const
void calculateT0corr(DTRecSegment2D *seg) const
LocalVector localDirection() const override
Local direction in Chamber frame.
const DTChamberRecSegment2D * phiSegment() const
The superPhi segment: 0 if no phi projection available.
edm::ESHandle< DTGeometry > theGeom
bool hasPhi() const
Does it have the Phi projection?
bool hasZed() const
Does it have the Z projection?
const DTSLRecSegment2D * zSegment() const
The Z segment: 0 if not zed projection available.
const GeomDet * idToDet(DetId) const override
Definition: DTGeometry.cc:93
step
Definition: StallMonitor.cc:94
DetId geographicalId() const
dbl *** dir
Definition: mlp_gen.cc:35
bool fit(DTSegmentCand *seg, bool allow3par, const bool fitdebug) const
void DTSegmentUpdator::update ( DTRecSegment2D seg,
bool  allow3par 
) const

recompute hits position and refit the segment2D

Definition at line 100 of file DTSegmentUpdator.cc.

References gather_cfg::cout, debug, dir, fit(), TrackingRecHit::geographicalId(), DTGeometry::idToDet(), DTRecSegment2D::localDirection(), DTRecSegment2D::localPosition(), theGeom, and updateHits().

Referenced by progressbar.ProgressBar::__next__(), MatrixUtil.Matrix::__setitem__(), MatrixUtil.Steps::__setitem__(), Vispa.Gui.VispaWidget.VispaWidget::autosize(), Vispa.Views.LineDecayView.LineDecayContainer::createObject(), Vispa.Views.LineDecayView.LineDecayContainer::deselectAllObjects(), Vispa.Gui.VispaWidgetOwner.VispaWidgetOwner::deselectAllWidgets(), Vispa.Gui.VispaWidget.VispaWidget::enableAutosizing(), progressbar.ProgressBar::finish(), Vispa.Gui.MenuWidget.MenuWidget::leaveEvent(), Vispa.Gui.VispaWidgetOwner.VispaWidgetOwner::mouseMoveEvent(), Vispa.Gui.MenuWidget.MenuWidget::mouseMoveEvent(), Vispa.Views.LineDecayView.LineDecayContainer::mouseMoveEvent(), Vispa.Gui.VispaWidgetOwner.VispaWidgetOwner::mouseReleaseEvent(), Vispa.Views.LineDecayView.LineDecayContainer::objectMoved(), MatrixUtil.Steps::overwrite(), Vispa.Views.LineDecayView.LineDecayContainer::removeObject(), Vispa.Gui.ConnectableWidget.ConnectableWidget::removePorts(), Vispa.Gui.FindDialog.FindDialog::reset(), Vispa.Gui.PortConnection.PointToPointConnection::select(), Vispa.Gui.VispaWidget.VispaWidget::select(), Vispa.Views.LineDecayView.LineDecayContainer::select(), Vispa.Gui.VispaWidget.VispaWidget::setText(), Vispa.Gui.VispaWidget.VispaWidget::setTitle(), Vispa.Gui.ZoomableWidget.ZoomableWidget::setZoom(), Vispa.Views.LineDecayView.LineDecayContainer::setZoom(), and Vispa.Gui.PortConnection.PointToPointConnection::updateConnection().

100  {
101  if(debug) cout << "[DTSegmentUpdator] Starting to update the DTRecSegment2D" << endl;
102  GlobalPoint pos = (theGeom->idToDet(seg->geographicalId()))->toGlobal(seg->localPosition());
103  GlobalVector dir = (theGeom->idToDet(seg->geographicalId()))->toGlobal(seg->localDirection());
104 
105  updateHits(seg,pos,dir);
106  fit(seg,allow3par,false);
107 }
void updateHits(DTRecSegment2D *seg, GlobalPoint &gpos, GlobalVector &gdir, const int step=2) const
edm::ESHandle< DTGeometry > theGeom
LocalPoint localPosition() const override
local position in SL frame
LocalVector localDirection() const override
the local direction in SL frame
const GeomDet * idToDet(DetId) const override
Definition: DTGeometry.cc:93
DetId geographicalId() const
dbl *** dir
Definition: mlp_gen.cc:35
bool fit(DTSegmentCand *seg, bool allow3par, const bool fitdebug) const
void DTSegmentUpdator::updateHits ( DTRecSegment2D seg,
GlobalPoint gpos,
GlobalVector gdir,
const int  step = 2 
) const
private

Definition at line 405 of file DTSegmentUpdator.cc.

References angle(), funct::cos(), SoftLeptonByDistance_cfi::distance, relativeConstraints::error, Exception, DTRecSegment2D::ist0Valid(), DTGeometry::layer(), DTEnums::Left, convertSQLiteXML::ok, point, DTRecSegment2D::specificRecHits(), DTLayer::specificTopology(), DTRecSegment2D::t0(), T0_hit_resolution, theAlgo, theGeom, PV3DBase< T, PVType, FrameType >::theta(), GeomDet::toLocal(), DTRecSegment2D::update(), DTRecSegment2D::vDrift(), vdrift_4parfit, DTTopology::wirePosition(), PV3DBase< T, PVType, FrameType >::x(), hit::x, and PV3DBase< T, PVType, FrameType >::z().

Referenced by update().

406  {
407 
408  // it is not necessary to have DTRecHit1D* to modify the obj in the container
409  // but I have to be carefully, since I cannot make a copy before the iteration!
410 
411  vector<DTRecHit1D> toBeUpdatedRecHits = seg->specificRecHits();
412  vector<DTRecHit1D> updatedRecHits;
413 
414  for (vector<DTRecHit1D>::iterator hit= toBeUpdatedRecHits.begin();
415  hit!=toBeUpdatedRecHits.end(); ++hit) {
416 
417  const DTLayer* layer = theGeom->layer( hit->wireId().layerId() );
418 
419  LocalPoint segPos=layer->toLocal(gpos);
420  LocalVector segDir=layer->toLocal(gdir);
421 
422  // define impact angle needed by the step 2
423  const float angle = atan(segDir.x()/-segDir.z());
424 
425  // define the local position (extr.) of the segment. Needed by the third step
426  LocalPoint segPosAtLayer=segPos+segDir*(-segPos.z())/cos(segDir.theta());
427 
428  DTRecHit1D newHit1D = (*hit);
429  bool ok = true;
430 
431  if (step == 2) {
432  ok = theAlgo->compute(layer,*hit,angle,newHit1D);
433 
434  } else if (step == 3) {
435 
436  LocalPoint hitPos(hit->localPosition().x(),+segPosAtLayer.y(),0.);
437  GlobalPoint glbpos= theGeom->layer( hit->wireId().layerId() )->toGlobal(hitPos);
438  newHit1D.setPosition(hitPos);
439  ok = theAlgo->compute(layer,*hit,angle,glbpos,newHit1D);
440 
441  } else if (step == 4) {
442 
443  //const double vminf = seg->vDrift(); // vdrift correction are recorded in the segment
444  double vminf =0.;
445  if(vdrift_4parfit) vminf = seg->vDrift(); // use vdrift recorded in the segment only if vdrift_4parfit=True
446 
447  double cminf = 0.;
448  if(seg->ist0Valid()) cminf = - seg->t0()*0.00543;
449 
450  //cout << "In updateHits: t0 = " << seg->t0() << endl;
451  //cout << "In updateHits: vminf = " << vminf << endl;
452  //cout << "In updateHits: cminf = " << cminf << endl;
453 
454  const float xwire = layer->specificTopology().wirePosition(hit->wireId().wire());
455  const float distance = fabs(hit->localPosition().x() - xwire);
456  const int ilc = ( hit->lrSide() == DTEnums::Left ) ? 1 : -1;
457  const double dy_corr = (vminf*ilc*distance-cminf*ilc );
458 
459  LocalPoint point(hit->localPosition().x() + dy_corr, +segPosAtLayer.y(), 0.);
460 
461  //double final_hit_resol = T0_hit_resolution;
462  //if(newHit1D.wireId().layerId().superlayerId().superLayer() != 2) final_hit_resol = final_hit_resol * 0.8;
463  //LocalError error(final_hit_resol * final_hit_resol,0.,0.);
465  newHit1D.setPositionAndError(point, error);
466 
467  //FIXME: check that the hit is still inside the cell
468  ok = true;
469 
470  } else throw cms::Exception("DTSegmentUpdator")<<" updateHits called with wrong step " << endl;
471 
472  if (ok) updatedRecHits.push_back(newHit1D);
473  else {
474  LogError("DTSegmentUpdator")<<"DTSegmentUpdator::updateHits failed update" << endl;
475  throw cms::Exception("DTSegmentUpdator")<<"updateHits failed update"<<endl;
476  }
477 
478  }
479  seg->update(updatedRecHits);
480 }
float wirePosition(int wireNumber) const
Returns the x position in the layer of a given wire number.
Definition: DTTopology.cc:86
LocalPoint toLocal(const GlobalPoint &gp) const
Conversion to the R.F. of the GeomDet.
Definition: GeomDet.h:69
void update(std::vector< DTRecHit1D > &updatedRecHits)
edm::ESHandle< DTGeometry > theGeom
std::unique_ptr< DTRecHitBaseAlgo > theAlgo
Geom::Theta< T > theta() const
Definition: PV3DBase.h:75
const DTTopology & specificTopology() const
Definition: DTLayer.cc:42
double vDrift() const
T z() const
Definition: PV3DBase.h:64
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
std::vector< DTRecHit1D > specificRecHits() const
Access to specific components.
bool ist0Valid() const
step
Definition: StallMonitor.cc:94
const DTLayer * layer(const DTLayerId &id) const
Return a layer given its id.
Definition: DTGeometry.cc:127
double t0() const
Get the segment t0 (if recomputed, 0 is returned otherwise)
T x() const
Definition: PV3DBase.h:62
*vegas h *****************************************************used in the default bin number in original ***version of VEGAS is ***a higher bin number might help to derive a more precise ***grade subtle point
Definition: invegas.h:5
T angle(T x1, T y1, T z1, T x2, T y2, T z2)
Definition: angle.h:11

Member Data Documentation

bool DTSegmentUpdator::debug
private
double DTSegmentUpdator::intime_cut
private

Definition at line 109 of file DTSegmentUpdator.h.

Referenced by DTSegmentUpdator(), and fit().

bool DTSegmentUpdator::perform_delta_rejecting
private

Definition at line 112 of file DTSegmentUpdator.h.

Referenced by DTSegmentUpdator(), and update().

double DTSegmentUpdator::T0_hit_resolution
private

Definition at line 111 of file DTSegmentUpdator.h.

Referenced by DTSegmentUpdator(), and updateHits().

std::unique_ptr<DTRecHitBaseAlgo> DTSegmentUpdator::theAlgo
private

Definition at line 83 of file DTSegmentUpdator.h.

Referenced by DTSegmentUpdator(), setES(), and updateHits().

std::unique_ptr<DTLinearFit> DTSegmentUpdator::theFitter
private

Definition at line 82 of file DTSegmentUpdator.h.

Referenced by calculateT0corr(), and fit().

edm::ESHandle<DTGeometry> DTSegmentUpdator::theGeom
private

Definition at line 84 of file DTSegmentUpdator.h.

Referenced by calculateT0corr(), fit(), rejectBadHits(), setES(), update(), and updateHits().

bool DTSegmentUpdator::vdrift_4parfit
private

Definition at line 110 of file DTSegmentUpdator.h.

Referenced by calculateT0corr(), DTSegmentUpdator(), and updateHits().