CMS 3D CMS Logo

EnergySumTemplate.cc
Go to the documentation of this file.
1 
17 // this class header
19 
20 // system include files
21 
22 #include <iostream>
23 #include <iomanip>
24 
25 // user include files
26 
27 // base class
28 
29 // forward declarations
30 
31 // constructors
33 
36 }
37 
39  : GlobalCondition(cName, l1t::CondEnergySum, cType) {
41 
42  // should be always 1 - they are global quantities...
43  int nObjects = nrObjects();
44 
45  if (nObjects > 0) {
46  m_objectParameter.reserve(nObjects);
47  m_objectType.reserve(nObjects);
48  }
49 }
50 
51 // copy constructor
53 
54 // destructor
56  // empty now
57 }
58 
59 // assign operator
61  copy(cp);
62  return *this;
63 }
64 
65 // setConditionParameter - set the parameters of the condition
66 void EnergySumTemplate::setConditionParameter(const std::vector<ObjectParameter>& objParameter) {
67  m_objectParameter = objParameter;
68 }
69 
70 void EnergySumTemplate::print(std::ostream& myCout) const {
71  myCout << "\n EnergySumTemplate print..." << std::endl;
72 
73  GlobalCondition::print(myCout);
74 
75  int nObjects = nrObjects();
76 
77  for (int i = 0; i < nObjects; i++) {
78  myCout << std::endl;
79  myCout << " Template for object " << i << " [ hex ]" << std::endl;
80  myCout << " etThreshold = " << std::hex << m_objectParameter[i].etLowThreshold << " - "
81  << m_objectParameter[i].etHighThreshold << std::endl;
82  myCout << " energyOverflow = " << std::hex << m_objectParameter[0].energyOverflow << std::endl;
83 
84  if (m_condType == l1t::TypeETM) {
85  myCout << " phi = " << std::hex << m_objectParameter[i].phiRange1Word << std::hex
86  << m_objectParameter[i].phiRange0Word << std::endl;
87  } else if (m_condType == l1t::TypeHTM) {
88  myCout << " phi = " << std::hex << m_objectParameter[i].phiRange0Word << std::endl;
89  } else if (m_condType == l1t::TypeETMHF) {
90  myCout << " phi = " << std::hex << m_objectParameter[i].phiRange0Word << std::endl;
91  }
92  }
93 
94  // reset to decimal output
95  myCout << std::dec << std::endl;
96 }
97 
99  m_condName = cp.condName();
100  m_condCategory = cp.condCategory();
101  m_condType = cp.condType();
102  m_objectType = cp.objectType();
103  m_condGEq = cp.condGEq();
104  m_condChipNr = cp.condChipNr();
105  m_condRelativeBx = cp.condRelativeBx();
106 
107  m_objectParameter = *(cp.objectParameter());
108 }
109 
110 // output stream operator
111 std::ostream& operator<<(std::ostream& os, const EnergySumTemplate& result) {
112  result.print(os);
113  return os;
114 }
EnergySumTemplate & operator=(const EnergySumTemplate &)
void copy(const EnergySumTemplate &cp)
copy function for copy constructor and operator=
bool m_condGEq
the operator used for the condition (>=, =): true for >=
delete x;
Definition: CaloConfig.h:22
std::ostream & operator<<(std::ostream &os, const EnergySumTemplate &result)
std::string m_condName
the name of the condition
int m_condChipNr
condition is located on condition chip m_condChipNr
l1t::GtConditionCategory m_condCategory
the category of the condition
std::vector< ObjectParameter > m_objectParameter
variables containing the parameters
void print(std::ostream &myCout) const override
print the condition
~EnergySumTemplate() override
const int nrObjects() const
get number of trigger objects
std::vector< l1t::GlobalObject > m_objectType
the trigger object type(s)
void setConditionParameter(const std::vector< ObjectParameter > &)
set functions
l1t::GtConditionType m_condType
the type of the condition (1s, etc)
virtual void print(std::ostream &myCout) const
print condition