CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes | Friends
Phase2L1GMT::MuonROI Class Reference

#include <MuonROI.h>

Public Member Functions

void addStub (const l1t::MuonStubRef &stub)
 
const int bx () const
 
const uint charge () const
 
bool isGlobalMuon () const
 
const l1t::RegionalMuonCandRefmuonRef () const
 
 MuonROI (int bx, uint charge, uint pt, uint quality)
 
const float offline_pt () const
 
void printROILine () const
 
const uint pt () const
 
const int quality () const
 
ap_uint< 32 > roiWord () const
 
void setMuonRef (const l1t::RegionalMuonCandRef &ref)
 
void setOfflinePt (float pt)
 
const l1t::MuonStubRefVectorstubs () const
 
ap_uint< 64 > stubWord (const l1t::MuonStubRef &stub) const
 

Private Attributes

int bx_
 
uint charge_
 
bool isGlobal_
 
l1t::RegionalMuonCandRef muRef_
 
float offline_pt_
 
uint pt_
 
uint quality_
 
l1t::MuonStubRefVector stubs_
 

Friends

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

Detailed Description

Definition at line 14 of file MuonROI.h.

Constructor & Destructor Documentation

◆ MuonROI()

Phase2L1GMT::MuonROI::MuonROI ( int  bx,
uint  charge,
uint  pt,
uint  quality 
)
inline

Definition at line 16 of file MuonROI.h.

const uint pt() const
Definition: MuonROI.h:22
const uint charge() const
Definition: MuonROI.h:20
const int bx() const
Definition: MuonROI.h:18
const int quality() const
Definition: MuonROI.h:23

Member Function Documentation

◆ addStub()

void Phase2L1GMT::MuonROI::addStub ( const l1t::MuonStubRef stub)
inline

Definition at line 29 of file MuonROI.h.

References stubs_.

Referenced by Phase2L1GMT::ROITempAssociator::associate().

29 { stubs_.push_back(stub); }
l1t::MuonStubRefVector stubs_
Definition: MuonROI.h:114

◆ bx()

const int Phase2L1GMT::MuonROI::bx ( ) const
inline

Definition at line 18 of file MuonROI.h.

References bx_.

18 { return bx_; }

◆ charge()

const uint Phase2L1GMT::MuonROI::charge ( void  ) const
inline

Definition at line 20 of file MuonROI.h.

References charge_.

20 { return charge_; }

◆ isGlobalMuon()

bool Phase2L1GMT::MuonROI::isGlobalMuon ( ) const
inline

Definition at line 35 of file MuonROI.h.

References isGlobal_.

Referenced by Muon.Muon::muonID().

35 { return isGlobal_; }

◆ muonRef()

const l1t::RegionalMuonCandRef& Phase2L1GMT::MuonROI::muonRef ( ) const
inline

Definition at line 37 of file MuonROI.h.

References muRef_.

37 { return muRef_; }
l1t::RegionalMuonCandRef muRef_
Definition: MuonROI.h:115

◆ offline_pt()

const float Phase2L1GMT::MuonROI::offline_pt ( ) const
inline

Definition at line 25 of file MuonROI.h.

References offline_pt_.

25 { return offline_pt_; }

◆ printROILine()

void Phase2L1GMT::MuonROI::printROILine ( ) const
inline

Definition at line 79 of file MuonROI.h.

References createfilelist::int, LogDebug, roiWord(), alignCSCRings::s, photons_cff::s4, stubs_, and stubWord().

79  {
80  ap_uint<64> s0 = 0x1ff000000000000;
81  ap_uint<64> s1 = 0x1ff000000000000;
82  ap_uint<64> s2 = 0x1ff000000000000;
83  ap_uint<64> s3 = 0x1ff000000000000;
84  ap_uint<64> s4 = 0x1ff000000000000;
85  for (const auto& s : stubs_) {
86  if (s->tfLayer() == 0)
87  s0 = stubWord(s);
88  if (s->tfLayer() == 1)
89  s1 = stubWord(s);
90  if (s->tfLayer() == 2)
91  s2 = stubWord(s);
92  if (s->tfLayer() == 3)
93  s3 = stubWord(s);
94  if (s->tfLayer() == 4)
95  s4 = stubWord(s);
96  }
97  LogDebug("MuonROI") << "MuonROI " << std::setfill('0') << std::setw(8) << std::hex
98  << (long long unsigned int)(roiWord().to_uint64()) << std::setfill('0') << std::setw(16)
99  << std::hex << (long long unsigned int)(s4.to_uint64()) << std::setfill('0') << std::setw(16)
100  << std::hex << (long long unsigned int)(s3.to_uint64()) << std::setfill('0') << std::setw(16)
101  << std::hex << (long long unsigned int)(s2.to_uint64()) << std::setfill('0') << std::setw(16)
102  << std::hex << (long long unsigned int)(s1.to_uint64()) << std::setfill('0') << std::setw(16)
103  << std::hex << (long long unsigned int)(s0.to_uint64());
104  }
l1t::MuonStubRefVector stubs_
Definition: MuonROI.h:114
ap_uint< 64 > stubWord(const l1t::MuonStubRef &stub) const
Definition: MuonROI.h:53
ap_uint< 32 > roiWord() const
Definition: MuonROI.h:69
#define LogDebug(id)

◆ pt()

const uint Phase2L1GMT::MuonROI::pt ( ) const
inline

◆ quality()

const int Phase2L1GMT::MuonROI::quality ( void  ) const
inline

Definition at line 23 of file MuonROI.h.

References quality_.

23 { return quality_; }

◆ roiWord()

ap_uint<32> Phase2L1GMT::MuonROI::roiWord ( ) const
inline

Definition at line 69 of file MuonROI.h.

References Phase2L1GMT::BITSMUONBX, Phase2L1GMT::BITSPT, Phase2L1GMT::BITSSTAMUONQUALITY, bx_, charge_, isGlobal_, pt_, quality_, and Phase2L1GMT::twos_complement().

Referenced by printROILine().

69  {
70  ap_uint<32> word = 0;
73  word = word | (twos_complement(charge_, 1) << (BITSMUONBX + 1));
74  word = word | (twos_complement(pt_, BITSPT) << (BITSMUONBX + 2));
76  return word;
77  }
uint64_t word
const int BITSPT
Definition: Constants.h:24
const int BITSSTAMUONQUALITY
Definition: Constants.h:37
const int BITSMUONBX
Definition: Constants.h:38
uint64_t twos_complement(long long int v, uint bits)
Definition: Constants.h:90

◆ setMuonRef()

void Phase2L1GMT::MuonROI::setMuonRef ( const l1t::RegionalMuonCandRef ref)
inline

Definition at line 31 of file MuonROI.h.

References isGlobal_, and muRef_.

Referenced by Phase2L1GMT::ROITempAssociator::associate().

31  {
32  muRef_ = ref;
33  isGlobal_ = true;
34  }
l1t::RegionalMuonCandRef muRef_
Definition: MuonROI.h:115

◆ setOfflinePt()

void Phase2L1GMT::MuonROI::setOfflinePt ( float  pt)
inline

Definition at line 27 of file MuonROI.h.

References offline_pt_, and pt().

27 { offline_pt_ = pt; }
const uint pt() const
Definition: MuonROI.h:22

◆ stubs()

const l1t::MuonStubRefVector& Phase2L1GMT::MuonROI::stubs ( ) const
inline

Definition at line 51 of file MuonROI.h.

References stubs_.

Referenced by Phase2L1GMT::ROITempAssociator::associate().

51 { return stubs_; }
l1t::MuonStubRefVector stubs_
Definition: MuonROI.h:114

◆ stubWord()

ap_uint<64> Phase2L1GMT::MuonROI::stubWord ( const l1t::MuonStubRef stub) const
inline

Definition at line 53 of file MuonROI.h.

References Phase2L1GMT::BITSSTUBCOORD, Phase2L1GMT::BITSSTUBETA, Phase2L1GMT::BITSSTUBETAQUALITY, Phase2L1GMT::BITSSTUBID, Phase2L1GMT::BITSSTUBPHIQUALITY, Phase2L1GMT::BITSSTUBTIME, edm::Ref< C, T, F >::id(), and Phase2L1GMT::twos_complement().

Referenced by printROILine().

53  {
54  ap_uint<64> word = 0;
55  word = word | twos_complement(stub->coord1(), BITSSTUBCOORD);
56  word = word | (twos_complement(stub->coord2(), BITSSTUBCOORD) << BITSSTUBCOORD);
57  word = word | (twos_complement(stub->eta1(), BITSSTUBETA) << (2 * BITSSTUBCOORD));
58  word = word | (twos_complement(stub->eta2(), BITSSTUBETA) << (2 * BITSSTUBCOORD + BITSSTUBETA));
59  word = word | (twos_complement(stub->quality(), BITSSTUBPHIQUALITY) << (2 * BITSSTUBCOORD + 2 * BITSSTUBETA));
60  word = word | (twos_complement(stub->etaQuality(), BITSSTUBETAQUALITY)
62  word = word | (twos_complement(stub->bxNum(), BITSSTUBTIME)
64  word = word | (twos_complement(stub->id(), BITSSTUBID)
66  return word;
67  }
const int BITSSTUBCOORD
Definition: Constants.h:31
ProductID id() const
Accessor for product ID.
Definition: Ref.h:244
const int BITSSTUBETA
Definition: Constants.h:32
const int BITSSTUBETAQUALITY
Definition: Constants.h:35
const int BITSSTUBTIME
Definition: Constants.h:36
uint64_t word
const int BITSSTUBID
Definition: Constants.h:33
const int BITSSTUBPHIQUALITY
Definition: Constants.h:34
uint64_t twos_complement(long long int v, uint bits)
Definition: Constants.h:90

Friends And Related Function Documentation

◆ operator<<

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

Definition at line 39 of file MuonROI.h.

39  {
40  s.setf(ios::right, ios::adjustfield);
41  s << "ROI:"
42  << " "
43  << "BX: " << setw(5) << id.bx_ << " "
44  << "charge:" << setw(5) << id.charge_ << " "
45  << "pt:" << setw(5) << id.pt_ << " "
46  << "quality:" << setw(5) << id.quality_ << " "
47  << "offline pt:" << setw(5) << id.offline_pt_;
48  return s;
49  }

Member Data Documentation

◆ bx_

int Phase2L1GMT::MuonROI::bx_
private

Definition at line 107 of file MuonROI.h.

Referenced by bx(), and roiWord().

◆ charge_

uint Phase2L1GMT::MuonROI::charge_
private

Definition at line 108 of file MuonROI.h.

Referenced by charge(), and roiWord().

◆ isGlobal_

bool Phase2L1GMT::MuonROI::isGlobal_
private

Definition at line 111 of file MuonROI.h.

Referenced by isGlobalMuon(), roiWord(), and setMuonRef().

◆ muRef_

l1t::RegionalMuonCandRef Phase2L1GMT::MuonROI::muRef_
private

Definition at line 115 of file MuonROI.h.

Referenced by muonRef(), and setMuonRef().

◆ offline_pt_

float Phase2L1GMT::MuonROI::offline_pt_
private

Definition at line 112 of file MuonROI.h.

Referenced by offline_pt(), and setOfflinePt().

◆ pt_

uint Phase2L1GMT::MuonROI::pt_
private

Definition at line 109 of file MuonROI.h.

Referenced by pt(), and roiWord().

◆ quality_

uint Phase2L1GMT::MuonROI::quality_
private

Definition at line 110 of file MuonROI.h.

Referenced by quality(), and roiWord().

◆ stubs_

l1t::MuonStubRefVector Phase2L1GMT::MuonROI::stubs_
private

Definition at line 114 of file MuonROI.h.

Referenced by addStub(), printROILine(), and stubs().