CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_5_2_9/src/L1Trigger/GlobalTrigger/src/L1GtExternalCondition.cc

Go to the documentation of this file.
00001 
00018 // this class header
00019 #include "L1Trigger/GlobalTrigger/interface/L1GtExternalCondition.h"
00020 
00021 // system include files
00022 #include <iostream>
00023 
00024 // user include files
00025 //   base classes
00026 #include "CondFormats/L1TObjects/interface/L1GtExternalTemplate.h"
00027 #include "L1Trigger/GlobalTrigger/interface/L1GtConditionEvaluation.h"
00028 
00029 // constructors
00030 //     default
00031 L1GtExternalCondition::L1GtExternalCondition() :
00032     L1GtConditionEvaluation() {
00033 
00034     m_conditionResult = false;
00035 
00036 }
00037 
00038 //     from base template condition (from event setup usually)
00039 L1GtExternalCondition::L1GtExternalCondition(const L1GtCondition* externalTemplate,
00040         const bool result) :
00041             L1GtConditionEvaluation(),
00042             m_gtExternalTemplate(static_cast<const L1GtExternalTemplate*>(externalTemplate)),
00043             m_conditionResult(result) {
00044 
00045     // maximum number of objects received for the evaluation of the condition
00046     // no object
00047     m_condMaxNumberObjects = 0;
00048 
00049 }
00050 
00051 // copy constructor
00052 void L1GtExternalCondition::copy(const L1GtExternalCondition &cp) {
00053 
00054     m_gtExternalTemplate = cp.gtExternalTemplate();
00055     m_conditionResult = cp.conditionResult();
00056 
00057     m_condMaxNumberObjects = cp.condMaxNumberObjects();
00058     m_condLastResult = cp.condLastResult();
00059     m_combinationsInCond = cp.getCombinationsInCond();
00060 
00061     m_verbosity = cp.m_verbosity;
00062 
00063 }
00064 
00065 L1GtExternalCondition::L1GtExternalCondition(const L1GtExternalCondition& cp) :
00066     L1GtConditionEvaluation() {
00067 
00068     copy(cp);
00069 
00070 }
00071 
00072 // destructor
00073 L1GtExternalCondition::~L1GtExternalCondition() {
00074 
00075     // empty
00076 
00077 }
00078 
00079 // equal operator
00080 L1GtExternalCondition& L1GtExternalCondition::operator= (const L1GtExternalCondition& cp)
00081 {
00082     copy(cp);
00083     return *this;
00084 }
00085 
00086 // methods
00087 void L1GtExternalCondition::setGtExternalTemplate(
00088         const L1GtExternalTemplate* externalTemplate) {
00089 
00090     m_gtExternalTemplate = externalTemplate;
00091 
00092 }
00093 
00094 const bool L1GtExternalCondition::evaluateCondition() const {
00095 
00096     // clear the m_combinationsInCond vector
00097     (combinationsInCond()).clear();
00098 
00099     //
00100     return m_conditionResult;
00101 
00102 }
00103 
00104 void L1GtExternalCondition::print(std::ostream& myCout) const {
00105 
00106     m_gtExternalTemplate->print(myCout);
00107     L1GtConditionEvaluation::print(myCout);
00108 
00109 }
00110