CMS 3D CMS Logo

RPCDataCertification.cc
Go to the documentation of this file.
2 
7 
10 //CondFormats
13 
14 
16 
17  numberOfDisks_ = ps.getUntrackedParameter<int>("NumberOfEndcapDisks", 4);
18  FEDRange_.first = ps.getUntrackedParameter<unsigned int>("MinimumRPCFEDId", 790);
19  FEDRange_.second = ps.getUntrackedParameter<unsigned int>("MaximumRPCFEDId", 792);
20  NumberOfFeds_ =FEDRange_.second - FEDRange_.first +1;
21  offlineDQM_ = ps.getUntrackedParameter<bool> ("OfflineDQM",true);
22 
23  init_= false;
24  defaultValue_=1.;
25 }
26 
28 
30 
32  edm::LuminosityBlock const & LB, edm::EventSetup const& setup){
33 
34  if(!init_){
35 
36  this->checkFED(setup);
37 
38  if(!offlineDQM_){ this->myBooker(ibooker); }
39  }
40 }
41 
43 
44  if(offlineDQM_){ this->myBooker(ibooker); }
45 
46 }
47 
48 
50  double defaultValue = 1.;
51 
52  if(auto runInfoRec = setup.tryToGet<RunInfoRcd>()) {
53  defaultValue = -1;
54  //get fed summary information
56  runInfoRec->get(sumFED);
57  std::vector<int> FedsInIds= sumFED->m_fed_in;
58  unsigned int f = 0;
59  bool flag = false;
60  while(!flag && f < FedsInIds.size()) {
61  int fedID=FedsInIds[f];
62  //make sure fed id is in allowed range
63  if(fedID>=FEDRange_.first && fedID<=FEDRange_.second) {
64  defaultValue = 1;
65  flag = true;
66  }
67  f++;
68  }
69  }
70 
71  defaultValue_ = defaultValue;
72 
73  init_= true;
74 
75 }
76 
77 
79 
80  ibooker.setCurrentFolder("RPC/EventInfo");
81  // global fraction
82  totalCertFraction = ibooker.bookFloat("CertificationSummary");
84 
85  CertMap_ = ibooker.book2D( "CertificationSummaryMap","RPC Certification Summary Map",15, -7.5, 7.5, 12, 0.5 ,12.5);
86 
87  //customize the 2d histo
88  std::stringstream BinLabel;
89  for (int i= 1 ; i<13; i++){
90  BinLabel.str("");
91  BinLabel<<"Sec"<<i;
92  CertMap_->setBinLabel(i,BinLabel.str(),2);
93  }
94 
95  for(int i = -2 ; i <=2; i++){
96  BinLabel.str("");
97  BinLabel<<"Wheel"<<i;
98  CertMap_->setBinLabel(i+8,BinLabel.str(),1);
99  }
100 
101 
102  for(int i = 1; i<=numberOfDisks_; i++){
103  BinLabel.str("");
104  BinLabel<<"Disk"<<i;
105  CertMap_->setBinLabel((i+11),BinLabel.str(),1);
106  BinLabel.str("");
107  BinLabel<<"Disk"<<-i;
108  CertMap_->setBinLabel((-i+5),BinLabel.str(),1);
109  }
110  //fill the histo with "1" --- just for the moment
111  for(int i=1; i<=15; i++){
112  for (int j=1; j<=12; j++ ){
113  if(i==5 || i==11 || (j>6 && (i<6 || i>10)))
114  CertMap_->setBinContent(i,j,-1);//bins that not correspond to subdetector parts
115  else
117  }
118  }
119 
120 
121  if(numberOfDisks_ < 4){
122  for (int j=1; j<=12; j++ ){
123  CertMap_->setBinContent(1,j,-1);//bins that not correspond to subdetector parts
124  CertMap_->setBinContent(15,j,-1);
125  }
126  }
127  // book the ME
128  ibooker.setCurrentFolder("RPC/EventInfo/CertificationContents");
129 
130  int limit = numberOfDisks_;
131  if(numberOfDisks_ < 2) limit = 2;
132 
133 
134  for (int i = -1 * limit; i<= limit;i++ ){//loop on wheels and disks
135  if (i>-3 && i<3){//wheels
136  std::stringstream streams;
137  streams << "RPC_Wheel" << i;
138  certWheelFractions[i+2] = ibooker.bookFloat(streams.str());
140  }
141 
142  if (i == 0 || i > numberOfDisks_ || i< (-1 * numberOfDisks_))continue;
143 
144  int offset = numberOfDisks_;
145  if (i>0) offset --; //used to skip case equale to zero
146  std::stringstream streams;
147  streams << "RPC_Disk" << i;
148  certDiskFractions[i+2] = ibooker.bookFloat(streams.str());
150  }
151 }
T getUntrackedParameter(std::string const &, T const &) const
std::optional< T > tryToGet() const
Definition: EventSetup.h:92
void myBooker(DQMStore::IBooker &)
void setBinContent(int binx, double content)
set content of bin (1-D)
MonitorElement * certWheelFractions[5]
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)
def setup(process, global_tag, zero_tesla=False)
Definition: GeneralSetup.py:2
~RPCDataCertification() override
Destructor.
void Fill(long long x)
MonitorElement * CertMap_
MonitorElement * totalCertFraction
std::pair< int, int > FEDRange_
RPCDataCertification(const edm::ParameterSet &pset)
Constructor.
void setCurrentFolder(std::string const &fullpath)
Definition: DQMStore.cc:268
std::vector< int > m_fed_in
Definition: RunInfo.h:26
double f[11][100]
MonitorElement * certDiskFractions[10]
MonitorElement * book2D(Args &&...args)
Definition: DQMStore.h:109
void checkFED(edm::EventSetup const &)
void dqmEndLuminosityBlock(DQMStore::IBooker &, DQMStore::IGetter &, edm::LuminosityBlock const &, edm::EventSetup const &) override
MonitorElement * bookFloat(Args &&...args)
Definition: DQMStore.h:105
void dqmEndJob(DQMStore::IBooker &, DQMStore::IGetter &) override