Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 12:53:57

0001 #ifndef DataFormats_L1TrackTrigger_TTDTC_h
0002 #define DataFormats_L1TrackTrigger_TTDTC_h
0003 
0004 #include "DataFormats/L1TrackTrigger/interface/TTTypes.h"
0005 #include "DataFormats/L1TrackTrigger/interface/TTBV.h"
0006 
0007 #include <bitset>
0008 #include <utility>
0009 #include <vector>
0010 
0011 /*! 
0012  * \class  TTDTC
0013  * \brief  Class to store hardware like structured TTStub Collection used by Track Trigger emulators
0014  * \author Thomas Schuh
0015  * \date   2020, Jan
0016  */
0017 class TTDTC {
0018 public:
0019   // bit accurate Stub
0020   typedef std::bitset<TTBV::S> BV;
0021   // TTStub with bit accurate Stub
0022   typedef std::pair<TTStubRef, BV> Frame;
0023   // stub collection transported over an optical link between DTC and TFP
0024   typedef std::vector<Frame> Stream;
0025   // collection of optical links
0026   typedef std::vector<Stream> Streams;
0027 
0028   TTDTC() {}
0029   TTDTC(int numRegions, int numOverlappingRegions, int numDTCsPerRegion);
0030   ~TTDTC() {}
0031 
0032   // all regions [default 0..8]
0033   const std::vector<int>& tfpRegions() const { return regions_; }
0034   // all TFP channel [default 0..47]
0035   const std::vector<int>& tfpChannels() const { return channels_; }
0036   // write one specific stream of TTStubRefs using DTC identifier (region[0-8], board[0-23], channel[0-1])
0037   // dtcRegions aka detector regions are defined by tk layout
0038   void setStream(int dtcRegion, int dtcBoard, int dtcChannel, const Stream& stream);
0039   // read one specific stream of TTStubRefs using TFP identifier (region[0-8], channel[0-47])
0040   // tfpRegions aka processing regions are rotated by -0.5 region width w.r.t detector regions
0041   const Stream& stream(int tfpRegion, int tfpChannel) const;
0042   // total number of frames
0043   int size() const;
0044   // total number of stubs
0045   int nStubs() const;
0046   // total number of gaps
0047   int nGaps() const;
0048 
0049 private:
0050   // converts DTC identifier (region[0-8], board[0-23], channel[0-1]) into allStreams_ index [0-431]
0051   int index(int dtcRegion, int dtcBoard, int dtcChannel) const;
0052   // converts TFP identifier (region[0-8], channel[0-47]) into allStreams_ index [0-431]
0053   int index(int tfpRegion, int tfpChannel) const;
0054   // number of phi slices the outer tracker readout is organized in [default 9]
0055   int numRegions_;
0056   // number of regions a reconstructable particle may cross [default 2]
0057   int numOverlappingRegions_;
0058   // number of DTC boards used to readout a detector region [default 24]
0059   int numDTCsPerRegion_;
0060   // number of DTC boards connected to one TFP [default 48]
0061   int numDTCsPerTFP_;
0062   // all regions [default 0..8]
0063   std::vector<int> regions_;
0064   // all TFP channel [default 0..47]
0065   std::vector<int> channels_;
0066   // collection of all optical links between DTC and TFP [default 432 links]
0067   Streams streams_;
0068 };
0069 
0070 #endif