Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2022-05-12 01:51:32

0001 #ifndef L1Trigger_DTTriggerPhase2_DTPattern_h
0002 #define L1Trigger_DTTriggerPhase2_DTPattern_h
0003 
0004 #include <tuple>
0005 #include <vector>
0006 #include <iostream>
0007 
0008 // Typedef for refHits organized as [SL, Cell, Laterality]. Using integers is an
0009 // overkill for something that only needs 3, 7 and 2 bits.
0010 typedef std::tuple<int, int, int> RefDTPatternHit;
0011 // Another overkill typing for the pattern identifier
0012 // [SLUp, SLDown, ChambedUp-ChamberDown], only need 3, 3 and 5 bits
0013 typedef std::tuple<int, int, int> DTPatternIdentifier;
0014 
0015 class DTPattern {
0016   // A pattern is a seed plus a set of hits. Translational simmetry is used to
0017   // translate it across all posible recoHits in the lower (upper layer) and
0018   // check for pattern hit matches of recohits.
0019 public:
0020   //Constructors and destructors
0021   DTPattern();
0022   DTPattern(RefDTPatternHit seedUp, RefDTPatternHit seedDown);
0023   DTPattern(int SL1, int SL2, int diff);
0024   virtual ~DTPattern();
0025 
0026   //Adding hits to the pattern
0027   void addHit(RefDTPatternHit hit);
0028   // Given the up and down seeding hits check if a given hit is in the pattern.
0029   // Returns -1 for left laterality, +1 for right laterality, 0 if undecided
0030   // and -999 if not in the pattern
0031   int latHitIn(int slId, int chId, int allowedVariance) const;
0032 
0033   // When comparing with a given set of hits we need to set up at least one of
0034   // those two to compute the translation
0035   void setHitUp(int chIdUp) { recoseedUp_ = chIdUp; }
0036   void setHitDown(int chIdDown) { recoseedDown_ = chIdDown; }
0037 
0038   //Get methods
0039   DTPatternIdentifier id() const { return id_; }
0040   int sl1() const { return std::get<0>(id_); }
0041   int sl2() const { return std::get<1>(id_); }
0042   int diff() const { return std::get<2>(id_); }
0043   const std::vector<RefDTPatternHit> &genHits() const { return genHits_; }
0044 
0045   //Printing
0046   friend std::ostream &operator<<(std::ostream &out, DTPattern const &p);
0047 
0048 private:
0049   //Generated seeds
0050   RefDTPatternHit seedUp_;
0051   RefDTPatternHit seedDown_;
0052   // Generated hits
0053   std::vector<RefDTPatternHit> genHits_;
0054   // Pattern is classified in terms of SL + chamber differences to profit from
0055   // translational invariance
0056   DTPatternIdentifier id_;
0057   //Generated seeds + hits translated to a given seed pair
0058   int recoseedUp_;
0059   int recoseedDown_;
0060   const bool debug_ = false;
0061 };
0062 
0063 #endif