test
CMS 3D CMS Logo

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

#include <RPCClusterSizeTest.h>

Inheritance diagram for RPCClusterSizeTest:
RPCClient

Public Member Functions

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

Private Types

enum  MEArraySizes { kWheels = 5, kDisks = 10 }
 

Private Member Functions

void resetMEArrays (void)
 

Private Attributes

MonitorElementCLSDDisk [kDisks]
 
MonitorElementCLSDisk [kDisks]
 
MonitorElementCLSDWheel [kWheels]
 
MonitorElementCLSWheel [kWheels]
 
std::string globalFolder_
 
MonitorElementMEANDDisk [kDisks]
 
MonitorElementMEANDisk [kDisks]
 
MonitorElementMEANDWheel [kWheels]
 
MonitorElementMEANWheel [kWheels]
 
std::vector< MonitorElement * > myClusterMe_
 
std::vector< RPCDetIdmyDetIds_
 
int numberOfDisks_
 
int numberOfRings_
 
int prescaleFactor_
 
bool testMode_
 
bool useRollInfo_
 

Detailed Description

Definition at line 8 of file RPCClusterSizeTest.h.

Member Enumeration Documentation

Enumerator
kWheels 
kDisks 

Definition at line 32 of file RPCClusterSizeTest.h.

Constructor & Destructor Documentation

RPCClusterSizeTest::RPCClusterSizeTest ( const edm::ParameterSet ps)

Constructor.

Definition at line 10 of file RPCClusterSizeTest.cc.

References edm::ParameterSet::getUntrackedParameter(), numberOfDisks_, numberOfRings_, prescaleFactor_, resetMEArrays(), testMode_, and useRollInfo_.

10  {
11  edm::LogVerbatim ("rpceventsummary") << "[RPCClusterSizeTest]: Constructor";
12 
13  prescaleFactor_ = ps.getUntrackedParameter<int>("DiagnosticPrescale", 1);
14 
15  numberOfDisks_ = ps.getUntrackedParameter<int>("NumberOfEndcapDisks", 4);
16  numberOfRings_ = ps.getUntrackedParameter<int>("NumberOfEndcapRings", 2);
17  testMode_ = ps.getUntrackedParameter<bool>("testMode", false);
18  useRollInfo_ = ps.getUntrackedParameter<bool>("useRollInfo", false);
19 
20  resetMEArrays();
21 }
T getUntrackedParameter(std::string const &, T const &) const
RPCClusterSizeTest::~RPCClusterSizeTest ( )
virtual

Destructor.

Definition at line 23 of file RPCClusterSizeTest.cc.

23 { }

Member Function Documentation

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

Implements RPCClient.

Definition at line 25 of file RPCClusterSizeTest.cc.

References globalFolder_.

25  {
26  edm::LogVerbatim ("rpceventsummary") << "[RPCClusterSizeTest]: Begin job ";
27 
28  globalFolder_ = workingFolder;
29 }
void RPCClusterSizeTest::clientOperation ( )
virtual

Implements RPCClient.

Definition at line 48 of file RPCClusterSizeTest.cc.

References CLSDDisk, CLSDisk, CLSDWheel, CLSWheel, rpcdqm::utils::detId2RollNr(), MonitorElement::Fill(), MonitorElement::getBinContent(), MonitorElement::getEntries(), MonitorElement::getMean(), i, MEANDDisk, MEANDisk, MEANDWheel, MEANWheel, myClusterMe_, myDetIds_, NULL, numberOfDisks_, numberOfRings_, RPCDetId::region(), RPCDetId::ring(), RPCDetId::roll(), RPCDetId::sector(), RPCGeomServ::segment(), RPCDetId::station(), testMode_, and cuy::yBin.

48  {
49 
50  edm::LogVerbatim ("rpceventsummary") <<"[RPCClusterSizeTest]:Client Operation";
51 
52  //check some statements and prescale Factor
53  if(myClusterMe_.size()==0 || myDetIds_.size()==0)return;
54 
55  MonitorElement * CLS = NULL; // ClusterSize in 1 bin, Roll vs Sector
56  MonitorElement * CLSD = NULL; // ClusterSize in 1 bin, Distribution
57  MonitorElement * MEAN = NULL; // Mean ClusterSize, Roll vs Sector
58  MonitorElement * MEAND = NULL; // Mean ClusterSize, Distribution
59 
60 
61  std::stringstream meName;
62  RPCDetId detId;
63  MonitorElement * myMe;
64 
65 
66  //Loop on chambers
67  for (unsigned int i = 0 ; i<myClusterMe_.size();i++){
68 
69  myMe = myClusterMe_[i];
70  if (!myMe || myMe->getEntries()==0 )continue;
71 
72 
73  detId=myDetIds_[i];
74 
75 
76  if (detId.region()==0){
77 
78  CLS = CLSWheel[detId.ring()+2];
79  MEAN = MEANWheel[detId.ring()+2];
80  if(testMode_){
81  CLSD = CLSDWheel[detId.ring()+2];
82  MEAND = MEANDWheel[detId.ring()+2];
83  }
84  }else {
85 
86  if(((detId.station() * detId.region() ) + numberOfDisks_) >= 0 ){
87 
88  if(detId.region()<0){
89  CLS=CLSDisk[(detId.station() * detId.region() ) + numberOfDisks_];
90  MEAN= MEANDisk[(detId.station() * detId.region() ) + numberOfDisks_];
91  if(testMode_){
92  CLSD = CLSDDisk[(detId.station() * detId.region() ) + numberOfDisks_];
93  MEAND= MEANDDisk[(detId.station() * detId.region() ) + numberOfDisks_];
94  }
95  }else{
96  CLS=CLSDisk[(detId.station() * detId.region() ) + numberOfDisks_ -1];
97  MEAN= MEANDisk[(detId.station() * detId.region() ) + numberOfDisks_-1];
98  if(testMode_){
99  CLSD = CLSDDisk[(detId.station() * detId.region() ) + numberOfDisks_-1];
100  MEAND= MEANDDisk[(detId.station() * detId.region() ) + numberOfDisks_-1];
101  }
102  }
103  }
104 
105  }
106 
107 
108  int xBin,yBin;
109 
110  if (detId.region()==0){//Barrel
111 
112  rpcdqm::utils rollNumber;
113  yBin = rollNumber.detId2RollNr(detId);
114  xBin = detId.sector();
115  }else {//Endcap
116 
117  //get segment number
118  RPCGeomServ RPCServ(detId);
119  xBin = RPCServ.segment();
120  (numberOfRings_ == 3 ? yBin= detId.ring()*3-detId.roll()+1 : yBin= (detId.ring()-1)*3-detId.roll()+1);
121  }
122 
123  // Normalization -> # of Entries in first Bin normalaized by total Entries
124 
125  float NormCLS = myMe->getBinContent(1)/myMe->getEntries();
126  float meanCLS = myMe->getMean();
127 
128  if (CLS) CLS -> setBinContent(xBin,yBin, NormCLS);
129  if(MEAN) MEAN -> setBinContent(xBin, yBin, meanCLS);
130 
131  if(testMode_){
132  if(MEAND) MEAND->Fill(meanCLS);
133  if(CLSD) CLSD->Fill(NormCLS);
134  }
135 
136  }//End loop on chambers
137 }
int i
Definition: DBlmapReader.cc:9
MonitorElement * MEANWheel[kWheels]
tuple yBin
Definition: cuy.py:891
#define NULL
Definition: scimark2.h:8
MonitorElement * MEANDWheel[kWheels]
double getEntries(void) const
get # of entries
double getMean(int axis=1) const
get mean value of histogram along x, y or z axis (axis=1, 2, 3 respectively)
MonitorElement * CLSDisk[kDisks]
MonitorElement * CLSDWheel[kWheels]
void Fill(long long x)
int roll() const
Definition: RPCDetId.h:120
int ring() const
Definition: RPCDetId.h:72
MonitorElement * MEANDisk[kDisks]
MonitorElement * MEANDDisk[kDisks]
std::vector< MonitorElement * > myClusterMe_
int detId2RollNr(const RPCDetId &_id)
Definition: utils.h:18
std::vector< RPCDetId > myDetIds_
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)
MonitorElement * CLSDDisk[kDisks]
MonitorElement * CLSWheel[kWheels]
int region() const
Region id: 0 for Barrel, +/-1 For +/- Endcap.
Definition: RPCDetId.h:63
int station() const
Definition: RPCDetId.h:96
void RPCClusterSizeTest::getMonitorElements ( std::vector< MonitorElement * > &  meVector,
std::vector< RPCDetId > &  detIdVector,
std::string &  clientHistoName 
)
virtual

Implements RPCClient.

Definition at line 32 of file RPCClusterSizeTest.cc.

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

32  {
33 
34 
35  //Get ME for each roll
36  for (unsigned int i = 0 ; i<meVector.size(); i++){
37 
38  std::string meName = meVector[i]->getName();
39 
40  if(meName.find(clientHistoName) != std::string::npos){
41  myClusterMe_.push_back(meVector[i]);
42  myDetIds_.push_back(detIdVector[i]);
43  }
44  }
45 }
int i
Definition: DBlmapReader.cc:9
std::vector< MonitorElement * > myClusterMe_
std::vector< RPCDetId > myDetIds_
void RPCClusterSizeTest::myBooker ( DQMStore::IBooker ibooker)
virtual

Implements RPCClient.

Definition at line 153 of file RPCClusterSizeTest.cc.

References DQMStore::IBooker::book1D(), DQMStore::IBooker::book2D(), CLSDDisk, CLSDisk, CLSDWheel, CLSWheel, ztail::d, globalFolder_, rpcdqm::utils::labelXAxisSector(), rpcdqm::utils::labelXAxisSegment(), rpcdqm::utils::labelYAxisRing(), rpcdqm::utils::labelYAxisRoll(), MEANDDisk, MEANDisk, MEANDWheel, MEANWheel, numberOfDisks_, numberOfRings_, hltrates_dqm_sourceclient-live_cfg::offset, resetMEArrays(), DQMStore::IBooker::setCurrentFolder(), testMode_, useRollInfo_, and w.

153  {
154 
155  resetMEArrays();
156 
158 
159  std::stringstream histoName;
160 
161  rpcdqm::utils rpcUtils;
162 
163  // Loop over wheels
164  for (int w = -2; w <= 2; w++) {
165  histoName.str("");
166  histoName<<"ClusterSizeIn1Bin_Roll_vs_Sector_Wheel"<<w; // ClusterSize in first bin norm. by Entries (2D Roll vs Sector)
167  CLSWheel[w+2] = ibooker.book2D(histoName.str().c_str(), histoName.str().c_str(), 12, 0.5, 12.5, 21, 0.5, 21.5);
168  rpcUtils.labelXAxisSector( CLSWheel[w+2]);
169  rpcUtils.labelYAxisRoll( CLSWheel[w+2], 0, w ,useRollInfo_);
170 
171 
172  histoName.str("");
173  histoName<<"ClusterSizeMean_Roll_vs_Sector_Wheel"<<w; // Avarage ClusterSize (2D Roll vs Sector)
174  MEANWheel[w+2] = ibooker.book2D(histoName.str().c_str(), histoName.str().c_str(), 12, 0.5, 12.5, 21, 0.5, 21.5);
175 
176  rpcUtils.labelXAxisSector( MEANWheel[w+2]);
177  rpcUtils.labelYAxisRoll(MEANWheel[w+2], 0, w,useRollInfo_ );
178 
179  if(testMode_){
180  histoName.str("");
181  histoName<<"ClusterSizeIn1Bin_Distribution_Wheel"<<w; // ClusterSize in first bin, distribution
182  CLSDWheel[w+2] = ibooker.book1D(histoName.str().c_str(), histoName.str().c_str(), 20, 0.0, 1.0);
183 
184 
185  histoName.str("");
186  histoName<<"ClusterSizeMean_Distribution_Wheel"<<w; // Avarage ClusterSize Distribution
187  MEANDWheel[w+2] = ibooker.book1D(histoName.str().c_str(), histoName.str().c_str(), 100, 0.5, 10.5);
188  }
189  }//end loop on wheels
190 
191 
192  for (int d = -numberOfDisks_; d <= numberOfDisks_; d++) {
193  if (d == 0)
194  continue;
195  //Endcap
196  int offset = numberOfDisks_;
197  if (d>0) offset--;
198 
199  histoName.str("");
200  histoName<<"ClusterSizeIn1Bin_Ring_vs_Segment_Disk"<<d; // ClusterSize in first bin norm. by Entries (2D Roll vs Sector)
201  CLSDisk[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);
202  rpcUtils.labelXAxisSegment(CLSDisk[d+offset]);
203  rpcUtils.labelYAxisRing(CLSDisk[d+offset], numberOfRings_,useRollInfo_ );
204 
205  if(testMode_){
206  histoName.str("");
207  histoName<<"ClusterSizeIn1Bin_Distribution_Disk"<<d; // ClusterSize in first bin, distribution
208  CLSDDisk[d+offset] = ibooker.book1D(histoName.str().c_str(), histoName.str().c_str(), 20, 0.0, 1.0);
209 
210  histoName.str("");
211  histoName<<"ClusterSizeMean_Distribution_Disk"<<d; // Avarage ClusterSize Distribution
212  MEANDDisk[d+offset] = ibooker.book1D(histoName.str().c_str(), histoName.str().c_str(), 100, 0.5, 10.5);
213 
214  }
215 
216  histoName.str("");
217  histoName<<"ClusterSizeMean_Ring_vs_Segment_Disk"<<d; // Avarage ClusterSize (2D Roll vs Sector)
218  MEANDisk[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);
219  rpcUtils.labelXAxisSegment(MEANDisk[d+offset]);
220  rpcUtils.labelYAxisRing(MEANDisk[d+offset], numberOfRings_ ,useRollInfo_);
221  }
222 }
const double w
Definition: UKUtility.cc:23
MonitorElement * MEANWheel[kWheels]
void labelXAxisSegment(MonitorElement *myMe)
Definition: utils.h:250
void labelYAxisRoll(MonitorElement *myMe, int region, int ring, bool useRollInfo)
Definition: utils.h:268
MonitorElement * MEANDWheel[kWheels]
MonitorElement * CLSDisk[kDisks]
MonitorElement * CLSDWheel[kWheels]
tuple d
Definition: ztail.py:151
void labelYAxisRing(MonitorElement *myMe, int numberOfRings, bool useRollInfo)
Definition: utils.h:295
MonitorElement * MEANDisk[kDisks]
MonitorElement * MEANDDisk[kDisks]
MonitorElement * book1D(Args &&...args)
Definition: DQMStore.h:115
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 * CLSDDisk[kDisks]
MonitorElement * CLSWheel[kWheels]
void RPCClusterSizeTest::resetMEArrays ( void  )
private

Definition at line 140 of file RPCClusterSizeTest.cc.

References CLSDDisk, CLSDisk, CLSDWheel, CLSWheel, kDisks, kWheels, MEANDDisk, MEANDisk, MEANDWheel, and MEANWheel.

Referenced by myBooker(), and RPCClusterSizeTest().

140  {
141  memset((void*) CLSWheel, 0, sizeof(MonitorElement*)*kWheels);
142  memset((void*) CLSDWheel, 0, sizeof(MonitorElement*)*kWheels);
143  memset((void*) MEANWheel, 0, sizeof(MonitorElement*)*kWheels);
144  memset((void*) MEANDWheel, 0, sizeof(MonitorElement*)*kWheels);
145 
146  memset((void*) CLSDisk, 0, sizeof(MonitorElement*)*kDisks);
147  memset((void*) CLSDDisk, 0, sizeof(MonitorElement*)*kDisks);
148  memset((void*) MEANDisk, 0, sizeof(MonitorElement*)*kDisks);
149  memset((void*) MEANDDisk, 0, sizeof(MonitorElement*)*kDisks);
150 }
MonitorElement * MEANWheel[kWheels]
MonitorElement * MEANDWheel[kWheels]
MonitorElement * CLSDisk[kDisks]
MonitorElement * CLSDWheel[kWheels]
MonitorElement * MEANDisk[kDisks]
MonitorElement * MEANDDisk[kDisks]
MonitorElement * CLSDDisk[kDisks]
MonitorElement * CLSWheel[kWheels]

Member Data Documentation

MonitorElement* RPCClusterSizeTest::CLSDDisk[kDisks]
private

Definition at line 43 of file RPCClusterSizeTest.h.

Referenced by clientOperation(), myBooker(), and resetMEArrays().

MonitorElement* RPCClusterSizeTest::CLSDisk[kDisks]
private

Definition at line 42 of file RPCClusterSizeTest.h.

Referenced by clientOperation(), myBooker(), and resetMEArrays().

MonitorElement* RPCClusterSizeTest::CLSDWheel[kWheels]
private

Definition at line 38 of file RPCClusterSizeTest.h.

Referenced by clientOperation(), myBooker(), and resetMEArrays().

MonitorElement* RPCClusterSizeTest::CLSWheel[kWheels]
private

Definition at line 37 of file RPCClusterSizeTest.h.

Referenced by clientOperation(), myBooker(), and resetMEArrays().

std::string RPCClusterSizeTest::globalFolder_
private

Definition at line 24 of file RPCClusterSizeTest.h.

Referenced by beginJob(), and myBooker().

MonitorElement* RPCClusterSizeTest::MEANDDisk[kDisks]
private

Definition at line 45 of file RPCClusterSizeTest.h.

Referenced by clientOperation(), myBooker(), and resetMEArrays().

MonitorElement* RPCClusterSizeTest::MEANDisk[kDisks]
private

Definition at line 44 of file RPCClusterSizeTest.h.

Referenced by clientOperation(), myBooker(), and resetMEArrays().

MonitorElement* RPCClusterSizeTest::MEANDWheel[kWheels]
private

Definition at line 40 of file RPCClusterSizeTest.h.

Referenced by clientOperation(), myBooker(), and resetMEArrays().

MonitorElement* RPCClusterSizeTest::MEANWheel[kWheels]
private

Definition at line 39 of file RPCClusterSizeTest.h.

Referenced by clientOperation(), myBooker(), and resetMEArrays().

std::vector<MonitorElement *> RPCClusterSizeTest::myClusterMe_
private

Definition at line 30 of file RPCClusterSizeTest.h.

Referenced by clientOperation(), and getMonitorElements().

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

Definition at line 31 of file RPCClusterSizeTest.h.

Referenced by clientOperation(), and getMonitorElements().

int RPCClusterSizeTest::numberOfDisks_
private

Definition at line 25 of file RPCClusterSizeTest.h.

Referenced by clientOperation(), myBooker(), and RPCClusterSizeTest().

int RPCClusterSizeTest::numberOfRings_
private

Definition at line 26 of file RPCClusterSizeTest.h.

Referenced by clientOperation(), myBooker(), and RPCClusterSizeTest().

int RPCClusterSizeTest::prescaleFactor_
private

Definition at line 27 of file RPCClusterSizeTest.h.

Referenced by RPCClusterSizeTest().

bool RPCClusterSizeTest::testMode_
private

Definition at line 28 of file RPCClusterSizeTest.h.

Referenced by clientOperation(), myBooker(), and RPCClusterSizeTest().

bool RPCClusterSizeTest::useRollInfo_
private

Definition at line 29 of file RPCClusterSizeTest.h.

Referenced by myBooker(), and RPCClusterSizeTest().