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 
17 /* Base Class Headers */
19 
20 /* Collaborating Class Declarations */
21 namespace edm {
22  class ParameterSet;
23  class EventSetup;
24  // class ESHandle;
25 }
26 class DTSegmentUpdator;
27 class DTSegmentCleaner;
28 class DTHitPairForFit;
29 class DTSegmentCand;
30 
31 /* C++ Headers */
32 #include <vector>
33 #include <deque>
34 #include <utility>
35 
38 
39 /* ====================================================================== */
40 
41 /* Class DTMeantimerPatternReco Interface */
42 
44 
45  public:
46 
49 
51  virtual ~DTMeantimerPatternReco() ;
52 
53  /* Operations */
54 
57  reconstruct(const DTSuperLayer* sl,
58  const std::vector<DTRecHit1DPair>& hits);
59 
61  virtual std::string algoName() const { return theAlgoName; }
62 
65  virtual void setES(const edm::EventSetup& setup);
66 
67  protected:
68 
69  private:
71 
72  typedef std::pair<DTHitPairForFit*, DTEnums::DTCellSide> AssPoint;
73 
74  // create the DTHitPairForFit from the pairs for easy use
75  std::vector<DTHitPairForFit*> initHits(const DTSuperLayer* sl,
76  const std::vector<DTRecHit1DPair>& hits);
77 
78  // search for candidate, starting from pairs of hits in different layers
79  std::vector<DTSegmentCand*> buildSegments(const DTSuperLayer* sl,
80  const std::vector<DTHitPairForFit*>& hits);
81 
82  // try adding more hits to a candidate
83  void addHits(const DTSuperLayer* sl,
84  std::vector<AssPoint>& assHits,
85  const std::vector<DTHitPairForFit*>& hits,
86  std::vector<DTSegmentCand*> &result,
87  std::vector<AssPoint>& usedHits);
88 
89  // fit a set of left/right hits, calculate t0 and chi^2
90  bool fitWithT0(const std::vector<AssPoint> &assHits, double &chi2, double &t0_corr, const bool fitdebug);
91 
92  // check if two hist can be considered in one segment (come from different layers, not too far away etc.)
93  bool geometryFilter( const DTWireId first, const DTWireId second ) const;
94 
95  // a generic least-square fit to a set of points
96  void rawFit(double &a, double &b, const std::vector< std::pair<double,double> > &hits);
97 
98  bool checkDoubleCandidates(std::vector<DTSegmentCand*>& segs,
99  DTSegmentCand* seg);
100 
101  private:
102 
103  std::string theAlgoName;
104  unsigned int theMaxAllowedHits;
107  double theMaxChi2;
108  double theMaxT0;
109  double theMinT0;
110  bool debug;
111  DTSegmentUpdator* theUpdator; // the updator and fitter
112  DTSegmentCleaner* theCleaner; // the cleaner
113 
114  unsigned int maxfound;
115 
117 };
118 #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:94
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