CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_5_3_10_patch1/src/Validation/RPCRecHits/src/RPCValidHistograms.cc

Go to the documentation of this file.
00001 #include "Validation/RPCRecHits/interface/RPCValidHistograms.h"
00002 
00003 #include "TAxis.h"
00004 
00005 void RPCValidHistograms::bookHistograms(DQMStore* dbe, const std::string subDir)
00006 {
00007   if ( !dbe ) 
00008   {
00009     edm::LogError("RPCValidHistograms") << "DBE not initialized\n";
00010     return;
00011   }
00012   if ( booked_ )
00013   {
00014     edm::LogError("RPCValidHistograms") << "Histogram is already booked\n";
00015     return;
00016   }
00017 
00018   const std::string pwd = dbe->pwd();
00019   dbe->setCurrentFolder(subDir);
00020 
00021   // Book histograms
00022   dbe->setCurrentFolder(subDir+"/HitProperty");
00023   clusterSize = dbe->book1D("ClusterSize", "Cluster size;Cluster size", 11, -0.5, 10.5);
00024   clusterSizeBarrel = dbe->book1D("ClusterSizeBarrel", "Cluster size in Barrel;Cluster size", 11, -0.5, 10.5);
00025   clusterSizeEndcap = dbe->book1D("ClusterSizeEndcap", "Cluster size in Endcap;Cluster size", 11, -0.5, 10.5);
00026 
00027   avgClusterSize = dbe->book1D("AverageClusterSize", "Average cluster size;Average clsuter size", 11, -0.5, 10.5);
00028   avgClusterSizeBarrel = dbe->book1D("AverageClusterSizeBarrel", "Average cluster size in Barrel;Average clsuter size", 11, -0.5, 10.5);
00029   avgClusterSizeEndcap = dbe->book1D("AverageClusterSizeEndcap", "Average cluster size in Endcap;Average clsuter size", 11, -0.5, 10.5);
00030 
00031   nRecHitBarrel = dbe->book1D("NRecHitBarrel", "Number of RPC recHits per event in Barrel;Number of RPC hits", 25, 0, 25);
00032   nRecHitEndcap = dbe->book1D("NRecHitEndcap", "Number of RPC recHits per event in Endcap;Number of RPC hits", 25, 0, 25);
00033 
00034   nRefHitBarrel = dbe->book1D("NRefHitBarrel", "Number of reference hits per event in Barrel;Number of RPC hits", 25, 0, 25);
00035   nRefHitEndcap = dbe->book1D("NRefHitEndcap", "Number of reference hits per event in Endcap;Number of RPC hits", 25, 0, 25);
00036 
00037   nMatchHitBarrel = dbe->book1D("nMatchBarrel", "Number of matched reference hits per event in Barrel;Number of RPC hits", 25, 0, 25);
00038   nMatchHitEndcap = dbe->book1D("nMatchEndcap", "Number of matched reference hits per event in Endcap;Number of RPC hits", 25, 0, 25);
00039 
00040   // Occupancy 1D
00041   dbe->setCurrentFolder(subDir+"/Occupancy");
00042   refHitOccupancyBarrel_wheel   = dbe->book1D("RefHitOccupancyBarrel_wheel"  , "Reference Hit occupancy", 5, -2.5, 2.5);
00043   refHitOccupancyEndcap_disk    = dbe->book1D("RefHitOccupancyEndcap_disk"   , "Reference Hit occupancy", 7, -3.5, 3.5);
00044   refHitOccupancyBarrel_station = dbe->book1D("RefHitOccupancyBarrel_station", "Reference Hit occupancy", 4,  0.5, 4.5);
00045 
00046   recHitOccupancyBarrel_wheel   = dbe->book1D("RecHitOccupancyBarrel_wheel"  , "RecHit occupancy", 5, -2.5, 2.5);
00047   recHitOccupancyEndcap_disk    = dbe->book1D("RecHitOccupancyEndcap_disk"   , "RecHit occupancy", 7, -3.5, 3.5);
00048   recHitOccupancyBarrel_station = dbe->book1D("RecHitOccupancyBarrel_station", "RecHit occupancy", 4,  0.5, 4.5);
00049 
00050   matchOccupancyBarrel_wheel   = dbe->book1D("MatchOccupancyBarrel_wheel"  , "Matched hit occupancy", 5, -2.5, 2.5);
00051   matchOccupancyEndcap_disk    = dbe->book1D("MatchOccupancyEndcap_disk"   , "Matched hit occupancy", 7, -3.5, 3.5);
00052   matchOccupancyBarrel_station = dbe->book1D("MatchOccupancyBarrel_station", "Matched hit occupancy", 4,  0.5, 4.5);
00053 
00054   umOccupancyBarrel_wheel   = dbe->book1D("UmOccupancyBarrel_wheel"  , "Un-matched hit occupancy", 5, -2.5, 2.5);
00055   umOccupancyEndcap_disk    = dbe->book1D("UmOccupancyEndcap_disk"   , "Un-matched hit occupancy", 7, -3.5, 3.5);
00056   umOccupancyBarrel_station = dbe->book1D("UmOccupancyBarrel_station", "Un-matched hit occupancy", 4,  0.5, 4.5);
00057 
00058   // Occupancy 2D
00059   refHitOccupancyBarrel_wheel_station = dbe->book2D("RefHitOccupancyBarrel_wheel_station", "Reference hit occupancy", 5, -2.5, 2.5, 4, 0.5, 4.5);
00060   refHitOccupancyEndcap_disk_ring     = dbe->book2D("RefHitOccupancyEndcap_disk_ring"    , "Reference hit occupancy", 7, -3.5, 3.5, 4, 0.5, 4.5);
00061 
00062   recHitOccupancyBarrel_wheel_station = dbe->book2D("RecHitOccupancyBarrel_wheel_station", "RecHit occupancy", 5, -2.5, 2.5, 4, 0.5, 4.5);
00063   recHitOccupancyEndcap_disk_ring     = dbe->book2D("RecHitOccupancyEndcap_disk_ring"    , "RecHit occupancy", 7, -3.5, 3.5, 4, 0.5, 4.5);
00064 
00065   matchOccupancyBarrel_wheel_station = dbe->book2D("MatchOccupancyBarrel_wheel_station", "Matched hit occupancy", 5, -2.5, 2.5, 4, 0.5, 4.5);
00066   matchOccupancyEndcap_disk_ring     = dbe->book2D("MatchOccupancyEndcap_disk_ring"    , "Matched hit occupancy", 7, -3.5, 3.5, 4, 0.5, 4.5);
00067 
00068   umOccupancyBarrel_wheel_station = dbe->book2D("UmOccupancyBarrel_wheel_station", "Un-matched hit occupancy", 5, -2.5, 2.5, 4, 0.5, 4.5);
00069   umOccupancyEndcap_disk_ring     = dbe->book2D("UmOccupancyEndcap_disk_ring"    , "Un-matched hit occupancy", 7, -3.5, 3.5, 4, 0.5, 4.5);
00070 
00071   // Residuals
00072   dbe->setCurrentFolder(subDir+"/Residual");
00073   resBarrel = dbe->book1D("ResBarrel", "Global Residuals for Barrel;Residual [cm]"  , 100, -8, 8);
00074   resEndcap = dbe->book1D("ResEndcap", "Global Residuals for Endcap;Residual [cm]"   , 100, -8, 8);
00075 
00076   res_wheel_res   = dbe->book2D("Res_wheel_res"  , "Residuals vs Wheel;;Residual [cm]", 5, -2.5, 2.5, 50, -8, 8);
00077   res_disk_res    = dbe->book2D("Res_disk_res"   , "Residuals vs Disk;;Residual [cm]", 7, -3.5, 3.5, 50, -8, 8);
00078   res_station_res = dbe->book2D("Res_station_res", "Redisuals vs Station;;Residual [cm]", 4, 0.5, 4.5, 50, -8, 8);
00079   res_ring_res    = dbe->book2D("Res_ring_res"   , "Redisuals vs Ring;;Residual [cm]", 4, 0.5, 4.5, 50, -8, 8);
00080 
00081   // Pulls
00082   pullBarrel = dbe->book1D("PullBarrel", "Global Pull for Barrel;Pull", 100, -3, 3);
00083   pullEndcap = dbe->book1D("PullEndcap", "Global Pull for Endcap;Pull", 100, -3, 3);
00084 
00085   pull_wheel_pull   = dbe->book2D("Pull_wheel_pull"  , "Pull vs Wheel;;Pull"  , 5, -2.5, 2.5, 50, -3, 3);
00086   pull_disk_pull    = dbe->book2D("Pull_disk_pull"   , "Pull vs Disk;;Pull"   , 7, -3.5, 3.5, 50, -3, 3);
00087   pull_station_pull = dbe->book2D("Pull_station_pull", "Pull vs Station;;Pull", 4,  0.5, 4.5, 50, -3, 3);
00088   pull_ring_pull    = dbe->book2D("Pull_ring_pull"   , "Pull vs Ring;;Pull"   , 4,  0.5, 4.5, 50, -3, 3);
00089 
00090   // Set plot options
00091   refHitOccupancyBarrel_wheel_station->getTH2F()->SetOption("COLZ");
00092   refHitOccupancyEndcap_disk_ring    ->getTH2F()->SetOption("COLZ");
00093   recHitOccupancyBarrel_wheel_station->getTH2F()->SetOption("COLZ");
00094   recHitOccupancyEndcap_disk_ring    ->getTH2F()->SetOption("COLZ");
00095   matchOccupancyBarrel_wheel_station ->getTH2F()->SetOption("COLZ");
00096   matchOccupancyEndcap_disk_ring     ->getTH2F()->SetOption("COLZ");
00097   umOccupancyBarrel_wheel_station    ->getTH2F()->SetOption("COLZ");
00098   umOccupancyEndcap_disk_ring        ->getTH2F()->SetOption("COLZ");
00099 
00100   res_wheel_res  ->getTH2F()->SetOption("COLZ");
00101   res_disk_res   ->getTH2F()->SetOption("COLZ");
00102   res_station_res->getTH2F()->SetOption("COLZ");
00103   res_ring_res   ->getTH2F()->SetOption("COLZ");
00104 
00105   pull_wheel_pull  ->getTH2F()->SetOption("COLZ");
00106   pull_disk_pull   ->getTH2F()->SetOption("COLZ");
00107   pull_station_pull->getTH2F()->SetOption("COLZ");
00108   pull_ring_pull   ->getTH2F()->SetOption("COLZ");
00109 
00110   // Set bin labels
00111   for ( int i=1; i<=5; ++i )
00112   {
00113     TString binLabel = Form("Wheel %d", i-3);
00114 
00115     refHitOccupancyBarrel_wheel->getTH1F()->GetXaxis()->SetBinLabel(i, binLabel);
00116     recHitOccupancyBarrel_wheel->getTH1F()->GetXaxis()->SetBinLabel(i, binLabel);
00117     matchOccupancyBarrel_wheel ->getTH1F()->GetXaxis()->SetBinLabel(i, binLabel);
00118     umOccupancyBarrel_wheel    ->getTH1F()->GetXaxis()->SetBinLabel(i, binLabel);
00119 
00120     refHitOccupancyBarrel_wheel_station->getTH2F()->GetXaxis()->SetBinLabel(i, binLabel);
00121     recHitOccupancyBarrel_wheel_station->getTH2F()->GetXaxis()->SetBinLabel(i, binLabel);
00122     matchOccupancyBarrel_wheel_station ->getTH2F()->GetXaxis()->SetBinLabel(i, binLabel);
00123     umOccupancyBarrel_wheel_station    ->getTH2F()->GetXaxis()->SetBinLabel(i, binLabel);
00124 
00125     res_wheel_res  ->getTH2F()->GetXaxis()->SetBinLabel(i, binLabel);
00126     pull_wheel_pull->getTH2F()->GetXaxis()->SetBinLabel(i, binLabel);
00127   }
00128 
00129   for ( int i=1; i<=7; ++i )
00130   {
00131     TString binLabel = Form("Disk %d", i-4);
00132 
00133     refHitOccupancyEndcap_disk->getTH1F()->GetXaxis()->SetBinLabel(i, binLabel);
00134     recHitOccupancyEndcap_disk->getTH1F()->GetXaxis()->SetBinLabel(i, binLabel);
00135     matchOccupancyEndcap_disk ->getTH1F()->GetXaxis()->SetBinLabel(i, binLabel);
00136     umOccupancyEndcap_disk    ->getTH1F()->GetXaxis()->SetBinLabel(i, binLabel);
00137 
00138     refHitOccupancyEndcap_disk_ring->getTH2F()->GetXaxis()->SetBinLabel(i, binLabel);
00139     recHitOccupancyEndcap_disk_ring->getTH2F()->GetXaxis()->SetBinLabel(i, binLabel);
00140     matchOccupancyEndcap_disk_ring ->getTH2F()->GetXaxis()->SetBinLabel(i, binLabel);
00141     umOccupancyEndcap_disk_ring    ->getTH2F()->GetXaxis()->SetBinLabel(i, binLabel);
00142 
00143     res_disk_res  ->getTH2F()->GetXaxis()->SetBinLabel(i, binLabel);
00144     pull_disk_pull->getTH2F()->GetXaxis()->SetBinLabel(i, binLabel);
00145   }
00146 
00147   for ( int i=1; i<=4; ++i )
00148   {
00149     TString binLabel = Form("Station %d", i);
00150 
00151     refHitOccupancyBarrel_station->getTH1F()->GetXaxis()->SetBinLabel(i, binLabel);
00152     recHitOccupancyBarrel_station->getTH1F()->GetXaxis()->SetBinLabel(i, binLabel);
00153     matchOccupancyBarrel_station ->getTH1F()->GetXaxis()->SetBinLabel(i, binLabel);
00154     umOccupancyBarrel_station    ->getTH1F()->GetXaxis()->SetBinLabel(i, binLabel);
00155 
00156     refHitOccupancyBarrel_wheel_station->getTH2F()->GetYaxis()->SetBinLabel(i, binLabel);
00157     recHitOccupancyBarrel_wheel_station->getTH2F()->GetYaxis()->SetBinLabel(i, binLabel);
00158     matchOccupancyBarrel_wheel_station ->getTH2F()->GetYaxis()->SetBinLabel(i, binLabel);
00159     umOccupancyBarrel_wheel_station    ->getTH2F()->GetYaxis()->SetBinLabel(i, binLabel);
00160 
00161     res_station_res  ->getTH2F()->GetXaxis()->SetBinLabel(i, binLabel);
00162     pull_station_pull->getTH2F()->GetXaxis()->SetBinLabel(i, binLabel);
00163   }
00164 
00165   for ( int i=1; i<=4; ++i )
00166   {
00167     TString binLabel = Form("Ring %d", i);
00168 
00169     refHitOccupancyEndcap_disk_ring->getTH2F()->GetYaxis()->SetBinLabel(i, binLabel);
00170     recHitOccupancyEndcap_disk_ring->getTH2F()->GetYaxis()->SetBinLabel(i, binLabel);
00171     matchOccupancyEndcap_disk_ring ->getTH2F()->GetYaxis()->SetBinLabel(i, binLabel);
00172     umOccupancyEndcap_disk_ring    ->getTH2F()->GetYaxis()->SetBinLabel(i, binLabel);
00173   }
00174 
00175   dbe->setCurrentFolder(pwd);
00176   booked_ = true;
00177 }
00178