Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:11:11

0001 #ifndef SIMPLEL1MU_GMT_CAND_H
0002 #define SIMPLEL1MU_GMT_CAND_H
0003 
0004 #include <DataFormats/L1GlobalMuonTrigger/interface/L1MuGMTExtendedCand.h>
0005 
0006 #include "DataFormats/Math/interface/LorentzVector.h"
0007 
0008 class SimTrack;
0009 
0010 namespace HepMC {
0011   class GenParticle;
0012 }
0013 
0014 /** \class SimpleL1MuGMTCand
0015  *   Description: Simple L1 Global Muon Trigger Candidate 
0016  *   Inherits the basics from 'L1MuGMTCand' base class.
0017  *   Contains pointer to RawHepEventParticle from the
0018  *   event manager. Allows easy conversion from a 
0019  *   RawHepEventParticle.
0020  *
0021  *   Author:      Andrea Perrotta     05/09/2006
0022  */
0023 
0024 class SimpleL1MuGMTCand : public L1MuGMTExtendedCand {
0025 public:
0026   typedef math::XYZTLorentzVector LorentzVector;
0027 
0028   /// constructor
0029   SimpleL1MuGMTCand();
0030 
0031   /// copy constructor
0032   SimpleL1MuGMTCand(const SimpleL1MuGMTCand&);
0033 
0034   /// copy constructor from pointer
0035   SimpleL1MuGMTCand(const SimpleL1MuGMTCand*);
0036 
0037   /// convert a FSimTrack into a SimpleL1MuGMTCand (L1MuGMTExtendedCand)
0038   SimpleL1MuGMTCand(const SimTrack*);
0039 
0040   /// The same as above, but without relying on internal tables (safer)
0041   SimpleL1MuGMTCand(const SimTrack* p,
0042                     unsigned etaIndex,
0043                     unsigned phiIndex,
0044                     unsigned pTIndex,
0045                     float etaValue,
0046                     float phiValue,
0047                     float pTValue);
0048 
0049   /// destructor
0050   ~SimpleL1MuGMTCand() override;
0051 
0052   /// reset muon candidate
0053   void reset();
0054 
0055   /// get name of object
0056   inline std::string name() const { return m_name; }
0057 
0058   /// get phi-code
0059   inline unsigned int phi() const { return m_phi; }
0060 
0061   /// get eta-code
0062   inline unsigned int eta() const { return m_eta; }
0063 
0064   /// get pt-code
0065   inline unsigned int pt() const { return m_pt; }
0066 
0067   /// get charge
0068   inline int charge() const { return m_charge; }
0069 
0070   /// get rank
0071   inline unsigned int rank() const { return m_rank; }
0072 
0073   /// is it an empty  muon candidate?
0074   inline bool empty() const { return m_empty; }
0075 
0076   /// enable muon candidate
0077   inline void enable() { m_empty = false; }
0078 
0079   /// disable muon candidate
0080   inline void disable() { m_empty = true; }
0081 
0082   /// set phi-value and packed code of muon candidate
0083   void setPhi(float phi);
0084 
0085   /// set eta-value and packed code of muon candidate
0086   void setEta(float eta);
0087 
0088   /// set pt-value and packed code of muon candidate
0089   void setPt(float pt);
0090 
0091   /// set charge and packed code of muon candidate
0092   void setCharge(int charge);
0093 
0094   /// set rank
0095   inline void setRank(unsigned int rank) { m_rank = rank; }
0096 
0097   /// return the smeared L1 Pt value before discretization in 32-bit
0098   float smearedPt() const { return m_smearedPt; }
0099 
0100   /// nevermind this one
0101   inline unsigned int linearizedPt(float lsbValue, unsigned maxScale) const { return 0; }
0102 
0103   /// get quality (not implemented for FAMOS)
0104   inline unsigned int quality() const { return m_quality; }
0105 
0106   unsigned int etaRegionIndex() const { return eta(); }
0107 
0108   unsigned int phiRegionIndex() const { return phi(); }
0109 
0110   // set and get the 4-momentum of the original (generator) particle
0111   void setMomentum(const LorentzVector& m) { myMomentum = m; }
0112   const LorentzVector getMomentum() const { return myMomentum; }
0113 
0114   /// assignment operator
0115   SimpleL1MuGMTCand& operator=(const SimpleL1MuGMTCand&);
0116 
0117   /// assignment operator for a FSimTrack
0118   SimpleL1MuGMTCand* operator=(const SimTrack*);
0119 
0120   /// equal operator
0121   bool operator==(const SimpleL1MuGMTCand&) const;
0122 
0123   /// unequal operator
0124   bool operator!=(const SimpleL1MuGMTCand&) const;
0125 
0126   /// print parameters of muon candidate
0127   void print() const;
0128 
0129   /// output stream operator
0130   friend std::ostream& operator<<(std::ostream&, const SimpleL1MuGMTCand&);
0131 
0132   /// define a rank for muon candidates
0133   bool getRank(const SimpleL1MuGMTCand* first, const SimpleL1MuGMTCand* second) const {
0134     unsigned int rank_f = (first) ? first->rank() : 0;
0135     unsigned int rank_s = (second) ? second->rank() : 0;
0136     return rank_f > rank_s;
0137   }
0138 
0139   static const float ptScale[32];
0140   static const float etaScale[63];
0141   static const float phiScale[144];
0142 
0143 private:
0144   std::string m_name;
0145   bool m_empty;
0146 
0147   unsigned int m_phi;
0148   unsigned int m_eta;
0149   unsigned int m_pt;
0150   int m_charge;
0151   unsigned int m_quality;
0152   unsigned int m_rank;
0153   float m_smearedPt;
0154 
0155   LorentzVector myMomentum;
0156 };
0157 
0158 #endif