CMS 3D CMS Logo

Public Member Functions | Private Member Functions | Private Attributes

L1GtHfBitCountsCondition Class Reference

#include <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 L1GtCondition *, const L1GlobalTriggerPSB *)
 from base template condition (from event setup usually)
 L1GtHfBitCountsCondition ()
 L1GtHfBitCountsCondition (const L1GtHfBitCountsCondition &)
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.

                                                   :
    L1GtConditionEvaluation() {

    //empty

}
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.

                                                                           :
    L1GtConditionEvaluation(), m_gtHfBitCountsTemplate(
            static_cast<const L1GtHfBitCountsTemplate*> (bcTemplate)), m_gtPSB(
            ptrPSB)
{

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

}
L1GtHfBitCountsCondition::L1GtHfBitCountsCondition ( const L1GtHfBitCountsCondition cp)

Definition at line 74 of file L1GtHfBitCountsCondition.cc.

References copy().

L1GtHfBitCountsCondition::~L1GtHfBitCountsCondition ( ) [virtual]

Definition at line 82 of file L1GtHfBitCountsCondition.cc.

                                                    {

    // empty

}

Member Function Documentation

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

the core function to check if the condition matches

Implements L1GtConditionEvaluation.

Definition at line 110 of file L1GtHfBitCountsCondition.cc.

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

                                                             {

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

    // condition result condResult will be set to true if the HF bit counts
    // passes the requirement
    bool condResult = false;

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

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

    // get the HF bit counts (event / condition)
    const L1GctHFBitCounts* bitCounts = m_gtPSB->getCandL1HfBitCounts();

    // protection against missing HF bit counts collection
    if (bitCounts == 0) {
        return false;
    }

    const L1GtHfBitCountsTemplate::ObjectParameter objPar =
        ( *(m_gtHfBitCountsTemplate->objectParameter()) )[iCondition];

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

    const unsigned int cIndex = objPar.countIndex;
    if (cIndex >= numberL1HfBitCounts) {

        edm::LogError("L1GlobalTrigger") << "\nL1GtHfBitCountsCondition error: countIndex "
            << cIndex << "greater than GCT maximum index = " << numberL1HfBitCounts
            << "\n  ==> condResult = false " << std::endl;
        return false;

    }

    const unsigned int countValue = bitCounts->bitCount(cIndex);

    // check countThreshold
    if ( !checkThreshold(objPar.countThreshold, countValue, m_gtHfBitCountsTemplate->condGEq()) ) {

        return false;
    }

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

    objectsInComb.push_back(indexObj);
    (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 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().

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().

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

Definition at line 89 of file L1GtHfBitCountsCondition.cc.

References copy().

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

print condition

Reimplemented from L1GtConditionEvaluation.

Definition at line 173 of file L1GtHfBitCountsCondition.cc.

References m_gtHfBitCountsTemplate, and L1GtHfBitCountsTemplate::print().

Referenced by L1GlobalTriggerGTL::run().

void L1GtHfBitCountsCondition::setGtHfBitCountsTemplate ( const L1GtHfBitCountsTemplate bcTemplate)

Definition at line 96 of file L1GtHfBitCountsCondition.cc.

References m_gtHfBitCountsTemplate.

                                                                                                 {

    m_gtHfBitCountsTemplate = bcTemplate;

}
void L1GtHfBitCountsCondition::setGtPSB ( const L1GlobalTriggerPSB ptrPSB)

set the pointer to PSB

Definition at line 103 of file L1GtHfBitCountsCondition.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 L1GtHfBitCountsCondition.h.

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