CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_6_1_2_SLHC2_patch1/src/DQM/RPCMonitorClient/src/RPCEfficiencyBookSecondStep.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 <DQM/RPCMonitorClient/interface/RPCEfficiencySecond.h>
00010 #include <DQM/RPCMonitorDigi/interface/RPCBookFolderStructure.h>
00011 #include "DQMServices/Core/interface/MonitorElement.h"
00012 #include "Geometry/RPCGeometry/interface/RPCGeomServ.h"
00013 
00014 std::map<std::string, MonitorElement*> RPCEfficiencySecond::bookDetUnitSeg(RPCDetId & detId,int nstrips, std::string folderPath) {
00015   
00016   std::map<std::string, MonitorElement*> meMap;
00017    
00018   RPCBookFolderStructure *  folderStr = new RPCBookFolderStructure(); //Anna
00019 
00020   std::string folder = folderPath+ "RollByRoll/" +  folderStr->folderStructure(detId);
00021 
00022   delete folderStr;
00023 
00024   dbe->setCurrentFolder(folder);
00025 
00026   RPCGeomServ RPCname(detId);
00027   std::string nameRoll = RPCname.name();
00028 
00029   char detUnitLabel[128];
00030   char layerLabel[128];
00031 
00032   sprintf(detUnitLabel ,"%s",nameRoll.c_str());
00033   sprintf(layerLabel ,"%s",nameRoll.c_str());
00034 
00035   char meId [128];
00036   char meTitle [128];
00037   
00038   //Begin booking DT
00039   if(detId.region()==0) {
00040 
00041     //std::cout<<"Booking "<<folder<<meId<<std::endl;
00042     sprintf(meId,"ExpectedOccupancyFromDT_%s",detUnitLabel);
00043     sprintf(meTitle,"ExpectedOccupancyFromDT_for_%s",layerLabel);
00044     meMap[meId] = dbe->book1D(meId, meTitle, nstrips, 0.5, nstrips+0.5);
00045     //std::cout<<"Booking "<<meId<<std::endl;
00046  
00047     sprintf(meId,"RPCDataOccupancyFromDT_%s",detUnitLabel);
00048     sprintf(meTitle,"RPCDataOccupancyFromDT_for_%s",layerLabel);
00049     meMap[meId] = dbe->book1D(meId, meTitle, nstrips, 0.5, nstrips+0.5);
00050 
00051     sprintf(meId,"Profile_%s",detUnitLabel);
00052     sprintf(meTitle,"Profile_for_%s",layerLabel);
00053     meMap[meId] = dbe->book1D(meId, meTitle, nstrips, 0.5, nstrips+0.5);
00054     //std::cout<<"Booking "<<folder<<meId<<std::endl;
00055 
00056 //     sprintf(meId,"BXDistribution_%s",detUnitLabel);
00057 //     sprintf(meTitle,"BXDistribution_for_%s",layerLabel);
00058 //     meMap[meId] = dbe->book1D(meId, meTitle, 11,-5.5, 5.5);
00059     
00060   }else{
00061     //std::cout<<"Booking for the EndCap"<<detUnitLabel<<std::endl;
00062 
00063     //std::cout<<"Booking "<<meId<<std::endl;
00064     sprintf(meId,"ExpectedOccupancyFromCSC_%s",detUnitLabel);
00065     sprintf(meTitle,"ExpectedOccupancyFromCSC_for_%s",layerLabel);
00066     meMap[meId] = dbe->book1D(meId, meTitle, nstrips, 0.5, nstrips+0.5);
00067        
00068     //std::cout<<"Booking "<<meId<<std::endl;
00069     sprintf(meId,"RPCDataOccupancyFromCSC_%s",detUnitLabel);
00070     sprintf(meTitle,"RPCDataOccupancyFromCSC_for_%s",layerLabel);
00071     meMap[meId] = dbe->book1D(meId, meTitle, nstrips, 0.5, nstrips+0.5);
00072     
00073     //std::cout<<"Booking "<<meId<<std::endl;
00074     sprintf(meId,"Profile_%s",detUnitLabel);
00075     sprintf(meTitle,"Profile_for_%s",layerLabel);
00076     meMap[meId] = dbe->book1D(meId, meTitle, nstrips, 0.5, nstrips+0.5);
00077     
00078 //     //std::cout<<"Booking "<<meId<<std::endl;
00079 //     sprintf(meId,"BXDistribution_%s",detUnitLabel);
00080 //     sprintf(meTitle,"BXDistribution_for_%s",layerLabel);
00081 //     meMap[meId] = dbe->book1D(meId, meTitle, 11,-5.5, 5.5);
00082   }
00083   return meMap;
00084 }
00085 
00086 
00087