CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_5_3_4/src/DQM/SiStripMonitorCluster/src/MonitorLTC.cc

Go to the documentation of this file.
00001 // -*- C++ -*-
00002 //
00003 // Package:    SiStripMonitorCluster
00004 // Class:      MonitorLTC
00005 // 
00006 //class MonitorLTC MonitorLTC.cc DQM/SiStripMonitorCluster/src/MonitorLTC.cc
00007 #include <vector>
00008 
00009 #include <numeric>
00010 #include <iostream>
00011 
00012 
00013 
00014 #include "FWCore/ServiceRegistry/interface/Service.h"
00015 
00016 #include "DQM/SiStripMonitorCluster/interface/MonitorLTC.h"
00017 #include "DQMServices/Core/interface/DQMStore.h"
00018 
00019 #include "DataFormats/LTCDigi/interface/LTCDigi.h"
00020 
00021 MonitorLTC::MonitorLTC(const edm::ParameterSet& iConfig)
00022 {
00023   HLTDirectory="HLTResults";
00024   dqmStore_  = edm::Service<DQMStore>().operator->();
00025   conf_ = iConfig;
00026 }
00027 
00028 
00029 void MonitorLTC::beginJob(){
00030   dqmStore_->setCurrentFolder(HLTDirectory);
00031   // 0 DT
00032   // 1 CSC
00033   // 2 RBC1 (RPC techn. cosmic trigger for wheel +1, sector 10)
00034   // 3 RBC2 (RPC techn. cosmic trigger for wheel +2, sector 10)
00035   // 4 RPCTB (RPC Trigger Board trigger, covering both sectors 10 of both wheels, but with different geometrical acceptance ("pointing"))
00036   // 5 unused 
00037 //  edm::CurrentProcessingContext const* current_processing_context = currentContext();
00038 //  std::string const* the_label = moduleLabel();
00039   std::string the_label = conf_.getParameter<std::string>("@module_label");
00040   std::string ltctitle = the_label + "_LTCTriggerDecision";
00041   LTCTriggerDecision_all = dqmStore_->book1D(ltctitle, ltctitle, 8, -0.5, 7.5);
00042   LTCTriggerDecision_all->setBinLabel(1, "DT");
00043   LTCTriggerDecision_all->setBinLabel(2, "CSC");
00044   LTCTriggerDecision_all->setBinLabel(3, "RBC1");
00045   LTCTriggerDecision_all->setBinLabel(4, "RBC2");
00046   LTCTriggerDecision_all->setBinLabel(5, "RPCTB");
00047 }
00048 
00049 void MonitorLTC::analyze(const edm::Event& iEvent, const edm::EventSetup& iSetup)
00050 {
00051   edm::Handle<LTCDigiCollection> ltcdigis; iEvent.getByType(ltcdigis);
00052 //  unsigned int ltc_run;
00053 //  unsigned int ltc_event;
00054 //  unsigned int ltc_triggerNumber;
00055 //  unsigned int ltc_mask; // eight bits
00056 //  unsigned long long int ltc_gpstime;
00057 //  unsigned int ltc_orbit;
00058 //  unsigned int ltc_bunch;
00059 //  unsigned int ltc_inhibit;
00060   for( LTCDigiCollection::const_iterator ltcdigiItr = ltcdigis->begin() ; ltcdigiItr != ltcdigis->end() ; ++ltcdigiItr ) {
00061 //    ltc_run = ltcdigiItr->runNumber();
00062 //    ltc_event = ltcdigiItr->eventNumber();
00063 //    ltc_triggerNumber = ltcdigiItr->eventID();
00064 //    ltc_bunch = ltcdigiItr->bunchNumber();
00065 //    ltc_orbit = ltcdigiItr->orbitNumber();
00066 //    ltc_inhibit = ltcdigiItr->triggerInhibitNumber();
00067 //    ltc_mask = (unsigned int)(ltcdigiItr->externTriggerMask());
00068 //    ltc_gpstime = ltcdigiItr->bstGpsTime();
00069     for ( int ibit = 0; ibit < 7; ++ibit ) {
00070       if ( ltcdigiItr->HasTriggered(ibit) ) {
00071        LTCTriggerDecision_all->Fill(ibit,1.);
00072       }
00073     }
00074     //
00075 //    std::cout << "XXX: "
00076 //              << ltcdigiItr->runNumber() << " "
00077 //              << ltcdigiItr->eventNumber() << " "
00078 //              << ltcdigiItr->bunchNumber() << " "
00079 //              << ltcdigiItr->orbitNumber() << " "
00080 //              << "0x" << std::hex
00081 //              << int(ltcdigiItr->externTriggerMask()) << " "
00082 //              << std::dec
00083 //              << ltcdigiItr->triggerInhibitNumber() << " "
00084 //              << ltcdigiItr->bstGpsTime() << " "
00085 //              << std::endl;
00086 //    std::cout << (*ltcdigiItr) << std::endl;
00087   }
00088 
00089 }
00090 
00091 void MonitorLTC::endJob(void){
00092   bool outputMEsInRootFile = conf_.getParameter<bool>("OutputMEsInRootFile");
00093   std::string outputFileName = conf_.getParameter<std::string>("OutputFileName");
00094   if(outputMEsInRootFile){
00095     dqmStore_->save(outputFileName);
00096   }
00097 }
00098