Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 14:22:20

0001 /**
0002  * \class L1GtExternalCondition
0003  *
0004  *
0005  * Description: evaluation of a CondExternal condition.
0006  *
0007  * Implementation:
0008  *    Simply put the result read in the L1GtConditionEvaluation
0009  *    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/L1GtExternalCondition.h"
0018 
0019 // system include files
0020 #include <iostream>
0021 
0022 // user include files
0023 //   base classes
0024 #include "CondFormats/L1TObjects/interface/L1GtExternalTemplate.h"
0025 #include "L1Trigger/GlobalTrigger/interface/L1GtConditionEvaluation.h"
0026 
0027 // constructors
0028 //     default
0029 L1GtExternalCondition::L1GtExternalCondition() : L1GtConditionEvaluation() { m_conditionResult = false; }
0030 
0031 //     from base template condition (from event setup usually)
0032 L1GtExternalCondition::L1GtExternalCondition(const L1GtCondition *externalTemplate, const bool result)
0033     : L1GtConditionEvaluation(),
0034       m_gtExternalTemplate(static_cast<const L1GtExternalTemplate *>(externalTemplate)),
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 L1GtExternalCondition::copy(const L1GtExternalCondition &cp) {
0043   m_gtExternalTemplate = cp.gtExternalTemplate();
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 L1GtExternalCondition::L1GtExternalCondition(const L1GtExternalCondition &cp) : L1GtConditionEvaluation() { copy(cp); }
0054 
0055 // destructor
0056 L1GtExternalCondition::~L1GtExternalCondition() {
0057   // empty
0058 }
0059 
0060 // equal operator
0061 L1GtExternalCondition &L1GtExternalCondition::operator=(const L1GtExternalCondition &cp) {
0062   copy(cp);
0063   return *this;
0064 }
0065 
0066 // methods
0067 void L1GtExternalCondition::setGtExternalTemplate(const L1GtExternalTemplate *externalTemplate) {
0068   m_gtExternalTemplate = externalTemplate;
0069 }
0070 
0071 const bool L1GtExternalCondition::evaluateCondition() const {
0072   // clear the m_combinationsInCond vector
0073   (combinationsInCond()).clear();
0074 
0075   //
0076   return m_conditionResult;
0077 }
0078 
0079 void L1GtExternalCondition::print(std::ostream &myCout) const {
0080   m_gtExternalTemplate->print(myCout);
0081   L1GtConditionEvaluation::print(myCout);
0082 }