File indexing completed on 2024-04-06 12:08:46
0001
0002
0003
0004
0005
0006
0007
0008 #include <vector>
0009 #include <iostream>
0010 #include <numeric>
0011
0012 #include "DQM/SiStripMonitorCluster/interface/MonitorLTC.h"
0013 #include "DQMServices/Core/interface/DQMStore.h"
0014 #include "FWCore/ServiceRegistry/interface/Service.h"
0015
0016 MonitorLTC::MonitorLTC(const edm::ParameterSet& iConfig)
0017
0018 {
0019 HLTDirectory = "HLTResults";
0020 conf_ = iConfig;
0021
0022 ltcDigiCollectionTagToken_ = consumes<LTCDigiCollection>(conf_.getParameter<edm::InputTag>("ltcDigiCollectionTag"));
0023 }
0024
0025 void MonitorLTC::bookHistograms(DQMStore::IBooker& ibooker, const edm::Run& run, const edm::EventSetup& es) {
0026 ibooker.setCurrentFolder(HLTDirectory);
0027
0028
0029
0030
0031
0032
0033
0034
0035 std::string the_label = conf_.getParameter<std::string>("@module_label");
0036 std::string ltctitle = the_label + "_LTCTriggerDecision";
0037 LTCTriggerDecision_all = ibooker.book1D(ltctitle, ltctitle, 8, -0.5, 7.5);
0038 LTCTriggerDecision_all->setBinLabel(1, "DT");
0039 LTCTriggerDecision_all->setBinLabel(2, "CSC");
0040 LTCTriggerDecision_all->setBinLabel(3, "RBC1");
0041 LTCTriggerDecision_all->setBinLabel(4, "RBC2");
0042 LTCTriggerDecision_all->setBinLabel(5, "RPCTB");
0043 }
0044
0045 void MonitorLTC::analyze(const edm::Event& iEvent, const edm::EventSetup& iSetup) {
0046 edm::Handle<LTCDigiCollection> ltcdigis;
0047 iEvent.getByToken(ltcDigiCollectionTagToken_, ltcdigis);
0048
0049
0050
0051
0052
0053
0054
0055
0056 for (LTCDigiCollection::const_iterator ltcdigiItr = ltcdigis->begin(); ltcdigiItr != ltcdigis->end(); ++ltcdigiItr) {
0057
0058
0059
0060
0061
0062
0063
0064
0065 for (int ibit = 0; ibit < 7; ++ibit) {
0066 if (ltcdigiItr->HasTriggered(ibit)) {
0067 LTCTriggerDecision_all->Fill(ibit, 1.);
0068 }
0069 }
0070
0071
0072
0073
0074
0075
0076
0077
0078
0079
0080
0081
0082
0083 }
0084 }