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