CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | Public Types | Public Member Functions | Static Public Attributes | Private Attributes | Friends
SimpleL1MuGMTCand Class Reference

#include <SimpleL1MuGMTCand.h>

Inheritance diagram for SimpleL1MuGMTCand:
L1MuGMTExtendedCand L1MuGMTCand

Public Types

typedef math::XYZTLorentzVector LorentzVector
 

Public Member Functions

int charge () const
 get charge More...
 
void disable ()
 disable muon candidate More...
 
bool empty () const
 is it an empty muon candidate? More...
 
void enable ()
 enable muon candidate More...
 
unsigned int eta () const
 get eta-code More...
 
unsigned int etaRegionIndex () const
 
const LorentzVector getMomentum () const
 
bool getRank (const SimpleL1MuGMTCand *first, const SimpleL1MuGMTCand *second) const
 define a rank for muon candidates More...
 
unsigned int linearizedPt (float lsbValue, unsigned maxScale) const
 nevermind this one More...
 
std::string name () const
 get name of object More...
 
bool operator!= (const SimpleL1MuGMTCand &) const
 unequal operator More...
 
SimpleL1MuGMTCandoperator= (const SimpleL1MuGMTCand &)
 assignment operator More...
 
SimpleL1MuGMTCandoperator= (const SimTrack *)
 assignment operator for a FSimTrack More...
 
bool operator== (const SimpleL1MuGMTCand &) const
 equal operator More...
 
unsigned int phi () const
 get phi-code More...
 
unsigned int phiRegionIndex () const
 
void print () const
 print parameters of muon candidate More...
 
unsigned int pt () const
 get pt-code More...
 
unsigned int quality () const
 get quality (not implemented for FAMOS) More...
 
unsigned int rank () const
 get rank More...
 
void reset ()
 reset muon candidate More...
 
void setCharge (int charge)
 set charge and packed code of muon candidate More...
 
void setEta (float eta)
 set eta-value and packed code of muon candidate More...
 
void setMomentum (const LorentzVector &m)
 
void setPhi (float phi)
 set phi-value and packed code of muon candidate More...
 
void setPt (float pt)
 set pt-value and packed code of muon candidate More...
 
void setRank (unsigned int rank)
 set rank More...
 
 SimpleL1MuGMTCand ()
 constructor More...
 
 SimpleL1MuGMTCand (const SimpleL1MuGMTCand &)
 copy constructor More...
 
 SimpleL1MuGMTCand (const SimpleL1MuGMTCand *)
 copy constructor from pointer More...
 
 SimpleL1MuGMTCand (const SimTrack *)
 convert a FSimTrack into a SimpleL1MuGMTCand (L1MuGMTExtendedCand) More...
 
 SimpleL1MuGMTCand (const SimTrack *p, unsigned etaIndex, unsigned phiIndex, unsigned pTIndex, float etaValue, float phiValue, float pTValue)
 The same as above, but without relying on internal tables (safer) More...
 
float smearedPt () const
 return the smeared L1 Pt value before discretization in 32-bit More...
 
 ~SimpleL1MuGMTCand () override
 destructor More...
 
- Public Member Functions inherited from L1MuGMTExtendedCand
unsigned int detector () const
 
unsigned getDTCSCIndex () const
 get index of contributing DT/CSC muon More...
 
unsigned getRPCIndex () const
 get index of contributing RPC muon More...
 
bool isFwd () const
 get forward bit (true=forward, false=barrel) More...
 
bool isRPC () const
 get RPC bit (true=RPC, false = DT/CSC or matched) More...
 
 L1MuGMTExtendedCand ()
 constructor More...
 
 L1MuGMTExtendedCand (unsigned data, unsigned rank, int bx=0)
 constructor More...
 
 L1MuGMTExtendedCand (const L1MuGMTExtendedCand &)
 copy constructor More...
 
bool operator!= (const L1MuGMTExtendedCand &) const
 unequal operator More...
 
bool operator== (const L1MuGMTExtendedCand &) const
 equal operator More...
 
void print () const
 print parameters of muon candidate More...
 
unsigned int rank () const
 get rank More...
 
void reset ()
 reset muon candidate More...
 
void setDTCSCIndex (unsigned int idxdtcsc)
 set index of contributing DT/CSC muon More...
 
void setFwdBit (unsigned int fwdbit)
 set forward bit (1=forward, 0=barrel) More...
 
void setRank (unsigned int rank)
 set rank More...
 
void setRPCBit (unsigned int rpcbit)
 set RPC bit (1=RPC, 0=DT/CSC or matched) More...
 
void setRPCIndex (unsigned int idxrpc)
 set index of contributing RPC muon More...
 
 ~L1MuGMTExtendedCand () override
 destructor More...
 
- Public Member Functions inherited from L1MuGMTCand
int bx () const
 get bunch crossing identifier More...
 
int charge () const
 get charge (+1 -1) More...
 
bool charge_valid () const
 is the charge valid ? More...
 
bool empty () const
 is it an empty muon candidate? More...
 
unsigned int etaIndex () const
 get eta-code More...
 
unsigned int etaRegionIndex () const
 
float etaValue () const
 
unsigned getDataWord () const
 get muon data word More...
 
bool isHaloCand () const
 interpretation of quality code: is the candidate a beam halo muon ? More...
 
bool isMatchedCand () const
 interpretation of quality code: is the candidate a matched candidate ? More...
 
bool isol () const
 get isolation More...
 
bool isSyncWord () const
 is the candidate a sync word More...
 
 L1MuGMTCand ()
 constructor More...
 
 L1MuGMTCand (unsigned data, int bx=0)
 constructor from dataword More...
 
 L1MuGMTCand (const L1MuGMTCand &)
 copy constructor More...
 
unsigned int linearizedPt (float lsbValue, unsigned maxScale) const
 
bool mip () const
 get mip More...
 
std::string name () const
 get name of object More...
 
bool operator!= (const L1MuGMTCand &) const
 unequal operator More...
 
bool operator== (const L1MuGMTCand &) const
 equal operator More...
 
unsigned int phiIndex () const
 get phi-code More...
 
unsigned int phiRegionIndex () const
 
float phiValue () const
 
void print () const
 print parameters of muon candidate More...
 
unsigned int ptIndex () const
 get pt-code More...
 
float ptValue () const
 
unsigned int quality () const
 get quality More...
 
void reset ()
 reset muon candidate More...
 
void setBx (int bx)
 set bunch crossing identifier More...
 
void setChargePacked (unsigned ch)
 set packed charge/synchronization word of muon candidate (0=POS, 1=NEG, 2=UNDEF, 3=SYNC) More...
 
void setEtaPacked (unsigned eta)
 set packed eta-code of muon candidate More...
 
void setEtaValue (float etaVal)
 Set Eta Value (need to set type, first) More...
 
void setIsolation (bool isol)
 set isolation of muon candidate More...
 
void setMIP (bool mip)
 set min ionizing bit for muon candidate More...
 
void setPhiPacked (unsigned phi)
 set packed phi-code of muon candidate More...
 
void setPhiValue (float phiVal)
 Setters for physical values. More...
 
void setPtPacked (unsigned pt)
 set packed pt-code of muon candidate More...
 
void setPtValue (float ptVal)
 Set Pt Value. More...
 
void setQuality (unsigned quality)
 set quality of muon candidate More...
 
unsigned sysign () const
 get charge/synchronization word (0=POS, 1=NEG, 2=UNDEF, 3=SYNC) More...
 
bool useInDiMuonTrigger () const
 interpretation of quality code: is the candidate to be used in a di-muon trigger ? More...
 
bool useInSingleMuonTrigger () const
 interpretation of quality code: is the candidate to be used in a single muon trigger ? More...
 
virtual ~L1MuGMTCand ()
 destructor More...
 

Static Public Attributes

static const float etaScale [63]
 
static const float phiScale [144]
 
static const float ptScale [32]
 

Private Attributes

int m_charge
 
bool m_empty
 
unsigned int m_eta
 
std::string m_name
 
unsigned int m_phi
 
unsigned int m_pt
 
unsigned int m_quality
 
unsigned int m_rank
 
float m_smearedPt
 
LorentzVector myMomentum
 

Friends

std::ostream & operator<< (std::ostream &, const SimpleL1MuGMTCand &)
 output stream operator More...
 

Additional Inherited Members

- Static Public Member Functions inherited from L1MuGMTExtendedCand
static bool compareRank (const L1MuGMTExtendedCand *first, const L1MuGMTExtendedCand *second)
 define a rank for muon candidates More...
 
static bool rankRef (const L1MuGMTExtendedCand &first, const L1MuGMTExtendedCand &second)
 define a rank for muon candidates More...
 
- Protected Types inherited from L1MuGMTCand
enum  { PHI_START = 0 }
 
enum  { PHI_LENGTH = 8 }
 
enum  { PT_START = 8 }
 
enum  { PT_LENGTH = 5 }
 
enum  { QUAL_START = 13 }
 
enum  { QUAL_LENGTH = 3 }
 
enum  { ETA_START = 16 }
 
enum  { ETA_LENGTH = 6 }
 
enum  { ISO_START = 22 }
 
enum  { ISO_LENGTH = 1 }
 
enum  { MIP_START = 23 }
 
enum  { MIP_LENGTH = 1 }
 
enum  { SYSIGN_START = 24 }
 
enum  { SYSIGN_LENGTH = 2 }
 
- Protected Member Functions inherited from L1MuGMTCand
unsigned readDataField (unsigned start, unsigned count) const
 
void writeDataField (unsigned start, unsigned count, unsigned value)
 
- Protected Attributes inherited from L1MuGMTCand
int m_bx
 
unsigned m_dataWord
 
float m_etaValue
 
std::string m_name
 
float m_phiValue
 
float m_ptValue
 
- Static Protected Attributes inherited from L1MuGMTCand
static const float m_invalidValue = -10.
 

Detailed Description

Description: Simple L1 Global Muon Trigger Candidate Inherits the basics from 'L1MuGMTCand' base class. Contains pointer to RawHepEventParticle from the event manager. Allows easy conversion from a RawHepEventParticle.

Author: Andrea Perrotta 05/09/2006

Definition at line 24 of file SimpleL1MuGMTCand.h.

Member Typedef Documentation

Definition at line 26 of file SimpleL1MuGMTCand.h.

Constructor & Destructor Documentation

SimpleL1MuGMTCand::SimpleL1MuGMTCand ( )

constructor

Definition at line 14 of file SimpleL1MuGMTCand.cc.

15  : m_name("FastL1MuCand"),
16  m_empty(true),
17  m_phi(0),
18  m_eta(31),
19  m_pt(0),
20  m_charge(0),
21  m_quality(0),
22  m_rank(0),
23  m_smearedPt(0) {}
unsigned int m_quality
SimpleL1MuGMTCand::SimpleL1MuGMTCand ( const SimpleL1MuGMTCand mu)

copy constructor

Definition at line 25 of file SimpleL1MuGMTCand.cc.

References getMomentum(), m_charge, m_eta, m_phi, m_pt, m_quality, setCharge(), L1MuGMTCand::setEtaPacked(), setMomentum(), L1MuGMTCand::setPhiPacked(), L1MuGMTCand::setPtPacked(), and L1MuGMTCand::setQuality().

27  m_name(mu.m_name),
28  m_empty(mu.m_empty),
29  m_phi(mu.m_phi),
30  m_eta(mu.m_eta),
31  m_pt(mu.m_pt),
32  m_charge(mu.m_charge),
33  m_quality(mu.m_quality),
34  m_rank(mu.m_rank),
37  setQuality(m_quality & 7);
38  setEtaPacked(m_eta & 63);
39  setPhiPacked(m_phi & 255);
41  setPtPacked(m_pt & 31);
42 }
void setPtPacked(unsigned pt)
set packed pt-code of muon candidate
Definition: L1MuGMTCand.h:151
unsigned int m_quality
void setCharge(int charge)
set charge and packed code of muon candidate
L1MuGMTExtendedCand()
constructor
void setQuality(unsigned quality)
set quality of muon candidate
Definition: L1MuGMTCand.h:154
void setEtaPacked(unsigned eta)
set packed eta-code of muon candidate
Definition: L1MuGMTCand.h:157
const LorentzVector getMomentum() const
void setMomentum(const LorentzVector &m)
void setPhiPacked(unsigned phi)
set packed phi-code of muon candidate
Definition: L1MuGMTCand.h:148
SimpleL1MuGMTCand::SimpleL1MuGMTCand ( const SimpleL1MuGMTCand mu)

copy constructor from pointer

Definition at line 44 of file SimpleL1MuGMTCand.cc.

References getMomentum(), m_charge, m_eta, m_phi, m_pt, m_quality, setCharge(), L1MuGMTCand::setEtaPacked(), setMomentum(), L1MuGMTCand::setPhiPacked(), L1MuGMTCand::setPtPacked(), and L1MuGMTCand::setQuality().

45  : m_name(mu->m_name),
46  m_empty(mu->m_empty),
47  m_phi(mu->m_phi),
48  m_eta(mu->m_eta),
49  m_pt(mu->m_pt),
50  m_charge(mu->m_charge),
51  m_quality(mu->m_quality),
52  m_rank(mu->m_rank),
54  setMomentum(mu->getMomentum());
55  setQuality(m_quality & 7);
56  setEtaPacked(m_eta & 63);
57  setPhiPacked(m_phi & 255);
59  setPtPacked(m_pt & 31);
60 }
void setPtPacked(unsigned pt)
set packed pt-code of muon candidate
Definition: L1MuGMTCand.h:151
unsigned int m_quality
void setCharge(int charge)
set charge and packed code of muon candidate
void setQuality(unsigned quality)
set quality of muon candidate
Definition: L1MuGMTCand.h:154
void setEtaPacked(unsigned eta)
set packed eta-code of muon candidate
Definition: L1MuGMTCand.h:157
const LorentzVector getMomentum() const
void setMomentum(const LorentzVector &m)
void setPhiPacked(unsigned phi)
set packed phi-code of muon candidate
Definition: L1MuGMTCand.h:148
SimpleL1MuGMTCand::SimpleL1MuGMTCand ( const SimTrack p)

convert a FSimTrack into a SimpleL1MuGMTCand (L1MuGMTExtendedCand)

Definition at line 62 of file SimpleL1MuGMTCand.cc.

References CoreSimTrack::charge(), m_empty, m_name, m_quality, m_rank, CoreSimTrack::momentum(), myMomentum, L1MuGMTCand::setBx(), setCharge(), setEta(), L1MuGMTExtendedCand::setFwdBit(), setMomentum(), setPhi(), setPt(), L1MuGMTCand::setQuality(), and L1MuGMTExtendedCand::setRPCBit().

62  {
63  // setMomentum(p->momentum());
64  LorentzVector toBeRemoved(p->momentum().x(), p->momentum().y(), p->momentum().z(), p->momentum().t());
65  setMomentum(toBeRemoved);
66  m_name = "FastL1MuCand";
67  m_empty = false;
68  m_quality = 7;
70  m_rank = 0;
71  setEta(myMomentum.Eta());
72  setPhi(myMomentum.Phi());
73  setCharge(int(p->charge()));
74  setPt(myMomentum.Pt());
75  setBx(0);
76  if (fabs(myMomentum.eta()) > 1.04)
77  setFwdBit(1);
78  else
79  setFwdBit(0);
80  setRPCBit(0);
81 }
float charge() const
charge
Definition: CoreSimTrack.cc:17
unsigned int m_quality
void setFwdBit(unsigned int fwdbit)
set forward bit (1=forward, 0=barrel)
void setCharge(int charge)
set charge and packed code of muon candidate
math::XYZTLorentzVector LorentzVector
void setBx(int bx)
set bunch crossing identifier
Definition: L1MuGMTCand.h:169
void setPt(float pt)
set pt-value and packed code of muon candidate
void setEta(float eta)
set eta-value and packed code of muon candidate
void setQuality(unsigned quality)
set quality of muon candidate
Definition: L1MuGMTCand.h:154
void setRPCBit(unsigned int rpcbit)
set RPC bit (1=RPC, 0=DT/CSC or matched)
const math::XYZTLorentzVectorD & momentum() const
Definition: CoreSimTrack.h:19
void setMomentum(const LorentzVector &m)
void setPhi(float phi)
set phi-value and packed code of muon candidate
LorentzVector myMomentum
SimpleL1MuGMTCand::SimpleL1MuGMTCand ( const SimTrack p,
unsigned  etaIndex,
unsigned  phiIndex,
unsigned  pTIndex,
float  etaValue,
float  phiValue,
float  pTValue 
)

The same as above, but without relying on internal tables (safer)

Definition at line 83 of file SimpleL1MuGMTCand.cc.

References CoreSimTrack::charge(), L1MuGMTCand::etaIndex(), m_empty, m_eta, m_name, m_phi, m_pt, m_quality, m_rank, m_smearedPt, CoreSimTrack::momentum(), myMomentum, L1MuGMTCand::phiIndex(), L1MuGMTCand::setBx(), setCharge(), L1MuGMTCand::setEtaPacked(), L1MuGMTCand::setEtaValue(), L1MuGMTExtendedCand::setFwdBit(), setMomentum(), L1MuGMTCand::setPhiPacked(), L1MuGMTCand::setPhiValue(), L1MuGMTCand::setPtPacked(), L1MuGMTCand::setPtValue(), L1MuGMTCand::setQuality(), and L1MuGMTExtendedCand::setRPCBit().

89  {
90  // setMomentum(p->momentum());
91  LorentzVector toBeRemoved(p->momentum().x(), p->momentum().y(), p->momentum().z(), p->momentum().t());
92  setMomentum(toBeRemoved);
93  m_name = "FastL1MuCand";
94  m_empty = false;
95  m_quality = 7;
97  m_rank = 0;
98  m_phi = phiIndex;
101  m_eta = etaIndex;
104  setCharge(int(p->charge()));
105  m_pt = pTIndex;
106  setPtPacked(pTIndex);
107  setPtValue(pTValue);
108  m_smearedPt = myMomentum.Pt();
109  setBx(0);
110  if (fabs(etaValue) > 1.04)
111  setFwdBit(1);
112  else
113  setFwdBit(0);
114  setRPCBit(0);
115 }
float etaValue() const
Definition: L1MuGMTCand.cc:102
void setPtPacked(unsigned pt)
set packed pt-code of muon candidate
Definition: L1MuGMTCand.h:151
float phiValue() const
Definition: L1MuGMTCand.cc:92
unsigned int phiIndex() const
get phi-code
Definition: L1MuGMTCand.h:70
unsigned int etaIndex() const
get eta-code
Definition: L1MuGMTCand.h:105
float charge() const
charge
Definition: CoreSimTrack.cc:17
unsigned int m_quality
void setPhiValue(float phiVal)
Setters for physical values.
Definition: L1MuGMTCand.h:174
void setFwdBit(unsigned int fwdbit)
set forward bit (1=forward, 0=barrel)
void setCharge(int charge)
set charge and packed code of muon candidate
math::XYZTLorentzVector LorentzVector
void setBx(int bx)
set bunch crossing identifier
Definition: L1MuGMTCand.h:169
void setQuality(unsigned quality)
set quality of muon candidate
Definition: L1MuGMTCand.h:154
void setEtaPacked(unsigned eta)
set packed eta-code of muon candidate
Definition: L1MuGMTCand.h:157
void setEtaValue(float etaVal)
Set Eta Value (need to set type, first)
Definition: L1MuGMTCand.h:180
void setRPCBit(unsigned int rpcbit)
set RPC bit (1=RPC, 0=DT/CSC or matched)
const math::XYZTLorentzVectorD & momentum() const
Definition: CoreSimTrack.h:19
void setMomentum(const LorentzVector &m)
void setPtValue(float ptVal)
Set Pt Value.
Definition: L1MuGMTCand.h:177
LorentzVector myMomentum
void setPhiPacked(unsigned phi)
set packed phi-code of muon candidate
Definition: L1MuGMTCand.h:148
SimpleL1MuGMTCand::~SimpleL1MuGMTCand ( )
override

destructor

Definition at line 117 of file SimpleL1MuGMTCand.cc.

References reset().

117 { reset(); }
void reset()
reset muon candidate

Member Function Documentation

int SimpleL1MuGMTCand::charge ( void  ) const
inline

get charge

Definition at line 68 of file SimpleL1MuGMTCand.h.

References m_charge.

Referenced by print(), and setCharge().

68 { return m_charge; }
void SimpleL1MuGMTCand::disable ( )
inline

disable muon candidate

Definition at line 80 of file SimpleL1MuGMTCand.h.

References m_empty.

80 { m_empty = true; }
bool SimpleL1MuGMTCand::empty ( void  ) const
inline

is it an empty muon candidate?

Definition at line 74 of file SimpleL1MuGMTCand.h.

References m_empty.

Referenced by operator<<(), and print().

74 { return m_empty; }
void SimpleL1MuGMTCand::enable ( )
inline

enable muon candidate

Definition at line 77 of file SimpleL1MuGMTCand.h.

References m_empty.

77 { m_empty = false; }
unsigned int SimpleL1MuGMTCand::eta ( void  ) const
inline

get eta-code

Definition at line 62 of file SimpleL1MuGMTCand.h.

References m_eta.

Referenced by Particle.Particle::__str__(), etaRegionIndex(), Jet.Jet::jetID(), and Jet.Jet::puJetId().

62 { return m_eta; }
unsigned int SimpleL1MuGMTCand::etaRegionIndex ( ) const
inline

Definition at line 106 of file SimpleL1MuGMTCand.h.

References eta().

106 { return eta(); }
unsigned int eta() const
get eta-code
const LorentzVector SimpleL1MuGMTCand::getMomentum ( ) const
inline

Definition at line 112 of file SimpleL1MuGMTCand.h.

References myMomentum.

Referenced by SimpleL1MuGMTCand().

112 { return myMomentum; }
LorentzVector myMomentum
bool SimpleL1MuGMTCand::getRank ( const SimpleL1MuGMTCand first,
const SimpleL1MuGMTCand second 
) const
inline

define a rank for muon candidates

Definition at line 133 of file SimpleL1MuGMTCand.h.

References first, rank(), and edm::second().

133  {
134  unsigned int rank_f = (first) ? first->rank() : 0;
135  unsigned int rank_s = (second) ? second->rank() : 0;
136  return rank_f > rank_s;
137  }
unsigned int rank() const
get rank
U second(std::pair< T, U > const &p)
unsigned int SimpleL1MuGMTCand::linearizedPt ( float  lsbValue,
unsigned  maxScale 
) const
inline

nevermind this one

Definition at line 101 of file SimpleL1MuGMTCand.h.

101 { return 0; }
std::string SimpleL1MuGMTCand::name ( void  ) const
inline
bool SimpleL1MuGMTCand::operator!= ( const SimpleL1MuGMTCand cand) const

unequal operator

Definition at line 268 of file SimpleL1MuGMTCand.cc.

References m_charge, m_empty, m_eta, m_phi, m_pt, m_quality, and m_rank.

268  {
269  if (m_empty != cand.m_empty)
270  return true;
271  if (m_phi != cand.m_phi)
272  return true;
273  if (m_eta != cand.m_eta)
274  return true;
275  if (m_pt != cand.m_pt)
276  return true;
277  if (m_charge != cand.m_charge)
278  return true;
279  if (m_quality != cand.m_quality)
280  return true;
281  if (m_rank != cand.m_rank)
282  return true;
283  return false;
284 }
unsigned int m_quality
SimpleL1MuGMTCand & SimpleL1MuGMTCand::operator= ( const SimpleL1MuGMTCand cand)

assignment operator

Definition at line 217 of file SimpleL1MuGMTCand.cc.

References m_charge, m_empty, m_eta, m_phi, m_pt, m_quality, m_rank, and m_smearedPt.

217  {
218  if (this != &cand) {
219  m_empty = cand.m_empty;
220  m_phi = cand.m_phi;
221  m_eta = cand.m_eta;
222  m_pt = cand.m_pt;
223  m_charge = cand.m_charge;
224  m_quality = cand.m_quality;
225  m_rank = cand.m_rank;
226  m_smearedPt = cand.m_smearedPt;
227  }
228  return *this;
229 }
unsigned int m_quality
SimpleL1MuGMTCand * SimpleL1MuGMTCand::operator= ( const SimTrack p)

assignment operator for a FSimTrack

Definition at line 234 of file SimpleL1MuGMTCand.cc.

References CoreSimTrack::charge(), m_empty, CoreSimTrack::momentum(), setCharge(), setEta(), setPhi(), setPt(), and mathSSE::sqrt().

234  {
235  m_empty = false;
236  setEta(p->momentum().eta());
237  setPhi(p->momentum().phi());
238  setCharge(int(p->charge()));
239  setPt(std::sqrt(p->momentum().perp2()));
240 
241  return this;
242 }
float charge() const
charge
Definition: CoreSimTrack.cc:17
T sqrt(T t)
Definition: SSEVec.h:19
void setCharge(int charge)
set charge and packed code of muon candidate
void setPt(float pt)
set pt-value and packed code of muon candidate
void setEta(float eta)
set eta-value and packed code of muon candidate
const math::XYZTLorentzVectorD & momentum() const
Definition: CoreSimTrack.h:19
void setPhi(float phi)
set phi-value and packed code of muon candidate
bool SimpleL1MuGMTCand::operator== ( const SimpleL1MuGMTCand cand) const

equal operator

Definition at line 247 of file SimpleL1MuGMTCand.cc.

References m_charge, m_empty, m_eta, m_phi, m_pt, m_quality, and m_rank.

247  {
248  if (m_empty != cand.m_empty)
249  return false;
250  if (m_phi != cand.m_phi)
251  return false;
252  if (m_eta != cand.m_eta)
253  return false;
254  if (m_pt != cand.m_pt)
255  return false;
256  if (m_charge != cand.m_charge)
257  return false;
258  if (m_quality != cand.m_quality)
259  return false;
260  if (m_rank != cand.m_rank)
261  return false;
262  return true;
263 }
unsigned int m_quality
unsigned int SimpleL1MuGMTCand::phi ( void  ) const
inline

get phi-code

Definition at line 59 of file SimpleL1MuGMTCand.h.

References m_phi.

Referenced by Particle.Particle::__str__(), ntupleDataFormat.Track::phiPull(), phiRegionIndex(), and setPhi().

59 { return m_phi; }
unsigned int SimpleL1MuGMTCand::phiRegionIndex ( ) const
inline

Definition at line 108 of file SimpleL1MuGMTCand.h.

References phi().

108 { return phi(); }
unsigned int phi() const
get phi-code
void SimpleL1MuGMTCand::print ( void  ) const

print parameters of muon candidate

Definition at line 289 of file SimpleL1MuGMTCand.cc.

References charge(), gather_cfg::cout, empty(), L1MuGMTCand::etaValue(), L1MuGMTCand::phiValue(), L1MuGMTCand::ptValue(), and rank().

289  {
290  using namespace std;
291 
292  if (!empty()) {
293  cout.setf(ios::showpoint);
294  cout.setf(ios::right, ios::adjustfield);
295  cout << setiosflags(ios::showpoint | ios::fixed) << "pt = " << setw(5) << setprecision(1) << ptValue() << " GeV "
296  << "charge = " << setw(2) << charge() << " "
297  << "eta = " << setw(5) << setprecision(2) << etaValue() << " "
298  << "phi = " << setw(5) << setprecision(3) << phiValue() << " rad "
299  << "rank = " << setw(6) << rank() << endl;
300  }
301 }
float etaValue() const
Definition: L1MuGMTCand.cc:102
float phiValue() const
Definition: L1MuGMTCand.cc:92
unsigned int rank() const
get rank
int charge() const
get charge
bool empty() const
is it an empty muon candidate?
float ptValue() const
Definition: L1MuGMTCand.cc:112
tuple cout
Definition: gather_cfg.py:144
unsigned int SimpleL1MuGMTCand::pt ( ) const
inline
unsigned int SimpleL1MuGMTCand::quality ( void  ) const
inline

get quality (not implemented for FAMOS)

Definition at line 104 of file SimpleL1MuGMTCand.h.

References m_quality.

104 { return m_quality; }
unsigned int m_quality
unsigned int SimpleL1MuGMTCand::rank ( ) const
inline

get rank

Definition at line 71 of file SimpleL1MuGMTCand.h.

References m_rank.

Referenced by getRank(), print(), and setRank().

71 { return m_rank; }
void SimpleL1MuGMTCand::reset ( void  )

reset muon candidate

Definition at line 120 of file SimpleL1MuGMTCand.cc.

References m_charge, m_empty, m_eta, m_phi, m_pt, m_quality, m_rank, and m_smearedPt.

Referenced by ~SimpleL1MuGMTCand().

120  {
121  m_empty = true;
122  m_phi = 0;
123  m_eta = 31;
124  m_pt = 0;
125  m_charge = 0;
126  m_quality = 0;
127  m_rank = 0;
128  m_smearedPt = 0;
129 }
unsigned int m_quality
void SimpleL1MuGMTCand::setCharge ( int  charge)

set charge and packed code of muon candidate

Definition at line 199 of file SimpleL1MuGMTCand.cc.

References charge(), m_charge, and L1MuGMTCand::setChargePacked().

Referenced by operator=(), and SimpleL1MuGMTCand().

199  {
200  m_charge = charge;
201  setChargePacked(charge == 1 ? 0 : 1);
202 }
int charge() const
get charge
void setChargePacked(unsigned ch)
set packed charge/synchronization word of muon candidate (0=POS, 1=NEG, 2=UNDEF, 3=SYNC) ...
Definition: L1MuGMTCand.h:166
void SimpleL1MuGMTCand::setEta ( float  eta)

set eta-value and packed code of muon candidate

Definition at line 157 of file SimpleL1MuGMTCand.cc.

References change_name::diff, etaScale, mps_fire::i, m_eta, L1MuGMTCand::setEtaPacked(), and L1MuGMTCand::setEtaValue().

Referenced by operator=(), and SimpleL1MuGMTCand().

157  {
158  int index = 0;
159  float mindiff = 1000.0;
160 
161  for (int i = 0; i < 63; i++) {
162  float diff = fabs(SimpleL1MuGMTCand::etaScale[i] - eta);
163  if (diff <= mindiff) {
164  mindiff = diff;
165  index = i;
166  }
167  }
168 
169  m_eta = index;
170  setEtaPacked(m_eta & 63);
172 }
unsigned int eta() const
get eta-code
static const float etaScale[63]
void setEtaPacked(unsigned eta)
set packed eta-code of muon candidate
Definition: L1MuGMTCand.h:157
void setEtaValue(float etaVal)
Set Eta Value (need to set type, first)
Definition: L1MuGMTCand.h:180
void SimpleL1MuGMTCand::setMomentum ( const LorentzVector m)
inline
void SimpleL1MuGMTCand::setPhi ( float  phi)

set phi-value and packed code of muon candidate

Definition at line 134 of file SimpleL1MuGMTCand.cc.

References change_name::diff, mps_fire::i, m_phi, M_PI, phi(), phiScale, L1MuGMTCand::setPhiPacked(), and L1MuGMTCand::setPhiValue().

Referenced by operator=(), and SimpleL1MuGMTCand().

134  {
135  int index = 0;
136  float mindiff = 1000.0;
137 
138  if (phi < 0.) {
139  phi = 2 * M_PI + phi;
140  }
141  for (int i = 0; i < 144; i++) {
142  float diff = fabs(SimpleL1MuGMTCand::phiScale[i] - phi);
143  if (diff <= mindiff) {
144  mindiff = diff;
145  index = i;
146  }
147  }
148 
149  m_phi = index;
150  setPhiPacked(m_phi & 255);
152 }
void setPhiValue(float phiVal)
Setters for physical values.
Definition: L1MuGMTCand.h:174
#define M_PI
unsigned int phi() const
get phi-code
static const float phiScale[144]
void setPhiPacked(unsigned phi)
set packed phi-code of muon candidate
Definition: L1MuGMTCand.h:148
void SimpleL1MuGMTCand::setPt ( float  pt)

set pt-value and packed code of muon candidate

Definition at line 177 of file SimpleL1MuGMTCand.cc.

References change_name::diff, mps_fire::i, m_pt, m_smearedPt, pt(), ptScale, L1MuGMTCand::setPtPacked(), and L1MuGMTCand::setPtValue().

Referenced by operator=(), and SimpleL1MuGMTCand().

177  {
178  int index = 0;
179  m_smearedPt = pt;
180 
181  float mindiff = 1000.0;
182 
183  for (int i = 0; i < 32; i++) {
184  float diff = fabs(SimpleL1MuGMTCand::ptScale[i] - pt);
185  if (diff <= mindiff) {
186  mindiff = diff;
187  index = i;
188  }
189  }
190 
191  m_pt = index;
192  setPtPacked(m_pt & 31);
194 }
void setPtPacked(unsigned pt)
set packed pt-code of muon candidate
Definition: L1MuGMTCand.h:151
unsigned int pt() const
get pt-code
static const float ptScale[32]
void setPtValue(float ptVal)
Set Pt Value.
Definition: L1MuGMTCand.h:177
void SimpleL1MuGMTCand::setRank ( unsigned int  rank)
inline

set rank

Definition at line 95 of file SimpleL1MuGMTCand.h.

References m_rank, and rank().

95 { m_rank = rank; }
unsigned int rank() const
get rank
float SimpleL1MuGMTCand::smearedPt ( ) const
inline

return the smeared L1 Pt value before discretization in 32-bit

Definition at line 98 of file SimpleL1MuGMTCand.h.

References m_smearedPt.

98 { return m_smearedPt; }

Friends And Related Function Documentation

std::ostream& operator<< ( std::ostream &  s,
const SimpleL1MuGMTCand id 
)
friend

output stream operator

Definition at line 306 of file SimpleL1MuGMTCand.cc.

306  {
307  using namespace std;
308 
309  if (!id.empty()) {
310  s << setiosflags(ios::showpoint | ios::fixed) << "pt = " << setw(5) << setprecision(1) << id.ptValue() << " GeV "
311  << "charge = " << setw(2) << id.charge() << " "
312  << "eta = " << setw(5) << setprecision(2) << id.etaValue() << " "
313  << "phi = " << setw(5) << setprecision(3) << id.phiValue() << " rad ";
314  }
315  return s;
316 }
bool empty() const
is it an empty muon candidate?

Member Data Documentation

const float SimpleL1MuGMTCand::etaScale
static
Initial value:
= {
-2.40, -2.35, -2.30, -2.25, -2.20, -2.15, -2.10, -2.05, -2.00, -1.95, -1.90, -1.85, -1.80, -1.75, -1.70, -1.60,
-1.50, -1.40, -1.30, -1.20, -1.10, -1.00, -0.90, -0.80, -0.70, -0.60, -0.50, -0.40, -0.30, -0.20, -0.10, 0.00,
0.10, 0.20, 0.30, 0.40, 0.50, 0.60, 0.70, 0.80, 0.90, 1.00, 1.10, 1.20, 1.30, 1.40, 1.50, 1.60,
1.70, 1.75, 1.80, 1.85, 1.90, 1.95, 2.00, 2.05, 2.10, 2.15, 2.20, 2.25, 2.30, 2.35, 2.40}

Definition at line 140 of file SimpleL1MuGMTCand.h.

Referenced by setEta().

int SimpleL1MuGMTCand::m_charge
private
bool SimpleL1MuGMTCand::m_empty
private
unsigned int SimpleL1MuGMTCand::m_eta
private
std::string SimpleL1MuGMTCand::m_name
private

Definition at line 144 of file SimpleL1MuGMTCand.h.

Referenced by name(), and SimpleL1MuGMTCand().

unsigned int SimpleL1MuGMTCand::m_phi
private
unsigned int SimpleL1MuGMTCand::m_pt
private

Definition at line 149 of file SimpleL1MuGMTCand.h.

Referenced by operator!=(), operator=(), operator==(), pt(), reset(), setPt(), and SimpleL1MuGMTCand().

unsigned int SimpleL1MuGMTCand::m_quality
private
unsigned int SimpleL1MuGMTCand::m_rank
private
float SimpleL1MuGMTCand::m_smearedPt
private

Definition at line 153 of file SimpleL1MuGMTCand.h.

Referenced by operator=(), reset(), setPt(), SimpleL1MuGMTCand(), and smearedPt().

LorentzVector SimpleL1MuGMTCand::myMomentum
private

Definition at line 155 of file SimpleL1MuGMTCand.h.

Referenced by getMomentum(), setMomentum(), and SimpleL1MuGMTCand().

const float SimpleL1MuGMTCand::phiScale
static
Initial value:
= {
0.0000, 0.0436, 0.0873, 0.1309, 0.1745, 0.2182, 0.2618, 0.3054, 0.3491, 0.3927, 0.4363, 0.4800, 0.5236, 0.5672,
0.6109, 0.6545, 0.6981, 0.7418, 0.7854, 0.8290, 0.8727, 0.9163, 0.9599, 1.0036, 1.0472, 1.0908, 1.1345, 1.1781,
1.2217, 1.2654, 1.3090, 1.3526, 1.3963, 1.4399, 1.4835, 1.5272, 1.5708, 1.6144, 1.6581, 1.7017, 1.7453, 1.7890,
1.8326, 1.8762, 1.9199, 1.9635, 2.0071, 2.0508, 2.0944, 2.1380, 2.1817, 2.2253, 2.2689, 2.3126, 2.3562, 2.3998,
2.4435, 2.4871, 2.5307, 2.5744, 2.6180, 2.6616, 2.7053, 2.7489, 2.7925, 2.8362, 2.8798, 2.9234, 2.9671, 3.0107,
3.0543, 3.0980, 3.1416, 3.1852, 3.2289, 3.2725, 3.3161, 3.3598, 3.4034, 3.4470, 3.4907, 3.5343, 3.5779, 3.6216,
3.6652, 3.7088, 3.7525, 3.7961, 3.8397, 3.8834, 3.9270, 3.9706, 4.0143, 4.0579, 4.1015, 4.1452, 4.1888, 4.2324,
4.2761, 4.3197, 4.3633, 4.4070, 4.4506, 4.4942, 4.5379, 4.5815, 4.6251, 4.6688, 4.7124, 4.7560, 4.7997, 4.8433,
4.8869, 4.9306, 4.9742, 5.0178, 5.0615, 5.1051, 5.1487, 5.1924, 5.2360, 5.2796, 5.3233, 5.3669, 5.4105, 5.4542,
5.4978, 5.5414, 5.5851, 5.6287, 5.6723, 5.7160, 5.7596, 5.8032, 5.8469, 5.8905, 5.9341, 5.9778, 6.0214, 6.0650,
6.1087, 6.1523, 6.1959, 6.2396}

Definition at line 141 of file SimpleL1MuGMTCand.h.

Referenced by setPhi().

const float SimpleL1MuGMTCand::ptScale
static
Initial value:
= {0.0, 0.0, 1.5, 2.0, 2.5, 3.0, 3.5, 4.0, 4.5, 5.0, 6.0,
7.0, 8.0, 10.0, 12.0, 14.0, 16.0, 18.0, 20.0, 25.0, 30.0, 35.0,
40.0, 45.0, 50.0, 60.0, 70.0, 80.0, 90.0, 100.0, 120.0, 140.0}

Definition at line 139 of file SimpleL1MuGMTCand.h.

Referenced by setPt().