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 
20 
22  ltcDigiCollectionTag_(iConfig.getParameter<edm::InputTag>("ltcDigiCollectionTag"))
23 {
24  HLTDirectory="HLTResults";
26  conf_ = iConfig;
27 }
28 
29 
32  // 0 DT
33  // 1 CSC
34  // 2 RBC1 (RPC techn. cosmic trigger for wheel +1, sector 10)
35  // 3 RBC2 (RPC techn. cosmic trigger for wheel +2, sector 10)
36  // 4 RPCTB (RPC Trigger Board trigger, covering both sectors 10 of both wheels, but with different geometrical acceptance ("pointing"))
37  // 5 unused
38 // edm::CurrentProcessingContext const* current_processing_context = currentContext();
39 // std::string const* the_label = moduleLabel();
40  std::string the_label = conf_.getParameter<std::string>("@module_label");
41  std::string ltctitle = the_label + "_LTCTriggerDecision";
42  LTCTriggerDecision_all = dqmStore_->book1D(ltctitle, ltctitle, 8, -0.5, 7.5);
48 }
49 
51 {
53 // unsigned int ltc_run;
54 // unsigned int ltc_event;
55 // unsigned int ltc_triggerNumber;
56 // unsigned int ltc_mask; // eight bits
57 // unsigned long long int ltc_gpstime;
58 // unsigned int ltc_orbit;
59 // unsigned int ltc_bunch;
60 // unsigned int ltc_inhibit;
61  for( LTCDigiCollection::const_iterator ltcdigiItr = ltcdigis->begin() ; ltcdigiItr != ltcdigis->end() ; ++ltcdigiItr ) {
62 // ltc_run = ltcdigiItr->runNumber();
63 // ltc_event = ltcdigiItr->eventNumber();
64 // ltc_triggerNumber = ltcdigiItr->eventID();
65 // ltc_bunch = ltcdigiItr->bunchNumber();
66 // ltc_orbit = ltcdigiItr->orbitNumber();
67 // ltc_inhibit = ltcdigiItr->triggerInhibitNumber();
68 // ltc_mask = (unsigned int)(ltcdigiItr->externTriggerMask());
69 // ltc_gpstime = ltcdigiItr->bstGpsTime();
70  for ( int ibit = 0; ibit < 7; ++ibit ) {
71  if ( ltcdigiItr->HasTriggered(ibit) ) {
72  LTCTriggerDecision_all->Fill(ibit,1.);
73  }
74  }
75  //
76 // std::cout << "XXX: "
77 // << ltcdigiItr->runNumber() << " "
78 // << ltcdigiItr->eventNumber() << " "
79 // << ltcdigiItr->bunchNumber() << " "
80 // << ltcdigiItr->orbitNumber() << " "
81 // << "0x" << std::hex
82 // << int(ltcdigiItr->externTriggerMask()) << " "
83 // << std::dec
84 // << ltcdigiItr->triggerInhibitNumber() << " "
85 // << ltcdigiItr->bstGpsTime() << " "
86 // << std::endl;
87 // std::cout << (*ltcdigiItr) << std::endl;
88  }
89 
90 }
91 
92 void MonitorLTC::endJob(void){
93  bool outputMEsInRootFile = conf_.getParameter<bool>("OutputMEsInRootFile");
95  if(outputMEsInRootFile){
96  dqmStore_->save(outputFileName);
97  }
98 }
99 
T getParameter(std::string const &) const
MonitorElement * book1D(const char *name, const char *title, int nchX, double lowX, double highX)
Book 1D histogram.
Definition: DQMStore.cc:722
virtual void beginJob()
Definition: MonitorLTC.cc:30
void save(const std::string &filename, const std::string &path="", const std::string &pattern="", const std::string &rewrite="", SaveReferenceTag ref=SaveWithReference, int minStatus=dqm::qstatus::STATUS_OK, const std::string &fileupdate="RECREATE")
Definition: DQMStore.cc:2118
MonitorElement * LTCTriggerDecision_all
Definition: MonitorLTC.h:37
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)
edm::InputTag ltcDigiCollectionTag_
Definition: MonitorLTC.h:40
int iEvent
Definition: GenABIO.cc:243
virtual void analyze(const edm::Event &, const edm::EventSetup &)
Definition: MonitorLTC.cc:50
std::string HLTDirectory
Definition: MonitorLTC.h:39
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:361
DQMStore * dqmStore_
Definition: MonitorLTC.h:34
MonitorLTC(const edm::ParameterSet &)
Definition: MonitorLTC.cc:21
edm::ParameterSet conf_
Definition: MonitorLTC.h:35
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:434
virtual void endJob()
Definition: MonitorLTC.cc:92