test
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 class DTLinearFit;
29 
30 /* C++ Headers */
31 #include <vector>
32 #include <deque>
33 #include <utility>
34 
38 
39 /* ====================================================================== */
40 
41 /* Class DTMeantimerPatternReco Interface */
42 
43 
45 
46  public:
47 
50 
52  virtual ~DTMeantimerPatternReco() ;
53 
54  /* Operations */
55 
58  reconstruct(const DTSuperLayer* sl,
59  const std::vector<DTRecHit1DPair>& hits);
60 
62  virtual std::string algoName() const { return theAlgoName; }
63 
66  virtual void setES(const edm::EventSetup& setup);
67 
68  protected:
69 
70  private:
71  DTLinearFit* theFitter; // the linear fitter
72 
74 
75  // typedef std::pair<DTHitPairForFit*, DTEnums::DTCellSide> AssPoint;
76 
77  // create the DTHitPairForFit from the pairs for easy use
78  std::vector<std::shared_ptr<DTHitPairForFit>> initHits(const DTSuperLayer* sl,
79  const std::vector<DTRecHit1DPair>& hits);
80 
81  // search for candidate, starting from pairs of hits in different layers
82  std::vector<DTSegmentCand*> buildSegments(const DTSuperLayer* sl,
83  const std::vector<std::shared_ptr<DTHitPairForFit>>& hits);
84 
85  // try adding more hits to a candidate
86  void addHits(const DTSuperLayer* sl,
87  std::vector<DTSegmentCand::AssPoint>& assHits,
88  const std::vector<std::shared_ptr<DTHitPairForFit>>& hits,
89  std::vector<DTSegmentCand*> &result);
90 
91  // fit a set of left/right hits, calculate t0 and chi^2
92  std::unique_ptr<DTSegmentCand> fitWithT0(const DTSuperLayer* sl,
93  const std::vector<DTSegmentCand::AssPoint> &assHits,
94  double &chi2,
95  double &t0_corr,
96  const bool fitdebug);
97 
98  // check if two hist can be considered in one segment (come from different layers, not too far away etc.)
99  bool geometryFilter( const DTWireId first, const DTWireId second ) const;
100 
101  bool checkDoubleCandidates(std::vector<DTSegmentCand*>& segs,
102  DTSegmentCand* seg);
103 
104  void printPattern( std::vector<DTSegmentCand::AssPoint>& assHits, const DTHitPairForFit* hit);
105 
106 
107  private:
108 
110  unsigned int theMaxAllowedHits;
113  double theMaxChi2;
114  bool debug;
115  DTSegmentUpdator* theUpdator; // the updator and fitter
116  DTSegmentCleaner* theCleaner; // the cleaner
117 
118  unsigned int maxfound;
119 
121 };
122 #endif // DTSegment_DTMeantimerPatternReco_h
std::vector< std::shared_ptr< DTHitPairForFit > > initHits(const DTSuperLayer *sl, const std::vector< DTRecHit1DPair > &hits)
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)
std::vector< DTSegmentCand * > buildSegments(const DTSuperLayer *sl, const std::vector< std::shared_ptr< DTHitPairForFit >> &hits)
virtual void setES(const edm::EventSetup &setup)
std::unique_ptr< DTSegmentCand > fitWithT0(const DTSuperLayer *sl, const std::vector< DTSegmentCand::AssPoint > &assHits, double &chi2, double &t0_corr, const bool fitdebug)
tuple result
Definition: query.py:137
bool first
Definition: L1TdeRCT.cc:75
void printPattern(std::vector< DTSegmentCand::AssPoint > &assHits, const DTHitPairForFit *hit)
void addHits(const DTSuperLayer *sl, std::vector< DTSegmentCand::AssPoint > &assHits, const std::vector< std::shared_ptr< DTHitPairForFit >> &hits, std::vector< DTSegmentCand * > &result)
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
DTMeantimerPatternReco(const edm::ParameterSet &pset)
Constructor.
void setup(std::vector< TH2F > &depth, std::string name, std::string units="")
edm::ESHandle< DTGeometry > theDTGeometry