CMS 3D CMS Logo

RPCBookDetUnitSeg.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/RPCMonitorDigi/interface/MuonSegmentEff.h>
00010 #include "DQMServices/Core/interface/MonitorElement.h"
00011 
00012 #include "Geometry/RPCGeometry/interface/RPCGeomServ.h"
00013 std::map<std::string, MonitorElement*> MuonSegmentEff::bookDetUnitSeg(RPCDetId & detId) {
00014   
00015   std::map<std::string, MonitorElement*> meMap;
00016   std::string regionName;
00017   std::string ringType;
00018   if(detId.region()==0) {
00019     regionName="Barrel";
00020     ringType="Wheel";
00021   }
00022   else{
00023     ringType="Disk";
00024     if(detId.region() == -1) regionName="Endcap-";
00025     if(detId.region() ==  1) regionName="Endcap+";
00026   }
00027   
00028   char  folder[120];
00029   sprintf(folder,"RPC/MuonSegEff/%s/%s_%d/station_%d/sector_%d",regionName.c_str(),ringType.c_str(),detId.ring(),detId.station(),detId.sector());
00030   dbe->setCurrentFolder(folder);
00031 
00032   RPCGeomServ RPCname(detId);
00033   std::string nameRoll = RPCname.name();
00034 
00035   char detUnitLabel[128];
00036   char layerLabel[128];
00037 
00038   sprintf(detUnitLabel ,"%s",nameRoll.c_str());
00039   sprintf(layerLabel ,"%s",nameRoll.c_str());
00040 
00041   char meId [128];
00042   char meTitle [128];
00043   
00044 
00045   //Begin booking DT
00046   if(detId.region()==0) {
00047     std::cout<<"Booking for the Barrel"<<detUnitLabel<<std::endl;
00048 
00049     sprintf(meId,"ExpectedOccupancyFromDT_%s",detUnitLabel);
00050     sprintf(meTitle,"ExpectedOccupancyFromDT_for_%s",layerLabel);
00051     meMap[meId] = dbe->book1D(meId, meTitle, 100, 0.5, 100.5);
00052     
00053     sprintf(meId,"RealDetectedOccupancyFromDT_%s",detUnitLabel);
00054     sprintf(meTitle,"RealDetectedOccupancyFromDT_for_%s",layerLabel);
00055     meMap[meId] = dbe->book1D(meId, meTitle, 100, 0.5, 100.5);
00056     
00057     sprintf(meId,"ExpectedOccupancy2DFromDT_%s",detUnitLabel);
00058     sprintf(meTitle,"ExpectedOccupancy2DFromDT_for_%s",layerLabel);
00059     meMap[meId] = dbe->book2D(meId, meTitle, 100, 0.5, 100.5,200,-100.,100.);
00060     
00061     sprintf(meId,"RPCDataOccupancyFromDT_%s",detUnitLabel);
00062     sprintf(meTitle,"RPCDataOccupancyFromDT_for_%s",layerLabel);
00063     meMap[meId] = dbe->book1D(meId, meTitle, 100, 0.5, 100.5);
00064     
00065     sprintf(meId,"RPCDataOccupancy2DFromDT_%s",detUnitLabel);
00066     sprintf(meTitle,"RPCDataOccupancy2DFromDT_for_%s",layerLabel);
00067     meMap[meId] = dbe->book2D(meId, meTitle, 100, 0.5, 100.5,200,-100.,100.);
00068     
00069     sprintf(meId,"RPCResidualsFromDT_%s",detUnitLabel);
00070     sprintf(meTitle,"RPCResidualsFromDT_for_%s",layerLabel);
00071     meMap[meId] = dbe->book1D(meId, meTitle, 201,-100.5, 100.5);
00072 
00073     sprintf(meId,"BXDistribution_%s",detUnitLabel);
00074     sprintf(meTitle,"BXDistribution_for_%s",layerLabel);
00075     meMap[meId] = dbe->book1D(meId, meTitle, 11,-5.5, 5.5);
00076     
00077     sprintf(meId,"RPCResiduals2DFromDT_%s",detUnitLabel);
00078     sprintf(meTitle,"RPCResiduals2DFromDT_for_%s",layerLabel);
00079     meMap[meId] = dbe->book2D(meId, meTitle, 201,-100.5, 100.5,200,-100.,100.);
00080     
00081     sprintf(meId,"EfficienyFromDTExtrapolation_%s",detUnitLabel);
00082     sprintf(meTitle,"EfficienyFromDTExtrapolation_for_%s",layerLabel);
00083     meMap[meId] = dbe->book1D(meId, meTitle, 100, 0.5, 100.5);
00084     
00085     sprintf(meId,"EfficienyFromDT2DExtrapolation_%s",detUnitLabel);
00086     sprintf(meTitle,"EfficienyFromDT2DExtrapolation_for_%s",layerLabel);
00087     meMap[meId] = dbe->book2D(meId, meTitle, 100, 0.5, 100.5,200,-100.,100.);
00088 
00089   }else{
00090     std::cout<<"Booking for the EndCap"<<detUnitLabel<<std::endl;
00091 
00092     sprintf(meId,"ExpectedOccupancyFromCSC_%s",detUnitLabel);
00093     sprintf(meTitle,"ExpectedOccupancyFromCSC_for_%s",layerLabel);
00094     meMap[meId] = dbe->book1D(meId, meTitle, 100, 0.5, 100.5);
00095     
00096     sprintf(meId,"RealDetectedOccupancyFromCSC_%s",detUnitLabel);
00097     sprintf(meTitle,"RealDetectedOccupancyFromCSC_for_%s",layerLabel);
00098     meMap[meId] = dbe->book1D(meId, meTitle, 100, 0.5, 100.5);
00099     
00100     sprintf(meId,"ExpectedOccupancy2DFromCSC_%s",detUnitLabel);
00101     sprintf(meTitle,"ExpectedOccupancy2DFromCSC_for_%s",layerLabel);
00102     meMap[meId] = dbe->book2D(meId, meTitle, 100, 0.5, 100.5,200,-100.,100.);
00103     
00104     sprintf(meId,"RPCDataOccupancyFromCSC_%s",detUnitLabel);
00105     sprintf(meTitle,"RPCDataOccupancyFromCSC_for_%s",layerLabel);
00106     meMap[meId] = dbe->book1D(meId, meTitle, 100, 0.5, 100.5);
00107     
00108     sprintf(meId,"RPCDataOccupancy2DFromCSC_%s",detUnitLabel);
00109     sprintf(meTitle,"RPCDataOccupancy2DFromCSC_for_%s",layerLabel);
00110     meMap[meId] = dbe->book2D(meId, meTitle, 100, 0.5, 100.5,200,-100.,100.);
00111     
00112     sprintf(meId,"RPCResidualsFromCSC_%s",detUnitLabel);
00113     sprintf(meTitle,"RPCResidualsFromCSC_for_%s",layerLabel);
00114     meMap[meId] = dbe->book1D(meId, meTitle, 201,-100.5, 100.5);
00115 
00116     sprintf(meId,"BXDistribution_%s",detUnitLabel);
00117     sprintf(meTitle,"BXDistribution_for_%s",layerLabel);
00118     meMap[meId] = dbe->book1D(meId, meTitle, 11,-5.5, 5.5);
00119 
00120     sprintf(meId,"RPCResiduals2DFromCSC_%s",detUnitLabel);
00121     sprintf(meTitle,"RPCResiduals2DFromCSC_for_%s",layerLabel);
00122     meMap[meId] = dbe->book2D(meId, meTitle, 201,-100.5, 100.5,200,-100.,100.);
00123     
00124     sprintf(meId,"EfficienyFromCSCExtrapolation_%s",detUnitLabel);
00125     sprintf(meTitle,"EfficienyFromCSCExtrapolation_for_%s",layerLabel);
00126     meMap[meId] = dbe->book1D(meId, meTitle, 100, 0.5, 100.5);
00127     
00128     sprintf(meId,"EfficienyFromCSC2DExtrapolation_%s",detUnitLabel);
00129     sprintf(meTitle,"EfficienyFromCSC2DExtrapolation_for_%s",layerLabel);
00130     meMap[meId] = dbe->book2D(meId, meTitle, 100, 0.5, 100.5,200,-100.,100.);
00131   }
00132 
00133   return meMap;
00134 }
00135 
00136 
00137 

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