CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_6_1_1/src/L1Trigger/GlobalTriggerAnalyzer/src/L1GtTrigReportEntry.cc

Go to the documentation of this file.
00001 
00017 // this class header
00018 #include "L1Trigger/GlobalTriggerAnalyzer/interface/L1GtTrigReportEntry.h"
00019 
00020 // system include files
00021 #include <string>
00022 
00023 // user include files
00024 
00025 // constructor(s)
00026 L1GtTrigReportEntry::L1GtTrigReportEntry(const std::string& menuName, const std::string& algName,
00027     const int prescaleFactor, const int triggerMask, const int daqPartition) {
00028 
00029     m_triggerMenuName = menuName;
00030     m_algoName = algName;
00031     m_prescaleFactor = prescaleFactor;
00032     m_triggerMask = triggerMask;
00033     m_daqPartition = daqPartition;
00034 
00035     // counters
00036 
00037     m_nrEventsAccept = 0;
00038     m_nrEventsReject = 0;
00039     m_nrEventsAcceptBeforeMask = 0;
00040     m_nrEventsRejectBeforeMask = 0;
00041     m_nrEventsError = 0;
00042 }
00043 
00044 // destructor
00045 L1GtTrigReportEntry::~L1GtTrigReportEntry() {
00046 
00047     //empty
00048 
00049 }
00050 
00051 // assignment operator
00052 L1GtTrigReportEntry& L1GtTrigReportEntry::operator=(
00053     const L1GtTrigReportEntry& repEntry)
00054 {
00055 
00056     if ( this != &repEntry ) {
00057 
00058         m_triggerMenuName = repEntry.m_triggerMenuName;
00059 
00060         m_algoName = repEntry.m_algoName;
00061 
00062         m_prescaleFactor = repEntry.m_prescaleFactor;
00063 
00064         m_triggerMask = repEntry.m_triggerMask;
00065 
00066         m_daqPartition = repEntry.m_daqPartition;
00067     }
00068 
00069     return *this;
00070 
00071 }
00072 
00073 // equal operator
00074 bool L1GtTrigReportEntry::operator==(const L1GtTrigReportEntry& repEntry) const
00075 {
00076 
00077     // faster comparisons first
00078 
00079     if (m_daqPartition != repEntry.m_daqPartition) {
00080         return false;
00081     }
00082 
00083     if (m_triggerMask != repEntry.m_triggerMask) {
00084         return false;
00085     }
00086 
00087     if (m_prescaleFactor != repEntry.m_prescaleFactor) {
00088         return false;
00089     }
00090 
00091     if (m_algoName != repEntry.m_algoName) {
00092         return false;
00093     }
00094 
00095     if (m_triggerMenuName != repEntry.m_triggerMenuName) {
00096         return false;
00097     }
00098 
00099 
00100     // all members identical
00101     return true;
00102 
00103 }
00104 
00105 // unequal operator
00106 bool L1GtTrigReportEntry::operator!=(const L1GtTrigReportEntry& result) const
00107 {
00108 
00109     return !( result == *this);
00110 
00111 }
00112 
00113 // member functions
00114 
00116 void L1GtTrigReportEntry::addValidEntry(const bool algResultAfterMask,
00117         const bool algResultBeforeMask)
00118 {
00119 
00120     if (algResultAfterMask) {
00121         m_nrEventsAccept++;
00122     }
00123     else {
00124         m_nrEventsReject++;
00125     }
00126 
00127     if (algResultBeforeMask) {
00128         m_nrEventsAcceptBeforeMask++;
00129     }
00130     else {
00131         m_nrEventsRejectBeforeMask++;
00132     }
00133 
00134 }
00135 
00137 void L1GtTrigReportEntry::addErrorEntry() {
00138 
00139     m_nrEventsError++;
00140 }