CMS 3D CMS Logo

BookRPCEfficiency.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 
00007 
00008 #include <DataFormats/MuonDetId/interface/RPCDetId.h>
00009 #include <DQMOffline/Muon/interface/RPCEfficiency.h>
00010 #include <DQMOffline/Muon/interface/RPCBookFolderStructure.h>
00011 #include "DQMServices/Core/interface/MonitorElement.h"
00012 
00013 #include "Geometry/RPCGeometry/interface/RPCGeomServ.h"
00014 std::map<std::string, MonitorElement*> RPCEfficiency::bookDetUnitSeg(RPCDetId & detId,int nstrips) {
00015   
00016   std::map<std::string, MonitorElement*> meMap;
00017    
00018   RPCBookFolderStructure *  folderStr = new RPCBookFolderStructure(); //Anna
00019   std::string folder = "Muons/MuonSegEff/" +  folderStr->folderStructure(detId);
00020 
00021   dbe->setCurrentFolder(folder);
00022 
00023   RPCGeomServ RPCname(detId);
00024   std::string nameRoll = RPCname.name();
00025 
00026   char detUnitLabel[128];
00027   char layerLabel[128];
00028 
00029   sprintf(detUnitLabel ,"%s",nameRoll.c_str());
00030   sprintf(layerLabel ,"%s",nameRoll.c_str());
00031 
00032   char meId [128];
00033   char meTitle [128];
00034   
00035   //Begin booking DT
00036   if(detId.region()==0) {
00037     
00038     sprintf(meId,"ExpectedOccupancyFromDT_%s",detUnitLabel);
00039     sprintf(meTitle,"ExpectedOccupancyFromDT_for_%s",layerLabel);
00040     meMap[meId] = dbe->book1D(meId, meTitle, nstrips, 0.5, nstrips+0.5);
00041     
00042     sprintf(meId,"RealDetectedOccupancyFromDT_%s",detUnitLabel);
00043     sprintf(meTitle,"RealDetectedOccupancyFromDT_for_%s",layerLabel);
00044     meMap[meId] = dbe->book1D(meId, meTitle, nstrips, 0.5, nstrips+0.5);
00045     
00046     sprintf(meId,"RPCDataOccupancyFromDT_%s",detUnitLabel);
00047     sprintf(meTitle,"RPCDataOccupancyFromDT_for_%s",layerLabel);
00048     meMap[meId] = dbe->book1D(meId, meTitle, nstrips, 0.5, nstrips+0.5);
00049     
00050     sprintf(meId,"BXDistribution_%s",detUnitLabel);
00051     sprintf(meTitle,"BXDistribution_for_%s",layerLabel);
00052     meMap[meId] = dbe->book1D(meId, meTitle, 11,-5.5, 5.5);
00053   }else{
00054     //std::cout<<"Booking for the EndCap"<<detUnitLabel<<std::endl;
00055 
00056     sprintf(meId,"ExpectedOccupancyFromCSC_%s",detUnitLabel);
00057     sprintf(meTitle,"ExpectedOccupancyFromCSC_for_%s",layerLabel);
00058     meMap[meId] = dbe->book1D(meId, meTitle, nstrips, 0.5, nstrips+0.5);
00059     
00060     sprintf(meId,"RealDetectedOccupancyFromCSC_%s",detUnitLabel);
00061     sprintf(meTitle,"RealDetectedOccupancyFromCSC_for_%s",layerLabel);
00062     meMap[meId] = dbe->book1D(meId, meTitle, nstrips, 0.5, nstrips+0.5);
00063     
00064     sprintf(meId,"RPCDataOccupancyFromCSC_%s",detUnitLabel);
00065     sprintf(meTitle,"RPCDataOccupancyFromCSC_for_%s",layerLabel);
00066     meMap[meId] = dbe->book1D(meId, meTitle, nstrips, 0.5, nstrips+0.5);
00067     
00068     sprintf(meId,"BXDistribution_%s",detUnitLabel);
00069     sprintf(meTitle,"BXDistribution_for_%s",layerLabel);
00070     meMap[meId] = dbe->book1D(meId, meTitle, 11,-5.5, 5.5);
00071   }
00072   return meMap;
00073 }
00074 
00075 
00076 

Generated on Tue Jun 9 17:33:48 2009 for CMSSW by  doxygen 1.5.4