CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
MonitorLTC.cc
Go to the documentation of this file.
1 // -*- C++ -*-
2 //
3 // Package: SiStripMonitorCluster
4 // Class: MonitorLTC
5 //
6 //class MonitorLTC MonitorLTC.cc DQM/SiStripMonitorCluster/src/MonitorLTC.cc
7 #include <vector>
8 
9 #include <numeric>
10 #include <iostream>
11 
12 
13 
15 
18 
19 
21  // ltcDigiCollectionTag_(iConfig.getParameter<edm::InputTag>("ltcDigiCollectionTag"))
22 {
23  HLTDirectory="HLTResults";
25  conf_ = iConfig;
26 
27  ltcDigiCollectionTagToken_ = consumes<LTCDigiCollection>(conf_.getParameter<edm::InputTag>("ltcDigiCollectionTag") );
28 }
29 
31 {
33  // 0 DT
34  // 1 CSC
35  // 2 RBC1 (RPC techn. cosmic trigger for wheel +1, sector 10)
36  // 3 RBC2 (RPC techn. cosmic trigger for wheel +2, sector 10)
37  // 4 RPCTB (RPC Trigger Board trigger, covering both sectors 10 of both wheels, but with different geometrical acceptance ("pointing"))
38  // 5 unused
39  // edm::CurrentProcessingContext const* current_processing_context = currentContext();
40  // std::string const* the_label = moduleLabel();
41  std::string the_label = conf_.getParameter<std::string>("@module_label");
42  std::string ltctitle = the_label + "_LTCTriggerDecision";
43  LTCTriggerDecision_all = ibooker.book1D(ltctitle, ltctitle, 8, -0.5, 7.5);
48  LTCTriggerDecision_all->setBinLabel(5, "RPCTB");
49 }
50 
52 
53 }
54 
56 {
58 // unsigned int ltc_run;
59 // unsigned int ltc_event;
60 // unsigned int ltc_triggerNumber;
61 // unsigned int ltc_mask; // eight bits
62 // unsigned long long int ltc_gpstime;
63 // unsigned int ltc_orbit;
64 // unsigned int ltc_bunch;
65 // unsigned int ltc_inhibit;
66  for( LTCDigiCollection::const_iterator ltcdigiItr = ltcdigis->begin() ; ltcdigiItr != ltcdigis->end() ; ++ltcdigiItr ) {
67 // ltc_run = ltcdigiItr->runNumber();
68 // ltc_event = ltcdigiItr->eventNumber();
69 // ltc_triggerNumber = ltcdigiItr->eventID();
70 // ltc_bunch = ltcdigiItr->bunchNumber();
71 // ltc_orbit = ltcdigiItr->orbitNumber();
72 // ltc_inhibit = ltcdigiItr->triggerInhibitNumber();
73 // ltc_mask = (unsigned int)(ltcdigiItr->externTriggerMask());
74 // ltc_gpstime = ltcdigiItr->bstGpsTime();
75  for ( int ibit = 0; ibit < 7; ++ibit ) {
76  if ( ltcdigiItr->HasTriggered(ibit) ) {
77  LTCTriggerDecision_all->Fill(ibit,1.);
78  }
79  }
80  //
81 // std::cout << "XXX: "
82 // << ltcdigiItr->runNumber() << " "
83 // << ltcdigiItr->eventNumber() << " "
84 // << ltcdigiItr->bunchNumber() << " "
85 // << ltcdigiItr->orbitNumber() << " "
86 // << "0x" << std::hex
87 // << int(ltcdigiItr->externTriggerMask()) << " "
88 // << std::dec
89 // << ltcdigiItr->triggerInhibitNumber() << " "
90 // << ltcdigiItr->bstGpsTime() << " "
91 // << std::endl;
92 // std::cout << (*ltcdigiItr) << std::endl;
93  }
94 
95 }
96 
97 void MonitorLTC::endJob(void){
98  bool outputMEsInRootFile = conf_.getParameter<bool>("OutputMEsInRootFile");
100  if(outputMEsInRootFile){
101  dqmStore_->save(outputFileName);
102  }
103 }
104 
T getParameter(std::string const &) const
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:434
virtual void beginJob()
Definition: MonitorLTC.cc:51
MonitorElement * LTCTriggerDecision_all
Definition: MonitorLTC.h:41
void setBinLabel(int bin, const std::string &label, int axis=1)
set bin label for x, y or z axis (axis=1, 2, 3 respectively)
void Fill(long long x)
int iEvent
Definition: GenABIO.cc:230
MonitorElement * book1D(Args &&...args)
Definition: DQMStore.h:113
virtual void analyze(const edm::Event &, const edm::EventSetup &)
Definition: MonitorLTC.cc:55
std::string HLTDirectory
Definition: MonitorLTC.h:43
edm::EDGetTokenT< LTCDigiCollection > ltcDigiCollectionTagToken_
Definition: MonitorLTC.h:45
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:274
DQMStore * dqmStore_
Definition: MonitorLTC.h:38
MonitorLTC(const edm::ParameterSet &)
Definition: MonitorLTC.cc:20
void save(const std::string &filename, const std::string &path="", const std::string &pattern="", const std::string &rewrite="", const uint32_t run=0, const uint32_t lumi=0, SaveReferenceTag ref=SaveWithReference, int minStatus=dqm::qstatus::STATUS_OK, const std::string &fileupdate="RECREATE", const bool resetMEsAfterWriting=false)
Definition: DQMStore.cc:2540
void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
Definition: MonitorLTC.cc:30
edm::ParameterSet conf_
Definition: MonitorLTC.h:39
Definition: Run.h:41
virtual void endJob()
Definition: MonitorLTC.cc:97