File indexing completed on 2024-04-06 12:07:07
0001 #ifndef DTDigiTask_H
0002 #define DTDigiTask_H
0003
0004
0005
0006
0007
0008
0009
0010
0011 #include "FWCore/Framework/interface/Frameworkfwd.h"
0012 #include "DataFormats/Common/interface/Handle.h"
0013 #include "FWCore/Framework/interface/Event.h"
0014 #include "FWCore/Framework/interface/MakerMacros.h"
0015 #include "FWCore/ParameterSet/interface/ParameterSet.h"
0016
0017 #include "DQMServices/Core/interface/DQMStore.h"
0018
0019 #include "DQMServices/Core/interface/DQMOneEDAnalyzer.h"
0020
0021 #include "CondFormats/DTObjects/interface/DTReadOutMapping.h"
0022 #include "CondFormats/DTObjects/interface/DTStatusFlag.h"
0023
0024 #include "Geometry/Records/interface/MuonGeometryRecord.h"
0025 #include "CondFormats/DataRecord/interface/DTReadOutMappingRcd.h"
0026 #include "CondFormats/DataRecord/interface/DTTtrigRcd.h"
0027 #include "CondFormats/DataRecord/interface/DTT0Rcd.h"
0028 #include "CondFormats/DataRecord/interface/DTStatusFlagRcd.h"
0029
0030 #include "DataFormats/LTCDigi/interface/LTCDigi.h"
0031 #include "DataFormats/DTDigi/interface/DTDigi.h"
0032 #include "DataFormats/DTDigi/interface/DTDigiCollection.h"
0033
0034 #include "FWCore/Framework/interface/LuminosityBlock.h"
0035 #include "FWCore/Utilities/interface/InputTag.h"
0036
0037 #include <memory>
0038 #include <iostream>
0039 #include <fstream>
0040 #include <string>
0041 #include <vector>
0042 #include <map>
0043
0044 class DTGeometry;
0045 class DTSuperLayerId;
0046 class DTLayerId;
0047 class DTChamberId;
0048 class DTTtrig;
0049 class DTT0;
0050
0051 class DTDigiTask : public DQMOneEDAnalyzer<edm::one::WatchLuminosityBlocks> {
0052 public:
0053
0054 DTDigiTask(const edm::ParameterSet& ps);
0055
0056
0057 ~DTDigiTask() override;
0058
0059 protected:
0060 void dqmBeginRun(const edm::Run&, const edm::EventSetup&) override;
0061
0062
0063 void bookHistograms(DQMStore::IBooker&, edm::Run const&, edm::EventSetup const&) override;
0064
0065
0066 void bookHistos(DQMStore::IBooker& ibooker, const DTSuperLayerId& dtSL, std::string folder, std::string histoTag);
0067 void bookHistos(DQMStore::IBooker& ibooker, const DTChamberId& dtCh, std::string folder, std::string histoTag);
0068 void bookHistos(DQMStore::IBooker& ibooker, const int wheelId, std::string folder, std::string histoTag);
0069
0070
0071 void beginLuminosityBlock(edm::LuminosityBlock const& lumiSeg, edm::EventSetup const& context) override;
0072 void endLuminosityBlock(edm::LuminosityBlock const& lumiSeg, edm::EventSetup const& context) final {}
0073
0074
0075 void channelsMap(const DTChamberId& dtCh, std::string histoTag);
0076
0077
0078 void analyze(const edm::Event& e, const edm::EventSetup& c) override;
0079
0080
0081 std::string triggerSource();
0082
0083 private:
0084 std::string topFolder() const;
0085
0086 int nevents;
0087
0088
0089 int tMax;
0090 int maxTDCHits;
0091
0092
0093 float tTrig;
0094 float tTrigRMS;
0095 float kFactor;
0096
0097
0098
0099 std::map<DTChamberId, int> hitMap;
0100 std::set<DTChamberId> syncNoisyChambers;
0101 int syncNumTot;
0102 int syncNum;
0103
0104 edm::Handle<LTCDigiCollection> ltcdigis;
0105
0106 edm::ESGetToken<DTGeometry, MuonGeometryRecord> muonGeomToken_;
0107 const DTGeometry* muonGeom;
0108 edm::ESGetToken<DTReadOutMapping, DTReadOutMappingRcd> readOutMapToken_;
0109 const DTReadOutMapping* mapping;
0110
0111 edm::ESGetToken<DTTtrig, DTTtrigRcd> TtrigToken_;
0112 const DTTtrig* tTrigMap;
0113 edm::ESGetToken<DTT0, DTT0Rcd> T0Token_;
0114 const DTT0* t0Map;
0115
0116
0117 edm::ESGetToken<DTStatusFlag, DTStatusFlagRcd> statusMapToken_;
0118 const DTStatusFlag* statusMap;
0119
0120 std::map<std::string, std::map<uint32_t, MonitorElement*> > digiHistos;
0121 std::map<std::string, std::map<int, MonitorElement*> > wheelHistos;
0122
0123
0124
0125
0126 edm::EDGetTokenT<DTDigiCollection> dtDigiToken_;
0127
0128 edm::EDGetTokenT<LTCDigiCollection> ltcDigiCollectionToken_;
0129
0130
0131 bool readTTrigDB;
0132
0133 bool subtractT0;
0134
0135 int defaultTmax;
0136
0137
0138 bool doStaticBooking;
0139
0140 bool isLocalRun;
0141
0142 int resetCycle;
0143
0144 bool checkNoisyChannels;
0145
0146 int defaultTTrig;
0147
0148 int inTimeHitsLowerBound;
0149 int inTimeHitsUpperBound;
0150 int timeBoxGranularity;
0151 int maxTTMounts;
0152 bool doAllHitsOccupancies;
0153 bool doNoiseOccupancies;
0154 bool doInTimeOccupancies;
0155
0156 bool tpMode;
0157 bool lookForSyncNoise;
0158 bool filterSyncNoise;
0159
0160 bool sliceTestMode;
0161 int tdcPedestal;
0162
0163 bool doLayerTimeBoxes;
0164
0165 std::map<DTChamberId, int> nSynchNoiseEvents;
0166 MonitorElement* nEventMonitor;
0167 };
0168
0169 #endif
0170
0171
0172
0173
0174