CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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 
28 
29  if(!init_){this->myBooker(ibooker);}
30 
31  if(0 != iSetup.find( recordKey ) ) {
32 
33  //get fed summary information
35  iSetup.get<RunInfoRcd>().get(sumFED);
36  std::vector<int> FedsInIds= sumFED->m_fed_in;
37 
38  int FedCount=0;
39 
40  //loop on all active feds
41  for(unsigned int fedItr=0;fedItr<FedsInIds.size(); ++fedItr) {
42  int fedID=FedsInIds[fedItr];
43  //make sure fed id is in allowed range
44 
45  if(fedID>=FEDRange_.first && fedID<=FEDRange_.second) ++FedCount;
46  }
47 
48  //Fill active fed fraction ME
49  if(NumberOfFeds_>0) DaqFraction_->Fill( FedCount/NumberOfFeds_);
50  else DaqFraction_->Fill(-1);
51 
52  }else{
53  DaqFraction_->Fill(-1);
54  return;
55  }
56 }
57 
58 
60 
61 
63 
64  //fraction of alive FEDs
65  ibooker.setCurrentFolder("RPC/EventInfo/DAQContents");
66 
67  int limit = numberOfDisks_;
68  if(numberOfDisks_ < 2) limit = 2;
69 
70  for (int i = -1 * limit; i<= limit;i++ ){//loop on wheels and disks
71  if (i>-3 && i<3){//wheels
72  std::stringstream streams;
73  streams << "RPC_Wheel" << i;
74  daqWheelFractions[i+2] = ibooker.bookFloat(streams.str());
75  daqWheelFractions[i+2]->Fill(-1);
76  }
77 
78  if (i == 0 || i > numberOfDisks_ || i< (-1 * numberOfDisks_))continue;
79 
80  int offset = numberOfDisks_;
81  if (i>0) offset --; //used to skip case equale to zero
82 
83  std::stringstream streams;
84  streams << "RPC_Disk" << i;
85  daqDiskFractions[i+2] = ibooker.bookFloat(streams.str());
86  daqDiskFractions[i+2]->Fill(-1);
87  }
88 
89 
90  //daq summary for RPCs
91  ibooker.setCurrentFolder("RPC/EventInfo");
92 
93  DaqFraction_ = ibooker.bookFloat("DAQSummary");
94 
95  DaqMap_ = ibooker.book2D( "DAQSummaryMap","RPC DAQ Summary Map",15, -7.5, 7.5, 12, 0.5 ,12.5);
96 
97  //customize the 2d histo
98  std::stringstream BinLabel;
99  for (int i= 1 ; i<=15; i++){
100  BinLabel.str("");
101  if(i<13){
102  BinLabel<<"Sec"<<i;
103  DaqMap_->setBinLabel(i,BinLabel.str(),2);
104  }
105 
106  BinLabel.str("");
107  if(i<5)
108  BinLabel<<"Disk"<<i-5;
109  else if(i>11)
110  BinLabel<<"Disk"<<i-11;
111  else if(i==11 || i==5)
112  BinLabel.str("");
113  else
114  BinLabel<<"Wheel"<<i-8;
115 
116  DaqMap_->setBinLabel(i,BinLabel.str(),1);
117  }
118 
119  init_=true;
120 
121 }
122 
123 
124 
125 
T getUntrackedParameter(std::string const &, T const &) const
int i
Definition: DBlmapReader.cc:9
void dqmEndJob(DQMStore::IBooker &, DQMStore::IGetter &) override
Definition: RPCDaqInfo.cc:59
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)
const eventsetup::EventSetupRecord * find(const eventsetup::EventSetupRecordKey &) const
Definition: EventSetup.cc:90
void Fill(long long x)
RPCDaqInfo(const edm::ParameterSet &)
Definition: RPCDaqInfo.cc:11
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:274
void beginJob()
Definition: RPCDaqInfo.cc:24
MonitorElement * book2D(Args &&...args)
Definition: DQMStore.h:133
const T & get() const
Definition: EventSetup.h:55
void myBooker(DQMStore::IBooker &)
Definition: RPCDaqInfo.cc:62
MonitorElement * daqWheelFractions[5]
Definition: RPCDaqInfo.h:32
MonitorElement * DaqMap_
Definition: RPCDaqInfo.h:31
MonitorElement * bookFloat(Args &&...args)
Definition: DQMStore.h:109
int numberOfDisks_
Definition: RPCDaqInfo.h:37
void dqmEndLuminosityBlock(DQMStore::IBooker &, DQMStore::IGetter &, edm::LuminosityBlock const &, edm::EventSetup const &)
Definition: RPCDaqInfo.cc:25
static HCTypeTag findType(char const *iTypeName)
find a type based on the types name, if not found will return default HCTypeTag
Definition: HCTypeTag.cc:125
int NumberOfFeds_
Definition: RPCDaqInfo.h:37