25 theSL(sl), theChi2(-1.) , theHits(hits){
44 static const double epsilon=0.00001;
46 if (fabs(
chi2()-seg.
chi2())>epsilon)
return false;
77 for (AssPointCont::const_iterator
hit=
theHits.begin();
79 for (AssPointCont::const_iterator hit2=seg.
hits().begin();
80 hit2!=seg.
hits().end() ; ++hit2) {
82 if ((*(*hit).first)==(*(*hit2).first)) {
98 AssPointCont::const_iterator hitBegin2 = hits2.begin(), hitEnd2 = hits2.end();
101 for (AssPointCont::const_iterator hit2 = hitBegin2; hit2 != hitEnd2; ++hit2) {
102 if ((*(*hit).first)==(*(*hit2).first) &&
103 (*hit).second != (*hit2).second) {
115 if(
NDOF() == 0)
return false;
129 if (
theHits.size()>20)
return false;
131 for(DTSegmentCand::AssPointCont::iterator assHit=
theHits.begin();
132 assHit!=
theHits.end(); ++assHit) {
133 layerN[
i]=(*assHit).first->id().layerId().layer()+10*(*assHit).first->id().superlayerId().superlayer();
138 for(
int j=0;j<
i;j++){
139 if(layerN[i] == layerN[j])
return true;
155 double seg2DChi2 =
chi2();
158 std::vector<DTRecHit1D> hits1D;
159 for(DTSegmentCand::AssPointCont::iterator assHit=
theHits.begin();
160 assHit!=
theHits.end(); ++assHit) {
163 theSL->
toGlobal( (*assHit).first->localPosition((*assHit).second) );
170 ((*assHit).first)->digiTime(),
172 ((*assHit).first)->localPositionError() );
173 hits1D.push_back(
hit);
177 seg2Dposition,seg2DDirection,seg2DCovMatrix,
192 double seg2DChi2 =
chi2();
195 std::vector<DTRecHit1D> hits1D;
196 for(DTSegmentCand::AssPointCont::iterator assHit=
theHits.begin();
197 assHit!=
theHits.end(); ++assHit) {
200 theSL->
toGlobal( (*assHit).first->localPosition((*assHit).second) );
204 ->
superLayer((*assHit).first->id().superlayerId())
205 ->layer( (*assHit).first->id().layerId() )->
toLocal(hitGlobalPos);
209 ((*assHit).first)->digiTime(),
211 ((*assHit).first)->localPositionError() );
212 hits1D.push_back(
hit);
216 pos,dirInCh,seg2DCovMatrix,
226 return *(pt1.first) < *(pt2.first);
231 <<
" chi2/nHits: " << seg.
chi2() <<
"/" << seg.DTSegmentCand::nHits()
232 <<
" t0: " << seg.
t0();
std::pair< std::shared_ptr< DTHitPairForFit >, DTEnums::DTCellSide > AssPoint
GlobalPoint toGlobal(const Local2DPoint &lp) const
Conversion to the global R.F. from the R.F. of the GeomDet.
virtual AlgebraicSymMatrix covMatrix() const
the covariance matrix
virtual const AssPointCont & hits() const
the used hits
DTCellSide
Which side of the DT cell.
LocalPoint toLocal(const GlobalPoint &gp) const
Conversion to the R.F. of the GeomDet.
LocalVector toLocal(const reco::Track::Vector &v, const Surface &s)
virtual bool good() const
virtual unsigned int NDOF() const
static const unsigned int nHitsMin
DTSegmentCand(AssPointCont &hits, const DTSuperLayer *sl)
Constructor.
Geom::Theta< T > theta() const
AlgebraicSymMatrix theCovMatrix
DTSuperLayerId id() const
Return the DetId of this SL.
virtual bool operator==(const DTSegmentCand &seg)
equality operator based on position, direction, chi2 and nHits
virtual bool hitsShareLayer() const
virtual void add(AssPoint newHit)
add hits to the hit list.
virtual bool operator<(const DTSegmentCand &seg)
less operator based on nHits and chi2
DTChamberId id() const
Return the DTChamberId of this chamber.
Cos< T >::type cos(const T &t)
static const double chi2max
bool operator()(const AssPoint &pt1, const AssPoint &pt2) const
virtual int nLayers() const
number of different layers with hits
const DTLayer * layer(DTLayerId id) const
Return the layer corresponding to the given id.
virtual double chi2() const
the chi2 (NOT chi2/NDOF) of the fit
const DTSuperLayer * theSL
virtual AssPointCont conflictingHitPairs(const DTSegmentCand &seg) const
std::set< AssPoint, AssPointLessZ > AssPointCont
virtual unsigned int nHits() const
virtual double t0() const
the t0 of the segment
virtual LocalPoint position() const
const DTChamber * chamber() const
std::ostream & operator<<(std::ostream &out, const DTSegmentCand &seg)
virtual void removeHit(AssPoint hit)
remove hit from the candidate
CLHEP::HepSymMatrix AlgebraicSymMatrix
virtual ~DTSegmentCand()
Destructor.
virtual int nSharedHitPairs(const DTSegmentCand &seg) const
number of shared hit pair with other segment candidate
virtual LocalVector direction() const
const DTSuperLayer * superLayer(DTSuperLayerId id) const
Return the superlayer corresponding to the given id.