CMS 3D CMS Logo

L1GtHfBitCountsCondition Class Reference

Description: evaluation of a CondHfBitCounts condition. More...

#include <L1Trigger/GlobalTrigger/interface/L1GtHfBitCountsCondition.h>

Inheritance diagram for L1GtHfBitCountsCondition:

L1GtConditionEvaluation

List of all members.

Public Member Functions

const bool evaluateCondition () const
 the core function to check if the condition matches
const L1GtHfBitCountsTemplategtHfBitCountsTemplate () const
 get / set the pointer to a L1GtCondition
const L1GlobalTriggerPSBgtPSB () const
 get / set the pointer to PSB
 L1GtHfBitCountsCondition (const L1GtHfBitCountsCondition &)
 L1GtHfBitCountsCondition (const L1GtCondition *, const L1GlobalTriggerPSB *)
 from base template condition (from event setup usually)
 L1GtHfBitCountsCondition ()
 constructors default
L1GtHfBitCountsConditionoperator= (const L1GtHfBitCountsCondition &)
void print (std::ostream &myCout) const
 print condition
void setGtHfBitCountsTemplate (const L1GtHfBitCountsTemplate *)
void setGtPSB (const L1GlobalTriggerPSB *)
 set the pointer to PSB
virtual ~L1GtHfBitCountsCondition ()

Private Member Functions

void copy (const L1GtHfBitCountsCondition &cp)
 copy function for copy constructor and operator=

Private Attributes

const L1GtHfBitCountsTemplatem_gtHfBitCountsTemplate
 pointer to a L1GtHfBitCountsTemplate
const L1GlobalTriggerPSBm_gtPSB
 pointer to PSB, to be able to get the trigger objects


Detailed Description

Description: evaluation of a CondHfBitCounts condition.

Implementation: <TODO: enter implementation details>

Author:
: Vasile Mihai Ghete - HEPHY Vienna
$Date$ $Revision$

Definition at line 34 of file L1GtHfBitCountsCondition.h.


Constructor & Destructor Documentation

L1GtHfBitCountsCondition::L1GtHfBitCountsCondition (  ) 

constructors default

Definition at line 39 of file L1GtHfBitCountsCondition.cc.

00039                                                    :
00040     L1GtConditionEvaluation() {
00041 
00042     //empty
00043 
00044 }

L1GtHfBitCountsCondition::L1GtHfBitCountsCondition ( const L1GtCondition bcTemplate,
const L1GlobalTriggerPSB ptrPSB 
)

from base template condition (from event setup usually)

Definition at line 47 of file L1GtHfBitCountsCondition.cc.

References L1GtConditionEvaluation::m_condMaxNumberObjects.

00048                                                                            :
00049     L1GtConditionEvaluation(), m_gtHfBitCountsTemplate(
00050             static_cast<const L1GtHfBitCountsTemplate*> (bcTemplate)), m_gtPSB(
00051             ptrPSB)
00052 {
00053 
00054     // maximum number of objects received for the evaluation of the condition
00055     // no objects, in fact, just a count
00056     m_condMaxNumberObjects = 1;
00057 
00058 }

L1GtHfBitCountsCondition::L1GtHfBitCountsCondition ( const L1GtHfBitCountsCondition cp  ) 

Definition at line 72 of file L1GtHfBitCountsCondition.cc.

References copy().

00072                                                                                      :
00073     L1GtConditionEvaluation() {
00074 
00075     copy(cp);
00076 
00077 }

L1GtHfBitCountsCondition::~L1GtHfBitCountsCondition (  )  [virtual]

Definition at line 80 of file L1GtHfBitCountsCondition.cc.

00080                                                     {
00081 
00082     // empty
00083 
00084 }


Member Function Documentation

void L1GtHfBitCountsCondition::copy ( const L1GtHfBitCountsCondition cp  )  [private]

copy function for copy constructor and operator=

Definition at line 61 of file L1GtHfBitCountsCondition.cc.

References L1GtConditionEvaluation::condLastResult(), L1GtConditionEvaluation::condMaxNumberObjects(), L1GtConditionEvaluation::getCombinationsInCond(), gtHfBitCountsTemplate(), gtPSB(), L1GtConditionEvaluation::m_combinationsInCond, L1GtConditionEvaluation::m_condLastResult, L1GtConditionEvaluation::m_condMaxNumberObjects, m_gtHfBitCountsTemplate, and m_gtPSB.

Referenced by L1GtHfBitCountsCondition(), and operator=().

00061                                                                       {
00062 
00063     m_gtHfBitCountsTemplate = cp.gtHfBitCountsTemplate();
00064     m_gtPSB = cp.gtPSB();
00065 
00066     m_condMaxNumberObjects = cp.condMaxNumberObjects();
00067     m_condLastResult = cp.condLastResult();
00068     m_combinationsInCond = cp.getCombinationsInCond();
00069 
00070 }

const bool L1GtHfBitCountsCondition::evaluateCondition (  )  const [virtual]

the core function to check if the condition matches

Implements L1GtConditionEvaluation.

Definition at line 108 of file L1GtHfBitCountsCondition.cc.

References L1GctHFBitCounts::bitCount(), L1GtConditionEvaluation::checkThreshold(), L1GtCondition::condGEq(), L1GtHfBitCountsTemplate::ObjectParameter::countIndex, L1GtHfBitCountsTemplate::ObjectParameter::countThreshold, lat::endl(), L1GlobalTriggerPSB::getCandL1HfBitCounts(), m_gtHfBitCountsTemplate, m_gtPSB, and L1GtHfBitCountsTemplate::objectParameter().

00108                                                              {
00109 
00110     // number of trigger objects in the condition
00111     // no objects, in fact, just a count
00112     int iCondition = 0;
00113 
00114     // condition result condResult will be set to true if the HF bit counts
00115     // passes the requirement
00116     bool condResult = false;
00117 
00118     // store the index of the HfBitCounts object
00119     // from the combination evaluated in the condition
00120     SingleCombInCond objectsInComb;
00121 
00122     // clear the m_combinationsInCond vector
00123     (*m_combinationsInCond).clear();
00124 
00125     // get the HF bit counts (event / condition)
00126     const L1GctHFBitCounts* bitCounts = m_gtPSB->getCandL1HfBitCounts();
00127 
00128     // protection against missing HF bit counts collection
00129     if (bitCounts == 0) {
00130         return false;
00131     }
00132 
00133     const L1GtHfBitCountsTemplate::ObjectParameter objPar =
00134         ( *(m_gtHfBitCountsTemplate->objectParameter()) )[iCondition];
00135 
00136     // FIXME ask GCT to provide a method to retrieve it
00137     const unsigned int numberL1HfBitCounts = 4;
00138 
00139     const unsigned int cIndex = objPar.countIndex;
00140     if (cIndex >= numberL1HfBitCounts) {
00141 
00142         edm::LogError("L1GtHfBitCountsCondition") << "\nL1GtHfBitCountsCondition error: countIndex "
00143             << cIndex << "greater than GCT maximum index = " << numberL1HfBitCounts
00144             << "\n  ==> condResult = false " << std::endl;
00145         return false;
00146 
00147     }
00148 
00149     const unsigned int countValue = bitCounts->bitCount(cIndex);
00150 
00151     // check countThreshold
00152     if ( !checkThreshold(objPar.countThreshold, countValue, m_gtHfBitCountsTemplate->condGEq()) ) {
00153 
00154         return false;
00155     }
00156 
00157     // index is always zero - the object is in fact a count
00158     int indexObj = 0;
00159 
00160     objectsInComb.push_back(indexObj);
00161     (*m_combinationsInCond).push_back(objectsInComb);
00162 
00163     // if we get here all checks were successful for this combination
00164     // set the general result for evaluateCondition to "true"
00165 
00166     condResult = true;
00167     return condResult;
00168 
00169 }

const L1GtHfBitCountsTemplate* L1GtHfBitCountsCondition::gtHfBitCountsTemplate (  )  const [inline]

get / set the pointer to a L1GtCondition

Definition at line 66 of file L1GtHfBitCountsCondition.h.

References m_gtHfBitCountsTemplate.

Referenced by copy().

00066                                                                         {
00067         return m_gtHfBitCountsTemplate;
00068     }

const L1GlobalTriggerPSB* L1GtHfBitCountsCondition::gtPSB (  )  const [inline]

get / set the pointer to PSB

Definition at line 73 of file L1GtHfBitCountsCondition.h.

References m_gtPSB.

Referenced by copy().

00073                                                    {
00074         return m_gtPSB;
00075     }

L1GtHfBitCountsCondition & L1GtHfBitCountsCondition::operator= ( const L1GtHfBitCountsCondition cp  ) 

Definition at line 87 of file L1GtHfBitCountsCondition.cc.

References copy().

00088 {
00089     copy(cp);
00090     return *this;
00091 }

void L1GtHfBitCountsCondition::print ( std::ostream &  myCout  )  const [virtual]

print condition

Reimplemented from L1GtConditionEvaluation.

Definition at line 171 of file L1GtHfBitCountsCondition.cc.

References m_gtHfBitCountsTemplate, L1GtHfBitCountsTemplate::print(), and L1GtConditionEvaluation::print().

Referenced by L1GlobalTriggerGTL::run().

00171                                                              {
00172 
00173     m_gtHfBitCountsTemplate->print(myCout);
00174     L1GtConditionEvaluation::print(myCout);
00175 
00176 }

void L1GtHfBitCountsCondition::setGtHfBitCountsTemplate ( const L1GtHfBitCountsTemplate bcTemplate  ) 

Definition at line 94 of file L1GtHfBitCountsCondition.cc.

References m_gtHfBitCountsTemplate.

00094                                                                                                  {
00095 
00096     m_gtHfBitCountsTemplate = bcTemplate;
00097 
00098 }

void L1GtHfBitCountsCondition::setGtPSB ( const L1GlobalTriggerPSB ptrPSB  ) 

set the pointer to PSB

Definition at line 101 of file L1GtHfBitCountsCondition.cc.

References m_gtPSB.

00101                                                                         {
00102 
00103     m_gtPSB = ptrPSB;
00104 
00105 }


Member Data Documentation

const L1GtHfBitCountsTemplate* L1GtHfBitCountsCondition::m_gtHfBitCountsTemplate [private]

pointer to a L1GtHfBitCountsTemplate

Definition at line 87 of file L1GtHfBitCountsCondition.h.

Referenced by copy(), evaluateCondition(), gtHfBitCountsTemplate(), print(), and setGtHfBitCountsTemplate().

const L1GlobalTriggerPSB* L1GtHfBitCountsCondition::m_gtPSB [private]

pointer to PSB, to be able to get the trigger objects

Definition at line 90 of file L1GtHfBitCountsCondition.h.

Referenced by copy(), evaluateCondition(), gtPSB(), and setGtPSB().


The documentation for this class was generated from the following files:
Generated on Tue Jun 9 18:26:44 2009 for CMSSW by  doxygen 1.5.4