Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 14:21:58

0001 //-------------------------------------------------
0002 //
0003 /**   \class DTSectColl.h
0004  *    Implementation of Sector Collector trigger algorithm
0005  *
0006  *
0007  *
0008  *
0009  *    \author D. Bonacorsi, S. Marcellini
0010  */
0011 //--------------------------------------------------
0012 #ifndef DT_SECT_COLL_H
0013 #define DT_SECT_COLL_H
0014 
0015 //------------------------------------
0016 // Collaborating Class Declarations --
0017 //------------------------------------
0018 class DTTracoTrigData;
0019 class DTSectCollCand;
0020 class DTConfigSectColl;
0021 class DTTrigGeom;
0022 class DTChambPhSegm;
0023 class DTChambThSegm;
0024 class DTSectCollSegm;
0025 class DTSC;
0026 class DTTSPhi;
0027 class DTTSTheta;
0028 class DTSCTrigUnit;
0029 
0030 //----------------------
0031 // Base Class Headers --
0032 //----------------------
0033 #include "L1Trigger/DTUtilities/interface/DTCache.h"
0034 #include "L1Trigger/DTSectorCollector/interface/DTSectCollPhCand.h"
0035 #include "L1Trigger/DTSectorCollector/interface/DTSectCollThCand.h"
0036 #include "L1Trigger/DTSectorCollector/interface/DTSectCollPhSegm.h"
0037 #include "L1Trigger/DTSectorCollector/interface/DTSectCollThSegm.h"
0038 #include "DataFormats/MuonDetId/interface/DTSectCollId.h"
0039 #include "L1TriggerConfig/DTTPGConfig/interface/DTConfigManager.h"
0040 #include "FWCore/ParameterSet/interface/ParameterSet.h"
0041 
0042 //---------------
0043 // C++ Headers --
0044 //---------------
0045 #include <vector>
0046 
0047 //              ---------------------
0048 //              -- Class Interface --
0049 //              ---------------------
0050 
0051 typedef std::vector<DTSectCollPhSegm> DTSectCollPhVector;
0052 typedef std::vector<DTSectCollThSegm> DTSectCollThVector;
0053 typedef DTCache<DTSectCollPhSegm, DTSectCollPhVector> DTSCPhCache;
0054 typedef DTCache<DTSectCollThSegm, DTSectCollThVector> DTSCThCache;
0055 
0056 class DTSectColl : public DTSCPhCache, public DTSCThCache {
0057 public:
0058   //!  Constructor
0059   //DTSectColl(edm::ParameterSet& sc_pset);
0060   DTSectColl(DTSectCollId id);
0061 
0062   //!  Destructor
0063   ~DTSectColl() override;
0064 
0065   /// Set configuration
0066   void setConfig(const DTConfigManager* conf);
0067 
0068   //! Return TSPhi
0069   inline DTTSPhi* getTSPhi(int istat) const { return _tsphi[istat - 1]; }
0070 
0071   //! Return TSTheta
0072   inline DTTSTheta* getTSTheta(int istat) const { return _tstheta[istat - 1]; }
0073 
0074   //!Configuration
0075   inline const DTConfigSectColl* config() const { return _config; }
0076 
0077   // non-const methods
0078 
0079   /*   //! Add a TSM candidate to the Sect Coll, ifs is first/second track flag  */
0080   /*   void addCandPh(DTSectCollPhCand* cand);  */
0081 
0082   /*   //! Add a TS Theta candidate to the Sect Coll, ifs is first/second track flag  */
0083   /*   void addCandTh(DTSectCollThCand* cand); */
0084 
0085   /*    //! Set a flag to skip sort2 */
0086   /*    void ignoreSecondTrack() { _ignoreSecondTrack=1; } */
0087 
0088   //! Local Clear
0089   void localClear();
0090 
0091   //! Load a Sector Collector
0092   void loadSectColl();
0093 
0094   //! Add a TSM candidate (step is TSM step not SC one)
0095   void addTSPhi(int step, const DTChambPhSegm* tsmsegm, int ifs, int istat);
0096 
0097   //! Add a TS Theta candidate (step is TSTheta step not sc one)
0098   void addTSTheta(int step, const DTChambThSegm* tsmsegm, int istat);
0099 
0100   //! Add a Trigger Unit to the Sector Collector
0101   void addTU(DTSCTrigUnit* tru);
0102 
0103   //! Get a Sector Collector (step is TS one)
0104   DTSC* getDTSC(int step, int istat) const;
0105 
0106   //! Run Sector Collector
0107   void runSectColl();
0108 
0109   //! Get a Phi Candidate for Sector Collector
0110   DTSectCollPhCand* getDTSectCollPhCand(int ifs, unsigned n) const;
0111 
0112   //! Get a Candidate for Sector Collector
0113   DTSectCollThCand* getDTSectCollThCand(unsigned n) const;
0114 
0115   // const methods
0116 
0117   //! Return the requested Phi track
0118   DTSectCollPhCand* getTrackPh(int n) const;
0119 
0120   //! Return the requested Theta track
0121   DTSectCollThCand* getTrackTh(int n) const;
0122 
0123   //! Return the number of Phi input tracks (first/second)
0124   unsigned nCandPh(int ifs) const;
0125 
0126   //! Return the number of Theta input tracks
0127   unsigned nCandTh() const;
0128 
0129   //! Return number of DTSectCollPhi segments (SC step)
0130   int nSegmPh(int step);
0131 
0132   //! Return number of DTSectCollTheta segments (SC step)
0133   int nSegmTh(int step);
0134 
0135   //! Return the number of output Phi tracks
0136   inline int nTracksPh() const { return _outcand_ph.size(); }
0137 
0138   //! Return the number of output Theta tracks
0139   inline int nTracksTh() const { return _outcand_th.size(); }
0140 
0141   //! Return requested Sector Collector Phi Segment 1st/2nd
0142   const DTSectCollPhSegm* SectCollPhSegment(int step, unsigned n);
0143 
0144   //! Return requested Sector Collector Theta Segment
0145   const DTSectCollThSegm* SectCollThSegment(int step);
0146 
0147   //! Return iterator to the beghin of Phi cache
0148   std::vector<DTSectCollPhSegm>::const_iterator beginPh() const { return DTSCPhCache::_cache.begin(); }
0149 
0150   //! Return Phi cache size
0151   int sizePh() const { return DTSCPhCache::_cache.size(); }
0152 
0153   //! Return iterator to the end of Phi cache
0154   std::vector<DTSectCollPhSegm>::const_iterator endPh() const { return DTSCPhCache::_cache.end(); }
0155 
0156   //! Return iterator to the begni of Theta cache
0157   std::vector<DTSectCollThSegm>::const_iterator beginTh() const { return DTSCThCache::_cache.begin(); }
0158 
0159   //! Return Theta cache size
0160   int sizeTh() const { return DTSCThCache::_cache.size(); }
0161 
0162   //! Return iterator to the end of Theta cache
0163   std::vector<DTSectCollThSegm>::const_iterator endTh() const { return DTSCThCache::_cache.end(); }
0164 
0165   //! Local position in chamber of a trigger-data object
0166   //  LocalPoint LocalPosition(const DTTrigData*) const;
0167 
0168   //! Local direction in chamber of a trigger-data object
0169   //  LocalVector LocalDirection(const DTTrigData*) const;
0170 
0171   //! Clear both (Phi and Theta) caches
0172   void clearCache() {
0173     DTSCPhCache::clearCache();
0174     DTSCThCache::clearCache();
0175   }
0176 
0177   //! Load Trigger Units triggers and run Sector Collector algorithm
0178   void reconstruct() override {
0179     loadSectColl();
0180     runSectColl();
0181   }
0182 
0183   //! Return the Sector Collector Id
0184   DTSectCollId SectCollId() { return _sectcollid; }
0185 
0186 private:
0187   // Configuration
0188   const DTConfigSectColl* _config;
0189 
0190   // SC Id
0191   DTSectCollId _sectcollid;
0192 
0193   DTTSPhi* _tsphi[DTConfigSectColl::NTSPSC];
0194   DTTSTheta* _tstheta[DTConfigSectColl::NTSTSC];
0195 
0196   // SM: new  sector collector
0197   DTSC* _tsc[DTConfigSectColl::NSTEPL - DTConfigSectColl::NSTEPF + 1][DTConfigSectColl::NDTSC];
0198 
0199   // input data Phi
0200   std::vector<DTSectCollPhCand*> _incand_ph[2];
0201 
0202   // output data Phi
0203   std::vector<DTSectCollPhCand*> _outcand_ph;
0204 
0205   // input data Theta
0206   std::vector<DTSectCollThCand*> _incand_th;
0207 
0208   // output data Theta
0209   std::vector<DTSectCollThCand*> _outcand_th;
0210 };
0211 #endif