25 theSL(sl), theChi2(-1.) , theHits(hits){
34 theSL(sl), thePosition(position), theDirection(direction), theChi2(chi2),
35 theCovMatrix( covMat), theHits(hits) {
44 static const double epsilon=0.00001;
46 if (fabs(
chi2()-seg.
chi2())>epsilon)
return false;
73 for (AssPointCont::const_iterator
hit=
theHits.begin();
75 for (AssPointCont::const_iterator hit2=hitsCont.begin();
76 hit2!=hitsCont.end() ; ++hit2) {
78 if ((*(*hit).first)==(*(*hit2).first)) {
94 AssPointCont::const_iterator hitBegin2 = hits2.begin(), hitEnd2 = hits2.end();
97 for (AssPointCont::const_iterator hit2 = hitBegin2; hit2 != hitEnd2; ++hit2) {
98 if ((*(*hit).first)==(*(*hit2).first) &&
99 (*hit).second != (*hit2).second) {
110 if(
NDOF() == 0)
return false;
120 std::vector<int> layerN;
122 for(DTSegmentCand::AssPointCont::iterator assHit=
theHits.begin();
123 assHit!=
theHits.end(); ++assHit) {
124 layerN.push_back((*assHit).first->id().layerId().layer());
129 for(
int i=0;
i<(int)layerN.size();
i++){
130 for(
int j=
i+1;
j<(int)layerN.size();
j++){
131 if(layerN[
i] == layerN[
j])
return true;
147 double seg2DChi2 = chi2();
150 std::vector<DTRecHit1D> hits1D;
151 for(DTSegmentCand::AssPointCont::iterator assHit=theHits.begin();
152 assHit!=theHits.end(); ++assHit) {
155 theSL->toGlobal( (*assHit).first->localPosition((*assHit).second) );
158 theSL->layer( (*assHit).first->id().layerId() )->
toLocal(hitGlobalPos);
162 ((*assHit).first)->digiTime(),
164 ((*assHit).first)->localPositionError() );
165 hits1D.push_back(
hit);
169 seg2Dposition,seg2DDirection,seg2DCovMatrix,
180 LocalVector dirInCh= theSL->chamber()->toLocal(theSL->toGlobal( direction() ));
184 double seg2DChi2 = chi2();
187 std::vector<DTRecHit1D> hits1D;
188 for(DTSegmentCand::AssPointCont::iterator assHit=theHits.begin();
189 assHit!=theHits.end(); ++assHit) {
192 theSL->toGlobal( (*assHit).first->localPosition((*assHit).second) );
196 ->superLayer((*assHit).first->id().superlayerId())
197 ->layer( (*assHit).first->id().layerId() )->
toLocal(hitGlobalPos);
201 ((*assHit).first)->digiTime(),
203 ((*assHit).first)->localPositionError() );
204 hits1D.push_back(
hit);
208 pos,dirInCh,seg2DCovMatrix,
218 return *(pt1.first) < *(pt2.first);
223 <<
" chi2/nHits: " << seg.
chi2() <<
"/" << seg.DTSegmentCand::nHits() <<
"/" << seg.
nHits();
DTCellSide
Which side of the DT cell.
LocalVector toLocal(const reco::Track::Vector &v, const Surface &s)
std::ostream & operator<<(std::ostream &out, const ALILine &li)
virtual bool good() const
virtual unsigned int NDOF() const
static int position[TOTALCHAMBERS][3]
static const unsigned int nHitsMin
DTSegmentCand(AssPointCont &hits, const DTSuperLayer *sl)
Constructor.
Geom::Theta< T > theta() const
virtual bool operator==(const DTSegmentCand &seg)
equality operator based on position, direction, chi2 and nHits
virtual bool hitsShareLayer() const
virtual bool operator<(const DTSegmentCand &seg)
less operator based on nHits and chi2
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
virtual double chi2() const
the chi2 (NOT chi2/NDOF) of the fit
virtual AssPointCont hits() const
the used hits
std::pair< DTHitPairForFit *, DTEnums::DTCellSide > AssPoint
virtual AssPointCont conflictingHitPairs(const DTSegmentCand &seg) const
std::set< AssPoint, AssPointLessZ > AssPointCont
virtual unsigned int nHits() const
virtual LocalPoint position() const
virtual void add(DTHitPairForFit *hit, DTEnums::DTCellSide code)
add hits to the hit list.
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
volatile std::atomic< bool > shutdown_flag false
virtual LocalVector direction() const