CMS 3D CMS Logo

Public Member Functions | Private Member Functions | Private Attributes

L1GtJetCountsCondition Class Reference

#include <L1GtJetCountsCondition.h>

Inheritance diagram for L1GtJetCountsCondition:
L1GtConditionEvaluation

List of all members.

Public Member Functions

const bool evaluateCondition () const
 the core function to check if the condition matches
const L1GtJetCountsTemplategtJetCountsTemplate () const
 get / set the pointer to a L1GtCondition
const L1GlobalTriggerPSBgtPSB () const
 get / set the pointer to PSB
 L1GtJetCountsCondition (const L1GtCondition *, const L1GlobalTriggerPSB *, const int nrL1JetCounts)
 from base template condition (from event setup usually)
 L1GtJetCountsCondition ()
 L1GtJetCountsCondition (const L1GtJetCountsCondition &)
L1GtJetCountsConditionoperator= (const L1GtJetCountsCondition &)
void print (std::ostream &myCout) const
 print condition
void setGtJetCountsTemplate (const L1GtJetCountsTemplate *)
void setGtPSB (const L1GlobalTriggerPSB *)
 set the pointer to PSB
virtual ~L1GtJetCountsCondition ()

Private Member Functions

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

Private Attributes

const L1GtJetCountsTemplatem_gtJetCountsTemplate
 pointer to a L1GtJetCountsTemplate
const L1GlobalTriggerPSBm_gtPSB
 pointer to PSB, to be able to get the trigger objects
unsigned int m_numberL1JetCounts
 maximum number of jet counts

Detailed Description

Description: evaluation of a CondJetCounts condition.

Implementation: <TODO: enter implementation details>

Author:
: Vasile Mihai Ghete - HEPHY Vienna

$Date$ $Revision$

Definition at line 35 of file L1GtJetCountsCondition.h.


Constructor & Destructor Documentation

L1GtJetCountsCondition::L1GtJetCountsCondition ( )

constructors default

Definition at line 39 of file L1GtJetCountsCondition.cc.

                                               :
    L1GtConditionEvaluation() {

    //empty

}
L1GtJetCountsCondition::L1GtJetCountsCondition ( const L1GtCondition jcTemplate,
const L1GlobalTriggerPSB ptrPSB,
const int  nrL1JetCounts 
)

from base template condition (from event setup usually)

Definition at line 47 of file L1GtJetCountsCondition.cc.

References L1GtConditionEvaluation::m_condMaxNumberObjects.

                                                               :
    L1GtConditionEvaluation(),
    m_gtJetCountsTemplate(static_cast<const L1GtJetCountsTemplate*>(jcTemplate)),
    m_gtPSB(ptrPSB),
    m_numberL1JetCounts(nrL1JetCounts)
{

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

}
L1GtJetCountsCondition::L1GtJetCountsCondition ( const L1GtJetCountsCondition cp)

Definition at line 75 of file L1GtJetCountsCondition.cc.

References copy().

L1GtJetCountsCondition::~L1GtJetCountsCondition ( ) [virtual]

Definition at line 83 of file L1GtJetCountsCondition.cc.

                                                {

    // empty

}

Member Function Documentation

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

the core function to check if the condition matches

Implements L1GtConditionEvaluation.

Definition at line 111 of file L1GtJetCountsCondition.cc.

References L1GtConditionEvaluation::checkThreshold(), L1GtCondition::condGEq(), L1GctJetCounts::count(), L1GtJetCountsTemplate::ObjectParameter::countIndex, L1GtJetCountsTemplate::ObjectParameter::countThreshold, L1GlobalTriggerPSB::getCandL1JetCounts(), m_gtJetCountsTemplate, m_gtPSB, m_numberL1JetCounts, and L1GtJetCountsTemplate::objectParameter().

                                                           {

    // number of trigger objects in the condition
    // in fact, there is only one object
    int iCondition = 0;

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

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

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

    // get the jet counts (event / condition)
    const L1GctJetCounts* jetCounts = m_gtPSB->getCandL1JetCounts();

    // protection against missing jet counts collection
    if (jetCounts == 0) {
        return false;
    }

    const L1GtJetCountsTemplate::ObjectParameter objPar =
        ( *(m_gtJetCountsTemplate->objectParameter()) )[iCondition];

    unsigned int cIndex = objPar.countIndex;

    if (cIndex >= m_numberL1JetCounts) {

        edm::LogError("L1GtJetCountsCondition") << "\nL1GtJetCountsCondition error: countIndex "
            << cIndex << "greater than maximum allowed count = " << m_numberL1JetCounts
            << "\n  ==> condResult = false " << std::endl;
        return false;

    }

    unsigned int countValue = jetCounts->count(cIndex);

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

        return false;
    }

    // index is always zero, as they are global quantities (there is only one object)
    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 L1GtJetCountsTemplate* L1GtJetCountsCondition::gtJetCountsTemplate ( ) const [inline]

get / set the pointer to a L1GtCondition

Definition at line 67 of file L1GtJetCountsCondition.h.

References m_gtJetCountsTemplate.

Referenced by copy().

                                                                    {
        return m_gtJetCountsTemplate;
    }
const L1GlobalTriggerPSB* L1GtJetCountsCondition::gtPSB ( ) const [inline]

get / set the pointer to PSB

Definition at line 74 of file L1GtJetCountsCondition.h.

References m_gtPSB.

Referenced by copy().

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

Definition at line 90 of file L1GtJetCountsCondition.cc.

References copy().

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

print condition

Reimplemented from L1GtConditionEvaluation.

Definition at line 172 of file L1GtJetCountsCondition.cc.

References m_gtJetCountsTemplate, and L1GtJetCountsTemplate::print().

Referenced by L1GlobalTriggerGTL::run().

void L1GtJetCountsCondition::setGtJetCountsTemplate ( const L1GtJetCountsTemplate jcTemplate)

Definition at line 97 of file L1GtJetCountsCondition.cc.

References m_gtJetCountsTemplate.

                                                                                           {

    m_gtJetCountsTemplate = jcTemplate;

}
void L1GtJetCountsCondition::setGtPSB ( const L1GlobalTriggerPSB ptrPSB)

set the pointer to PSB

Definition at line 104 of file L1GtJetCountsCondition.cc.

References m_gtPSB.

                                                                      {

    m_gtPSB = ptrPSB;

}

Member Data Documentation

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

Definition at line 91 of file L1GtJetCountsCondition.h.

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

maximum number of jet counts

Definition at line 94 of file L1GtJetCountsCondition.h.

Referenced by evaluateCondition().