CMS 3D CMS Logo

MuonTemplate.cc
Go to the documentation of this file.
1 
19 // this class header
21 
22 // system include files
23 
24 #include <iostream>
25 #include <iomanip>
26 
27 // user include files
28 
29 // base class
30 
31 // forward declarations
32 
33 // constructors
35 
37 
39  : GlobalCondition(cName, l1t::CondMuon, cType) {
40  int nObjects = nrObjects();
41 
42  if (nObjects > 0) {
43  m_objectParameter.reserve(nObjects);
44 
45  m_objectType.reserve(nObjects);
46  m_objectType.assign(nObjects, l1t::gtMu);
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 MuonTemplate::setConditionParameter(const std::vector<ObjectParameter>& objParameter,
66  const CorrelationParameter& corrParameter) {
67  m_objectParameter = objParameter;
68  m_correlationParameter = corrParameter;
69 }
70 
71 void MuonTemplate::print(std::ostream& myCout) const {
72  myCout << "\n MuonTemplate 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 << " ptHighThreshold = " << std::hex << m_objectParameter[i].ptHighThreshold << std::endl;
82  myCout << " ptLowThreshold = " << std::hex << m_objectParameter[i].ptLowThreshold << std::endl;
83  myCout << " uptHighCut = " << std::hex << m_objectParameter[i].unconstrainedPtHigh << std::endl;
84  myCout << " uptLowCut = " << std::hex << m_objectParameter[i].unconstrainedPtLow << std::endl;
85  myCout << " indexHigh = " << std::hex << m_objectParameter[i].indexHigh << std::endl;
86  myCout << " indexLow = " << std::hex << m_objectParameter[i].indexLow << std::endl;
87  myCout << " enableMip = " << std::hex << m_objectParameter[i].enableMip << std::endl;
88  myCout << " enableIso = " << std::hex << m_objectParameter[i].enableIso << std::endl;
89  myCout << " requestIso = " << std::hex << m_objectParameter[i].requestIso << std::endl;
90  myCout << " charge =" << std::dec << m_objectParameter[i].charge << std::endl;
91  myCout << " qualityLUT = " << std::hex << m_objectParameter[i].qualityLUT << std::endl;
92  myCout << " isolationLUT = " << std::hex << m_objectParameter[i].isolationLUT << std::endl;
93  myCout << " impactParameterLUT= " << std::hex << m_objectParameter[i].impactParameterLUT << std::endl;
94  myCout << " phiWindow1Lower =" << std::hex << m_objectParameter[i].phiWindow1Lower << std::endl;
95  myCout << " phiWindow1Upper =" << std::hex << m_objectParameter[i].phiWindow1Upper << std::endl;
96  myCout << " phiWindow2Lower =" << std::hex << m_objectParameter[i].phiWindow2Lower << std::endl;
97  myCout << " phiWindow2Upper =" << std::hex << m_objectParameter[i].phiWindow2Upper << std::endl;
98 
99  size_t etaWindowIndex = 1;
100  for (const auto& window : m_objectParameter[i].etaWindows) {
101  myCout << " etaWindows[" << etaWindowIndex << "].lower =" << std::hex << window.lower << std::endl;
102  myCout << " etaWindows[" << etaWindowIndex << "].upper =" << std::hex << window.upper << std::endl;
103  ++etaWindowIndex;
104  }
105  }
106 
107  if (wsc()) {
108  myCout << " Correlation parameters "
109  << "[ hex ]" << std::endl;
110 
111  myCout << " chargeCorrelation = " << std::hex << m_correlationParameter.chargeCorrelation << std::endl;
112 
113  myCout << " deltaEtaRange = " << std::hex << m_correlationParameter.deltaEtaRange << std::endl;
114  myCout << " deltaPhiRange1Word = " << std::hex << m_correlationParameter.deltaPhiRange1Word << std::endl;
115  myCout << " deltaPhiRange0Word = " << std::hex << m_correlationParameter.deltaPhiRange0Word << std::endl;
116  myCout << " deltaPhiMaxbits = " << std::hex << m_correlationParameter.deltaPhiMaxbits << std::endl;
117  } else {
118  if (m_condType == l1t::Type1s) {
119  myCout << " Correlation parameters "
120  << "[ hex ]" << std::endl;
121 
122  myCout << " chargeCorrelation = " << std::hex << m_correlationParameter.chargeCorrelation << " (charge sign) "
123  << std::endl;
124 
125  } else {
126  myCout << "\n Correlation parameters "
127  << "[ hex ]" << std::endl;
128 
129  myCout << " chargeCorrelation = " << std::hex << m_correlationParameter.chargeCorrelation << std::endl;
130  }
131  }
132 
133  // reset to decimal output
134  myCout << std::dec << std::endl;
135 }
136 
138  m_condName = cp.condName();
139  m_condCategory = cp.condCategory();
140  m_condType = cp.condType();
141  m_objectType = cp.objectType();
142  m_condGEq = cp.condGEq();
143  m_condChipNr = cp.condChipNr();
144  m_condRelativeBx = cp.condRelativeBx();
145 
146  m_objectParameter = *(cp.objectParameter());
147  m_correlationParameter = *(cp.correlationParameter());
148 }
149 
150 // output stream operator
151 std::ostream& operator<<(std::ostream& os, const MuonTemplate& result) {
152  result.print(os);
153  return os;
154 }
void copy(const MuonTemplate &cp)
copy function for copy constructor and operator=
const bool wsc() const
MuonTemplate & operator=(const MuonTemplate &)
Definition: MuonTemplate.cc:59
bool m_condGEq
the operator used for the condition (>=, =): true for >=
delete x;
Definition: CaloConfig.h:22
void print(std::ostream &myCout) const override
print the condition
Definition: MuonTemplate.cc:71
std::ostream & operator<<(std::ostream &os, const MuonTemplate &result)
std::vector< ObjectParameter > m_objectParameter
variables containing the parameters
Definition: MuonTemplate.h:139
def window(xmin, xmax, ymin, ymax, x=0, y=0, width=100, height=100, xlogbase=None, ylogbase=None, minusInfinity=-1000, flipx=False, flipy=True)
Definition: svgfig.py:643
std::string m_condName
the name of the condition
unsigned long long deltaPhiRange0Word
Definition: MuonTemplate.h:102
int m_condChipNr
condition is located on condition chip m_condChipNr
l1t::GtConditionCategory m_condCategory
the category of the condition
unsigned long long deltaPhiRange1Word
Definition: MuonTemplate.h:103
void setConditionParameter(const std::vector< ObjectParameter > &objParameter, const CorrelationParameter &corrParameter)
set functions
Definition: MuonTemplate.cc:65
const int nrObjects() const
get number of trigger objects
~MuonTemplate() override
Definition: MuonTemplate.cc:54
std::vector< l1t::GlobalObject > m_objectType
the trigger object type(s)
CorrelationParameter m_correlationParameter
Definition: MuonTemplate.h:140
l1t::GtConditionType m_condType
the type of the condition (1s, etc)
virtual void print(std::ostream &myCout) const
print condition