CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
RPCEfficiencyBookSecondStep.cc
Go to the documentation of this file.
1 #include <stdio.h>
2 #include <stdlib.h>
3 #include <iostream>
4 #include <string>
5 #include <map>
11 
12 std::map<std::string, MonitorElement*> RPCEfficiencySecond::bookDetUnitSeg(RPCDetId & detId,int nstrips, std::string folderPath) {
13 
14  std::map<std::string, MonitorElement*> meMap;
15 
17 
18  std::string folder = folderPath+ "RollByRoll/" + folderStr->folderStructure(detId);
19 
20  delete folderStr;
21 
22  dbe->setCurrentFolder(folder);
23 
24  RPCGeomServ RPCname(detId);
25  std::string nameRoll = RPCname.name();
26  char detUnitLabel[128];
27  char layerLabel[128];
28 
29  sprintf(detUnitLabel ,"%s",nameRoll.c_str());
30  sprintf(layerLabel ,"%s",nameRoll.c_str());
31 
32  char meId [128];
33  char meTitle [128];
34 
35  //Begin booking DT
36  if(detId.region()==0) {
37 
38  //std::cout<<"Booking "<<folder<<meId<<std::endl;
39  sprintf(meId,"ExpectedOccupancyFromDT_%s",detUnitLabel);
40  sprintf(meTitle,"ExpectedOccupancyFromDT_for_%s",layerLabel);
41  meMap[meId] = dbe->book1D(meId, meTitle, nstrips, 0.5, nstrips+0.5);
42  //std::cout<<"Booking "<<meId<<std::endl;
43 
44  sprintf(meId,"RPCDataOccupancyFromDT_%s",detUnitLabel);
45  sprintf(meTitle,"RPCDataOccupancyFromDT_for_%s",layerLabel);
46  meMap[meId] = dbe->book1D(meId, meTitle, nstrips, 0.5, nstrips+0.5);
47 
48  sprintf(meId,"Profile_%s",detUnitLabel);
49  sprintf(meTitle,"Profile_for_%s",layerLabel);
50  meMap[meId] = dbe->book1D(meId, meTitle, nstrips, 0.5, nstrips+0.5);
51  //std::cout<<"Booking "<<folder<<meId<<std::endl;
52 
53 // sprintf(meId,"BXDistribution_%s",detUnitLabel);
54 // sprintf(meTitle,"BXDistribution_for_%s",layerLabel);
55 // meMap[meId] = dbe->book1D(meId, meTitle, 11,-5.5, 5.5);
56 
57  }else{
58  //std::cout<<"Booking for the EndCap"<<detUnitLabel<<std::endl;
59 
60  //std::cout<<"Booking "<<meId<<std::endl;
61  sprintf(meId,"ExpectedOccupancyFromCSC_%s",detUnitLabel);
62  sprintf(meTitle,"ExpectedOccupancyFromCSC_for_%s",layerLabel);
63  meMap[meId] = dbe->book1D(meId, meTitle, nstrips, 0.5, nstrips+0.5);
64 
65  //std::cout<<"Booking "<<meId<<std::endl;
66  sprintf(meId,"RPCDataOccupancyFromCSC_%s",detUnitLabel);
67  sprintf(meTitle,"RPCDataOccupancyFromCSC_for_%s",layerLabel);
68  meMap[meId] = dbe->book1D(meId, meTitle, nstrips, 0.5, nstrips+0.5);
69 
70  //std::cout<<"Booking "<<meId<<std::endl;
71  sprintf(meId,"Profile_%s",detUnitLabel);
72  sprintf(meTitle,"Profile_for_%s",layerLabel);
73  meMap[meId] = dbe->book1D(meId, meTitle, nstrips, 0.5, nstrips+0.5);
74 
75 // //std::cout<<"Booking "<<meId<<std::endl;
76 // sprintf(meId,"BXDistribution_%s",detUnitLabel);
77 // sprintf(meTitle,"BXDistribution_for_%s",layerLabel);
78 // meMap[meId] = dbe->book1D(meId, meTitle, 11,-5.5, 5.5);
79  }
80  return meMap;
81 }
82 
83 
84 
MonitorElement * book1D(const char *name, const char *title, int nchX, double lowX, double highX)
Book 1D histogram.
Definition: DQMStore.cc:942
virtual std::string name()
Definition: RPCGeomServ.cc:20
std::string folderStructure(RPCDetId detId)
std::map< std::string, MonitorElement * > bookDetUnitSeg(RPCDetId &detId, int nstrips, std::string folder)
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:655
int region() const
Region id: 0 for Barrel, +/-1 For +/- Endcap.
Definition: RPCDetId.h:63