File indexing completed on 2024-04-06 12:07:44
0001 #ifndef BxTiming_H
0002 #define BxTiming_H
0003
0004
0005
0006
0007
0008
0009
0010
0011 #include <memory>
0012 #include <string>
0013 #include "FWCore/ServiceRegistry/interface/Service.h"
0014 #include "FWCore/Framework/interface/Frameworkfwd.h"
0015 #include "FWCore/Framework/interface/Event.h"
0016 #include "FWCore/Framework/interface/MakerMacros.h"
0017 #include "FWCore/ParameterSet/interface/ParameterSet.h"
0018 #include "FWCore/MessageLogger/interface/MessageLogger.h"
0019
0020 #include "DQMServices/Core/interface/DQMStore.h"
0021
0022 #include "DataFormats/L1GlobalTrigger/interface/L1GlobalTriggerReadoutRecord.h"
0023 #include "DataFormats/FEDRawData/interface/FEDRawDataCollection.h"
0024 #include "DataFormats/FEDRawData/interface/FEDHeader.h"
0025 #include "DataFormats/FEDRawData/interface/FEDTrailer.h"
0026 #include "DataFormats/FEDRawData/interface/FEDNumbering.h"
0027 #include "DQMServices/Core/interface/DQMEDAnalyzer.h"
0028 #include "DataFormats/Provenance/interface/EventAuxiliary.h"
0029
0030 #define nfed_ FEDNumbering::MAXFEDID + 1
0031
0032 class BxTiming : public DQMEDAnalyzer {
0033 public:
0034 explicit BxTiming(const edm::ParameterSet&);
0035 ~BxTiming() override;
0036
0037 protected:
0038 void analyze(const edm::Event&, const edm::EventSetup&) override;
0039 void bookHistograms(DQMStore::IBooker& ibooker, edm::Run const&, edm::EventSetup const&) override;
0040
0041 private:
0042
0043 edm::InputTag fedSource_;
0044 edm::EDGetTokenT<FEDRawDataCollection> fedSource_token_;
0045 edm::InputTag gtSource_;
0046 edm::EDGetTokenT<L1GlobalTriggerReadoutRecord> gtSource_token_;
0047
0048
0049 int verbose_;
0050 int verbose() { return verbose_; }
0051
0052
0053
0054
0055
0056
0057
0058 int calcBxDiff(int bx1, int bx2);
0059
0060
0061 int nEvt_;
0062
0063
0064 std::string histFile_;
0065
0066
0067 std::string histFolder_;
0068
0069
0070 bool runInFF_;
0071
0072
0073 static const int norb_ = 3564;
0074 static const int half_norb_ = norb_ / 2;
0075
0076 static const int nbig_ = 10000;
0077 static const int nttype_ = 6;
0078
0079 std::vector<int> listGtBits_;
0080
0081 enum nsys { NSYS = 10 };
0082 enum syslist { PS = 0, ETP, HTP, GCT, CTP, CTF, DTP, DTF, RPC, GLT };
0083 std::pair<int, int> fedRange_[NSYS];
0084 int fedRef_;
0085
0086
0087 static const int nspr_ = 3;
0088 int nBxDiff[nfed_][nspr_];
0089 int nBxOccy[nfed_][nspr_];
0090
0091
0092 MonitorElement* hBxDiffAllFed;
0093 MonitorElement* hBxDiffSysFed[NSYS];
0094 MonitorElement* hBxOccyAllFed;
0095 MonitorElement** hBxOccyOneFed;
0096
0097 MonitorElement* hBxDiffAllFedSpread[nspr_];
0098 MonitorElement* hBxOccyAllFedSpread[nspr_];
0099
0100 MonitorElement* hBxOccyGtTrigType[nttype_];
0101 MonitorElement** hBxOccyTrigBit[NSYS];
0102 };
0103
0104 #endif