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
RPCBxTest Class Reference

#include <RPCBxTest.h>

Inheritance diagram for RPCBxTest:
RPCClient

Public Member Functions

void analyze (const edm::Event &iEvent, const edm::EventSetup &c)
 Analyze. More...
 
void beginJob (DQMStore *)
 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)
 
virtual void endJob (void)
 
void endLuminosityBlock (edm::LuminosityBlock const &lumiSeg, edm::EventSetup const &c)
 End Lumi Block. More...
 
virtual void endRun (const edm::Run &r, const edm::EventSetup &c)
 
void getMonitorElements (std::vector< MonitorElement * > &, std::vector< RPCDetId > &)
 
 RPCBxTest (const edm::ParameterSet &ps)
 Constructor. More...
 
virtual ~RPCBxTest ()
 Destructor. More...
 
- Public Member Functions inherited from RPCClient
virtual void beginJob (std::string &)=0
 
virtual void clientOperation ()=0
 
virtual void getMonitorElements (std::vector< MonitorElement * > &, std::vector< RPCDetId > &, std::string &)=0
 
virtual void myBooker (DQMStore::IBooker &)=0
 
virtual ~RPCClient (void)
 

Private Attributes

MonitorElementBXEntriesBarrel
 
MonitorElementBXEntriesEndcapN
 
MonitorElementBXEntriesEndcapP
 
MonitorElementBXMeanBarrel
 
MonitorElementBXMeanDisk [10]
 
MonitorElementBXMeanEndcapN
 
MonitorElementBXMeanEndcapP
 
MonitorElementBXMeanWheel [5]
 
MonitorElementBXRmsBarrel
 
MonitorElementBXRmsDisk [10]
 
MonitorElementBXRmsEndcapN
 
MonitorElementBXRmsEndcapP
 
MonitorElementBXRmsWheel [5]
 
DQMStoredbe_
 
double distanceMean_
 
int entriesCut_
 
std::string globalFolder_
 
std::vector< MonitorElement * > myBXMe_
 
std::vector< RPCDetIdmyDetIds_
 
int nLumiSegs_
 
int numberOfDisks_
 
int numberOfRings_
 
int prescaleFactor_
 
double rmsCut_
 

Detailed Description

Definition at line 13 of file RPCBxTest.h.

Constructor & Destructor Documentation

RPCBxTest::RPCBxTest ( const edm::ParameterSet ps)

Constructor.

Definition at line 13 of file RPCBxTest.cc.

References distanceMean_, entriesCut_, edm::ParameterSet::getUntrackedParameter(), globalFolder_, numberOfDisks_, numberOfRings_, prescaleFactor_, rmsCut_, and AlCaHLTBitMon_QueryRunRegistry::string.

13  {
14  edm::LogVerbatim ("rpcbxtest") << "[RPCBxTest]: Constructor";
15 
16  prescaleFactor_ = ps.getUntrackedParameter<int>("DiagnosticPrescale", 1);
17 
18  //Nome della dir per gli istogrammi nuovi . Cominciare sempre con RPC/RecHits/
19  globalFolder_ = ps.getUntrackedParameter<std::string>("RPCGlobalFolder", "RPC/RecHits/SummaryHistograms/");
20 
21  entriesCut_ = ps.getUntrackedParameter<int>("EntriesCut");
22  rmsCut_ = ps.getUntrackedParameter<double>("RMSCut");
23  distanceMean_ = ps.getUntrackedParameter<double>("DistanceFromZeroBx");
24 
25  numberOfDisks_ = ps.getUntrackedParameter<int>("NumberOfEndcapDisks", 4);
26  numberOfRings_ = ps.getUntrackedParameter<int>("NumberOfEndcapRings", 2);
27 }
T getUntrackedParameter(std::string const &, T const &) const
double distanceMean_
Definition: RPCBxTest.h:44
int prescaleFactor_
Definition: RPCBxTest.h:47
std::string globalFolder_
Definition: RPCBxTest.h:45
int entriesCut_
Definition: RPCBxTest.h:49
int numberOfDisks_
Definition: RPCBxTest.h:46
int numberOfRings_
Definition: RPCBxTest.h:46
double rmsCut_
Definition: RPCBxTest.h:48
RPCBxTest::~RPCBxTest ( )
virtual

Destructor.

Definition at line 29 of file RPCBxTest.cc.

References dbe_.

29 { dbe_=0;}
DQMStore * dbe_
Definition: RPCBxTest.h:50

Member Function Documentation

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

Analyze.

Definition at line 166 of file RPCBxTest.cc.

166 {}
void RPCBxTest::beginJob ( DQMStore dbe)

BeginJob.

Definition at line 31 of file RPCBxTest.cc.

References dbe_.

31  {
32  edm::LogVerbatim ("rpcbxtest") << "[RPCBxTest]: Begin job ";
33  dbe_ = dbe;
34 }
DQMStore * dbe_
Definition: RPCBxTest.h:50
void RPCBxTest::beginLuminosityBlock ( edm::LuminosityBlock const &  lumiSeg,
edm::EventSetup const &  context 
)

Begin Lumi block.

Definition at line 164 of file RPCBxTest.cc.

164 {}
void RPCBxTest::beginRun ( const edm::Run r,
const edm::EventSetup c 
)

Definition at line 37 of file RPCBxTest.cc.

References DQMStore::book1D(), BXEntriesBarrel, BXEntriesEndcapN, BXEntriesEndcapP, BXMeanBarrel, BXMeanDisk, BXMeanEndcapN, BXMeanEndcapP, BXMeanWheel, BXRmsBarrel, BXRmsDisk, BXRmsEndcapN, BXRmsEndcapP, BXRmsWheel, dbe_, DQMStore::get(), MonitorElement::getName(), globalFolder_, hltbtagharvestinganalyzer_cfi::histoName, MessageLogger_cff::limit, numberOfDisks_, evf::evtn::offset(), DQMStore::removeElement(), MonitorElement::setAxisTitle(), DQMStore::setCurrentFolder(), and w.

37  {
38  edm::LogVerbatim ("rpcbxtest") << "[RPCBxTest]: Begin run";
39 
40  MonitorElement* me;
42 
43  std::stringstream histoName;
44 
45  histoName.str("");
46  histoName<<"BX_Mean_Distribution_Barrel";
47  BXMeanBarrel = dbe_->book1D(histoName.str().c_str(), histoName.str().c_str(), 11, -5.5, 5.5);
48  BXMeanBarrel->setAxisTitle("Bx",1);
49 
50  histoName.str("");
51  histoName<<"BX_Mean_Distribution_EndcapP";
52  BXMeanEndcapP = dbe_->book1D(histoName.str().c_str(), histoName.str().c_str(), 11, -5.5, 5.5);
53 
54  histoName.str("");
55  histoName<<"BX_Mean_Distribution_EndcapN";
56  BXMeanEndcapN = dbe_->book1D(histoName.str().c_str(), histoName.str().c_str(), 11, -5.5, 5.5);
57 
58 
59  histoName.str("");
60  histoName<<"BX_Entries_Distribution_Barrel";
61  BXEntriesBarrel = dbe_->book1D(histoName.str().c_str(), histoName.str().c_str(), 1000, -0.5, 999.5);
62 
63  histoName.str("");
64  histoName<<"BX_Entries_Distribution_EndcapP";
65  BXEntriesEndcapP = dbe_->book1D(histoName.str().c_str(), histoName.str().c_str(),1000, -0.5, 999.5);
66 
67  histoName.str("");
68  histoName<<"BX_Entries_Distribution_EndcapN";
69  BXEntriesEndcapN = dbe_->book1D(histoName.str().c_str(), histoName.str().c_str(), 1000, -0.5, 999.5);
70 
71 
72  histoName.str("");
73  histoName<<"BX_RMS_Distribution_Barrel";
74  BXRmsBarrel = dbe_->book1D(histoName.str().c_str(), histoName.str().c_str(), 21, -0.1, 4.1);
75 
76  histoName.str("");
77  histoName<<"BX_RMS_Distribution_EndcapP";
78  BXRmsEndcapP = dbe_->book1D(histoName.str().c_str(), histoName.str().c_str(), 21, -0.1, 4.1);
79 
80  histoName.str("");
81  histoName<<"BX_RMS_Distribution_EndcapN";
82  BXRmsEndcapN = dbe_->book1D(histoName.str().c_str(), histoName.str().c_str(), 21, -0.1, 4.1);
83 
84 
85  rpcdqm::utils rpcUtils;
86 
87  int limit = numberOfDisks_;
88  if(numberOfDisks_ < 2) limit = 2;
89 
90  for (int w = -1 * limit; w<=limit;w++ ){//loop on wheels and disks
91  if (w>-3 && w<3){//wheels
92  histoName.str("");
93  histoName<<"BX_Mean_Distribution_Wheel"<<w;
94  me = 0;
95  me = dbe_->get(globalFolder_ + histoName.str()) ;
96  if ( 0!=me ) {
97  dbe_->removeElement(me->getName());
98  }
99  BXMeanWheel[w+2] = dbe_->book1D(histoName.str().c_str(), histoName.str().c_str(), 10, -0.5, 9.5);
100 
101  histoName.str("");
102  histoName<<"BX_RMS_Distribution_Wheel"<<w;
103  me = 0;
104  me = dbe_->get(globalFolder_ + histoName.str()) ;
105  if ( 0!=me){
106  dbe_->removeElement(me->getName());
107  }
108  BXRmsWheel[w+2] = dbe_->book1D(histoName.str().c_str(), histoName.str().c_str(), 50, -0.5, 4.5);
109  }//end loop on wheels
110 
111  if (w == 0 || w< (-1 * numberOfDisks_) || w > numberOfDisks_)continue;
112  //Endcap
113  int offset = numberOfDisks_;
114  if (w>0) offset --; //used to skip case equale to zero
115 
116  histoName.str("");
117  histoName<<"BX_Mean_Distribution_Disk"<<w;
118  me = 0;
119  me = dbe_->get(globalFolder_ + histoName.str()) ;
120  if ( 0!=me){
121  dbe_->removeElement(me->getName());
122  }
123  BXMeanDisk[w+offset] = dbe_->book1D(histoName.str().c_str(), histoName.str().c_str(),10, -0.5, 9.5);
124 
125 
126  histoName.str("");
127  histoName<<"BX_RMS_Distribution_Disk"<<w;
128  me = 0;
129  me = dbe_->get(globalFolder_ + histoName.str()) ;
130  if ( 0!=me){
131  dbe_->removeElement(me->getName());
132  }
133  BXRmsDisk[w+offset] = dbe_->book1D(histoName.str().c_str(), histoName.str().c_str(), 50, -0.5, 4.5);
134  }
135 
136 }
const std::string & getName(void) const
get name of ME
MonitorElement * BXRmsEndcapP
Definition: RPCBxTest.h:67
const double w
Definition: UKUtility.cc:23
MonitorElement * BXRmsEndcapN
Definition: RPCBxTest.h:66
MonitorElement * book1D(const char *name, const char *title, int nchX, double lowX, double highX)
Book 1D histogram.
Definition: DQMStore.cc:971
MonitorElement * BXRmsBarrel
Definition: RPCBxTest.h:68
MonitorElement * BXRmsWheel[5]
Definition: RPCBxTest.h:70
MonitorElement * BXMeanEndcapN
Definition: RPCBxTest.h:60
MonitorElement * BXEntriesBarrel
Definition: RPCBxTest.h:58
MonitorElement * BXMeanDisk[10]
Definition: RPCBxTest.h:64
MonitorElement * BXRmsDisk[10]
Definition: RPCBxTest.h:69
void removeElement(const std::string &name)
Definition: DQMStore.cc:3166
std::string globalFolder_
Definition: RPCBxTest.h:45
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:1725
DQMStore * dbe_
Definition: RPCBxTest.h:50
MonitorElement * BXMeanEndcapP
Definition: RPCBxTest.h:61
int numberOfDisks_
Definition: RPCBxTest.h:46
MonitorElement * BXMeanWheel[5]
Definition: RPCBxTest.h:63
MonitorElement * BXEntriesEndcapN
Definition: RPCBxTest.h:56
MonitorElement * BXEntriesEndcapP
Definition: RPCBxTest.h:57
MonitorElement * BXMeanBarrel
Definition: RPCBxTest.h:62
void setAxisTitle(const std::string &title, int axis=1)
set x-, y- or z-axis title (axis=1, 2, 3 respectively)
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:684
void RPCBxTest::endJob ( void  )
virtual

Definition at line 170 of file RPCBxTest.cc.

170  {
171  edm::LogVerbatim ("rpcbxtest") << "[RPCBxTest]: end job ";
172 }
void RPCBxTest::endLuminosityBlock ( edm::LuminosityBlock const &  lumiSeg,
edm::EventSetup const &  c 
)

End Lumi Block.

Definition at line 168 of file RPCBxTest.cc.

168 { }
void RPCBxTest::endRun ( const edm::Run r,
const edm::EventSetup c 
)
virtual

Definition at line 176 of file RPCBxTest.cc.

References BXEntriesBarrel, BXEntriesEndcapN, BXEntriesEndcapP, BXMeanBarrel, BXMeanDisk, BXMeanEndcapN, BXMeanEndcapP, BXMeanWheel, BXRmsBarrel, BXRmsDisk, BXRmsEndcapN, BXRmsEndcapP, BXRmsWheel, python.tagInventory::entries, entriesCut_, MonitorElement::Fill(), MonitorElement::getTH1F(), i, timingPdfMaker::mean, myBXMe_, myDetIds_, NULL, RPCDetId::region(), RPCDetId::ring(), RMS, plotscripts::rms(), rmsCut_, and RPCDetId::station().

176  {
177 
178  MonitorElement * myMe;
179  RPCDetId detId;
180  TH1F * myTH1F;
181 
182  MonitorElement * ENTRIES =NULL;
183  MonitorElement * MEAN =NULL;
184  MonitorElement * MEANRing =NULL;
185  MonitorElement * RMS =NULL;
186  MonitorElement * RMSRing =NULL;
187 
188  for (unsigned int i = 0 ; i<myBXMe_.size();i++){
189 
190  myMe = myBXMe_[i];
191  detId = myDetIds_[i];
192 
193  //Prendi TH1F corrispondente al Monitor Element
194  myTH1F = myMe->getTH1F();
195  // //Spegni Overflow
196 // myTH1F->StatOverflows(false); // per accendere overflow mettere true
197 // //Ricalcola la media e l'RMS //commentare le 3 righe seguenti. Ricorda di ricompilare
198 // myTH1F->GetXaxis()->SetRangeUser(-9.5,9.5);
199 // Double_t stat[4];
200 // myTH1F->GetStats(stat);
201 
202 
203  float mean = myTH1F->GetMean();
204  float rms = myTH1F->GetRMS();
205  float entries = myTH1F->GetEntries();
206 
207  //Get Occupancy ME for roll
208  RPCGeomServ RPCname(detId);
209  // if(rms==0) cout<<RPCname.name()<<endl;
210 
211  if(detId.region()== 0){
212  ENTRIES = BXEntriesBarrel;
213  MEAN = BXMeanBarrel; //nome istogramma definito in beginRun
214  MEANRing = BXMeanWheel[detId.ring()+2];
215  RMS = BXRmsBarrel;
216  RMSRing = BXRmsWheel[detId.ring()+2];
217  }else if(detId.region()==1){
218  ENTRIES = BXEntriesEndcapP;
219  MEAN = BXMeanEndcapP;
220  MEANRing = BXMeanDisk[detId.station()+2];
221  RMS = BXRmsEndcapP;
222  RMSRing = BXRmsDisk[detId.station()+2];
223  }else if(detId.region()==-1){
224  ENTRIES = BXEntriesEndcapN;
225  MEAN = BXMeanEndcapN;
226  MEANRing = BXMeanDisk[3-detId.station()];
227  RMS = BXRmsEndcapN;
228  RMSRing = BXRmsDisk[3-detId.station()];
229  }
230 
231  ENTRIES->Fill(entries);
232 
233  if(entries >= entriesCut_){
234  RMSRing->Fill(rms);
235  RMS->Fill(rms);
236 
237  if(rms <= rmsCut_){
238 
239  //if(mean> distanceMean_ || mean<-distanceMean_ ) cout<<RPCname.name()<<endl;
240 
241  MEAN->Fill(mean);
242  MEANRing->Fill(mean);
243  }
244  }
245 
246  }
247 }
int i
Definition: DBlmapReader.cc:9
MonitorElement * BXRmsEndcapP
Definition: RPCBxTest.h:67
MonitorElement * BXRmsEndcapN
Definition: RPCBxTest.h:66
MonitorElement * BXRmsBarrel
Definition: RPCBxTest.h:68
MonitorElement * BXRmsWheel[5]
Definition: RPCBxTest.h:70
MonitorElement * BXMeanEndcapN
Definition: RPCBxTest.h:60
std::vector< RPCDetId > myDetIds_
Definition: RPCBxTest.h:54
#define NULL
Definition: scimark2.h:8
MonitorElement * BXEntriesBarrel
Definition: RPCBxTest.h:58
void Fill(long long x)
MonitorElement * BXMeanDisk[10]
Definition: RPCBxTest.h:64
int ring() const
Definition: RPCDetId.h:72
MonitorElement * BXRmsDisk[10]
Definition: RPCBxTest.h:69
int entriesCut_
Definition: RPCBxTest.h:49
TH1F * getTH1F(void) const
MonitorElement * BXMeanEndcapP
Definition: RPCBxTest.h:61
MonitorElement * BXMeanWheel[5]
Definition: RPCBxTest.h:63
MonitorElement * BXEntriesEndcapN
Definition: RPCBxTest.h:56
MonitorElement * BXEntriesEndcapP
Definition: RPCBxTest.h:57
MonitorElement * BXMeanBarrel
Definition: RPCBxTest.h:62
std::vector< MonitorElement * > myBXMe_
Definition: RPCBxTest.h:53
double rmsCut_
Definition: RPCBxTest.h:48
int region() const
Region id: 0 for Barrel, +/-1 For +/- Endcap.
Definition: RPCDetId.h:63
int station() const
Definition: RPCDetId.h:96
void RPCBxTest::getMonitorElements ( std::vector< MonitorElement * > &  meVector,
std::vector< RPCDetId > &  detIdVector 
)

Definition at line 138 of file RPCBxTest.cc.

References rpcdqm::BX, archive::flag, i, myBXMe_, and myDetIds_.

138  {
139 
140  //Qui prende gli isto del BX per roll definiti nel client
141  //crea due vettore ordinati myBXMe_(istogrammi) e myDetIds_(rpcDetId)
142  //Get ME for each roll
143  for (unsigned int i = 0 ; i<meVector.size(); i++){
144 
145  bool flag= false;
146 
147  DQMNet::TagList tagList;
148  tagList = meVector[i]->getTags();
149  DQMNet::TagList::iterator tagItr = tagList.begin();
150 
151  while (tagItr != tagList.end() && !flag ) {
152  if((*tagItr) == rpcdqm::BX){ flag= true;}
153  tagItr++;
154  }
155 
156  if(flag){
157  myBXMe_.push_back(meVector[i]);
158  myDetIds_.push_back(detIdVector[i]);
159  }
160  }
161 
162 }
int i
Definition: DBlmapReader.cc:9
std::vector< RPCDetId > myDetIds_
Definition: RPCBxTest.h:54
std::vector< uint32_t > TagList
Definition: DQMNet.h:84
std::vector< MonitorElement * > myBXMe_
Definition: RPCBxTest.h:53

Member Data Documentation

MonitorElement* RPCBxTest::BXEntriesBarrel
private

Definition at line 58 of file RPCBxTest.h.

Referenced by beginRun(), and endRun().

MonitorElement* RPCBxTest::BXEntriesEndcapN
private

Definition at line 56 of file RPCBxTest.h.

Referenced by beginRun(), and endRun().

MonitorElement* RPCBxTest::BXEntriesEndcapP
private

Definition at line 57 of file RPCBxTest.h.

Referenced by beginRun(), and endRun().

MonitorElement* RPCBxTest::BXMeanBarrel
private

Definition at line 62 of file RPCBxTest.h.

Referenced by beginRun(), and endRun().

MonitorElement* RPCBxTest::BXMeanDisk[10]
private

Definition at line 64 of file RPCBxTest.h.

Referenced by beginRun(), and endRun().

MonitorElement* RPCBxTest::BXMeanEndcapN
private

Definition at line 60 of file RPCBxTest.h.

Referenced by beginRun(), and endRun().

MonitorElement* RPCBxTest::BXMeanEndcapP
private

Definition at line 61 of file RPCBxTest.h.

Referenced by beginRun(), and endRun().

MonitorElement* RPCBxTest::BXMeanWheel[5]
private

Definition at line 63 of file RPCBxTest.h.

Referenced by beginRun(), and endRun().

MonitorElement* RPCBxTest::BXRmsBarrel
private

Definition at line 68 of file RPCBxTest.h.

Referenced by beginRun(), and endRun().

MonitorElement* RPCBxTest::BXRmsDisk[10]
private

Definition at line 69 of file RPCBxTest.h.

Referenced by beginRun(), and endRun().

MonitorElement* RPCBxTest::BXRmsEndcapN
private

Definition at line 66 of file RPCBxTest.h.

Referenced by beginRun(), and endRun().

MonitorElement* RPCBxTest::BXRmsEndcapP
private

Definition at line 67 of file RPCBxTest.h.

Referenced by beginRun(), and endRun().

MonitorElement* RPCBxTest::BXRmsWheel[5]
private

Definition at line 70 of file RPCBxTest.h.

Referenced by beginRun(), and endRun().

DQMStore* RPCBxTest::dbe_
private

Definition at line 50 of file RPCBxTest.h.

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

double RPCBxTest::distanceMean_
private

Definition at line 44 of file RPCBxTest.h.

Referenced by RPCBxTest().

int RPCBxTest::entriesCut_
private

Definition at line 49 of file RPCBxTest.h.

Referenced by endRun(), and RPCBxTest().

std::string RPCBxTest::globalFolder_
private

Definition at line 45 of file RPCBxTest.h.

Referenced by beginRun(), and RPCBxTest().

std::vector<MonitorElement *> RPCBxTest::myBXMe_
private

Definition at line 53 of file RPCBxTest.h.

Referenced by endRun(), and getMonitorElements().

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

Definition at line 54 of file RPCBxTest.h.

Referenced by endRun(), and getMonitorElements().

int RPCBxTest::nLumiSegs_
private

Definition at line 51 of file RPCBxTest.h.

int RPCBxTest::numberOfDisks_
private

Definition at line 46 of file RPCBxTest.h.

Referenced by beginRun(), and RPCBxTest().

int RPCBxTest::numberOfRings_
private

Definition at line 46 of file RPCBxTest.h.

Referenced by RPCBxTest().

int RPCBxTest::prescaleFactor_
private

Definition at line 47 of file RPCBxTest.h.

Referenced by RPCBxTest().

double RPCBxTest::rmsCut_
private

Definition at line 48 of file RPCBxTest.h.

Referenced by endRun(), and RPCBxTest().