CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
L1TRPCBookME.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 #include <sstream>
7 
12 
13 using namespace std;
14 
16 
17 
18 
19 
20 
21 
22  std::map<std::string, MonitorElement*>
24 
25  std::map<std::string, MonitorElement*> meMap;
26 
27 
28  std::string regionName;
29  std::string ringType;
30  if(detId.region() == 0) {
31  regionName="Barrel";
32  ringType="Wheel";
33  }else{
34  ringType="Disk";
35  if(detId.region() == -1) regionName="Encap-";
36  if(detId.region() == 1) regionName="Encap+";
37  }
38 
39  char folder[220];
40  sprintf(folder,"L1T/L1TRPCTPG/Strips/%s/%s_%d/station_%d/sector_%d",
41  regionName.c_str(),ringType.c_str(),
42  detId.ring(),detId.station(),detId.sector());
43  //cout << folder << endl;
44  dbe->setCurrentFolder(folder);
45 
47  char detUnitLabel[328];
48  char layerLabel[328];
49 
50  //sprintf(detUnitLabel ,"%d",detId());
51  RPCGeomServ RPCname(detId);
52  std::string nameRoll = RPCname.name();
53  sprintf(detUnitLabel ,"%s",nameRoll.c_str());
54  sprintf(layerLabel ,"%s",nameRoll.c_str());
55 
56  char meId [328];
57  char meTitle [328];
58 
59 
60  // Begin booking
61  sprintf(meId,"Occupancy_%s",detUnitLabel);
62  sprintf(meTitle,"Occupancy_for_%s",layerLabel);
63  // cout << meId << endl;
64  // cout << meTitle << endl;
65  meMap[meId] = dbe->book1D(meId, meTitle, 100, 0.5, 100.5);
66 
67  sprintf(meId,"BXN_%s",detUnitLabel);
68  sprintf(meTitle,"BXN_for_%s",layerLabel);
69  meMap[meId] = dbe->book1D(meId, meTitle, 11, -10.5, 10.5);
70 
71  sprintf(meId,"BXN_vs_strip_%s",detUnitLabel);
72  sprintf(meTitle,"BXN_vs_strip_for_%s",layerLabel);
73  meMap[meId] = dbe->book2D(meId, meTitle, 100, 0.5, 100.5, 11, -10.5, 10.5);
74 
75  return meMap;
76  }
77 
78 
79 
80 
81 
82 
std::map< std::string, MonitorElement * > L1TRPCBookME(RPCDetId &detId)
Booking of MonitoringElemnt for one RPCDetId (= roll)
Definition: L1TRPCBookME.cc:23
virtual std::string name()
Definition: RPCGeomServ.cc:20
int ring() const
Definition: RPCDetId.h:76
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