CMS 3D CMS Logo

GlobalParamsHelper.cc
Go to the documentation of this file.
2 
3 using namespace l1t;
4 
6  return new GlobalParamsHelper(es);
7 }
8 
11  x->useCopy();
12  return x;
13 }
14 
16  write_ = w;
17  check_write();
18  we_own_write_ = false;
20  read_ = write_;
21 }
22 
24  read_ = es;
25  write_ = nullptr;
26 }
27 
30  we_own_write_ = true;
31  read_ = write_;
32 }
33 
35  if (we_own_write_ && write_)
36  delete write_;
37 }
38 
39 // set the number of bx in event
40 void GlobalParamsHelper::setTotalBxInEvent(const int& numberBxValue) {
41  check_write();
42  write_->m_totalBxInEvent = numberBxValue;
43 }
44 
45 // set the number of physics trigger algorithms
46 void GlobalParamsHelper::setNumberPhysTriggers(const unsigned int& numberPhysTriggersValue) {
47  check_write();
48  write_->m_numberPhysTriggers = numberPhysTriggersValue;
49 }
50 
51 // set the number of L1 muons received by GT
52 void GlobalParamsHelper::setNumberL1Mu(const unsigned int& numberL1MuValue) {
53  check_write();
54  write_->m_numberL1Mu = numberL1MuValue;
55 }
56 
57 // set the number of L1 e/gamma objects received by GT
58 void GlobalParamsHelper::setNumberL1EG(const unsigned int& numberL1EGValue) {
59  check_write();
60  write_->m_numberL1EG = numberL1EGValue;
61 }
62 
63 // set the number of L1 central jets received by GT
64 void GlobalParamsHelper::setNumberL1Jet(const unsigned int& numberL1JetValue) {
65  check_write();
66  write_->m_numberL1Jet = numberL1JetValue;
67 }
68 
69 // set the number of L1 tau jets received by GT
70 void GlobalParamsHelper::setNumberL1Tau(const unsigned int& numberL1TauValue) {
71  check_write();
72  write_->m_numberL1Tau = numberL1TauValue;
73 }
74 
75 // hardware stuff
76 
77 // set the number of condition chips in GTL
78 void GlobalParamsHelper::setNumberChips(const unsigned int& numberChipsValue) {
79  check_write();
80  write_->m_numberChips = numberChipsValue;
81 }
82 
83 // set the number of pins on the GTL condition chips
84 void GlobalParamsHelper::setPinsOnChip(const unsigned int& pinsOnChipValue) {
85  check_write();
86  write_->m_pinsOnChip = pinsOnChipValue;
87 }
88 
89 // set the correspondence "condition chip - GTL algorithm word"
90 // in the hardware
91 void GlobalParamsHelper::setOrderOfChip(const std::vector<int>& orderOfChipValue) {
92  check_write();
93  write_->m_orderOfChip = orderOfChipValue;
94 }
95 
96 // print all the L1 GT stable parameters
97 void GlobalParamsHelper::print(std::ostream& myStr) const {
98  myStr << "\nL1T Global Parameters \n" << std::endl;
99 
100  // number of bx
101  myStr << "\n Number of bx in Event = " << read_->m_totalBxInEvent << std::endl;
102 
103  // trigger decision
104 
105  // number of physics trigger algorithms
106  myStr << "\n Number of physics trigger algorithms = " << read_->m_numberPhysTriggers << std::endl;
107 
108  // muons
109  myStr << "\n Number of muons received by L1 GT = " << read_->m_numberL1Mu << std::endl;
110 
111  // e/gamma and isolated e/gamma objects
112  myStr << " Number of e/gamma objects received by L1 GT = " << read_->m_numberL1EG << std::endl;
113 
114  // central, forward and tau jets
115  myStr << "\n Number of jets received by L1 GT = " << read_->m_numberL1Jet << std::endl;
116 
117  myStr << " Number of tau received by L1 GT = " << read_->m_numberL1Tau << std::endl;
118 
119  // hardware
120 
121  // number of condition chips
122  myStr << "\n Number of condition chips = " << read_->m_numberChips << std::endl;
123 
124  // number of pins on the GTL condition chips
125  myStr << " Number of pins on chips = " << read_->m_pinsOnChip << std::endl;
126 
127  // correspondence "condition chip - GTL algorithm word" in the hardware
128  // chip 2: 0 - 95; chip 1: 96 - 128 (191)
129  myStr << " Order of chips for algorithm word = {";
130 
131  for (unsigned int iChip = 0; iChip < read_->m_orderOfChip.size(); ++iChip) {
132  myStr << read_->m_orderOfChip[iChip];
133  if (iChip != (read_->m_orderOfChip.size() - 1)) {
134  myStr << ", ";
135  }
136  }
137 
138  myStr << "}" << std::endl;
139 
140  myStr << "\n" << std::endl;
141 }
l1t::GlobalParamsHelper::setNumberPhysTriggers
void setNumberPhysTriggers(const unsigned int &)
Definition: GlobalParamsHelper.cc:46
l1t::GlobalParamsHelper::setNumberL1Jet
void setNumberL1Jet(const unsigned int &)
Definition: GlobalParamsHelper.cc:64
GlobalParamsHelper.h
L1TGlobalParameters::m_numberL1Jet
unsigned int m_numberL1Jet
jets
Definition: L1TGlobalParameters.h:31
L1TGlobalParameters::m_orderOfChip
std::vector< int > m_orderOfChip
correspondence "condition chip - GTL algorithm word" in the hardware
Definition: L1TGlobalParameters.h:45
L1TGlobalParameters::m_numberL1Tau
unsigned int m_numberL1Tau
taus
Definition: L1TGlobalParameters.h:34
l1t::GlobalParamsHelper::setOrderOfChip
void setOrderOfChip(const std::vector< int > &)
Definition: GlobalParamsHelper.cc:91
L1TGlobalParameters::m_numberL1EG
unsigned int m_numberL1EG
e/gamma objects
Definition: L1TGlobalParameters.h:28
l1t::GlobalParamsHelper::useCopy
void useCopy()
Definition: GlobalParamsHelper.cc:28
L1TGlobalParameters
Definition: L1TGlobalParameters.h:7
l1t::GlobalParamsHelper::~GlobalParamsHelper
~GlobalParamsHelper()
Definition: GlobalParamsHelper.cc:34
l1t::GlobalParamsHelper::setNumberL1Mu
void setNumberL1Mu(const unsigned int &)
Definition: GlobalParamsHelper.cc:52
l1t::GlobalParamsHelper::write_
L1TGlobalParameters * write_
Definition: GlobalParamsHelper.h:108
w
const double w
Definition: UKUtility.cc:23
l1t::GlobalParamsHelper::readFromEventSetup
static const GlobalParamsHelper * readFromEventSetup(const L1TGlobalParameters *es)
Definition: GlobalParamsHelper.cc:5
L1TGlobalParameters::m_totalBxInEvent
int m_totalBxInEvent
bx in event
Definition: L1TGlobalParameters.h:15
l1t::GlobalParamsHelper::check_write
void check_write()
Definition: GlobalParamsHelper.h:105
l1t::GlobalParamsHelper::setNumberL1EG
void setNumberL1EG(const unsigned int &)
Definition: GlobalParamsHelper.cc:58
l1t::GlobalParamsHelper::VERSION
Definition: GlobalParamsHelper.h:35
l1t::GlobalParamsHelper
Definition: GlobalParamsHelper.h:33
L1TGlobalParameters::m_version
int m_version
Definition: L1TGlobalParameters.h:47
l1t::GlobalParamsHelper::GlobalParamsHelper
GlobalParamsHelper(L1TGlobalParameters *w)
Definition: GlobalParamsHelper.cc:15
l1t
delete x;
Definition: CaloConfig.h:22
l1t::GlobalParamsHelper::print
void print(std::ostream &) const
print all the L1 GT parameters
Definition: GlobalParamsHelper.cc:97
l1t::GlobalParamsHelper::we_own_write_
bool we_own_write_
Definition: GlobalParamsHelper.h:109
L1TGlobalParameters::m_numberChips
unsigned int m_numberChips
hardware
Definition: L1TGlobalParameters.h:39
l1t::GlobalParamsHelper::readAndWriteFromEventSetup
static GlobalParamsHelper * readAndWriteFromEventSetup(const L1TGlobalParameters *es)
Definition: GlobalParamsHelper.cc:9
l1t::GlobalParamsHelper::setTotalBxInEvent
void setTotalBxInEvent(const int &)
Definition: GlobalParamsHelper.cc:40
l1t::GlobalParamsHelper::read_
const L1TGlobalParameters * read_
Definition: GlobalParamsHelper.h:107
l1t::GlobalParamsHelper::setPinsOnChip
void setPinsOnChip(const unsigned int &)
Definition: GlobalParamsHelper.cc:84
L1TGlobalParameters::m_numberPhysTriggers
unsigned int m_numberPhysTriggers
trigger decision
Definition: L1TGlobalParameters.h:20
l1t::GlobalParamsHelper::setNumberChips
void setNumberChips(const unsigned int &)
Definition: GlobalParamsHelper.cc:78
L1TGlobalParameters::m_numberL1Mu
unsigned int m_numberL1Mu
trigger objects
Definition: L1TGlobalParameters.h:25
l1t::GlobalParamsHelper::setNumberL1Tau
void setNumberL1Tau(const unsigned int &)
Definition: GlobalParamsHelper.cc:70
L1TGlobalParameters::m_pinsOnChip
unsigned int m_pinsOnChip
number of pins on the GTL condition chips
Definition: L1TGlobalParameters.h:42