CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
DTPattern.h
Go to the documentation of this file.
1 #ifndef L1Trigger_DTTriggerPhase2_DTPattern_h
2 #define L1Trigger_DTTriggerPhase2_DTPattern_h
3 
4 #include <tuple>
5 #include <vector>
6 #include <iostream>
7 
8 // Typedef for refHits organized as [SL, Cell, Laterality]. Using integers is an
9 // overkill for something that only needs 3, 7 and 2 bits.
10 typedef std::tuple<int, int, int> RefDTPatternHit;
11 // Another overkill typing for the pattern identifier
12 // [SLUp, SLDown, ChambedUp-ChamberDown], only need 3, 3 and 5 bits
13 typedef std::tuple<int, int, int> DTPatternIdentifier;
14 
15 class DTPattern {
16  // A pattern is a seed plus a set of hits. Translational simmetry is used to
17  // translate it across all posible recoHits in the lower (upper layer) and
18  // check for pattern hit matches of recohits.
19 public:
20  //Constructors and destructors
21  DTPattern();
22  DTPattern(RefDTPatternHit seedUp, RefDTPatternHit seedDown);
23  DTPattern(int SL1, int SL2, int diff);
24  virtual ~DTPattern();
25 
26  //Adding hits to the pattern
28  // Given the up and down seeding hits check if a given hit is in the pattern.
29  // Returns -1 for left laterality, +1 for right laterality, 0 if undecided
30  // and -999 if not in the pattern
31  int latHitIn(int slId, int chId, int allowedVariance) const;
32 
33  // When comparing with a given set of hits we need to set up at least one of
34  // those two to compute the translation
35  void setHitUp(int chIdUp) { recoseedUp_ = chIdUp; }
36  void setHitDown(int chIdDown) { recoseedDown_ = chIdDown; }
37 
38  //Get methods
39  DTPatternIdentifier id() const { return id_; }
40  int sl1() const { return std::get<0>(id_); }
41  int sl2() const { return std::get<1>(id_); }
42  int diff() const { return std::get<2>(id_); }
43  const std::vector<RefDTPatternHit> &genHits() const { return genHits_; }
44 
45  //Printing
46  friend std::ostream &operator<<(std::ostream &out, DTPattern const &p);
47 
48 private:
49  //Generated seeds
52  // Generated hits
53  std::vector<RefDTPatternHit> genHits_;
54  // Pattern is classified in terms of SL + chamber differences to profit from
55  // translational invariance
57  //Generated seeds + hits translated to a given seed pair
60  bool debug_ = false;
61 };
62 
63 #endif
void setHitDown(int chIdDown)
Definition: DTPattern.h:36
int sl1() const
Definition: DTPattern.h:40
void addHit(RefDTPatternHit hit)
Definition: DTPattern.cc:30
std::vector< RefDTPatternHit > genHits_
Definition: DTPattern.h:53
RefDTPatternHit seedDown_
Definition: DTPattern.h:51
virtual ~DTPattern()
Definition: DTPattern.cc:69
int diff() const
Definition: DTPattern.h:42
std::tuple< int, int, int > RefDTPatternHit
Definition: DTPattern.h:10
int recoseedDown_
Definition: DTPattern.h:59
const std::vector< RefDTPatternHit > & genHits() const
Definition: DTPattern.h:43
bool debug_
Definition: DTPattern.h:60
RefDTPatternHit seedUp_
Definition: DTPattern.h:50
int sl2() const
Definition: DTPattern.h:41
int recoseedUp_
Definition: DTPattern.h:58
std::tuple< int, int, int > DTPatternIdentifier
Definition: DTPattern.h:13
int latHitIn(int slId, int chId, int allowedVariance) const
Definition: DTPattern.cc:38
friend std::ostream & operator<<(std::ostream &out, DTPattern const &p)
Definition: DTPattern.cc:56
DTPatternIdentifier id_
Definition: DTPattern.h:56
DTPatternIdentifier id() const
Definition: DTPattern.h:39
void setHitUp(int chIdUp)
Definition: DTPattern.h:35