CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
DQMScalInfo.cc
Go to the documentation of this file.
1 /*
2  * \file DQMDcsInfo.cc
3  * \author A.Meyer - DESY
4  * Last Update:
5  *
6  */
7 
8 #include "DQMScalInfo.h"
13 
19 
20 using namespace std;
21 
22 
23 // Framework
24 
25 
27 {
28  parameters_ = ps;
29 
30  scalfolder_ = parameters_.getUntrackedParameter<std::string>("dqmScalFolder", "Scal") ;
31  gtCollection_ = consumes<L1GlobalTriggerReadoutRecord>(parameters_.getUntrackedParameter<std::string>("gtCollection","gtDigis"));
32  dcsStatusCollection_ = consumes<DcsStatusCollection>(parameters_.getUntrackedParameter<std::string>("dcsStatusCollection","scalersRawToDigi"));
33  l1tscollectionToken_ = consumes<Level1TriggerScalersCollection>(parameters_.getUntrackedParameter<std::string>("l1TSCollection", "scalersRawToDigi"));
34  lumicollectionToken_ = consumes<LumiScalersCollection>(parameters_.getUntrackedParameter<std::string>("lumiCollection", "scalersRawToDigi"));
35 
36 }
37 
39 }
40 
42  edm::Run const & /* iRun */,
43  edm::EventSetup const & /* iSetup */) {
44 
45  const int maxNbins = 2001;
46 
47  // Fetch GlobalTag information and fill the string/ME.
48  ibooker.cd();
49  ibooker.setCurrentFolder(scalfolder_ +"/L1TriggerScalers/");
50  const int fracLS = 16;
51  const int maxLS = 250;
52  hlresync_ = ibooker.book1D("lresync","Orbit of last resync",fracLS*maxLS,0,maxLS*262144);
53  hlOC0_ = ibooker.book1D("lOC0","Orbit of last OC0",fracLS*maxLS,0,maxLS*262144);
54  hlTE_ = ibooker.book1D("lTE","Orbit of last TestEnable",fracLS*maxLS,0,maxLS*262144);
55  hlstart_ = ibooker.book1D("lstart","Orbit of last Start",fracLS*maxLS,0,maxLS*262144);
56  hlEC0_ = ibooker.book1D("lEC0","Orbit of last EC0",fracLS*maxLS,0,maxLS*262144);
57  hlHR_ = ibooker.book1D("lHR","Orbit of last HardReset",fracLS*maxLS,0,maxLS*262144);
58 
59  hphysTrig_ = ibooker.book1D("Physics_Triggers", "Physics Triggers", maxNbins, -0.5, double(maxNbins)-0.5);
60  hphysTrig_->setAxisTitle("Lumi Section", 1);
61 
62  ibooker.cd();
63  ibooker.setCurrentFolder(scalfolder_ +"/LumiScalers/");
64  hinstLumi_ = ibooker.book1D("Instant_Lumi", "Instant Lumi", maxNbins, -0.5, double(maxNbins)-0.5);
65 }
66 
68  makeL1Scalars(e);
69  makeLumiScalars(e);
70  return;
71 }
72 
73 void
75 {
77  e.getByToken(l1tscollectionToken_,l1ts);
79  e.getByToken(lumicollectionToken_,lumiScalers);
80 
81  Level1TriggerScalersCollection::const_iterator it = l1ts->begin();
82 
83  if(l1ts->size()==0) return;
84  hlresync_->Fill((*l1ts)[0].lastResync());
85  hlOC0_->Fill((*l1ts)[0].lastOrbitCounter0());
86  hlTE_->Fill((*l1ts)[0].lastTestEnable());
87  hlstart_->Fill((*l1ts)[0].lastStart());
88  hlEC0_->Fill((*l1ts)[0].lastEventCounter0());
89  hlHR_->Fill((*l1ts)[0].lastHardReset());
90 
91  unsigned int lumisection = it->lumiSegmentNr();
92  if(lumisection){
93  hphysTrig_->setBinContent(lumisection + 1, it->l1AsPhysics());
94  }
95 
96  return ;
97 }
98 
99 void
101 {
103  e.getByToken(lumicollectionToken_,lumiScalers);
104 
105  LumiScalersCollection::const_iterator it = lumiScalers->begin();
106 
107  if(lumiScalers->size()){
108  unsigned int lumisection = it->sectionNumber();
109  if(lumisection){
110  hinstLumi_->setBinContent(lumisection + 1, it->instantLumi());
111  }
112  }
113 
114  return;
115 }
T getUntrackedParameter(std::string const &, T const &) const
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:464
void cd(void)
Definition: DQMStore.cc:266
void makeL1Scalars(const edm::Event &e)
Definition: DQMScalInfo.cc:74
return((rh^lh)&mask)
void makeLumiScalars(const edm::Event &e)
Definition: DQMScalInfo.cc:100
void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
Definition: DQMScalInfo.cc:41
MonitorElement * book1D(Args &&...args)
Definition: DQMStore.h:115
DQMScalInfo(const edm::ParameterSet &ps)
Constructor.
Definition: DQMScalInfo.cc:26
virtual ~DQMScalInfo()
Destructor.
Definition: DQMScalInfo.cc:38
void analyze(const edm::Event &e, const edm::EventSetup &c)
Analyze.
Definition: DQMScalInfo.cc:67
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:274
void setAxisTitle(const std::string &title, int axis=1)
set x-, y- or z-axis title (axis=1, 2, 3 respectively)
Definition: Run.h:43