CMS 3D CMS Logo

/afs/cern.ch/work/a/aaltunda/public/www/CMSSW_6_2_7/src/DQM/L1TMonitor/src/L1TRPCBookME.cc

Go to the documentation of this file.
00001 #include <stdio.h>
00002 #include <stdlib.h>
00003 #include <iostream>
00004 #include <string>
00005 #include <map>
00006 #include <sstream>
00007 
00008 #include <DQM/L1TMonitor/interface/L1TRPCTPG.h>
00009 #include <DataFormats/MuonDetId/interface/RPCDetId.h>
00010 #include <Geometry/RPCGeometry/interface/RPCGeomServ.h>
00011 #include "DQMServices/Core/interface/MonitorElement.h"
00012 
00013 using namespace std;
00014 
00016 
00017 
00018 
00019 
00020 
00021 
00022   std::map<std::string, MonitorElement*> 
00023    L1TRPCTPG::L1TRPCBookME(RPCDetId & detId) {
00024     
00025     std::map<std::string, MonitorElement*> meMap;
00026 
00027 
00028     std::string regionName;
00029     std::string ringType;
00030     if(detId.region() ==  0) {
00031       regionName="Barrel";
00032       ringType="Wheel";
00033     }else{
00034       ringType="Disk";
00035       if(detId.region() == -1) regionName="Encap-";
00036       if(detId.region() ==  1) regionName="Encap+";
00037     }
00038     
00039     char  folder[220];
00040     sprintf(folder,"L1T/L1TRPCTPG/Strips/%s/%s_%d/station_%d/sector_%d",
00041      regionName.c_str(),ringType.c_str(),
00042      detId.ring(),detId.station(),detId.sector());
00043     //cout << folder << endl;
00044     dbe->setCurrentFolder(folder);
00045     
00047     char detUnitLabel[328];
00048     char layerLabel[328];
00049     
00050   //sprintf(detUnitLabel ,"%d",detId());
00051     RPCGeomServ RPCname(detId);
00052     std::string nameRoll = RPCname.name();
00053     sprintf(detUnitLabel ,"%s",nameRoll.c_str());
00054     sprintf(layerLabel ,"%s",nameRoll.c_str());
00055     
00056     char meId [328];
00057     char meTitle [328];
00058     
00059     
00060  // Begin booking
00061      sprintf(meId,"Occupancy_%s",detUnitLabel);
00062      sprintf(meTitle,"Occupancy_for_%s",layerLabel);
00063      //   cout << meId << endl;
00064      //   cout << meTitle << endl; 
00065      meMap[meId] = dbe->book1D(meId, meTitle, 100, 0.5, 100.5);
00066       
00067      sprintf(meId,"BXN_%s",detUnitLabel);
00068      sprintf(meTitle,"BXN_for_%s",layerLabel);
00069      meMap[meId] = dbe->book1D(meId, meTitle, 11, -10.5, 10.5);
00070       
00071      sprintf(meId,"BXN_vs_strip_%s",detUnitLabel);
00072      sprintf(meTitle,"BXN_vs_strip_for_%s",layerLabel);
00073      meMap[meId] = dbe->book2D(meId, meTitle,  100, 0.5, 100.5, 11, -10.5, 10.5);
00074       
00075     return meMap;
00076   }
00077   
00078   
00079 
00080 
00081 
00082