CMS 3D CMS Logo

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
List of all members | Public Member Functions | Private Member Functions | Private Attributes
l1t::EnergySumZdcCondition Class Reference

#include <EnergySumZdcCondition.h>

Inheritance diagram for l1t::EnergySumZdcCondition:
l1t::ConditionEvaluation

Public Member Functions

 EnergySumZdcCondition ()
 
 EnergySumZdcCondition (const GlobalCondition *, const GlobalBoard *)
 from base template condition (from event setup usually) More...
 
 EnergySumZdcCondition (const EnergySumZdcCondition &)
 
const bool evaluateCondition (const int bxEval) const override
 the core function to check if the condition matches More...
 
const GlobalBoardgetuGtB () const
 get / set the pointer to uGt GlobalBoard More...
 
const EnergySumZdcTemplategtEnergySumZdcTemplate () const
 get / set the pointer to a L1GtCondition More...
 
EnergySumZdcConditionoperator= (const EnergySumZdcCondition &)
 
void print (std::ostream &myCout) const override
 print condition More...
 
void setGtEnergySumZdcTemplate (const EnergySumZdcTemplate *)
 
void setuGtB (const GlobalBoard *)
 
 ~EnergySumZdcCondition () override
 
- Public Member Functions inherited from l1t::ConditionEvaluation
 ConditionEvaluation ()
 constructor More...
 
bool condLastResult () const
 get the latest result for the condition More...
 
int condMaxNumberObjects () const
 
void evaluateConditionStoreResult (const int bxEval)
 call evaluateCondition and save last result More...
 
CombinationsInCond const & getCombinationsInCond () const
 get all the object combinations evaluated to true in the condition More...
 
virtual std::string getNumericExpression () const
 get numeric expression More...
 
void setCondMaxNumberObjects (int condMaxNumberObjectsValue)
 
void setVerbosity (const int verbosity)
 
virtual ~ConditionEvaluation ()
 destructor More...
 

Private Member Functions

void copy (const EnergySumZdcCondition &cp)
 copy function for copy constructor and operator= More...
 

Private Attributes

const EnergySumZdcTemplatem_gtEnergySumZdcTemplate
 pointer to a EnergySumZdcTemplate More...
 
const GlobalBoardm_uGtB
 pointer to uGt GlobalBoard, to be able to get the trigger objects More...
 

Additional Inherited Members

- Protected Member Functions inherited from l1t::ConditionEvaluation
template<class Type1 >
const bool checkBit (const Type1 &mask, const unsigned int bitNumber) const
 check if a bit with a given number is set in a mask More...
 
template<class Type1 , class Type2 >
const bool checkCut (const Type1 &cutL, const Type2 &value, bool condGEqValue) const
 
template<class Type1 >
const bool checkIndex (const Type1 &indexLo, const Type1 &indexHi, const unsigned int index) const
 check if a index is in a given range More...
 
template<class Type1 >
const bool checkRangeDeltaEta (const unsigned int obj1Eta, const unsigned int obj2Eta, const Type1 &lowerR, const Type1 &upperR, const unsigned int nEtaBits) const
 check if a value is in a given deltaEta range More...
 
template<class Type1 >
const bool checkRangeDeltaPhi (const unsigned int obj1Phi, const unsigned int obj2Phi, const Type1 &lowerR, const Type1 &upperR) const
 check if a value is in a given deltaPhi range More...
 
template<class Type1 >
const bool checkRangeEta (const unsigned int bitNumber, const std::vector< Type1 > &windows, const unsigned int nEtaBits) const
 
template<class Type1 >
const bool checkRangePhi (const unsigned int bitNumber, const Type1 &W1beginR, const Type1 &W1endR, const Type1 &W2beginR, const Type1 &W2endR) const
 check if a value is in a given phi range and outside of a veto range More...
 
template<class Type1 >
const bool checkRangeTfMuonIndex (const unsigned int bitNumber, const std::vector< Type1 > &windows) const
 check if a value is in a given muon track finder index range More...
 
template<class Type1 , class Type2 >
const bool checkThreshold (const Type1 &thresholdL, const Type1 &thresholdH, const Type2 &value, bool condGEqValue) const
 
template<class Type1 , class Type2 >
const bool checkUnconstrainedPt (const Type1 &thresholdL, const Type1 &thresholdH, const Type2 &value, bool condGEqValue) const
 
CombinationsInCondcombinationsInCond () const
 get all the object combinations (to fill it...) More...
 
- Protected Attributes inherited from l1t::ConditionEvaluation
CombinationsInCond m_combinationsInCond
 store all the object combinations evaluated to true in the condition More...
 
bool m_condLastResult
 the last result of evaluateCondition() More...
 
int m_condMaxNumberObjects
 
int m_verbosity
 verbosity level More...
 

Detailed Description

Definition at line 37 of file EnergySumZdcCondition.h.

Constructor & Destructor Documentation

◆ EnergySumZdcCondition() [1/3]

EnergySumZdcCondition::EnergySumZdcCondition ( )

constructors default

Definition at line 38 of file EnergySumZdcCondition.cc.

39  //empty
40 }

◆ EnergySumZdcCondition() [2/3]

EnergySumZdcCondition::EnergySumZdcCondition ( const GlobalCondition eSumTemplate,
const GlobalBoard ptrGTB 
)

from base template condition (from event setup usually)

Definition at line 43 of file EnergySumZdcCondition.cc.

References l1t::ConditionEvaluation::m_condMaxNumberObjects.

45  m_gtEnergySumZdcTemplate(static_cast<const EnergySumZdcTemplate*>(eSumTemplate)),
46  m_uGtB(ptrGTB)
47 
48 {
49  // maximum number of objects received for the evaluation of the condition
50  // energy sums are global quantities - one object per event
51 
53 }
const EnergySumZdcTemplate * m_gtEnergySumZdcTemplate
pointer to a EnergySumZdcTemplate
const GlobalBoard * m_uGtB
pointer to uGt GlobalBoard, to be able to get the trigger objects

◆ EnergySumZdcCondition() [3/3]

EnergySumZdcCondition::EnergySumZdcCondition ( const EnergySumZdcCondition cp)

Definition at line 67 of file EnergySumZdcCondition.cc.

References copy().

68  copy(cp);
69 }
void copy(const EnergySumZdcCondition &cp)
copy function for copy constructor and operator=

◆ ~EnergySumZdcCondition()

EnergySumZdcCondition::~EnergySumZdcCondition ( )
overridedefault

Member Function Documentation

◆ copy()

void EnergySumZdcCondition::copy ( const EnergySumZdcCondition cp)
private

copy function for copy constructor and operator=

Definition at line 56 of file EnergySumZdcCondition.cc.

Referenced by EnergySumZdcCondition().

56  {
57  m_gtEnergySumZdcTemplate = cp.gtEnergySumZdcTemplate();
58  m_uGtB = cp.getuGtB();
59 
60  m_condMaxNumberObjects = cp.condMaxNumberObjects();
61  m_condLastResult = cp.condLastResult();
62  m_combinationsInCond = cp.getCombinationsInCond();
63 
64  m_verbosity = cp.m_verbosity;
65 }
const EnergySumZdcTemplate * m_gtEnergySumZdcTemplate
pointer to a EnergySumZdcTemplate
const GlobalBoard * m_uGtB
pointer to uGt GlobalBoard, to be able to get the trigger objects
CombinationsInCond m_combinationsInCond
store all the object combinations evaluated to true in the condition
int m_verbosity
verbosity level
bool m_condLastResult
the last result of evaluateCondition()

◆ evaluateCondition()

const bool EnergySumZdcCondition::evaluateCondition ( const int  bxEval) const
overridevirtual

the core function to check if the condition matches

Implements l1t::ConditionEvaluation.

Definition at line 89 of file EnergySumZdcCondition.cc.

References BXVector< T >::at(), l1ct::clear(), EnergySumZdcTemplate::ObjectParameter::etHighThreshold, EnergySumZdcTemplate::ObjectParameter::etLowThreshold, BXVector< T >::getLastBX(), l1t::EtSum::getType(), l1t::gtZDCM, l1t::gtZDCP, l1t::L1Candidate::hwPt(), L1Analysis::kZDCM, L1Analysis::kZDCP, LogDebug, push_back(), and BXVector< T >::size().

89  {
90  // number of trigger objects in the condition: there is only one object
91  int iCondition = 0;
92 
93  // condition result condResult set to true if the energy sum
94  // passes all requirements
95  bool condResult = false;
96 
97  // store the indices of the calorimeter objects
98  // from the combination evaluated in the condition
99  SingleCombInCond objectsInComb;
100 
101  // clear the m_combinationsInCond vector
103 
104  // clear the indices in the combination
105  objectsInComb.clear();
106 
108 
109  // Look at objects in bx = bx + relativeBx
110  int useBx = bxEval + m_gtEnergySumZdcTemplate->condRelativeBx();
111 
112  // Fail condition if attempting to get Bx outside of range
113  if ((useBx < candVecZdc->getFirstBX()) || (useBx > candVecZdc->getLastBX())) {
114  return false;
115  }
116 
117  // If no candidates, no use looking any further
118  int numberObjectsZdc = candVecZdc->size(useBx);
119 
120  if (numberObjectsZdc < 1) {
121  return false;
122  }
123 
126  switch ((m_gtEnergySumZdcTemplate->objectType())[0]) {
127  case gtZDCP:
129  break;
130  case gtZDCM:
132  break;
133  default:
134  edm::LogError("L1TGlobal")
135  << "\n Error: "
136  << "Unmatched object type from template to EtSumZdcType, (m_gtEnergySumZdcTemplate->objectType())[0] = "
137  << (m_gtEnergySumZdcTemplate->objectType())[0] << std::endl;
139  break;
140  }
141 
142  // Definition in CondFormats/L1TObjects/interface/L1GtCondition.h:
143  // condGEqVal indicates the operator used for the condition (>=, =): true for >=
144  bool condGEqVal = m_gtEnergySumZdcTemplate->condGEq();
145 
146  l1t::EtSum candZdcPlus;
147  l1t::EtSum candZdcMinus;
148  unsigned int candZDCPEsum = 0;
149  unsigned int candZDCMEsum = 0;
150  bool myres = false;
151 
152  for (int iEtSum = 0; iEtSum < numberObjectsZdc; ++iEtSum) {
153  l1t::EtSum candZdc = *(candVecZdc->at(useBx, iEtSum));
154 
155  if (candZdc.getType() != type)
156  continue;
157 
158  if (candZdc.getType() == l1t::EtSum::EtSumType::kZDCP) {
159  candZdcPlus = *(candVecZdc->at(useBx, iEtSum));
160  candZDCPEsum = candZdcPlus.hwPt();
161  myres = checkThreshold(objPar.etLowThreshold, objPar.etHighThreshold, candZDCPEsum, condGEqVal);
162  } else if (candZdc.getType() == l1t::EtSum::EtSumType::kZDCM) {
163  candZdcMinus = *(candVecZdc->at(useBx, iEtSum));
164  candZDCMEsum = candZdcMinus.hwPt();
165  myres = checkThreshold(objPar.etLowThreshold, objPar.etHighThreshold, candZDCMEsum, condGEqVal);
166  } else {
167  LogDebug("L1TGlobal") << "\t\t l1t::EtSum failed ZDC checkThreshold" << std::endl;
168  return false;
169  }
170 
171  LogDebug("L1TGlobal") << "CANDZdc: " << candZdc.hwPt() << ", " << useBx << ", " << candZdc.getType();
172 
173  LogDebug("L1TGlobal")
174  << "----------------------------------------------> ZDC EtSumType object from EnergySumZdcTemplate"
175  << "\n objPar.etLowThreshold = " << objPar.etLowThreshold
176  << "\n objPar.etHighThreshold = " << objPar.etHighThreshold << "\n candZDCPEsum = " << candZDCPEsum
177  << "\n candZDCMEsum = " << candZDCMEsum << "\n condGEqVal = " << condGEqVal << "\n myres = " << myres
178  << std::endl;
179  }
180 
181  if (not myres)
182  return false;
183 
184  // index is always zero, as they are global quantities (there is only one object)
185  int indexObj = 0;
186 
187  objectsInComb.push_back(indexObj);
188  (combinationsInCond()).push_back(objectsInComb);
189 
190  // if we get here all checks were successful for this combination
191  // set the general result for evaluateCondition to "true"
192  condResult = true;
193  return condResult;
194 }
int getLastBX() const
const EnergySumZdcTemplate * m_gtEnergySumZdcTemplate
pointer to a EnergySumZdcTemplate
const std::vector< ObjectParameter > * objectParameter() const
const BXVector< const l1t::EtSum * > * getCandL1EtSumZdc() const
pointer to ZDC EtSum data list
Definition: GlobalBoard.h:170
std::vector< int > SingleCombInCond
typedefs
Log< level::Error, false > LogError
const bool checkThreshold(const Type1 &thresholdL, const Type1 &thresholdH, const Type2 &value, bool condGEqValue) const
const GlobalBoard * m_uGtB
pointer to uGt GlobalBoard, to be able to get the trigger objects
unsigned size(int bx) const
const bool condGEq() const
get / set condition GEq flag
const std::vector< l1t::GlobalObject > & objectType() const
get / set the trigger object type(s) in the condition
const T & at(int bx, unsigned i) const
int hwPt() const
Definition: L1Candidate.h:35
deadvectors [0] push_back({0.0175431, 0.538005, 6.80997, 13.29})
const int & condRelativeBx() const
get / set the condition relative bx
void clear(EGIsoObj &c)
Definition: egamma.h:82
CombinationsInCond & combinationsInCond() const
get all the object combinations (to fill it...)
EtSumType
Definition: EtSum.h:27
EtSumType getType() const
Definition: EtSum.cc:13
#define LogDebug(id)

◆ getuGtB()

const GlobalBoard* l1t::EnergySumZdcCondition::getuGtB ( ) const
inline

get / set the pointer to uGt GlobalBoard

Definition at line 69 of file EnergySumZdcCondition.h.

References m_uGtB.

69 { return m_uGtB; }
const GlobalBoard * m_uGtB
pointer to uGt GlobalBoard, to be able to get the trigger objects

◆ gtEnergySumZdcTemplate()

const EnergySumZdcTemplate* l1t::EnergySumZdcCondition::gtEnergySumZdcTemplate ( ) const
inline

get / set the pointer to a L1GtCondition

Definition at line 64 of file EnergySumZdcCondition.h.

References m_gtEnergySumZdcTemplate.

64 { return m_gtEnergySumZdcTemplate; }
const EnergySumZdcTemplate * m_gtEnergySumZdcTemplate
pointer to a EnergySumZdcTemplate

◆ operator=()

l1t::EnergySumZdcCondition & EnergySumZdcCondition::operator= ( const EnergySumZdcCondition cp)

Definition at line 75 of file EnergySumZdcCondition.cc.

References filterCSVwithJSON::copy.

75  {
76  copy(cp);
77  return *this;
78 }
void copy(const EnergySumZdcCondition &cp)
copy function for copy constructor and operator=

◆ print()

void EnergySumZdcCondition::print ( std::ostream &  myCout) const
overridevirtual

print condition

Reimplemented from l1t::ConditionEvaluation.

Definition at line 196 of file EnergySumZdcCondition.cc.

References l1t::ConditionEvaluation::print().

Referenced by l1t::GlobalBoard::runGTL().

196  {
199 }
const EnergySumZdcTemplate * m_gtEnergySumZdcTemplate
pointer to a EnergySumZdcTemplate
void print(std::ostream &myCout) const override
print the condition
virtual void print(std::ostream &myCout) const
print condition

◆ setGtEnergySumZdcTemplate()

void EnergySumZdcCondition::setGtEnergySumZdcTemplate ( const EnergySumZdcTemplate eSumTempl)

Definition at line 81 of file EnergySumZdcCondition.cc.

81  {
82  m_gtEnergySumZdcTemplate = eSumTempl;
83 }
const EnergySumZdcTemplate * m_gtEnergySumZdcTemplate
pointer to a EnergySumZdcTemplate

◆ setuGtB()

void EnergySumZdcCondition::setuGtB ( const GlobalBoard ptrGTB)

Definition at line 86 of file EnergySumZdcCondition.cc.

86 { m_uGtB = ptrGTB; }
const GlobalBoard * m_uGtB
pointer to uGt GlobalBoard, to be able to get the trigger objects

Member Data Documentation

◆ m_gtEnergySumZdcTemplate

const EnergySumZdcTemplate* l1t::EnergySumZdcCondition::m_gtEnergySumZdcTemplate
private

pointer to a EnergySumZdcTemplate

Definition at line 79 of file EnergySumZdcCondition.h.

Referenced by gtEnergySumZdcTemplate().

◆ m_uGtB

const GlobalBoard* l1t::EnergySumZdcCondition::m_uGtB
private

pointer to uGt GlobalBoard, to be able to get the trigger objects

Definition at line 82 of file EnergySumZdcCondition.h.

Referenced by getuGtB().