CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_5_3_9_patch3/src/L1Trigger/DTTrackFinder/interface/L1MuDTTrack.h

Go to the documentation of this file.
00001 //-------------------------------------------------
00002 //
00014 //
00015 //--------------------------------------------------
00016 #ifndef L1MUDT_TRACK_H
00017 #define L1MUDT_TRACK_H
00018 
00019 //---------------
00020 // C++ Headers --
00021 //---------------
00022 
00023 #include <iosfwd>
00024 #include <string>
00025 #include <vector>
00026 #include <functional>
00027 
00028 //----------------------
00029 // Base Class Headers --
00030 //----------------------
00031 
00032 #include "DataFormats/L1GlobalMuonTrigger/interface/L1MuRegionalCand.h"
00033 
00034 //------------------------------------
00035 // Collaborating Class Declarations --
00036 //------------------------------------
00037 
00038 #include <FWCore/Framework/interface/ESHandle.h>
00039 #include <FWCore/Framework/interface/EventSetup.h>
00040 #include "L1Trigger/DTTrackFinder/src/L1MuDTTrackAssParam.h"
00041 #include "L1Trigger/DTTrackFinder/src/L1MuDTAddressArray.h"
00042 #include "L1Trigger/DTTrackFinder/src/L1MuDTTrackSegPhi.h"
00043 #include "L1Trigger/DTTrackFinder/src/L1MuDTTrackSegEta.h"
00044 #include "L1Trigger/DTTrackFinder/src/L1MuDTSecProcId.h"
00045 
00046 
00047 //              ---------------------
00048 //              -- Class Interface --
00049 //              ---------------------
00050 
00051 class L1MuDTTrack : public L1MuRegionalCand {
00052 
00053   public:
00054 
00056     L1MuDTTrack();
00057 
00059     L1MuDTTrack(const L1MuDTSecProcId&);
00060    
00062     L1MuDTTrack(const L1MuDTTrack&);
00063 
00065     virtual ~L1MuDTTrack();
00066 
00068     void reset();
00069 
00071     inline std::string name() const { return m_name; }
00072 
00074     inline unsigned int pt() const { return pt_packed(); }
00075 
00077     inline unsigned int phi() const { return phi_packed(); }
00078 
00080     inline unsigned int eta() const { return eta_packed(); }
00081     
00083     inline bool fineEtaBit() const { return isFineHalo(); }
00084     
00086     inline int charge() const { return chargeValue(); }
00087     
00089     inline TrackClass tc() const { return m_tc; }
00090 
00092     inline bool empty() const { return m_empty; }
00093     
00095     inline const L1MuDTSecProcId& spid() const { return m_spid; }
00096     
00098     inline L1MuDTAddressArray address() const { return m_addArray; }
00099     
00101     inline int address(int stat) const { return m_addArray.station(stat); }
00102     
00104     inline int numberOfTSphi() const { return m_tsphiList.size(); }
00105     
00107     inline int numberOfTSeta() const { return m_tsetaList.size(); }
00108     
00110     const std::vector<L1MuDTTrackSegPhi>& getTSphi() const { return m_tsphiList; }
00111 
00113     const L1MuDTTrackSegPhi& getStartTSphi() const;
00114     
00116     const L1MuDTTrackSegPhi& getEndTSphi() const;
00117 
00119     const std::vector<L1MuDTTrackSegEta>& getTSeta() const { return m_tsetaList; }
00120     
00122     const L1MuDTTrackSegEta& getStartTSeta() const;
00123     
00125     const L1MuDTTrackSegEta& getEndTSeta() const;
00126 
00128     inline void enable() { m_empty = false; setType(0); }
00129     
00131     inline void disable() { m_empty = true; }
00132        
00134     inline void setName(std::string name) { m_name = name; }
00135         
00137     inline void setTC(TrackClass tc) { m_tc = tc; }
00138     
00140     inline void setPhi(int phi) { setPhiPacked(phi); }
00141     
00143     void setEta(int eta);
00144     
00146     inline void setFineEtaBit() { setFineHalo(true); }
00147     
00149     inline void setPt(int pt) { setPtPacked(pt); }
00150     
00152     inline void setCharge(int charge) { setChargeValue(charge); setChargeValid(true); }
00153     
00155     inline void setQuality(unsigned int quality) { setQualityPacked(quality); }
00156     
00158     inline void setAddresses(const L1MuDTAddressArray& addr) { m_addArray = addr; }
00159     
00161     void setTSphi(const std::vector<const L1MuDTTrackSegPhi*>& tsList);
00162 
00164     void setTSeta(const std::vector<const L1MuDTTrackSegEta*>& tsList);
00165  
00167     unsigned int triggerScale(float value, const edm::EventSetup& c) const;
00168 
00170     L1MuDTTrack& operator=(const L1MuDTTrack&);
00171 
00173     bool operator==(const L1MuDTTrack&) const;
00174     
00176     bool operator!=(const L1MuDTTrack&) const;
00177 
00179     void print() const;
00180   
00182     friend std::ostream& operator<<(std::ostream&, const L1MuDTTrack&);
00183 
00185     class Rank : std::binary_function< const L1MuDTTrack*, const L1MuDTTrack*, bool> {
00186       public :
00187         bool operator()( const L1MuDTTrack* first, const L1MuDTTrack* second ) const {
00188          unsigned short int rank_f = 0;  // rank of first
00189          unsigned short int rank_s = 0;  // rank of second
00190          if ( first )  rank_f = 10 * first->pt()  + first->quality(); 
00191          if ( second ) rank_s = 10 * second->pt() + second->quality(); 
00192          return rank_f > rank_s;
00193        }
00194     };
00195 
00196 
00197   private:
00198 
00199     L1MuDTSecProcId  m_spid;      // which SP found the track 
00200     std::string      m_name;
00201     bool             m_empty;      
00202     TrackClass       m_tc;
00203 
00204     L1MuDTAddressArray         m_addArray;
00205     std::vector<L1MuDTTrackSegPhi>  m_tsphiList;
00206     std::vector<L1MuDTTrackSegEta>  m_tsetaList;
00207 
00208 };
00209   
00210 #endif