Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 14:22:06

0001 //-------------------------------------------------
0002 //
0003 /**  \class DTTSS
0004  *    Implementation of TSS trigger algorithm
0005  *
0006  *
0007  *
0008  *   \author C. Grandi, D. Bonacorsi, S. Marcellini
0009  */
0010 //
0011 //--------------------------------------------------
0012 #ifndef DT_TSS_H
0013 #define DT_TSS_H
0014 
0015 //------------------------------------
0016 // Collaborating Class Declarations --
0017 //------------------------------------
0018 class DTTracoTrigData;
0019 class DTTSCand;
0020 class DTConfigTSPhi;
0021 
0022 //----------------------
0023 // Base Class Headers --
0024 //----------------------
0025 
0026 //---------------
0027 // C++ Headers --
0028 //---------------
0029 #include <string>
0030 #include <vector>
0031 
0032 //              ---------------------
0033 //              -- Class Interface --
0034 //              ---------------------
0035 
0036 class DTTSS {
0037 public:
0038   /// Constructor
0039   DTTSS(int);
0040 
0041   /// Destructor
0042   ~DTTSS();
0043 
0044   /// Add a TS candidate to the TSS, ifs is first/second track flag
0045   void addDTTSCand(DTTSCand *cand);
0046 
0047   /// Set configuration
0048   void setConfig(const DTConfigTSPhi *config) { _config = config; }
0049 
0050   /// Set a flag to skip sort2
0051   void ignoreSecondTrack() { _ignoreSecondTrack = 1; }
0052 
0053   /// Run the TSS algorithm
0054   void run();
0055 
0056   /// Sort 1
0057   DTTSCand *sortTSS1();
0058 
0059   /// Sort 2
0060   DTTSCand *sortTSS2();
0061 
0062   /// Clear
0063   void clear();
0064 
0065   /// Return identifier
0066   inline int number() const { return _n; }
0067 
0068   /// Configuration set
0069   inline const DTConfigTSPhi *config() const { return _config; }
0070 
0071   /// Return the number of input tracks (first/second)
0072   unsigned nTracoT(int ifs) const;
0073 
0074   /// Return the number of input first tracks
0075   inline int nFirstT() const { return _tctrig[0].size(); }
0076 
0077   /// Return the number of input second tracks
0078   inline int nSecondT() const { return _tctrig[1].size(); }
0079 
0080   /// Return requested TS candidate
0081   DTTSCand *getDTTSCand(int ifs, unsigned n) const;
0082 
0083   /// Return requested TRACO trigger
0084   const DTTracoTrigData *getTracoT(int ifs, unsigned n) const;
0085 
0086   /// Return the carry (for debugging)
0087   DTTSCand *getCarry() const;
0088 
0089   /// Return the number of sorted tracks
0090   inline int nTracks() const { return _outcand.size(); }
0091 
0092   /// Return the requested track
0093   DTTSCand *getTrack(int n) const;
0094 
0095   /// Return the requested log word
0096   std::string logWord(int n) const;
0097 
0098 private:
0099   const DTConfigTSPhi *_config;
0100 
0101   // identification
0102   int _n;
0103 
0104   // input data
0105   std::vector<DTTSCand *> _tctrig[2];
0106 
0107   // output data
0108   std::vector<DTTSCand *> _outcand;
0109 
0110   // internal use variables
0111   int _ignoreSecondTrack;
0112 
0113   // log words
0114   std::string _logWord1;
0115   std::string _logWord2;
0116 };
0117 
0118 #endif