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

MonitorElementAsyMeDDisk [10]
 
MonitorElementAsyMeDisk [10]
 
MonitorElementAsyMeDWheel [5]
 
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_
 
bool testMode_
 
bool useRollInfo_
 

Detailed Description

Definition at line 15 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, testMode_, 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  testMode_ = ps.getUntrackedParameter<bool>("testMode", false);
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_.

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

Implements RPCClient.

Definition at line 49 of file RPCOccupancyTest.cc.

References fillGlobalME(), i, myDetIds_, and myOccupancyMe_.

49  {
50 
51  edm::LogVerbatim ("rpceventsummary") <<"[RPCOccupancyTest]: Client Operation";
52 
53  //Loop on MEs
54  for (unsigned int i = 0 ; i<myOccupancyMe_.size();i++){
56  }//End loop on MEs
57 }
int i
Definition: DBlmapReader.cc:9
std::vector< RPCDetId > myDetIds_
void fillGlobalME(RPCDetId &, MonitorElement *)
std::vector< MonitorElement * > myOccupancyMe_
void RPCOccupancyTest::fillGlobalME ( RPCDetId detId,
MonitorElement myMe 
)
protected

Definition at line 154 of file RPCOccupancyTest.cc.

References AsyMeDDisk, AsyMeDisk, AsyMeDWheel, 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(), testMode_, and cuy::yBin.

Referenced by clientOperation().

154  {
155 
156 
157 if (!myMe) return;
158 
159  MonitorElement * AsyMe=NULL; //Left Right Asymetry
160  MonitorElement * AsyMeD=NULL;
161  MonitorElement * NormOccup=NULL;
162  MonitorElement * NormOccupD=NULL;
163 
164  if(detId.region() ==0){
165  AsyMe= AsyMeWheel[detId.ring()+2];
166  if(testMode_){
167  NormOccup=NormOccupWheel[detId.ring()+2];
168  AsyMeD= AsyMeDWheel[detId.ring()+2];
169  NormOccupD=NormOccupDWheel[detId.ring()+2];
170  }
171 
172  }else{
173 
174  if( -detId.station() + numberOfDisks_ >= 0 ){
175 
176  if(detId.region()<0){
177  AsyMe= AsyMeDisk[-detId.station() + numberOfDisks_];
178  if(testMode_){
179  NormOccup=NormOccupDisk[-detId.station() + numberOfDisks_];
180  AsyMeD= AsyMeDDisk[-detId.station() + numberOfDisks_];
181  NormOccupD=NormOccupDDisk[-detId.station() + numberOfDisks_];
182  }
183  }else{
184  AsyMe= AsyMeDisk[detId.station() + numberOfDisks_-1];
185  if(testMode_){
186  NormOccup=NormOccupDisk[detId.station() + numberOfDisks_-1];
187  AsyMeD= AsyMeDDisk[detId.station() + numberOfDisks_-1];
188  NormOccupD=NormOccupDDisk[detId.station() + numberOfDisks_-1];
189  }
190  }
191  }
192  }
193 
194 
195  int xBin,yBin;
196  if(detId.region()==0){//Barrel
197  xBin= detId.sector();
198  rpcdqm::utils rollNumber;
199  yBin = rollNumber.detId2RollNr(detId);
200  }else{//Endcap
201  //get segment number
202  RPCGeomServ RPCServ(detId);
203  xBin = RPCServ.segment();
204  (numberOfRings_ == 3 ? yBin= detId.ring()*3-detId.roll()+1 : yBin= (detId.ring()-1)*3-detId.roll()+1);
205  }
206 
207 
208  int stripInRoll=myMe->getNbinsX();
209  float FOccupancy=0;
210  float BOccupancy=0;
211 
212  float totEnt = myMe->getEntries();
213  for(int strip = 1 ; strip<=stripInRoll; strip++){
214  if(strip<=stripInRoll/2) FOccupancy+=myMe->getBinContent(strip);
215  else BOccupancy+=myMe->getBinContent(strip);
216  }
217 
218 
219  float asym = 0;
220  if(totEnt != 0 ) asym = fabs((FOccupancy - BOccupancy )/totEnt);
221 
222  if(AsyMe) AsyMe->setBinContent(xBin,yBin,asym);
223 
224 
225 
226  float normoccup = 1;
227  if(rpcevents_ != 0) normoccup = (totEnt/rpcevents_);
228 
229  if(testMode_){
230  if(NormOccup) NormOccup->setBinContent(xBin,yBin, normoccup);
231  if(AsyMeD) AsyMeD->Fill(asym);
232  if(NormOccupD) NormOccupD->Fill(normoccup);
233  }
234 
235 
236  if(detId.region()==0) {
237  if(Barrel_OccBySt)Barrel_OccBySt -> Fill(detId.station(), normoccup);
238  }else if(detId.region()==1) {
239  if(detId.ring()==3) {
240  EndCap_OccByRng -> Fill(1, normoccup);
241  } else {
242  EndCap_OccByRng -> Fill(2, normoccup);
243  }
244  } else {
245  if(detId.ring()==3) {
246  EndCap_OccByRng -> Fill(4, normoccup);
247  }else {
248  EndCap_OccByRng -> Fill(3, normoccup);
249  }
250  }
251 
252 }
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
MonitorElement * AsyMeDDisk[10]
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]
MonitorElement * AsyMeDWheel[5]
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 36 of file RPCOccupancyTest.cc.

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

36  {
37  //Get NumberOfDigi ME for each roll
38  for(unsigned int i = 0 ; i<meVector.size(); i++){
39 
40  std::string meName = meVector[i]->getName();
41 
42  if(meName.find(clientHistoName) != std::string::npos){
43  myOccupancyMe_.push_back(meVector[i]);
44  myDetIds_.push_back(detIdVector[i]);
45  }
46  }
47 }
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 60 of file RPCOccupancyTest.cc.

References AsyMeDDisk, AsyMeDisk, AsyMeDWheel, AsyMeWheel, Barrel_OccBySt, DQMStore::IBooker::book1D(), DQMStore::IBooker::book2D(), ztail::d, EndCap_OccByRng, globalFolder_, hltbtagharvestinganalyzer_cfi::histoName, rpcdqm::utils::labelXAxisSector(), rpcdqm::utils::labelXAxisSegment(), rpcdqm::utils::labelYAxisRing(), rpcdqm::utils::labelYAxisRoll(), NormOccupDDisk, NormOccupDisk, NormOccupDWheel, NormOccupWheel, numberOfDisks_, numberOfRings_, HLT_25ns14e33_v1_cff::offset, DQMStore::IBooker::setCurrentFolder(), testMode_, useRollInfo_, and w.

60  {
61 
63 
64  std::stringstream histoName;
65  rpcdqm::utils rpcUtils;
66 
67  histoName.str("");
68  histoName<<"Barrel_OccupancyByStations_Normalized";
69 
70  Barrel_OccBySt = ibooker.book1D(histoName.str().c_str(), histoName.str().c_str(), 4, 0.5, 4.5);
71  Barrel_OccBySt -> setBinLabel(1, "St1", 1);
72  Barrel_OccBySt -> setBinLabel(2, "St2", 1);
73  Barrel_OccBySt -> setBinLabel(3, "St3", 1);
74  Barrel_OccBySt -> setBinLabel(4, "St4", 1);
75 
76 
77  histoName.str("");
78  histoName<<"EndCap_OccupancyByRings_Normalized";
79  EndCap_OccByRng = ibooker.book1D(histoName.str().c_str(), histoName.str().c_str(), 4, 0.5, 4.5);
80  EndCap_OccByRng -> setBinLabel(1, "E+/R3", 1);
81  EndCap_OccByRng -> setBinLabel(2, "E+/R2", 1);
82  EndCap_OccByRng -> setBinLabel(3, "E-/R2", 1);
83  EndCap_OccByRng -> setBinLabel(4, "E-/R3", 1);
84 
85  for (int w = -2; w<=2; w++ ){//loop on wheels
86 
87  histoName.str("");
88  histoName<<"AsymmetryLeftRight_Roll_vs_Sector_Wheel"<<w;
89 
90  AsyMeWheel[w+2] = ibooker.book2D(histoName.str().c_str(), histoName.str().c_str(), 12, 0.5, 12.5, 21, 0.5, 21.5);
91 
92  rpcUtils.labelXAxisSector(AsyMeWheel[w+2]);
93  rpcUtils.labelYAxisRoll(AsyMeWheel[w+2], 0, w, useRollInfo_);
94 
95 
96  if(testMode_){
97 
98  histoName.str("");
99  histoName<<"OccupancyNormByEvents_Wheel"<<w;
100  NormOccupWheel[w+2] = ibooker.book2D(histoName.str().c_str(), histoName.str().c_str(), 12, 0.5, 12.5, 21, 0.5, 21.5);
101 
102  rpcUtils.labelXAxisSector( NormOccupWheel[w+2]);
103  rpcUtils.labelYAxisRoll( NormOccupWheel[w+2], 0, w, useRollInfo_);
104 
105 
106  histoName.str("");
107  histoName<<"AsymmetryLeftRight_Distribution_Wheel"<<w;
108  AsyMeDWheel[w+2] = ibooker.book1D(histoName.str().c_str(), histoName.str().c_str(), 20, -0.1, 1.1);
109 
110  histoName.str("");
111  histoName<<"OccupancyNormByEvents_Distribution_Wheel"<<w;
112 
113  NormOccupDWheel[w+2] = ibooker.book1D(histoName.str().c_str(), histoName.str().c_str(), 100, 0.0, 0.205);
114  }
115  }//end Barrel
116 
117  for(int d = -numberOfDisks_; d<=numberOfDisks_; d++ ){
118 
119  if (d == 0)continue;
120 
121  int offset = numberOfDisks_;
122  if (d>0) offset --; //used to skip case equale to zero
123 
124  histoName.str("");
125  histoName<<"AsymmetryLeftRight_Ring_vs_Segment_Disk"<<d;
126  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);
127 
128  rpcUtils.labelXAxisSegment(AsyMeDisk[d+offset]);
129  rpcUtils.labelYAxisRing(AsyMeDisk[d+offset], numberOfRings_, useRollInfo_);
130 
131 
132 
133  if(testMode_){
134 
135  histoName.str("");
136  histoName<<"OccupancyNormByEvents_Disk"<<d;
137  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);
138 
139  rpcUtils.labelXAxisSegment(NormOccupDisk[d+offset]);
141 
142  histoName.str("");
143  histoName<<"AsymmetryLeftRight_Distribution_Disk"<<d;
144  AsyMeDDisk[d+offset] = ibooker.book1D(histoName.str().c_str(), histoName.str().c_str(), 20, -0.1, 1.1);
145 
146  histoName.str("");
147  histoName<<"OccupancyNormByEvents_Distribution_Disk"<<d;
148  NormOccupDDisk[d+offset] = ibooker.book1D(histoName.str().c_str(), histoName.str().c_str(), 100, 0.0, 0.205);
149  }
150  }//End loop on Endcap
151 }
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
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:274
MonitorElement * book2D(Args &&...args)
Definition: DQMStore.h:133
MonitorElement * AsyMeDDisk[10]
MonitorElement * NormOccupDisk[10]
MonitorElement * AsyMeDWheel[5]

Member Data Documentation

MonitorElement* RPCOccupancyTest::AsyMeDDisk[10]
private

Definition at line 53 of file RPCOccupancyTest.h.

Referenced by fillGlobalME(), and myBooker().

MonitorElement* RPCOccupancyTest::AsyMeDisk[10]
private

Definition at line 50 of file RPCOccupancyTest.h.

Referenced by fillGlobalME(), and myBooker().

MonitorElement* RPCOccupancyTest::AsyMeDWheel[5]
private

Definition at line 47 of file RPCOccupancyTest.h.

Referenced by fillGlobalME(), and myBooker().

MonitorElement* RPCOccupancyTest::AsyMeWheel[5]
private

Definition at line 44 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 33 of file RPCOccupancyTest.h.

Referenced by beginJob(), and myBooker().

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

Definition at line 37 of file RPCOccupancyTest.h.

Referenced by clientOperation(), and getMonitorElements().

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

Definition at line 36 of file RPCOccupancyTest.h.

Referenced by clientOperation(), and getMonitorElements().

MonitorElement* RPCOccupancyTest::NormOccupDDisk[10]
private

Definition at line 54 of file RPCOccupancyTest.h.

Referenced by fillGlobalME(), and myBooker().

MonitorElement* RPCOccupancyTest::NormOccupDisk[10]
private

Definition at line 51 of file RPCOccupancyTest.h.

Referenced by fillGlobalME(), and myBooker().

MonitorElement* RPCOccupancyTest::NormOccupDWheel[5]
private

Definition at line 48 of file RPCOccupancyTest.h.

Referenced by fillGlobalME(), and myBooker().

MonitorElement* RPCOccupancyTest::NormOccupWheel[5]
private

Definition at line 45 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 33 of file RPCOccupancyTest.h.

Referenced by RPCOccupancyTest().

int RPCOccupancyTest::prescaleFactor_
private

Definition at line 38 of file RPCOccupancyTest.h.

Referenced by RPCOccupancyTest().

float RPCOccupancyTest::rpcevents_
private

Definition at line 42 of file RPCOccupancyTest.h.

Referenced by fillGlobalME().

bool RPCOccupancyTest::testMode_
private

Definition at line 34 of file RPCOccupancyTest.h.

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

bool RPCOccupancyTest::useRollInfo_
private

Definition at line 35 of file RPCOccupancyTest.h.

Referenced by myBooker(), and RPCOccupancyTest().