CMS 3D CMS Logo

L1GtCaloTemplate.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 
31 
32 // forward declarations
33 
34 // constructors
36 
38 
40  : L1GtCondition(cName, CondCalo, cType) {
41  int nObjects = nrObjects();
42 
43  if (nObjects > 0) {
44  m_objectParameter.reserve(nObjects);
45 
46  m_objectType.reserve(nObjects);
47  }
48 }
49 
50 // copy constructor
52 
53 // destructor
55  // empty now
56 }
57 
58 // assign operator
60  copy(cp);
61  return *this;
62 }
63 
64 // setConditionParameter - set the parameters of the condition
65 void L1GtCaloTemplate::setConditionParameter(const std::vector<ObjectParameter>& objParameter,
66  const CorrelationParameter& corrParameter) {
67  m_objectParameter = objParameter;
68  m_correlationParameter = corrParameter;
69 }
70 
71 void L1GtCaloTemplate::print(std::ostream& myCout) const {
72  myCout << "\n L1GtCaloTemplate print..." << std::endl;
73 
74  L1GtCondition::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].etThreshold << std::endl;
82  myCout << " etaRange = " << std::hex << m_objectParameter[i].etaRange << std::endl;
83  myCout << " phiRange = " << std::hex << m_objectParameter[i].phiRange << std::endl;
84  }
85 
86  if (wsc()) {
87  myCout << " Correlation parameters "
88  << "[ hex ]" << std::endl;
89 
90  myCout << " deltaEtaRange = " << std::hex << m_correlationParameter.deltaEtaRange << std::endl;
91  myCout << " deltaPhiRange = " << std::hex << m_correlationParameter.deltaPhiRange << std::endl;
92  myCout << " deltaPhiMaxbits = " << std::hex << m_correlationParameter.deltaPhiMaxbits << std::endl;
93  }
94 
95  // reset to decimal output
96  myCout << std::dec << std::endl;
97 }
98 
100  m_condName = cp.condName();
101  m_condCategory = cp.condCategory();
102  m_condType = cp.condType();
103  m_objectType = cp.objectType();
104  m_condGEq = cp.condGEq();
105  m_condChipNr = cp.condChipNr();
106 
107  m_objectParameter = *(cp.objectParameter());
108  m_correlationParameter = *(cp.correlationParameter());
109 }
110 
111 // output stream operator
112 std::ostream& operator<<(std::ostream& os, const L1GtCaloTemplate& result) {
113  result.print(os);
114  return os;
115 }
std::vector< ObjectParameter > m_objectParameter
variables containing the parameters
L1GtConditionType
std::vector< L1GtObject > m_objectType
the trigger object type(s)
void copy(const L1GtCaloTemplate &cp)
copy function for copy constructor and operator=
std::ostream & operator<<(std::ostream &os, const L1GtCaloTemplate &result)
void print(std::ostream &myCout) const override
print the condition
L1GtConditionType m_condType
the type of the condition (1s, etc)
L1GtConditionCategory m_condCategory
the category of the condition
L1GtCaloTemplate & operator=(const L1GtCaloTemplate &)
std::string m_condName
the name of the condition
typedef for correlation parameters
const bool wsc() const
~L1GtCaloTemplate() override
bool m_condGEq
the operator used for the condition (>=, =): true for >=
const int nrObjects() const
get number of trigger objects
int m_condChipNr
condition is located on condition chip m_condChipNr
void setConditionParameter(const std::vector< ObjectParameter > &objParameter, const CorrelationParameter &corrParameter)
set functions
virtual void print(std::ostream &myCout) const
print condition
CorrelationParameter m_correlationParameter