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 Attributes
RPCClusterSizeTest Class Reference

#include <RPCClusterSizeTest.h>

Inheritance diagram for RPCClusterSizeTest:
RPCClient

Public Member Functions

void analyze (const edm::Event &iEvent, const edm::EventSetup &c)
 Analyze. More...
 
void beginJob (DQMStore *, std::string)
 BeginJob. More...
 
void beginLuminosityBlock (edm::LuminosityBlock const &lumiSeg, edm::EventSetup const &context)
 Begin Lumi block. More...
 
void beginRun (const edm::Run &r, const edm::EventSetup &c)
 
void clientOperation (edm::EventSetup const &c)
 
void endJob (void)
 
void endLuminosityBlock (edm::LuminosityBlock const &lumiSeg, edm::EventSetup const &c)
 End Lumi Block. More...
 
void endRun (const edm::Run &r, const edm::EventSetup &c)
 
void getMonitorElements (std::vector< MonitorElement * > &, std::vector< RPCDetId > &)
 
 RPCClusterSizeTest (const edm::ParameterSet &ps)
 Constructor. More...
 
virtual ~RPCClusterSizeTest ()
 Destructor. More...
 
- Public Member Functions inherited from RPCClient
virtual ~RPCClient (void)
 

Private Attributes

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

Detailed Description

Definition at line 13 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_, 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", 3);
16  numberOfRings_ = ps.getUntrackedParameter<int>("NumberOfEndcapRings", 2);
17  testMode_ = ps.getUntrackedParameter<bool>("testMode", false);
18  useRollInfo_ = ps.getUntrackedParameter<bool>("useRollInfo", false);
19 }
T getUntrackedParameter(std::string const &, T const &) const
RPCClusterSizeTest::~RPCClusterSizeTest ( )
virtual

Destructor.

Definition at line 21 of file RPCClusterSizeTest.cc.

References dbe_.

21 { dbe_=0;}

Member Function Documentation

void RPCClusterSizeTest::analyze ( const edm::Event iEvent,
const edm::EventSetup c 
)
virtual

Analyze.

Implements RPCClient.

Definition at line 63 of file RPCClusterSizeTest.cc.

63 {}
void RPCClusterSizeTest::beginJob ( DQMStore dbe,
std::string  workingFolder 
)
virtual

BeginJob.

Implements RPCClient.

Definition at line 23 of file RPCClusterSizeTest.cc.

References dbe_, and globalFolder_.

23  {
24  edm::LogVerbatim ("rpceventsummary") << "[RPCClusterSizeTest]: Begin job ";
25 
26  globalFolder_ = workingFolder;
27  dbe_ = dbe;
28 }
void RPCClusterSizeTest::beginLuminosityBlock ( edm::LuminosityBlock const &  lumiSeg,
edm::EventSetup const &  context 
)
virtual

Begin Lumi block.

Implements RPCClient.

Definition at line 61 of file RPCClusterSizeTest.cc.

61 {}
void RPCClusterSizeTest::beginRun ( const edm::Run r,
const edm::EventSetup c 
)
virtual

Implements RPCClient.

Definition at line 159 of file RPCClusterSizeTest.cc.

References DQMStore::book1D(), DQMStore::book2D(), CLSDDisk, CLSDisk, CLSDWheel, CLSWheel, dbe_, DQMStore::get(), MonitorElement::getName(), globalFolder_, rpcdqm::utils::labelXAxisSector(), rpcdqm::utils::labelXAxisSegment(), rpcdqm::utils::labelYAxisRing(), rpcdqm::utils::labelYAxisRoll(), MEANDDisk, MEANDisk, MEANDWheel, MEANWheel, numberOfDisks_, numberOfRings_, evf::evtn::offset(), DQMStore::removeElement(), DQMStore::setCurrentFolder(), testMode_, useRollInfo_, and w().

159  {
160  MonitorElement* me;
162 
163  std::stringstream histoName;
164 
165  rpcdqm::utils rpcUtils;
166 
167 
168  for (int w = -2; w<=2;w++ ){//loop on wheels
169 
170  histoName.str("");
171  histoName<<"ClusterSizeIn1Bin_Roll_vs_Sector_Wheel"<<w; // ClusterSize in first bin norm. by Entries (2D Roll vs Sector)
172  me = 0;
173  me = dbe_->get(globalFolder_ + histoName.str()) ;
174  if ( 0!=me ) {
175  dbe_->removeElement(me->getName());
176  }
177 
178  CLSWheel[w+2] = dbe_->book2D(histoName.str().c_str(), histoName.str().c_str(), 12, 0.5, 12.5, 21, 0.5, 21.5);
179  rpcUtils.labelXAxisSector( CLSWheel[w+2]);
180  rpcUtils.labelYAxisRoll( CLSWheel[w+2], 0, w ,useRollInfo_);
181 
182 
183  histoName.str("");
184  histoName<<"ClusterSizeMean_Roll_vs_Sector_Wheel"<<w; // Avarage ClusterSize (2D Roll vs Sector)
185  me = 0;
186  me = dbe_->get(globalFolder_ + histoName.str()) ;
187  if ( 0!=me) {
188  dbe_->removeElement(me->getName());
189  }
190 
191  MEANWheel[w+2] = dbe_->book2D(histoName.str().c_str(), histoName.str().c_str(), 12, 0.5, 12.5, 21, 0.5, 21.5);
192 
193  rpcUtils.labelXAxisSector( MEANWheel[w+2]);
194  rpcUtils.labelYAxisRoll(MEANWheel[w+2], 0, w,useRollInfo_ );
195 
196  if(testMode_){
197  histoName.str("");
198  histoName<<"ClusterSizeIn1Bin_Distribution_Wheel"<<w; // ClusterSize in first bin, distribution
199  me = 0;
200  me = dbe_->get(globalFolder_ + histoName.str()) ;
201  if ( 0!=me ) {
202  dbe_->removeElement(me->getName());
203  }
204  CLSDWheel[w+2] = dbe_->book1D(histoName.str().c_str(), histoName.str().c_str(), 20, 0.0, 1.0);
205 
206 
207  histoName.str("");
208  histoName<<"ClusterSizeMean_Distribution_Wheel"<<w; // Avarage ClusterSize Distribution
209  me = 0;
210  me = dbe_->get(globalFolder_ + histoName.str()) ;
211  if ( 0!=me){
212  dbe_->removeElement(me->getName());
213  }
214  MEANDWheel[w+2] = dbe_->book1D(histoName.str().c_str(), histoName.str().c_str(), 100, 0.5, 10.5);
215  }
216  }//end loop on wheels
217 
218 
219  for(int d = -numberOfDisks_; d<=numberOfDisks_; d++ ){
220  if (d == 0 )continue;
221  //Endcap
222  int offset = numberOfDisks_;
223  if (d>0) offset --;
224 
225  histoName.str("");
226  histoName<<"ClusterSizeIn1Bin_Ring_vs_Segment_Disk"<<d; // ClusterSize in first bin norm. by Entries (2D Roll vs Sector)
227  me = 0;
228  me = dbe_->get(globalFolder_ + histoName.str()) ;
229  if ( 0!=me){
230  dbe_->removeElement(me->getName());
231  }
232 
233  CLSDisk[d+offset] = dbe_->book2D(histoName.str().c_str(), histoName.str().c_str(),36, 0.5, 36.5, 3*numberOfRings_, 0.5,3*numberOfRings_+ 0.5);
234  rpcUtils.labelXAxisSegment(CLSDisk[d+offset]);
235  rpcUtils.labelYAxisRing(CLSDisk[d+offset], numberOfRings_,useRollInfo_ );
236 
237  if(testMode_){
238  histoName.str("");
239  histoName<<"ClusterSizeIn1Bin_Distribution_Disk"<<d; // ClusterSize in first bin, distribution
240  me = 0;
241  me = dbe_->get(globalFolder_ + histoName.str()) ;
242  if ( 0!=me){
243  dbe_->removeElement(me->getName());
244  }
245  CLSDDisk[d+offset] = dbe_->book1D(histoName.str().c_str(), histoName.str().c_str(), 20, 0.0, 1.0);
246 
247  histoName.str("");
248  histoName<<"ClusterSizeMean_Distribution_Disk"<<d; // Avarage ClusterSize Distribution
249  me = 0;
250  me = dbe_->get(globalFolder_ + histoName.str()) ;
251  if ( 0!=me){
252  dbe_->removeElement(me->getName());
253  }
254  MEANDDisk[d+offset] = dbe_->book1D(histoName.str().c_str(), histoName.str().c_str(), 100, 0.5, 10.5);
255 
256  }
257 
258  histoName.str("");
259  histoName<<"ClusterSizeMean_Ring_vs_Segment_Disk"<<d; // Avarage ClusterSize (2D Roll vs Sector)
260  me = 0;
261  me = dbe_->get(globalFolder_ + histoName.str()) ;
262  if ( 0!=me){
263  dbe_->removeElement(me->getName());
264  }
265 
266  MEANDisk[d+offset] = dbe_->book2D(histoName.str().c_str(), histoName.str().c_str(), 36, 0.5, 36.5, 3*numberOfRings_, 0.5,3*numberOfRings_+ 0.5);
267  rpcUtils.labelXAxisSegment(MEANDisk[d+offset]);
268  rpcUtils.labelYAxisRing(MEANDisk[d+offset], numberOfRings_ ,useRollInfo_);
269 
270  }
271 
272 
273 
274 }
const std::string & getName(void) const
get name of ME
MonitorElement * CLSDDisk[10]
MonitorElement * book1D(const char *name, const char *title, int nchX, double lowX, double highX)
Book 1D histogram.
Definition: DQMStore.cc:717
void labelXAxisSegment(MonitorElement *myMe)
Definition: utils.h:251
void labelYAxisRoll(MonitorElement *myMe, int region, int ring, bool useRollInfo)
Definition: utils.h:269
void labelYAxisRing(MonitorElement *myMe, int numberOfRings, bool useRollInfo)
Definition: utils.h:296
void removeElement(const std::string &name)
Definition: DQMStore.cc:2572
MonitorElement * MEANDWheel[5]
unsigned int offset(bool)
MonitorElement * get(const std::string &path) const
get ME from full pathname (e.g. &quot;my/long/dir/my_histo&quot;)
Definition: DQMStore.cc:1468
void labelXAxisSector(MonitorElement *myMe)
Definition: utils.h:236
MonitorElement * MEANWheel[5]
MonitorElement * CLSDWheel[5]
MonitorElement * MEANDDisk[10]
MonitorElement * book2D(const char *name, const char *title, int nchX, double lowX, double highX, int nchY, double lowY, double highY)
Book 2D histogram.
Definition: DQMStore.cc:845
MonitorElement * CLSDisk[10]
MonitorElement * CLSWheel[5]
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:429
MonitorElement * MEANDisk[10]
T w() const
void RPCClusterSizeTest::clientOperation ( edm::EventSetup const &  c)
virtual

Implements RPCClient.

Definition at line 67 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(), and testMode_.

67  {
68 
69  edm::LogVerbatim ("rpceventsummary") <<"[RPCClusterSizeTest]:Client Operation";
70 
71  //check some statements and prescale Factor
72  if(myClusterMe_.size()==0 || myDetIds_.size()==0)return;
73 
74  MonitorElement * CLS =NULL; // ClusterSize in 1 bin, Roll vs Sector
75  MonitorElement * CLSD =NULL; // ClusterSize in 1 bin, Distribution
76  MonitorElement * MEAN =NULL; // Mean ClusterSize, Roll vs Sector
77  MonitorElement * MEAND =NULL; // Mean ClusterSize, Distribution
78 
79 
80  std::stringstream meName;
81  RPCDetId detId;
82  MonitorElement * myMe;
83 
84 
85  //Loop on chambers
86  for (unsigned int i = 0 ; i<myClusterMe_.size();i++){
87 
88  myMe = myClusterMe_[i];
89  if (!myMe || myMe->getEntries()==0 )continue;
90 
91 
92  detId=myDetIds_[i];
93 
94 
95  if (detId.region()==0){
96 
97  CLS=CLSWheel[detId.ring()+2];
98  MEAN= MEANWheel[detId.ring()+2];
99  if(testMode_){
100  CLSD=CLSDWheel[detId.ring()+2];
101  MEAND=MEANDWheel[detId.ring()+2];
102  }
103  }else {
104 
105  if(((detId.station() * detId.region() ) + numberOfDisks_) >= 0 ){
106 
107  if(detId.region()<0){
108  CLS=CLSDisk[(detId.station() * detId.region() ) + numberOfDisks_];
109  MEAN= MEANDisk[(detId.station() * detId.region() ) + numberOfDisks_];
110  if(testMode_){
111  CLSD = CLSDDisk[(detId.station() * detId.region() ) + numberOfDisks_];
112  MEAND= MEANDDisk[(detId.station() * detId.region() ) + numberOfDisks_];
113  }
114  }else{
115  CLS=CLSDisk[(detId.station() * detId.region() ) + numberOfDisks_ -1];
116  MEAN= MEANDisk[(detId.station() * detId.region() ) + numberOfDisks_-1];
117  if(testMode_){
118  CLSD = CLSDDisk[(detId.station() * detId.region() ) + numberOfDisks_-1];
119  MEAND= MEANDDisk[(detId.station() * detId.region() ) + numberOfDisks_-1];
120  }
121  }
122  }
123 
124  }
125 
126 
127  int xBin,yBin;
128 
129  if (detId.region()==0){//Barrel
130 
131  rpcdqm::utils rollNumber;
132  yBin = rollNumber.detId2RollNr(detId);
133  xBin = detId.sector();
134  }else {//Endcap
135 
136  //get segment number
137  RPCGeomServ RPCServ(detId);
138  xBin = RPCServ.segment();
139  (numberOfRings_ == 3 ? yBin= detId.ring()*3-detId.roll()+1 : yBin= (detId.ring()-1)*3-detId.roll()+1);
140  }
141 
142  // Normalization -> # of Entries in first Bin normalaized by total Entries
143 
144  float NormCLS = myMe->getBinContent(1)/myMe->getEntries();
145  float meanCLS = myMe->getMean();
146 
147  if (CLS) CLS -> setBinContent(xBin,yBin, NormCLS);
148  if(MEAN) MEAN -> setBinContent(xBin, yBin, meanCLS);
149 
150  if(testMode_){
151  if(MEAND) MEAND->Fill(meanCLS);
152  if(CLSD) CLSD->Fill(NormCLS);
153  }
154 
155  }//End loop on chambers
156 }
int i
Definition: DBlmapReader.cc:9
MonitorElement * CLSDDisk[10]
#define NULL
Definition: scimark2.h:8
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)
void Fill(long long x)
int roll() const
Definition: RPCDetId.h:124
int ring() const
Definition: RPCDetId.h:76
MonitorElement * MEANDWheel[5]
std::vector< MonitorElement * > myClusterMe_
MonitorElement * MEANWheel[5]
MonitorElement * CLSDWheel[5]
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:106
double getBinContent(int binx) const
get content of bin (1-D)
MonitorElement * MEANDDisk[10]
MonitorElement * CLSDisk[10]
MonitorElement * CLSWheel[5]
MonitorElement * MEANDisk[10]
int region() const
Region id: 0 for Barrel, +/-1 For +/- Endcap.
Definition: RPCDetId.h:67
int station() const
Definition: RPCDetId.h:100
void RPCClusterSizeTest::endJob ( void  )
virtual

Implements RPCClient.

Definition at line 158 of file RPCClusterSizeTest.cc.

158 {}
void RPCClusterSizeTest::endLuminosityBlock ( edm::LuminosityBlock const &  lumiSeg,
edm::EventSetup const &  c 
)
virtual

End Lumi Block.

Implements RPCClient.

Definition at line 65 of file RPCClusterSizeTest.cc.

65 {}
void RPCClusterSizeTest::endRun ( const edm::Run r,
const edm::EventSetup c 
)
virtual

Implements RPCClient.

Definition at line 30 of file RPCClusterSizeTest.cc.

30  {
31  edm::LogVerbatim ("rpceventsummary") << "[RPCClusterSizeTest]: End run";
32 }
void RPCClusterSizeTest::getMonitorElements ( std::vector< MonitorElement * > &  meVector,
std::vector< RPCDetId > &  detIdVector 
)
virtual

Implements RPCClient.

Definition at line 34 of file RPCClusterSizeTest.cc.

References rpcdqm::CLUSTERSIZE, i, myClusterMe_, myDetIds_, and packageDocSplitter::tagList.

34  {
35 
36 
37  //Get ME for each roll
38  for (unsigned int i = 0 ; i<meVector.size(); i++){
39 
40  bool flag= false;
41 
43  tagList = meVector[i]->getTags();
44  DQMNet::TagList::iterator tagItr = tagList.begin();
45 
46  while (tagItr != tagList.end() && !flag ) {
47  if((*tagItr) == rpcdqm::CLUSTERSIZE)
48  flag= true;
49 
50  tagItr++;
51  }
52 
53  if(flag){
54  myClusterMe_.push_back(meVector[i]);
55  myDetIds_.push_back(detIdVector[i]);
56  }
57  }
58 
59 }
int i
Definition: DBlmapReader.cc:9
long int flag
Definition: mlp_lapack.h:47
std::vector< MonitorElement * > myClusterMe_
std::vector< uint32_t > TagList
Definition: DQMNet.h:83
std::vector< RPCDetId > myDetIds_

Member Data Documentation

MonitorElement* RPCClusterSizeTest::CLSDDisk[10]
private

Definition at line 65 of file RPCClusterSizeTest.h.

Referenced by beginRun(), and clientOperation().

MonitorElement* RPCClusterSizeTest::CLSDisk[10]
private

Definition at line 64 of file RPCClusterSizeTest.h.

Referenced by beginRun(), and clientOperation().

MonitorElement* RPCClusterSizeTest::CLSDWheel[5]
private

Definition at line 60 of file RPCClusterSizeTest.h.

Referenced by beginRun(), and clientOperation().

MonitorElement* RPCClusterSizeTest::CLSWheel[5]
private

Definition at line 59 of file RPCClusterSizeTest.h.

Referenced by beginRun(), and clientOperation().

DQMStore* RPCClusterSizeTest::dbe_
private

Definition at line 53 of file RPCClusterSizeTest.h.

Referenced by beginJob(), beginRun(), and ~RPCClusterSizeTest().

std::string RPCClusterSizeTest::globalFolder_
private

Definition at line 48 of file RPCClusterSizeTest.h.

Referenced by beginJob(), and beginRun().

MonitorElement* RPCClusterSizeTest::MEANDDisk[10]
private

Definition at line 67 of file RPCClusterSizeTest.h.

Referenced by beginRun(), and clientOperation().

MonitorElement* RPCClusterSizeTest::MEANDisk[10]
private

Definition at line 66 of file RPCClusterSizeTest.h.

Referenced by beginRun(), and clientOperation().

MonitorElement* RPCClusterSizeTest::MEANDWheel[5]
private

Definition at line 62 of file RPCClusterSizeTest.h.

Referenced by beginRun(), and clientOperation().

MonitorElement* RPCClusterSizeTest::MEANWheel[5]
private

Definition at line 61 of file RPCClusterSizeTest.h.

Referenced by beginRun(), and clientOperation().

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

Definition at line 55 of file RPCClusterSizeTest.h.

Referenced by clientOperation(), and getMonitorElements().

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

Definition at line 56 of file RPCClusterSizeTest.h.

Referenced by clientOperation(), and getMonitorElements().

int RPCClusterSizeTest::numberOfDisks_
private

Definition at line 49 of file RPCClusterSizeTest.h.

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

int RPCClusterSizeTest::numberOfRings_
private

Definition at line 50 of file RPCClusterSizeTest.h.

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

int RPCClusterSizeTest::prescaleFactor_
private

Definition at line 51 of file RPCClusterSizeTest.h.

Referenced by RPCClusterSizeTest().

bool RPCClusterSizeTest::testMode_
private

Definition at line 52 of file RPCClusterSizeTest.h.

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

bool RPCClusterSizeTest::useRollInfo_
private

Definition at line 54 of file RPCClusterSizeTest.h.

Referenced by beginRun(), and RPCClusterSizeTest().