CMS 3D CMS Logo

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 &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
DTPattern::addHit
void addHit(RefDTPatternHit hit)
Definition: DTPattern.cc:30
DTPattern::latHitIn
int latHitIn(int slId, int chId, int allowedVariance) const
Definition: DTPattern.cc:38
DTPattern::operator<<
friend std::ostream & operator<<(std::ostream &out, DTPattern &p)
Definition: DTPattern.cc:56
DTPattern::diff
int diff() const
Definition: DTPattern.h:42
DTPattern::id_
DTPatternIdentifier id_
Definition: DTPattern.h:56
DTPattern::recoseedDown_
int recoseedDown_
Definition: DTPattern.h:59
AlCaHLTBitMon_ParallelJobs.p
p
Definition: AlCaHLTBitMon_ParallelJobs.py:153
DTPattern::seedDown_
RefDTPatternHit seedDown_
Definition: DTPattern.h:51
PseudoBayesGrouping_cfi.allowedVariance
allowedVariance
Definition: PseudoBayesGrouping_cfi.py:12
DTPattern
Definition: DTPattern.h:15
DTPattern::id
DTPatternIdentifier id() const
Definition: DTPattern.h:39
DTPattern::~DTPattern
virtual ~DTPattern()
Definition: DTPattern.cc:69
DTPattern::sl2
int sl2() const
Definition: DTPattern.h:41
DTPattern::debug_
bool debug_
Definition: DTPattern.h:60
DTPattern::setHitDown
void setHitDown(int chIdDown)
Definition: DTPattern.h:36
DTPattern::setHitUp
void setHitUp(int chIdUp)
Definition: DTPattern.h:35
DTPattern::DTPattern
DTPattern()
Definition: DTPattern.cc:10
DTPatternIdentifier
std::tuple< int, int, int > DTPatternIdentifier
Definition: DTPattern.h:13
DTPattern::recoseedUp_
int recoseedUp_
Definition: DTPattern.h:58
DTPattern::genHits_
std::vector< RefDTPatternHit > genHits_
Definition: DTPattern.h:53
DTPattern::genHits
const std::vector< RefDTPatternHit > & genHits() const
Definition: DTPattern.h:43
MillePedeFileConverter_cfg.out
out
Definition: MillePedeFileConverter_cfg.py:31
DTPattern::sl1
int sl1() const
Definition: DTPattern.h:40
DTPattern::seedUp_
RefDTPatternHit seedUp_
Definition: DTPattern.h:50
RefDTPatternHit
std::tuple< int, int, int > RefDTPatternHit
Definition: DTPattern.h:10
hit
Definition: SiStripHitEffFromCalibTree.cc:88