CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Protected Member Functions | Private Attributes
RPCOccupancyTest Class Reference

#include <RPCOccupancyTest.h>

Inheritance diagram for RPCOccupancyTest:
RPCClient

Public Member Functions

void beginJob (std::string &)
 
void clientOperation ()
 
void getMonitorElements (std::vector< MonitorElement * > &, std::vector< RPCDetId > &, std::string &)
 
void myBooker (DQMStore::IBooker &)
 
 RPCOccupancyTest (const edm::ParameterSet &ps)
 
virtual ~RPCOccupancyTest ()
 
- Public Member Functions inherited from RPCClient
virtual ~RPCClient (void)
 

Protected Member Functions

void fillGlobalME (RPCDetId &, MonitorElement *)
 

Private Attributes

MonitorElementActive_Dead
 
MonitorElementActive_Fraction
 
MonitorElementAsyMeDisk [10]
 
MonitorElementAsyMeWheel [5]
 
MonitorElementBarrel_OccBySt
 
MonitorElementEndCap_OccByDisk
 
MonitorElementEndCap_OccByRng
 
std::string globalFolder_
 
std::vector< RPCDetIdmyDetIds_
 
std::vector< MonitorElement * > myOccupancyMe_
 
MonitorElementNormOccupDDisk [10]
 
MonitorElementNormOccupDisk [10]
 
MonitorElementNormOccupDWheel [5]
 
MonitorElementNormOccupWheel [5]
 
int numberOfDisks_
 
int numberOfRings_
 
std::string prefixDir_
 
int prescaleFactor_
 
float rpcevents_
 
float totalActive_
 
float totalStrips_
 
bool useNormalization_
 
bool useRollInfo_
 

Detailed Description

Definition at line 13 of file RPCOccupancyTest.h.

Constructor & Destructor Documentation

RPCOccupancyTest::RPCOccupancyTest ( const edm::ParameterSet ps)

Definition at line 12 of file RPCOccupancyTest.cc.

References edm::ParameterSet::getUntrackedParameter(), numberOfDisks_, numberOfRings_, prefixDir_, prescaleFactor_, AlCaHLTBitMon_QueryRunRegistry::string, useNormalization_, and useRollInfo_.

12  {
13  edm::LogVerbatim ("rpceventsummary") << "[RPCOccupancyTest]: Constructor";
14 
15  prescaleFactor_ = ps.getUntrackedParameter<int>("DiagnosticPrescale", 1);
16  numberOfDisks_ = ps.getUntrackedParameter<int>("NumberOfEndcapDisks", 4);
17  numberOfRings_ = ps.getUntrackedParameter<int>("NumberOfEndcapRings", 2);
18  useNormalization_ = ps.getUntrackedParameter<bool>("testMode", true);
19  useRollInfo_ = ps.getUntrackedParameter<bool>("useRollInfo_", false);
20 
21  std::string subsystemFolder = ps.getUntrackedParameter<std::string>("RPCFolder", "RPC");
22  std::string recHitTypeFolder= ps.getUntrackedParameter<std::string>("RecHitTypeFolder", "AllHits");
23 
24  prefixDir_ = subsystemFolder+ "/"+ recHitTypeFolder;
25 
26 }
T getUntrackedParameter(std::string const &, T const &) const
std::string prefixDir_
RPCOccupancyTest::~RPCOccupancyTest ( )
virtual

Definition at line 28 of file RPCOccupancyTest.cc.

28 {}

Member Function Documentation

void RPCOccupancyTest::beginJob ( std::string &  workingFolder)
virtual

Implements RPCClient.

Definition at line 30 of file RPCOccupancyTest.cc.

References globalFolder_, totalActive_, and totalStrips_.

30  {
31  edm::LogVerbatim ("rpceventsummary") << "[RPCOccupancyTest]: Begin job ";
32  globalFolder_ = workingFolder;
33 
34  totalStrips_ = 0.;
35  totalActive_ = 0.;
36 }
std::string globalFolder_
void RPCOccupancyTest::clientOperation ( )
virtual

Implements RPCClient.

Definition at line 52 of file RPCOccupancyTest.cc.

References Active_Dead, Active_Fraction, fillGlobalME(), i, myDetIds_, myOccupancyMe_, MonitorElement::setBinContent(), totalActive_, and totalStrips_.

52  {
53 
54  edm::LogVerbatim ("rpceventsummary") <<"[RPCOccupancyTest]: Client Operation";
55 
56  //Loop on MEs
57  for (unsigned int i = 0 ; i<myOccupancyMe_.size();i++){
59  }//End loop on MEs
60 
61  //Active Channels
62  if(Active_Fraction && totalStrips_!=0.){
64  }
65  if(Active_Dead){
68  }
69 
70 }
int i
Definition: DBlmapReader.cc:9
void setBinContent(int binx, double content)
set content of bin (1-D)
MonitorElement * Active_Fraction
std::vector< RPCDetId > myDetIds_
void fillGlobalME(RPCDetId &, MonitorElement *)
MonitorElement * Active_Dead
std::vector< MonitorElement * > myOccupancyMe_
void RPCOccupancyTest::fillGlobalME ( RPCDetId detId,
MonitorElement myMe 
)
protected

Definition at line 168 of file RPCOccupancyTest.cc.

References AsyMeDisk, AsyMeWheel, Barrel_OccBySt, rpcdqm::utils::detId2RollNr(), EndCap_OccByRng, MonitorElement::Fill(), HcalObjRepresent::Fill(), MonitorElement::getBinContent(), MonitorElement::getEntries(), MonitorElement::getNbinsX(), NormOccupDDisk, NormOccupDisk, NormOccupDWheel, NormOccupWheel, NULL, numberOfDisks_, numberOfRings_, RPCDetId::region(), RPCDetId::ring(), RPCDetId::roll(), rpcevents_, RPCDetId::sector(), RPCGeomServ::segment(), MonitorElement::setBinContent(), RPCDetId::station(), totalActive_, totalStrips_, useNormalization_, and cuy::yBin.

Referenced by clientOperation().

168  {
169 
170 
171 if (!myMe) return;
172 
173  MonitorElement * AsyMe=NULL; //Left Right Asymetry
174  MonitorElement * NormOccup=NULL;
175  MonitorElement * NormOccupD=NULL;
176 
177  if(detId.region() ==0){
178  AsyMe= AsyMeWheel[detId.ring()+2];
179  if(useNormalization_){
180  NormOccup=NormOccupWheel[detId.ring()+2];
181  NormOccupD=NormOccupDWheel[detId.ring()+2];
182  }
183 
184  }else{
185 
186  if( -detId.station() + numberOfDisks_ >= 0 ){
187 
188  if(detId.region()<0){
189  AsyMe= AsyMeDisk[-detId.station() + numberOfDisks_];
190  if(useNormalization_){
191  NormOccup=NormOccupDisk[-detId.station() + numberOfDisks_];
192  NormOccupD=NormOccupDDisk[-detId.station() + numberOfDisks_];
193  }
194  }else{
195  AsyMe= AsyMeDisk[detId.station() + numberOfDisks_-1];
196  if(useNormalization_){
197  NormOccup=NormOccupDisk[detId.station() + numberOfDisks_-1];
198  NormOccupD=NormOccupDDisk[detId.station() + numberOfDisks_-1];
199  }
200  }
201  }
202  }
203 
204 
205  int xBin,yBin;
206  if(detId.region()==0){//Barrel
207  xBin= detId.sector();
208  rpcdqm::utils rollNumber;
209  yBin = rollNumber.detId2RollNr(detId);
210  }else{//Endcap
211  //get segment number
212  RPCGeomServ RPCServ(detId);
213  xBin = RPCServ.segment();
214  (numberOfRings_ == 3 ? yBin= detId.ring()*3-detId.roll()+1 : yBin= (detId.ring()-1)*3-detId.roll()+1);
215  }
216 
217 
218  int stripInRoll=myMe->getNbinsX();
219  totalStrips_ += (float)stripInRoll;
220  float FOccupancy=0;
221  float BOccupancy=0;
222 
223  float totEnt = myMe->getEntries();
224  for(int strip = 1 ; strip<=stripInRoll; strip++){
225  float stripEntries = myMe->getBinContent(strip);
226  if(stripEntries > 0) {totalActive_++;}
227  if(strip<=stripInRoll/2) {FOccupancy+=myMe->getBinContent(strip);}
228  else {BOccupancy+=myMe->getBinContent(strip);}
229  }
230 
231 
232  float asym = 0;
233  if(totEnt != 0 ) asym = fabs((FOccupancy - BOccupancy )/totEnt);
234 
235  if(AsyMe) AsyMe->setBinContent(xBin,yBin,asym);
236 
237 
238 
239  float normoccup = 1;
240  if(rpcevents_ != 0){ normoccup = (totEnt/rpcevents_);}
241 
242  if(useNormalization_){
243  if(NormOccup) NormOccup->setBinContent(xBin,yBin, normoccup);
244  if(NormOccupD) NormOccupD->Fill(normoccup);
245  }
246 
247 
248  if(detId.region()==0) {
249  if(Barrel_OccBySt)Barrel_OccBySt -> Fill(detId.station(), normoccup);
250  }else if(detId.region()==1) {
251  if(detId.ring()==3) {
252  EndCap_OccByRng -> Fill(1, normoccup);
253  } else {
254  EndCap_OccByRng -> Fill(2, normoccup);
255  }
256  } else {
257  if(detId.ring()==3) {
258  EndCap_OccByRng -> Fill(4, normoccup);
259  }else {
260  EndCap_OccByRng -> Fill(3, normoccup);
261  }
262  }
263 
264 }
void setBinContent(int binx, double content)
set content of bin (1-D)
MonitorElement * AsyMeWheel[5]
tuple yBin
Definition: cuy.py:891
MonitorElement * NormOccupDDisk[10]
MonitorElement * EndCap_OccByRng
#define NULL
Definition: scimark2.h:8
double getEntries(void) const
get # of entries
void Fill(long long x)
MonitorElement * NormOccupDWheel[5]
MonitorElement * Barrel_OccBySt
int roll() const
Definition: RPCDetId.h:120
MonitorElement * NormOccupWheel[5]
void Fill(HcalDetId &id, double val, std::vector< TH2F > &depth)
int ring() const
Definition: RPCDetId.h:72
MonitorElement * AsyMeDisk[10]
int detId2RollNr(const RPCDetId &_id)
Definition: utils.h:18
int sector() const
Sector id: the group of chambers at same phi (and increasing r)
Definition: RPCDetId.h:102
double getBinContent(int binx) const
get content of bin (1-D)
int getNbinsX(void) const
get # of bins in X-axis
MonitorElement * NormOccupDisk[10]
int region() const
Region id: 0 for Barrel, +/-1 For +/- Endcap.
Definition: RPCDetId.h:63
int station() const
Definition: RPCDetId.h:96
void RPCOccupancyTest::getMonitorElements ( std::vector< MonitorElement * > &  meVector,
std::vector< RPCDetId > &  detIdVector,
std::string &  clientHistoName 
)
virtual

Implements RPCClient.

Definition at line 39 of file RPCOccupancyTest.cc.

References i, myDetIds_, myOccupancyMe_, and AlCaHLTBitMon_QueryRunRegistry::string.

39  {
40  //Get NumberOfDigi ME for each roll
41  for(unsigned int i = 0 ; i<meVector.size(); i++){
42 
43  std::string meName = meVector[i]->getName();
44 
45  if(meName.find(clientHistoName) != std::string::npos){
46  myOccupancyMe_.push_back(meVector[i]);
47  myDetIds_.push_back(detIdVector[i]);
48  }
49  }
50 }
int i
Definition: DBlmapReader.cc:9
std::vector< RPCDetId > myDetIds_
std::vector< MonitorElement * > myOccupancyMe_
void RPCOccupancyTest::myBooker ( DQMStore::IBooker ibooker)
virtual

Implements RPCClient.

Definition at line 73 of file RPCOccupancyTest.cc.

References Active_Dead, Active_Fraction, AsyMeDisk, AsyMeWheel, Barrel_OccBySt, DQMStore::IBooker::book1D(), DQMStore::IBooker::book2D(), ztail::d, EndCap_OccByRng, globalFolder_, rpcdqm::utils::labelXAxisSector(), rpcdqm::utils::labelXAxisSegment(), rpcdqm::utils::labelYAxisRing(), rpcdqm::utils::labelYAxisRoll(), NormOccupDDisk, NormOccupDisk, NormOccupDWheel, NormOccupWheel, numberOfDisks_, numberOfRings_, hltrates_dqm_sourceclient-live_cfg::offset, DQMStore::IBooker::setCurrentFolder(), useNormalization_, useRollInfo_, and w.

73  {
74 
76 
77  std::stringstream histoName;
78  rpcdqm::utils rpcUtils;
79 
80  histoName.str("");
81  histoName<<"RPC_Active_Channel_Fractions";
82  Active_Fraction = ibooker.book1D(histoName.str().c_str(), histoName.str().c_str(), 1, 0.5, 1.5);
83  Active_Fraction -> setBinLabel(1, "Active Fraction", 1);
84 
85  histoName.str("");
86  histoName<<"RPC_Active_Inactive_Strips";
87  Active_Dead = ibooker.book1D(histoName.str().c_str(), histoName.str().c_str(), 2, 0.5, 2.5);
88  Active_Dead -> setBinLabel(1, "Active Strips", 1);
89  Active_Dead -> setBinLabel(2, "Inactive Strips", 1);
90 
91  histoName.str("");
92  histoName<<"Barrel_OccupancyByStations_Normalized";
93  Barrel_OccBySt = ibooker.book1D(histoName.str().c_str(), histoName.str().c_str(), 4, 0.5, 4.5);
94  Barrel_OccBySt -> setBinLabel(1, "St1", 1);
95  Barrel_OccBySt -> setBinLabel(2, "St2", 1);
96  Barrel_OccBySt -> setBinLabel(3, "St3", 1);
97  Barrel_OccBySt -> setBinLabel(4, "St4", 1);
98 
99 
100  histoName.str("");
101  histoName<<"EndCap_OccupancyByRings_Normalized";
102  EndCap_OccByRng = ibooker.book1D(histoName.str().c_str(), histoName.str().c_str(), 4, 0.5, 4.5);
103  EndCap_OccByRng -> setBinLabel(1, "E+/R3", 1);
104  EndCap_OccByRng -> setBinLabel(2, "E+/R2", 1);
105  EndCap_OccByRng -> setBinLabel(3, "E-/R2", 1);
106  EndCap_OccByRng -> setBinLabel(4, "E-/R3", 1);
107 
108  for (int w = -2; w<=2; w++ ){//loop on wheels
109 
110  histoName.str("");
111  histoName<<"AsymmetryLeftRight_Roll_vs_Sector_Wheel"<<w;
112 
113  AsyMeWheel[w+2] = ibooker.book2D(histoName.str().c_str(), histoName.str().c_str(), 12, 0.5, 12.5, 21, 0.5, 21.5);
114 
115  rpcUtils.labelXAxisSector(AsyMeWheel[w+2]);
116  rpcUtils.labelYAxisRoll(AsyMeWheel[w+2], 0, w, useRollInfo_);
117 
118 
119  if(useNormalization_){
120 
121  histoName.str("");
122  histoName<<"OccupancyNormByEvents_Wheel"<<w;
123  NormOccupWheel[w+2] = ibooker.book2D(histoName.str().c_str(), histoName.str().c_str(), 12, 0.5, 12.5, 21, 0.5, 21.5);
124 
125  rpcUtils.labelXAxisSector( NormOccupWheel[w+2]);
126  rpcUtils.labelYAxisRoll( NormOccupWheel[w+2], 0, w, useRollInfo_);
127 
128  histoName.str("");
129  histoName<<"OccupancyNormByEvents_Distribution_Wheel"<<w;
130 
131  NormOccupDWheel[w+2] = ibooker.book1D(histoName.str().c_str(), histoName.str().c_str(), 100, 0.0, 0.205);
132  }
133  }//end Barrel
134 
135  for(int d = -numberOfDisks_; d<=numberOfDisks_; d++ ){
136 
137  if (d == 0)continue;
138 
139  int offset = numberOfDisks_;
140  if (d>0) offset --; //used to skip case equale to zero
141 
142  histoName.str("");
143  histoName<<"AsymmetryLeftRight_Ring_vs_Segment_Disk"<<d;
144  AsyMeDisk[d+offset] = ibooker.book2D(histoName.str().c_str(), histoName.str().c_str(), 36, 0.5, 36.5, 3*numberOfRings_, 0.5,3*numberOfRings_+ 0.5);
145 
146  rpcUtils.labelXAxisSegment(AsyMeDisk[d+offset]);
147  rpcUtils.labelYAxisRing(AsyMeDisk[d+offset], numberOfRings_, useRollInfo_);
148 
149 
150 
151  if(useNormalization_){
152 
153  histoName.str("");
154  histoName<<"OccupancyNormByEvents_Disk"<<d;
155  NormOccupDisk[d+offset] = ibooker.book2D(histoName.str().c_str(), histoName.str().c_str(), 36, 0.5, 36.5, 3*numberOfRings_, 0.5,3*numberOfRings_+ 0.5);
156 
157  rpcUtils.labelXAxisSegment(NormOccupDisk[d+offset]);
159 
160  histoName.str("");
161  histoName<<"OccupancyNormByEvents_Distribution_Disk"<<d;
162  NormOccupDDisk[d+offset] = ibooker.book1D(histoName.str().c_str(), histoName.str().c_str(), 100, 0.0, 0.205);
163  }
164  }//End loop on Endcap
165 }
MonitorElement * AsyMeWheel[5]
const double w
Definition: UKUtility.cc:23
MonitorElement * NormOccupDDisk[10]
void labelXAxisSegment(MonitorElement *myMe)
Definition: utils.h:250
MonitorElement * EndCap_OccByRng
void labelYAxisRoll(MonitorElement *myMe, int region, int ring, bool useRollInfo)
Definition: utils.h:268
MonitorElement * Active_Fraction
tuple d
Definition: ztail.py:151
MonitorElement * NormOccupDWheel[5]
MonitorElement * Barrel_OccBySt
void labelYAxisRing(MonitorElement *myMe, int numberOfRings, bool useRollInfo)
Definition: utils.h:295
MonitorElement * NormOccupWheel[5]
MonitorElement * book1D(Args &&...args)
Definition: DQMStore.h:115
MonitorElement * AsyMeDisk[10]
std::string globalFolder_
void labelXAxisSector(MonitorElement *myMe)
Definition: utils.h:236
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:276
MonitorElement * book2D(Args &&...args)
Definition: DQMStore.h:133
MonitorElement * Active_Dead
MonitorElement * NormOccupDisk[10]

Member Data Documentation

MonitorElement* RPCOccupancyTest::Active_Dead
private

Definition at line 45 of file RPCOccupancyTest.h.

Referenced by clientOperation(), and myBooker().

MonitorElement* RPCOccupancyTest::Active_Fraction
private

Definition at line 44 of file RPCOccupancyTest.h.

Referenced by clientOperation(), and myBooker().

MonitorElement* RPCOccupancyTest::AsyMeDisk[10]
private

Definition at line 51 of file RPCOccupancyTest.h.

Referenced by fillGlobalME(), and myBooker().

MonitorElement* RPCOccupancyTest::AsyMeWheel[5]
private

Definition at line 47 of file RPCOccupancyTest.h.

Referenced by fillGlobalME(), and myBooker().

MonitorElement* RPCOccupancyTest::Barrel_OccBySt
private

Definition at line 55 of file RPCOccupancyTest.h.

Referenced by fillGlobalME(), and myBooker().

MonitorElement* RPCOccupancyTest::EndCap_OccByDisk
private

Definition at line 57 of file RPCOccupancyTest.h.

MonitorElement* RPCOccupancyTest::EndCap_OccByRng
private

Definition at line 56 of file RPCOccupancyTest.h.

Referenced by fillGlobalME(), and myBooker().

std::string RPCOccupancyTest::globalFolder_
private

Definition at line 31 of file RPCOccupancyTest.h.

Referenced by beginJob(), and myBooker().

std::vector<RPCDetId> RPCOccupancyTest::myDetIds_
private

Definition at line 35 of file RPCOccupancyTest.h.

Referenced by clientOperation(), and getMonitorElements().

std::vector<MonitorElement *> RPCOccupancyTest::myOccupancyMe_
private

Definition at line 34 of file RPCOccupancyTest.h.

Referenced by clientOperation(), and getMonitorElements().

MonitorElement* RPCOccupancyTest::NormOccupDDisk[10]
private

Definition at line 53 of file RPCOccupancyTest.h.

Referenced by fillGlobalME(), and myBooker().

MonitorElement* RPCOccupancyTest::NormOccupDisk[10]
private

Definition at line 52 of file RPCOccupancyTest.h.

Referenced by fillGlobalME(), and myBooker().

MonitorElement* RPCOccupancyTest::NormOccupDWheel[5]
private

Definition at line 49 of file RPCOccupancyTest.h.

Referenced by fillGlobalME(), and myBooker().

MonitorElement* RPCOccupancyTest::NormOccupWheel[5]
private

Definition at line 48 of file RPCOccupancyTest.h.

Referenced by fillGlobalME(), and myBooker().

int RPCOccupancyTest::numberOfDisks_
private

Definition at line 40 of file RPCOccupancyTest.h.

Referenced by fillGlobalME(), myBooker(), and RPCOccupancyTest().

int RPCOccupancyTest::numberOfRings_
private

Definition at line 40 of file RPCOccupancyTest.h.

Referenced by fillGlobalME(), myBooker(), and RPCOccupancyTest().

std::string RPCOccupancyTest::prefixDir_
private

Definition at line 31 of file RPCOccupancyTest.h.

Referenced by RPCOccupancyTest().

int RPCOccupancyTest::prescaleFactor_
private

Definition at line 36 of file RPCOccupancyTest.h.

Referenced by RPCOccupancyTest().

float RPCOccupancyTest::rpcevents_
private

Definition at line 42 of file RPCOccupancyTest.h.

Referenced by fillGlobalME().

float RPCOccupancyTest::totalActive_
private

Definition at line 38 of file RPCOccupancyTest.h.

Referenced by beginJob(), clientOperation(), and fillGlobalME().

float RPCOccupancyTest::totalStrips_
private

Definition at line 38 of file RPCOccupancyTest.h.

Referenced by beginJob(), clientOperation(), and fillGlobalME().

bool RPCOccupancyTest::useNormalization_
private

Definition at line 32 of file RPCOccupancyTest.h.

Referenced by fillGlobalME(), myBooker(), and RPCOccupancyTest().

bool RPCOccupancyTest::useRollInfo_
private

Definition at line 33 of file RPCOccupancyTest.h.

Referenced by myBooker(), and RPCOccupancyTest().