Back to home page

Project CMSSW displayed by LXR

 
 

    


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

0001 /**
0002  * \class L1GtTrigReportEntry
0003  *
0004  *
0005  * Description: L1 Trigger report.
0006  *
0007  * Implementation:
0008  *    <TODO: enter implementation details>
0009  *
0010  * \author: Vasile Mihai Ghete - HEPHY Vienna
0011  *
0012  *
0013  */
0014 
0015 // this class header
0016 #include "L1Trigger/GlobalTriggerAnalyzer/interface/L1GtTrigReportEntry.h"
0017 
0018 // system include files
0019 #include <string>
0020 
0021 // user include files
0022 
0023 // constructor(s)
0024 L1GtTrigReportEntry::L1GtTrigReportEntry(const std::string& menuName,
0025                                          const std::string& algName,
0026                                          const int prescaleFactor,
0027                                          const int triggerMask,
0028                                          const int daqPartition) {
0029   m_triggerMenuName = menuName;
0030   m_algoName = algName;
0031   m_prescaleFactor = prescaleFactor;
0032   m_triggerMask = triggerMask;
0033   m_daqPartition = daqPartition;
0034 
0035   // counters
0036 
0037   m_nrEventsAccept = 0;
0038   m_nrEventsReject = 0;
0039   m_nrEventsAcceptBeforeMask = 0;
0040   m_nrEventsRejectBeforeMask = 0;
0041   m_nrEventsError = 0;
0042 }
0043 
0044 // destructor
0045 L1GtTrigReportEntry::~L1GtTrigReportEntry() {
0046   //empty
0047 }
0048 
0049 // assignment operator
0050 L1GtTrigReportEntry& L1GtTrigReportEntry::operator=(const L1GtTrigReportEntry& repEntry) {
0051   if (this != &repEntry) {
0052     m_triggerMenuName = repEntry.m_triggerMenuName;
0053 
0054     m_algoName = repEntry.m_algoName;
0055 
0056     m_prescaleFactor = repEntry.m_prescaleFactor;
0057 
0058     m_triggerMask = repEntry.m_triggerMask;
0059 
0060     m_daqPartition = repEntry.m_daqPartition;
0061   }
0062 
0063   return *this;
0064 }
0065 
0066 // equal operator
0067 bool L1GtTrigReportEntry::operator==(const L1GtTrigReportEntry& repEntry) const {
0068   // faster comparisons first
0069 
0070   if (m_daqPartition != repEntry.m_daqPartition) {
0071     return false;
0072   }
0073 
0074   if (m_triggerMask != repEntry.m_triggerMask) {
0075     return false;
0076   }
0077 
0078   if (m_prescaleFactor != repEntry.m_prescaleFactor) {
0079     return false;
0080   }
0081 
0082   if (m_algoName != repEntry.m_algoName) {
0083     return false;
0084   }
0085 
0086   if (m_triggerMenuName != repEntry.m_triggerMenuName) {
0087     return false;
0088   }
0089 
0090   // all members identical
0091   return true;
0092 }
0093 
0094 // unequal operator
0095 bool L1GtTrigReportEntry::operator!=(const L1GtTrigReportEntry& result) const { return !(result == *this); }
0096 
0097 // member functions
0098 
0099 /// increase # of events accepted/rejected for this entry
0100 void L1GtTrigReportEntry::addValidEntry(const bool algResultAfterMask, const bool algResultBeforeMask) {
0101   if (algResultAfterMask) {
0102     m_nrEventsAccept++;
0103   } else {
0104     m_nrEventsReject++;
0105   }
0106 
0107   if (algResultBeforeMask) {
0108     m_nrEventsAcceptBeforeMask++;
0109   } else {
0110     m_nrEventsRejectBeforeMask++;
0111   }
0112 }
0113 
0114 /// increase # of events with error
0115 void L1GtTrigReportEntry::addErrorEntry() { m_nrEventsError++; }