CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
DTMeantimerPatternReco.h
Go to the documentation of this file.
1 #ifndef DTSegment_DTMeantimerPatternReco_h
2 #define DTSegment_DTMeantimerPatternReco_h
3 
15 /* Base Class Headers */
17 
18 /* Collaborating Class Declarations */
19 namespace edm {
20  class ParameterSet;
21  class EventSetup;
22  // class ESHandle;
23 }
24 class DTSegmentUpdator;
25 class DTSegmentCleaner;
26 class DTHitPairForFit;
27 class DTSegmentCand;
28 
29 /* C++ Headers */
30 #include <vector>
31 #include <deque>
32 #include <utility>
33 
36 
37 /* ====================================================================== */
38 
39 /* Class DTMeantimerPatternReco Interface */
40 
42 
43  public:
44 
47 
49  virtual ~DTMeantimerPatternReco() ;
50 
51  /* Operations */
52 
55  reconstruct(const DTSuperLayer* sl,
56  const std::vector<DTRecHit1DPair>& hits);
57 
59  virtual std::string algoName() const { return theAlgoName; }
60 
63  virtual void setES(const edm::EventSetup& setup);
64 
65  protected:
66 
67  private:
69 
70  typedef std::pair<DTHitPairForFit*, DTEnums::DTCellSide> AssPoint;
71 
72  // create the DTHitPairForFit from the pairs for easy use
73  std::vector<DTHitPairForFit*> initHits(const DTSuperLayer* sl,
74  const std::vector<DTRecHit1DPair>& hits);
75 
76  // search for candidate, starting from pairs of hits in different layers
77  std::vector<DTSegmentCand*> buildSegments(const DTSuperLayer* sl,
78  const std::vector<DTHitPairForFit*>& hits);
79 
80  // try adding more hits to a candidate
81  void addHits(const DTSuperLayer* sl,
82  std::vector<AssPoint>& assHits,
83  const std::vector<DTHitPairForFit*>& hits,
84  std::vector<DTSegmentCand*> &result,
85  std::vector<AssPoint>& usedHits);
86 
87  // fit a set of left/right hits, calculate t0 and chi^2
88  bool fitWithT0(const std::vector<AssPoint> &assHits, double &chi2, double &t0_corr, const bool fitdebug);
89 
90  // check if two hist can be considered in one segment (come from different layers, not too far away etc.)
91  bool geometryFilter( const DTWireId first, const DTWireId second ) const;
92 
93  // a generic least-square fit to a set of points
94  void rawFit(double &a, double &b, const std::vector< std::pair<double,double> > &hits);
95 
96  bool checkDoubleCandidates(std::vector<DTSegmentCand*>& segs,
97  DTSegmentCand* seg);
98 
99  private:
100 
102  unsigned int theMaxAllowedHits;
105  double theMaxChi2;
106  double theMaxT0;
107  double theMinT0;
108  bool debug;
109  DTSegmentUpdator* theUpdator; // the updator and fitter
110  DTSegmentCleaner* theCleaner; // the cleaner
111 
112  unsigned int maxfound;
113 
115 };
116 #endif // DTSegment_DTMeantimerPatternReco_h
std::pair< DTHitPairForFit *, DTEnums::DTCellSide > AssPoint
bool checkDoubleCandidates(std::vector< DTSegmentCand * > &segs, DTSegmentCand *seg)
virtual ~DTMeantimerPatternReco()
Destructor.
virtual std::string algoName() const
return the algo name
U second(std::pair< T, U > const &p)
virtual void setES(const edm::EventSetup &setup)
std::vector< DTHitPairForFit * > initHits(const DTSuperLayer *sl, const std::vector< DTRecHit1DPair > &hits)
tuple result
Definition: query.py:137
bool fitWithT0(const std::vector< AssPoint > &assHits, double &chi2, double &t0_corr, const bool fitdebug)
bool first
Definition: L1TdeRCT.cc:79
void rawFit(double &a, double &b, const std::vector< std::pair< double, double > > &hits)
std::vector< DTSegmentCand * > buildSegments(const DTSuperLayer *sl, const std::vector< DTHitPairForFit * > &hits)
double b
Definition: hdecay.h:120
bool geometryFilter(const DTWireId first, const DTWireId second) const
virtual edm::OwnVector< DTSLRecSegment2D > reconstruct(const DTSuperLayer *sl, const std::vector< DTRecHit1DPair > &hits)
this function is called in the producer
void addHits(const DTSuperLayer *sl, std::vector< AssPoint > &assHits, const std::vector< DTHitPairForFit * > &hits, std::vector< DTSegmentCand * > &result, std::vector< AssPoint > &usedHits)
DTMeantimerPatternReco(const edm::ParameterSet &pset)
Constructor.
double a
Definition: hdecay.h:121
void setup(std::vector< TH2F > &depth, std::string name, std::string units="")
edm::ESHandle< DTGeometry > theDTGeometry