Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:08:46

0001 // -*- C++ -*-
0002 //
0003 // Package:    SiStripMonitorCluster
0004 // Class:      MonitorLTC
0005 //
0006 // class MonitorLTC MonitorLTC.cc DQM/SiStripMonitorCluster/src/MonitorLTC.cc
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 //  ltcDigiCollectionTag_(iConfig.getParameter<edm::InputTag>("ltcDigiCollectionTag"))
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   // 0 DT
0028   // 1 CSC
0029   // 2 RBC1 (RPC techn. cosmic trigger for wheel +1, sector 10)
0030   // 3 RBC2 (RPC techn. cosmic trigger for wheel +2, sector 10)
0031   // 4 RPCTB (RPC Trigger Board trigger, covering both sectors 10 of both
0032   // wheels, but with different geometrical acceptance ("pointing")) 5 unused
0033   // edm::CurrentProcessingContext const* current_processing_context =
0034   // currentContext(); std::string const* the_label = moduleLabel();
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   //  unsigned int ltc_run;
0049   //  unsigned int ltc_event;
0050   //  unsigned int ltc_triggerNumber;
0051   //  unsigned int ltc_mask; // eight bits
0052   //  unsigned long long int ltc_gpstime;
0053   //  unsigned int ltc_orbit;
0054   //  unsigned int ltc_bunch;
0055   //  unsigned int ltc_inhibit;
0056   for (LTCDigiCollection::const_iterator ltcdigiItr = ltcdigis->begin(); ltcdigiItr != ltcdigis->end(); ++ltcdigiItr) {
0057     //    ltc_run = ltcdigiItr->runNumber();
0058     //    ltc_event = ltcdigiItr->eventNumber();
0059     //    ltc_triggerNumber = ltcdigiItr->eventID();
0060     //    ltc_bunch = ltcdigiItr->bunchNumber();
0061     //    ltc_orbit = ltcdigiItr->orbitNumber();
0062     //    ltc_inhibit = ltcdigiItr->triggerInhibitNumber();
0063     //    ltc_mask = (unsigned int)(ltcdigiItr->externTriggerMask());
0064     //    ltc_gpstime = ltcdigiItr->bstGpsTime();
0065     for (int ibit = 0; ibit < 7; ++ibit) {
0066       if (ltcdigiItr->HasTriggered(ibit)) {
0067         LTCTriggerDecision_all->Fill(ibit, 1.);
0068       }
0069     }
0070     //
0071     //    std::cout << "XXX: "
0072     //              << ltcdigiItr->runNumber() << " "
0073     //              << ltcdigiItr->eventNumber() << " "
0074     //              << ltcdigiItr->bunchNumber() << " "
0075     //              << ltcdigiItr->orbitNumber() << " "
0076     //              << "0x" << std::hex
0077     //              << int(ltcdigiItr->externTriggerMask()) << " "
0078     //              << std::dec
0079     //              << ltcdigiItr->triggerInhibitNumber() << " "
0080     //              << ltcdigiItr->bstGpsTime() << " "
0081     //              << std::endl;
0082     //    std::cout << (*ltcdigiItr) << std::endl;
0083   }
0084 }