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>
6 
7 
13 
14 std::map<std::string, MonitorElement*> RPCEfficiencySecond::bookDetUnitSeg(RPCDetId & detId,int nstrips, std::string folderPath) {
15 
16  std::map<std::string, MonitorElement*> meMap;
17 
18  RPCBookFolderStructure * folderStr = new RPCBookFolderStructure(); //Anna
19 
20  std::string folder = folderPath+ "RollByRoll/" + folderStr->folderStructure(detId);
21 
22  delete folderStr;
23 
24  dbe->setCurrentFolder(folder);
25 
26  RPCGeomServ RPCname(detId);
27  std::string nameRoll = RPCname.name();
28 
29  char detUnitLabel[128];
30  char layerLabel[128];
31 
32  sprintf(detUnitLabel ,"%s",nameRoll.c_str());
33  sprintf(layerLabel ,"%s",nameRoll.c_str());
34 
35  char meId [128];
36  char meTitle [128];
37 
38  //Begin booking DT
39  if(detId.region()==0) {
40 
41  //std::cout<<"Booking "<<folder<<meId<<std::endl;
42  sprintf(meId,"ExpectedOccupancyFromDT_%s",detUnitLabel);
43  sprintf(meTitle,"ExpectedOccupancyFromDT_for_%s",layerLabel);
44  meMap[meId] = dbe->book1D(meId, meTitle, nstrips, 0.5, nstrips+0.5);
45  //std::cout<<"Booking "<<meId<<std::endl;
46 
47  sprintf(meId,"RPCDataOccupancyFromDT_%s",detUnitLabel);
48  sprintf(meTitle,"RPCDataOccupancyFromDT_for_%s",layerLabel);
49  meMap[meId] = dbe->book1D(meId, meTitle, nstrips, 0.5, nstrips+0.5);
50 
51  sprintf(meId,"Profile_%s",detUnitLabel);
52  sprintf(meTitle,"Profile_for_%s",layerLabel);
53  meMap[meId] = dbe->book1D(meId, meTitle, nstrips, 0.5, nstrips+0.5);
54  //std::cout<<"Booking "<<folder<<meId<<std::endl;
55 
56 // sprintf(meId,"BXDistribution_%s",detUnitLabel);
57 // sprintf(meTitle,"BXDistribution_for_%s",layerLabel);
58 // meMap[meId] = dbe->book1D(meId, meTitle, 11,-5.5, 5.5);
59 
60  }else{
61  //std::cout<<"Booking for the EndCap"<<detUnitLabel<<std::endl;
62 
63  //std::cout<<"Booking "<<meId<<std::endl;
64  sprintf(meId,"ExpectedOccupancyFromCSC_%s",detUnitLabel);
65  sprintf(meTitle,"ExpectedOccupancyFromCSC_for_%s",layerLabel);
66  meMap[meId] = dbe->book1D(meId, meTitle, nstrips, 0.5, nstrips+0.5);
67 
68  //std::cout<<"Booking "<<meId<<std::endl;
69  sprintf(meId,"RPCDataOccupancyFromCSC_%s",detUnitLabel);
70  sprintf(meTitle,"RPCDataOccupancyFromCSC_for_%s",layerLabel);
71  meMap[meId] = dbe->book1D(meId, meTitle, nstrips, 0.5, nstrips+0.5);
72 
73  //std::cout<<"Booking "<<meId<<std::endl;
74  sprintf(meId,"Profile_%s",detUnitLabel);
75  sprintf(meTitle,"Profile_for_%s",layerLabel);
76  meMap[meId] = dbe->book1D(meId, meTitle, nstrips, 0.5, nstrips+0.5);
77 
78 // //std::cout<<"Booking "<<meId<<std::endl;
79 // sprintf(meId,"BXDistribution_%s",detUnitLabel);
80 // sprintf(meTitle,"BXDistribution_for_%s",layerLabel);
81 // meMap[meId] = dbe->book1D(meId, meTitle, 11,-5.5, 5.5);
82  }
83  return meMap;
84 }
85 
86 
87 
MonitorElement * book1D(const char *name, const char *title, int nchX, double lowX, double highX)
Book 1D histogram.
Definition: DQMStore.cc:722
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:434
int region() const
Region id: 0 for Barrel, +/-1 For +/- Endcap.
Definition: RPCDetId.h:66