CMS 3D CMS Logo

EnergySumZdcTemplate.cc
Go to the documentation of this file.
1 
18 // this class header
20 
21 // system include files
22 
23 #include <iostream>
24 #include <iomanip>
25 
26 // user include files
27 
28 // base class
29 
30 // forward declarations
31 
32 // constructors
34 
37 }
38 
40  : GlobalCondition(cName, l1t::CondEnergySumZdc, cType) {
42 
43  // should be always 1 - they are global quantities...
44  int nObjects = nrObjects();
45 
46  if (nObjects > 0) {
47  m_objectParameter.reserve(nObjects);
48  m_objectType.reserve(nObjects);
49  }
50 }
51 
52 // copy constructor
54  copy(cp);
55 }
56 
57 // destructor
59 
60 // assign operator
62  copy(cp);
63  return *this;
64 }
65 
66 // setConditionParameter - set the parameters of the condition
67 void EnergySumZdcTemplate::setConditionParameter(const std::vector<ObjectParameter>& objParameter) {
68  m_objectParameter = objParameter;
69 }
70 
71 void EnergySumZdcTemplate::print(std::ostream& myCout) const {
72  myCout << "\n EnergySumZdcTemplate print..." << std::endl;
73 
74  GlobalCondition::print(myCout);
75 
76  int nObjects = nrObjects();
77 
78  for (int i = 0; i < nObjects; i++) {
79  myCout << std::endl;
80  myCout << " Template for object " << i << " [ hex ]" << std::endl;
81  myCout << " etThreshold = " << std::hex << m_objectParameter[i].etLowThreshold << " - "
82  << m_objectParameter[i].etHighThreshold << std::endl;
83  }
84 
85  // reset to decimal output
86  myCout << std::dec << std::endl;
87 }
88 
90  m_condName = cp.condName();
91  m_condCategory = cp.condCategory();
92  m_condType = cp.condType();
93  m_objectType = cp.objectType();
94  m_condGEq = cp.condGEq();
95  m_condChipNr = cp.condChipNr();
96  m_condRelativeBx = cp.condRelativeBx();
97 
98  m_objectParameter = *(cp.objectParameter());
99 }
100 
101 // output stream operator
102 std::ostream& operator<<(std::ostream& os, const EnergySumZdcTemplate& result) {
103  result.print(os);
104  return os;
105 }
std::ostream & operator<<(std::ostream &os, const EnergySumZdcTemplate &result)
void copy(const EnergySumZdcTemplate &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
~EnergySumZdcTemplate() override
void print(std::ostream &myCout) const override
print the condition
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
EnergySumZdcTemplate & operator=(const EnergySumZdcTemplate &)
void setConditionParameter(const std::vector< ObjectParameter > &)
set functions
const int nrObjects() const
get number of trigger objects
std::vector< l1t::GlobalObject > m_objectType
the trigger object type(s)
l1t::GtConditionType m_condType
the type of the condition (1s, etc)
virtual void print(std::ostream &myCout) const
print condition