CMS 3D CMS Logo

Public Member Functions | Private Member Functions | Private Attributes

L1GtHfRingEtSumsCondition Class Reference

#include <L1GtHfRingEtSumsCondition.h>

Inheritance diagram for L1GtHfRingEtSumsCondition:
L1GtConditionEvaluation

List of all members.

Public Member Functions

const bool evaluateCondition () const
 the core function to check if the condition matches
const L1GtHfRingEtSumsTemplategtHfRingEtSumsTemplate () const
 get / set the pointer to a L1GtCondition
const L1GlobalTriggerPSBgtPSB () const
 get / set the pointer to PSB
 L1GtHfRingEtSumsCondition (const L1GtCondition *, const L1GlobalTriggerPSB *)
 from base template condition (from event setup usually)
 L1GtHfRingEtSumsCondition ()
 L1GtHfRingEtSumsCondition (const L1GtHfRingEtSumsCondition &)
L1GtHfRingEtSumsConditionoperator= (const L1GtHfRingEtSumsCondition &)
void print (std::ostream &myCout) const
 print condition
void setGtHfRingEtSumsTemplate (const L1GtHfRingEtSumsTemplate *)
void setGtPSB (const L1GlobalTriggerPSB *)
 set the pointer to PSB
virtual ~L1GtHfRingEtSumsCondition ()

Private Member Functions

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

Private Attributes

const L1GtHfRingEtSumsTemplatem_gtHfRingEtSumsTemplate
 pointer to a L1GtHfRingEtSumsTemplate
const L1GlobalTriggerPSBm_gtPSB
 pointer to PSB, to be able to get the trigger objects

Detailed Description

Description: evaluation of a CondHfRingEtSums condition.

Implementation: <TODO: enter implementation details>

Author:
: Vasile Mihai Ghete - HEPHY Vienna

$Date$ $Revision$

Definition at line 34 of file L1GtHfRingEtSumsCondition.h.


Constructor & Destructor Documentation

L1GtHfRingEtSumsCondition::L1GtHfRingEtSumsCondition ( )

constructors default

Definition at line 39 of file L1GtHfRingEtSumsCondition.cc.

                                                     :
    L1GtConditionEvaluation() {

    //empty

}
L1GtHfRingEtSumsCondition::L1GtHfRingEtSumsCondition ( const L1GtCondition etTemplate,
const L1GlobalTriggerPSB ptrPSB 
)

from base template condition (from event setup usually)

Definition at line 47 of file L1GtHfRingEtSumsCondition.cc.

References L1GtConditionEvaluation::m_condMaxNumberObjects.

                                                                           :
    L1GtConditionEvaluation(), m_gtHfRingEtSumsTemplate(
            static_cast<const L1GtHfRingEtSumsTemplate*> (etTemplate)), m_gtPSB(
            ptrPSB)
{

    // maximum number of objects received for the evaluation of the condition
    // no objects, in fact, just a number
    m_condMaxNumberObjects = 1;

}
L1GtHfRingEtSumsCondition::L1GtHfRingEtSumsCondition ( const L1GtHfRingEtSumsCondition cp)

Definition at line 74 of file L1GtHfRingEtSumsCondition.cc.

References copy().

L1GtHfRingEtSumsCondition::~L1GtHfRingEtSumsCondition ( ) [virtual]

Definition at line 82 of file L1GtHfRingEtSumsCondition.cc.

                                                      {

    // empty

}

Member Function Documentation

void L1GtHfRingEtSumsCondition::copy ( const L1GtHfRingEtSumsCondition cp) [private]
const bool L1GtHfRingEtSumsCondition::evaluateCondition ( ) const [virtual]

the core function to check if the condition matches

Implements L1GtConditionEvaluation.

Definition at line 110 of file L1GtHfRingEtSumsCondition.cc.

References L1GtConditionEvaluation::checkThreshold(), L1GtCondition::condGEq(), L1GctHFRingEtSums::etSum(), L1GtHfRingEtSumsTemplate::ObjectParameter::etSumIndex, L1GtHfRingEtSumsTemplate::ObjectParameter::etSumThreshold, L1GlobalTriggerPSB::getCandL1HfRingEtSums(), m_gtHfRingEtSumsTemplate, m_gtPSB, and L1GtHfRingEtSumsTemplate::objectParameter().

                                                              {

    // number of trigger objects in the condition
    // no objects, in fact, just a number
    int iCondition = 0;

    // condition result condResult will be set to true if the HF Ring Et sums
    // passes the requirement
    bool condResult = false;

    // store the index of the HfRingEtSums object
    // from the combination evaluated in the condition
    SingleCombInCond objectsInComb;

    // clear the m_combinationsInCond vector
    (*m_combinationsInCond).clear();

    // get the HF Ring Et sums (event / condition)
    const L1GctHFRingEtSums* etSumCand = m_gtPSB->getCandL1HfRingEtSums();

    // protection against missing HF Ring Et sums collection
    if (etSumCand == 0) {
        return false;
    }

    const L1GtHfRingEtSumsTemplate::ObjectParameter objPar =
        ( *(m_gtHfRingEtSumsTemplate->objectParameter()) )[iCondition];

    // FIXME ask GCT to provide a method to retrieve it
    const unsigned int numberL1HfRingEtSums = 4;

    const unsigned int cIndex = objPar.etSumIndex;
    if (cIndex >= numberL1HfRingEtSums) {

        edm::LogError("L1GtHfRingEtSumsCondition") << "\nL1GtHfRingEtSumsCondition error: etSumIndex "
            << cIndex << "greater than GCT maximum index = " << numberL1HfRingEtSums
            << "\n  ==> condResult = false " << std::endl;
        return false;

    }

    const unsigned int etSumValue = etSumCand->etSum(cIndex);

    // check countThreshold
    if ( !checkThreshold(objPar.etSumThreshold, etSumValue, m_gtHfRingEtSumsTemplate->condGEq()) ) {

        return false;
    }

    // index is always zero - the object is in fact a count
    int indexObj = 0;

    objectsInComb.push_back(indexObj);
    (*m_combinationsInCond).push_back(objectsInComb);

    // if we get here all checks were successful for this combination
    // set the general result for evaluateCondition to "true"

    condResult = true;
    return condResult;

}
const L1GtHfRingEtSumsTemplate* L1GtHfRingEtSumsCondition::gtHfRingEtSumsTemplate ( ) const [inline]

get / set the pointer to a L1GtCondition

Definition at line 66 of file L1GtHfRingEtSumsCondition.h.

References m_gtHfRingEtSumsTemplate.

Referenced by copy().

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

get / set the pointer to PSB

Definition at line 73 of file L1GtHfRingEtSumsCondition.h.

References m_gtPSB.

Referenced by copy().

                                                   {
        return m_gtPSB;
    }
L1GtHfRingEtSumsCondition & L1GtHfRingEtSumsCondition::operator= ( const L1GtHfRingEtSumsCondition cp)

Definition at line 89 of file L1GtHfRingEtSumsCondition.cc.

References copy().

{
    copy(cp);
    return *this;
}
void L1GtHfRingEtSumsCondition::print ( std::ostream &  myCout) const [virtual]
void L1GtHfRingEtSumsCondition::setGtHfRingEtSumsTemplate ( const L1GtHfRingEtSumsTemplate etTemplate)

Definition at line 96 of file L1GtHfRingEtSumsCondition.cc.

References m_gtHfRingEtSumsTemplate.

                                                                                                    {

    m_gtHfRingEtSumsTemplate = etTemplate;

}
void L1GtHfRingEtSumsCondition::setGtPSB ( const L1GlobalTriggerPSB ptrPSB)

set the pointer to PSB

Definition at line 103 of file L1GtHfRingEtSumsCondition.cc.

References m_gtPSB.

                                                                         {

    m_gtPSB = ptrPSB;

}

Member Data Documentation

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

Definition at line 90 of file L1GtHfRingEtSumsCondition.h.

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