CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_4_1_8_patch9/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   std::string folder = folderPath+ "RollByRoll/" +  folderStr->folderStructure(detId);
00020 
00021   delete folderStr;
00022 
00023   dbe->setCurrentFolder(folder);
00024 
00025   RPCGeomServ RPCname(detId);
00026   std::string nameRoll = RPCname.name();
00027 
00028   char detUnitLabel[128];
00029   char layerLabel[128];
00030 
00031   sprintf(detUnitLabel ,"%s",nameRoll.c_str());
00032   sprintf(layerLabel ,"%s",nameRoll.c_str());
00033 
00034   char meId [128];
00035   char meTitle [128];
00036   
00037   //Begin booking DT
00038   if(detId.region()==0) {
00039 
00040     //std::cout<<"Booking "<<folder<<meId<<std::endl;
00041     sprintf(meId,"ExpectedOccupancyFromDT_%s",detUnitLabel);
00042     sprintf(meTitle,"ExpectedOccupancyFromDT_for_%s",layerLabel);
00043     meMap[meId] = dbe->book1D(meId, meTitle, nstrips, 0.5, nstrips+0.5);
00044     //std::cout<<"Booking "<<meId<<std::endl;
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,"Profile_%s",detUnitLabel);
00051     sprintf(meTitle,"Profile_for_%s",layerLabel);
00052     meMap[meId] = dbe->book1D(meId, meTitle, nstrips, 0.5, nstrips+0.5);
00053     //std::cout<<"Booking "<<folder<<meId<<std::endl;
00054 
00055     sprintf(meId,"BXDistribution_%s",detUnitLabel);
00056     sprintf(meTitle,"BXDistribution_for_%s",layerLabel);
00057     meMap[meId] = dbe->book1D(meId, meTitle, 11,-5.5, 5.5);
00058     
00059   }else{
00060     //std::cout<<"Booking for the EndCap"<<detUnitLabel<<std::endl;
00061 
00062     //std::cout<<"Booking "<<meId<<std::endl;
00063     sprintf(meId,"ExpectedOccupancyFromCSC_%s",detUnitLabel);
00064     sprintf(meTitle,"ExpectedOccupancyFromCSC_for_%s",layerLabel);
00065     meMap[meId] = dbe->book1D(meId, meTitle, nstrips, 0.5, nstrips+0.5);
00066        
00067     //std::cout<<"Booking "<<meId<<std::endl;
00068     sprintf(meId,"RPCDataOccupancyFromCSC_%s",detUnitLabel);
00069     sprintf(meTitle,"RPCDataOccupancyFromCSC_for_%s",layerLabel);
00070     meMap[meId] = dbe->book1D(meId, meTitle, nstrips, 0.5, nstrips+0.5);
00071     
00072     //std::cout<<"Booking "<<meId<<std::endl;
00073     sprintf(meId,"Profile_%s",detUnitLabel);
00074     sprintf(meTitle,"Profile_for_%s",layerLabel);
00075     meMap[meId] = dbe->book1D(meId, meTitle, nstrips, 0.5, nstrips+0.5);
00076     
00077     //std::cout<<"Booking "<<meId<<std::endl;
00078     sprintf(meId,"BXDistribution_%s",detUnitLabel);
00079     sprintf(meTitle,"BXDistribution_for_%s",layerLabel);
00080     meMap[meId] = dbe->book1D(meId, meTitle, 11,-5.5, 5.5);
00081   }
00082   return meMap;
00083 }
00084 
00085 
00086