Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:20:00

0001 /**
0002  * \class L1GtCastorCondition
0003  *
0004  *
0005  * Description: evaluation of a CondCastor condition.
0006  *
0007  * Implementation:
0008  *    Simply put the result read from CASTOR L1 record in the
0009  * L1GtConditionEvaluation base class, to be similar with other conditions.
0010  *
0011  * \author: Vasile Mihai Ghete   - HEPHY Vienna
0012  *
0013  *
0014  */
0015 
0016 // this class header
0017 #include "L1Trigger/GlobalTrigger/interface/L1GtCastorCondition.h"
0018 
0019 // system include files
0020 #include <iostream>
0021 
0022 // user include files
0023 //   base classes
0024 #include "CondFormats/L1TObjects/interface/L1GtCastorTemplate.h"
0025 #include "L1Trigger/GlobalTrigger/interface/L1GtConditionEvaluation.h"
0026 
0027 // constructors
0028 //     default
0029 L1GtCastorCondition::L1GtCastorCondition() : L1GtConditionEvaluation() { m_conditionResult = false; }
0030 
0031 //     from base template condition (from event setup usually)
0032 L1GtCastorCondition::L1GtCastorCondition(const L1GtCondition *castorTemplate, const bool result)
0033     : L1GtConditionEvaluation(),
0034       m_gtCastorTemplate(static_cast<const L1GtCastorTemplate *>(castorTemplate)),
0035       m_conditionResult(result) {
0036   // maximum number of objects received for the evaluation of the condition
0037   // no object
0038   m_condMaxNumberObjects = 0;
0039 }
0040 
0041 // copy constructor
0042 void L1GtCastorCondition::copy(const L1GtCastorCondition &cp) {
0043   m_gtCastorTemplate = cp.gtCastorTemplate();
0044   m_conditionResult = cp.conditionResult();
0045 
0046   m_condMaxNumberObjects = cp.condMaxNumberObjects();
0047   m_condLastResult = cp.condLastResult();
0048   m_combinationsInCond = cp.getCombinationsInCond();
0049 
0050   m_verbosity = cp.m_verbosity;
0051 }
0052 
0053 L1GtCastorCondition::L1GtCastorCondition(const L1GtCastorCondition &cp) : L1GtConditionEvaluation() { copy(cp); }
0054 
0055 // destructor
0056 L1GtCastorCondition::~L1GtCastorCondition() {
0057   // empty
0058 }
0059 
0060 // equal operator
0061 L1GtCastorCondition &L1GtCastorCondition::operator=(const L1GtCastorCondition &cp) {
0062   copy(cp);
0063   return *this;
0064 }
0065 
0066 // methods
0067 void L1GtCastorCondition::setGtCastorTemplate(const L1GtCastorTemplate *castorTemplate) {
0068   m_gtCastorTemplate = castorTemplate;
0069 }
0070 
0071 const bool L1GtCastorCondition::evaluateCondition() const {
0072   // clear the m_combinationsInCond vector
0073   (combinationsInCond()).clear();
0074 
0075   //
0076   return m_conditionResult;
0077 }
0078 
0079 void L1GtCastorCondition::print(std::ostream &myCout) const {
0080   m_gtCastorTemplate->print(myCout);
0081   L1GtConditionEvaluation::print(myCout);
0082 }