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

#include <RPCMultiplicityTest.h>

Inheritance diagram for RPCMultiplicityTest:
RPCClient

Public Member Functions

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

Protected Member Functions

void fillGlobalME (RPCDetId &detId, MonitorElement *myMe)
 

Private Attributes

DQMStoredbe_
 
std::string globalFolder_
 
MonitorElementMULTDDisk [10]
 
MonitorElementMULTDisk [10]
 
MonitorElementMULTDWheel [5]
 
MonitorElementMULTWheel [5]
 
std::vector< RPCDetIdmyDetIds_
 
std::vector< MonitorElement * > myNumDigiMe_
 
int numberOfDisks_
 
int numberOfRings_
 
int prescaleFactor_
 
bool testMode_
 
bool useRollInfo_
 

Detailed Description

Definition at line 11 of file RPCMultiplicityTest.h.

Constructor & Destructor Documentation

RPCMultiplicityTest::RPCMultiplicityTest ( const edm::ParameterSet ps)

Constructor.

Definition at line 16 of file RPCMultiplicityTest.cc.

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

16  {
17  edm::LogVerbatim ("multiplicity") << "[RPCMultiplicityTest]: Constructor";
18  useRollInfo_ = ps.getUntrackedParameter<bool>("UseRollInfo", false);
19  prescaleFactor_ = ps.getUntrackedParameter<int>("DiagnosticPrescale", 1);
20  numberOfDisks_ = ps.getUntrackedParameter<int>("NumberOfEndcapDisks", 3);
21  numberOfRings_ = ps.getUntrackedParameter<int>("NumberOfEndcapRings", 2);
22  testMode_ = ps.getUntrackedParameter<bool>("testMode", false);
23 }
T getUntrackedParameter(std::string const &, T const &) const
RPCMultiplicityTest::~RPCMultiplicityTest ( )
virtual

Destructor.

Definition at line 25 of file RPCMultiplicityTest.cc.

References dbe_.

25  {
26  dbe_ = 0;
27 }

Member Function Documentation

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

Analyze.

Implements RPCClient.

Definition at line 72 of file RPCMultiplicityTest.cc.

72 {}
void RPCMultiplicityTest::beginJob ( DQMStore dbe,
std::string  workingFolder 
)
virtual

BeginJob.

Implements RPCClient.

Definition at line 30 of file RPCMultiplicityTest.cc.

References dbe_, and globalFolder_.

30  {
31  edm::LogVerbatim ("multiplicity") << "[RPCMultiplicityTest]: Begin job";
32 
33  globalFolder_ = workingFolder;
34  dbe_=dbe;
35 }
void RPCMultiplicityTest::beginLuminosityBlock ( edm::LuminosityBlock const &  lumiSeg,
edm::EventSetup const &  context 
)
virtual

Begin Lumi block.

Implements RPCClient.

Definition at line 70 of file RPCMultiplicityTest.cc.

70 {}
void RPCMultiplicityTest::beginRun ( const edm::Run r,
const edm::EventSetup c 
)
virtual

Implements RPCClient.

Definition at line 86 of file RPCMultiplicityTest.cc.

References DQMStore::book1D(), DQMStore::book2D(), dbe_, DQMStore::get(), MonitorElement::getName(), globalFolder_, i, rpcdqm::utils::labelXAxisSector(), rpcdqm::utils::labelXAxisSegment(), rpcdqm::utils::labelYAxisRing(), rpcdqm::utils::labelYAxisRoll(), MULTDDisk, MULTDisk, MULTDWheel, MULTWheel, NULL, numberOfDisks_, numberOfRings_, evf::evtn::offset(), DQMStore::removeElement(), DQMStore::setCurrentFolder(), testMode_, and useRollInfo_.

86  {
87 
88  MonitorElement* me=NULL;
90 
91  std::stringstream histoName;
92 
93  rpcdqm::utils rpcUtils;
94 
95  for (int i = -2; i<=2;i++ ){//loop on wheels and disks
96 
97  histoName.str("");
98  histoName<<"NumberOfDigi_Mean_Roll_vs_Sector_Wheel"<<i;
99  me = 0;
100  me = dbe_->get(globalFolder_ +"/"+ histoName.str());
101  if ( 0!=me) {
102  dbe_->removeElement(me->getName());
103  }
104 
105  MULTWheel[i+2] = dbe_->book2D(histoName.str().c_str(), histoName.str().c_str(), 12, 0.5, 12.5, 21, 0.5, 21.5);
106 
107  rpcUtils.labelXAxisSector( MULTWheel[i+2]);
108  rpcUtils.labelYAxisRoll( MULTWheel[i+2], 0, i,useRollInfo_ );
109 
110  if(testMode_){
111  histoName.str("");
112  histoName<<"NumberOfDigi_Mean_Distribution_Wheel"<<i;
113  me = 0;
114  me = dbe_->get(globalFolder_ +"/"+ histoName.str());
115  if ( 0!=me) {
116  dbe_->removeElement(me->getName());
117  }
118 
119  MULTDWheel[i+2] = dbe_->book1D(histoName.str().c_str(), histoName.str().c_str(), 100, 0.5, 50.5);
120  }
121 
122  }//end wheels
123 
124  for(int d = -numberOfDisks_; d<=numberOfDisks_; d++ ){
125  if (d == 0 )continue;
126 
127  int offset = numberOfDisks_;
128  if (d>0) offset --; //used to skip case equale to zero
129 
130  histoName.str("");
131  histoName<<"NumberOfDigi_Mean_Ring_vs_Segment_Disk"<<d;
132  me = 0;
133  me = dbe_->get(globalFolder_ +"/"+ histoName.str());
134  if ( 0!=me) {
135  dbe_->removeElement(me->getName());
136  }
137  MULTDisk[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);
138  rpcUtils.labelXAxisSegment(MULTDisk[d+offset]);
139  rpcUtils.labelYAxisRing(MULTDisk[d+offset], numberOfRings_,useRollInfo_ );
140 
141  if(testMode_){
142  histoName.str("");
143  histoName<<"NumberOfDigi_Mean_Distribution_Disk"<<d;
144  me = 0;
145  me = dbe_->get(globalFolder_ +"/"+ histoName.str());
146  if ( 0!=me) {
147  dbe_->removeElement(me->getName());
148  }
149 
150  MULTDDisk[d+offset] = dbe_->book1D(histoName.str().c_str(), histoName.str().c_str(), 100, 0.5, 50.5);
151  }
152  }//end loop on wheels and disks
153 
154 
155 }
const std::string & getName(void) const
get name of ME
int i
Definition: DBlmapReader.cc:9
MonitorElement * MULTDDisk[10]
MonitorElement * book1D(const char *name, const char *title, int nchX, double lowX, double highX)
Book 1D histogram.
Definition: DQMStore.cc:717
MonitorElement * MULTDisk[10]
void labelXAxisSegment(MonitorElement *myMe)
Definition: utils.h:251
void labelYAxisRoll(MonitorElement *myMe, int region, int ring, bool useRollInfo)
Definition: utils.h:269
#define NULL
Definition: scimark2.h:8
void labelYAxisRing(MonitorElement *myMe, int numberOfRings, bool useRollInfo)
Definition: utils.h:296
void removeElement(const std::string &name)
Definition: DQMStore.cc:2572
MonitorElement * MULTDWheel[5]
MonitorElement * MULTWheel[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 * 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
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:429
void RPCMultiplicityTest::clientOperation ( edm::EventSetup const &  c)
virtual

Implements RPCClient.

Definition at line 76 of file RPCMultiplicityTest.cc.

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

76  {
77 
78  edm::LogVerbatim ("multiplicity") <<"[RPCMultiplicityTest]: Client Operation";
79 
80  //Loop on MEs
81  for (unsigned int i = 0 ; i<myNumDigiMe_.size();i++){
83  }//End loop on MEs
84 }
int i
Definition: DBlmapReader.cc:9
void fillGlobalME(RPCDetId &detId, MonitorElement *myMe)
std::vector< RPCDetId > myDetIds_
std::vector< MonitorElement * > myNumDigiMe_
void RPCMultiplicityTest::endJob ( void  )
virtual

Endjob.

Implements RPCClient.

Definition at line 157 of file RPCMultiplicityTest.cc.

157 {}
void RPCMultiplicityTest::endLuminosityBlock ( edm::LuminosityBlock const &  lumiSeg,
edm::EventSetup const &  iSetup 
)
virtual

End Lumi Block.

Implements RPCClient.

Definition at line 74 of file RPCMultiplicityTest.cc.

74 {}
void RPCMultiplicityTest::endRun ( const edm::Run r,
const edm::EventSetup iSetup 
)
virtual

Implements RPCClient.

Definition at line 38 of file RPCMultiplicityTest.cc.

38  {
39 
40  edm::LogVerbatim ("multiplicity") << "[RPCMultiplicityTest]: End run";
41 
42 }
void RPCMultiplicityTest::fillGlobalME ( RPCDetId detId,
MonitorElement myMe 
)
protected

Definition at line 159 of file RPCMultiplicityTest.cc.

References rpcdqm::utils::detId2RollNr(), MonitorElement::Fill(), MonitorElement::getMean(), timingPdfMaker::mean, MULTDDisk, MULTDisk, MULTDWheel, MULTWheel, NULL, numberOfDisks_, numberOfRings_, RPCDetId::region(), RPCDetId::ring(), RPCDetId::roll(), RPCDetId::sector(), RPCGeomServ::segment(), MonitorElement::setBinContent(), RPCDetId::station(), and testMode_.

Referenced by clientOperation().

159  {
160 
161  MonitorElement * MULT =NULL;
162  MonitorElement * MULTD = NULL;
163 
164  if (detId.region()==0) {
165  MULT = MULTWheel[detId.ring()+2];
166  if(testMode_) MULTD = MULTDWheel[detId.ring()+2];
167  }else{
168  if(-detId.station() + numberOfDisks_ >= 0 ){
169 
170  if(detId.region()<0){
171  MULT = MULTDisk[-detId.station() + numberOfDisks_];
172  if(testMode_) MULTD = MULTDDisk[-detId.station()+ numberOfDisks_];
173  }else{
174  MULT = MULTDisk[detId.station()+ numberOfDisks_ -1];
175  if(testMode_) MULTD = MULTDDisk[detId.station()+ numberOfDisks_-1];
176  }
177  }
178  }
179 
180 
181 
182  int xBin,yBin;
183  if(detId.region()==0){//Barrel
184  xBin= detId.sector();
185  rpcdqm::utils rollNumber;
186  yBin = rollNumber.detId2RollNr(detId);
187  }else{//Endcap
188  //get segment number
189  RPCGeomServ RPCServ(detId);
190  xBin = RPCServ.segment();
191  (numberOfRings_ == 3 ? yBin= detId.ring()*3-detId.roll()+1 : yBin= (detId.ring()-1)*3-detId.roll()+1);
192  }
193 
194  float mean = myMe->getMean();
195 
196  if(MULT) MULT->setBinContent(xBin,yBin, mean );
197  if(testMode_ && MULTD) MULTD->Fill(mean);
198 
199 
200 
201 }
void setBinContent(int binx, double content)
set content of bin (1-D)
MonitorElement * MULTDDisk[10]
MonitorElement * MULTDisk[10]
#define NULL
Definition: scimark2.h:8
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 * MULTDWheel[5]
MonitorElement * MULTWheel[5]
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:106
int region() const
Region id: 0 for Barrel, +/-1 For +/- Endcap.
Definition: RPCDetId.h:67
int station() const
Definition: RPCDetId.h:100
void RPCMultiplicityTest::getMonitorElements ( std::vector< MonitorElement * > &  meVector,
std::vector< RPCDetId > &  detIdVector 
)
virtual

Implements RPCClient.

Definition at line 44 of file RPCMultiplicityTest.cc.

References i, rpcdqm::MULTIPLICITY, myDetIds_, myNumDigiMe_, and packageDocSplitter::tagList.

44  {
45 
46  //Get NumberOfDigi ME for each roll
47  for (unsigned int i = 0 ; i<meVector.size(); i++){
48 
49  bool flag= false;
50 
52  tagList = meVector[i]->getTags();
53  DQMNet::TagList::iterator tagItr = tagList.begin();
54 
55  while (tagItr != tagList.end() && !flag ) {
56  if((*tagItr) == rpcdqm::MULTIPLICITY)
57  flag= true;
58 
59  tagItr++;
60  }
61 
62  if(flag){
63  myNumDigiMe_.push_back(meVector[i]);
64  myDetIds_.push_back(detIdVector[i]);
65  }
66  }
67 }
int i
Definition: DBlmapReader.cc:9
long int flag
Definition: mlp_lapack.h:47
std::vector< uint32_t > TagList
Definition: DQMNet.h:83
std::vector< RPCDetId > myDetIds_
std::vector< MonitorElement * > myNumDigiMe_

Member Data Documentation

DQMStore* RPCMultiplicityTest::dbe_
private

Definition at line 64 of file RPCMultiplicityTest.h.

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

std::string RPCMultiplicityTest::globalFolder_
private

Definition at line 52 of file RPCMultiplicityTest.h.

Referenced by beginJob(), and beginRun().

MonitorElement* RPCMultiplicityTest::MULTDDisk[10]
private

Definition at line 62 of file RPCMultiplicityTest.h.

Referenced by beginRun(), and fillGlobalME().

MonitorElement* RPCMultiplicityTest::MULTDisk[10]
private

Definition at line 61 of file RPCMultiplicityTest.h.

Referenced by beginRun(), and fillGlobalME().

MonitorElement* RPCMultiplicityTest::MULTDWheel[5]
private

Definition at line 60 of file RPCMultiplicityTest.h.

Referenced by beginRun(), and fillGlobalME().

MonitorElement* RPCMultiplicityTest::MULTWheel[5]
private

Definition at line 59 of file RPCMultiplicityTest.h.

Referenced by beginRun(), and fillGlobalME().

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

Definition at line 57 of file RPCMultiplicityTest.h.

Referenced by clientOperation(), and getMonitorElements().

std::vector<MonitorElement *> RPCMultiplicityTest::myNumDigiMe_
private

Definition at line 56 of file RPCMultiplicityTest.h.

Referenced by clientOperation(), and getMonitorElements().

int RPCMultiplicityTest::numberOfDisks_
private

Definition at line 53 of file RPCMultiplicityTest.h.

Referenced by beginRun(), fillGlobalME(), and RPCMultiplicityTest().

int RPCMultiplicityTest::numberOfRings_
private

Definition at line 54 of file RPCMultiplicityTest.h.

Referenced by beginRun(), fillGlobalME(), and RPCMultiplicityTest().

int RPCMultiplicityTest::prescaleFactor_
private

Definition at line 51 of file RPCMultiplicityTest.h.

Referenced by RPCMultiplicityTest().

bool RPCMultiplicityTest::testMode_
private

Definition at line 58 of file RPCMultiplicityTest.h.

Referenced by beginRun(), fillGlobalME(), and RPCMultiplicityTest().

bool RPCMultiplicityTest::useRollInfo_
private

Definition at line 55 of file RPCMultiplicityTest.h.

Referenced by beginRun(), and RPCMultiplicityTest().