CMS 3D CMS Logo

RPCDaqInfo.cc
Go to the documentation of this file.
8 
9 
10 
12 
13  FEDRange_.first = ps.getUntrackedParameter<unsigned int>("MinimumRPCFEDId", 790);
14  FEDRange_.second = ps.getUntrackedParameter<unsigned int>("MaximumRPCFEDId", 792);
15 
16  NumberOfFeds_ =FEDRange_.second - FEDRange_.first +1;
17 
18  numberOfDisks_ = ps.getUntrackedParameter<int>("NumberOfEndcapDisks", 4);
19 
20  init_=false;
21 }
22 
26 
27  if(!init_){this->myBooker(ibooker);}
28 
29  if(auto runInfoRec = iSetup.tryToGet<RunInfoRcd>()) {
30 
31  //get fed summary information
33  runInfoRec->get(sumFED);
34  std::vector<int> FedsInIds= sumFED->m_fed_in;
35 
36  int FedCount=0;
37 
38  //loop on all active feds
39  for(unsigned int fedItr=0;fedItr<FedsInIds.size(); ++fedItr) {
40  int fedID=FedsInIds[fedItr];
41  //make sure fed id is in allowed range
42 
43  if(fedID>=FEDRange_.first && fedID<=FEDRange_.second) ++FedCount;
44  }
45 
46  //Fill active fed fraction ME
47  if(NumberOfFeds_>0) DaqFraction_->Fill( FedCount/NumberOfFeds_);
48  else DaqFraction_->Fill(-1);
49 
50  }else{
51  DaqFraction_->Fill(-1);
52  return;
53  }
54 }
55 
56 
58 
59 
61 
62  //fraction of alive FEDs
63  ibooker.setCurrentFolder("RPC/EventInfo/DAQContents");
64 
65  int limit = numberOfDisks_;
66  if(numberOfDisks_ < 2) limit = 2;
67 
68  for (int i = -1 * limit; i<= limit;i++ ){//loop on wheels and disks
69  if (i>-3 && i<3){//wheels
70  std::stringstream streams;
71  streams << "RPC_Wheel" << i;
72  daqWheelFractions[i+2] = ibooker.bookFloat(streams.str());
73  daqWheelFractions[i+2]->Fill(-1);
74  }
75 
76  if (i == 0 || i > numberOfDisks_ || i< (-1 * numberOfDisks_))continue;
77 
78  int offset = numberOfDisks_;
79  if (i>0) offset --; //used to skip case equale to zero
80 
81  std::stringstream streams;
82  streams << "RPC_Disk" << i;
83  daqDiskFractions[i+2] = ibooker.bookFloat(streams.str());
84  daqDiskFractions[i+2]->Fill(-1);
85  }
86 
87 
88  //daq summary for RPCs
89  ibooker.setCurrentFolder("RPC/EventInfo");
90 
91  DaqFraction_ = ibooker.bookFloat("DAQSummary");
92 
93  DaqMap_ = ibooker.book2D( "DAQSummaryMap","RPC DAQ Summary Map",15, -7.5, 7.5, 12, 0.5 ,12.5);
94 
95  //customize the 2d histo
96  std::stringstream BinLabel;
97  for (int i= 1 ; i<=15; i++){
98  BinLabel.str("");
99  if(i<13){
100  BinLabel<<"Sec"<<i;
101  DaqMap_->setBinLabel(i,BinLabel.str(),2);
102  }
103 
104  BinLabel.str("");
105  if(i<5)
106  BinLabel<<"Disk"<<i-5;
107  else if(i>11)
108  BinLabel<<"Disk"<<i-11;
109  else if(i==11 || i==5)
110  BinLabel.str("");
111  else
112  BinLabel<<"Wheel"<<i-8;
113 
114  DaqMap_->setBinLabel(i,BinLabel.str(),1);
115  }
116 
117  init_=true;
118 
119 }
T getUntrackedParameter(std::string const &, T const &) const
std::optional< T > tryToGet() const
Definition: EventSetup.h:87
void dqmEndJob(DQMStore::IBooker &, DQMStore::IGetter &) override
Definition: RPCDaqInfo.cc:57
MonitorElement * daqDiskFractions[10]
Definition: RPCDaqInfo.h:33
std::pair< int, int > FEDRange_
Definition: RPCDaqInfo.h:35
bool init_
Definition: RPCDaqInfo.h:28
MonitorElement * DaqFraction_
Definition: RPCDaqInfo.h:30
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 beginJob() override
Definition: RPCDaqInfo.cc:24
void Fill(long long x)
~RPCDaqInfo() override
Definition: RPCDaqInfo.cc:23
RPCDaqInfo(const edm::ParameterSet &)
Definition: RPCDaqInfo.cc:11
void setCurrentFolder(std::string const &fullpath)
Definition: DQMStore.cc:268
std::vector< int > m_fed_in
Definition: RunInfo.h:26
MonitorElement * book2D(Args &&...args)
Definition: DQMStore.h:109
void myBooker(DQMStore::IBooker &)
Definition: RPCDaqInfo.cc:60
void dqmEndLuminosityBlock(DQMStore::IBooker &, DQMStore::IGetter &, edm::LuminosityBlock const &, edm::EventSetup const &) override
Definition: RPCDaqInfo.cc:25
MonitorElement * daqWheelFractions[5]
Definition: RPCDaqInfo.h:32
MonitorElement * DaqMap_
Definition: RPCDaqInfo.h:31
MonitorElement * bookFloat(Args &&...args)
Definition: DQMStore.h:105
int numberOfDisks_
Definition: RPCDaqInfo.h:37
int NumberOfFeds_
Definition: RPCDaqInfo.h:37