CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
L1GtEnergySumTemplate.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 
39 }
40 
42  : L1GtCondition(cName, CondEnergySum, cType) {
44 
45  // should be always 1 - they are global quantities...
46  int nObjects = nrObjects();
47 
48  if (nObjects > 0) {
49  m_objectParameter.reserve(nObjects);
50  m_objectType.reserve(nObjects);
51  }
52 }
53 
54 // copy constructor
56  copy(cp);
57 }
58 
59 // destructor
61  // empty now
62 }
63 
64 // assign operator
66  copy(cp);
67  return *this;
68 }
69 
70 // setConditionParameter - set the parameters of the condition
71 void L1GtEnergySumTemplate::setConditionParameter(const std::vector<ObjectParameter>& objParameter) {
72  m_objectParameter = objParameter;
73 }
74 
75 void L1GtEnergySumTemplate::print(std::ostream& myCout) const {
76  myCout << "\n L1GtEnergySumTemplate print..." << std::endl;
77 
78  L1GtCondition::print(myCout);
79 
80  int nObjects = nrObjects();
81 
82  for (int i = 0; i < nObjects; i++) {
83  myCout << std::endl;
84  myCout << " Template for object " << i << " [ hex ]" << std::endl;
85  myCout << " etThreshold = " << std::hex << m_objectParameter[i].etThreshold << std::endl;
86  myCout << " energyOverflow = " << std::hex << m_objectParameter[0].energyOverflow << std::endl;
87 
88  if (m_condType == TypeETM) {
89  myCout << " phi = " << std::hex << m_objectParameter[i].phiRange1Word << std::hex
90  << m_objectParameter[i].phiRange0Word << std::endl;
91  } else if (m_condType == TypeHTM) {
92  myCout << " phi = " << std::hex << m_objectParameter[i].phiRange0Word << std::endl;
93  }
94  }
95 
96  // reset to decimal output
97  myCout << std::dec << std::endl;
98 }
99 
101  m_condName = cp.condName();
103  m_condType = cp.condType();
104  m_objectType = cp.objectType();
105  m_condGEq = cp.condGEq();
106  m_condChipNr = cp.condChipNr();
107 
109 }
110 
111 // output stream operator
112 std::ostream& operator<<(std::ostream& os, const L1GtEnergySumTemplate& result) {
113  result.print(os);
114  return os;
115 }
const int nrObjects() const
get number of trigger objects
void print(std::ostream &myCout) const override
print the condition
L1GtConditionType
const std::string & condName() const
get / set condition name
Definition: L1GtCondition.h:52
const int & condChipNr() const
get / set the condition-chip number the condition is located on
Definition: L1GtCondition.h:77
const std::vector< L1GtObject > & objectType() const
get / set the trigger object type(s) in the condition
Definition: L1GtCondition.h:67
std::vector< L1GtObject > m_objectType
the trigger object type(s)
std::ostream & operator<<(std::ostream &out, const ALILine &li)
Definition: ALILine.cc:167
virtual void print(std::ostream &myCout) const
print condition
tuple result
Definition: mps_fire.py:311
L1GtConditionType m_condType
the type of the condition (1s, etc)
std::vector< ObjectParameter > m_objectParameter
variables containing the parameters
L1GtConditionCategory m_condCategory
the category of the condition
const std::vector< ObjectParameter > * objectParameter() const
const L1GtConditionType & condType() const
get / set the type of the condition (1s, etc)
Definition: L1GtCondition.h:62
std::string m_condName
the name of the condition
const L1GtConditionCategory & condCategory() const
get / set the category of the condition
Definition: L1GtCondition.h:57
void copy(const L1GtEnergySumTemplate &cp)
copy function for copy constructor and operator=
L1GtEnergySumTemplate & operator=(const L1GtEnergySumTemplate &)
bool m_condGEq
the operator used for the condition (&gt;=, =): true for &gt;=
const bool condGEq() const
get / set condition GEq flag
Definition: L1GtCondition.h:72
int m_condChipNr
condition is located on condition chip m_condChipNr
void setConditionParameter(const std::vector< ObjectParameter > &)
set functions