CMS 3D CMS Logo

HcalSubdetDigiMonitor.cc

Go to the documentation of this file.
00001 #include "Validation/HcalDigis/src/HcalSubdetDigiMonitor.h"
00002 #include "DQMServices/Core/interface/DQMStore.h"
00003 #include "DQMServices/Core/interface/MonitorElement.h"
00004 
00005 struct HistLim
00006 {
00007   HistLim(int nbin, float mini, float maxi)
00008   : n(nbin), min(mini), max(maxi) {}
00009   int n;
00010   float min;
00011   float max;
00012 };
00013 
00014 HcalSubdetDigiMonitor::HcalSubdetDigiMonitor(DQMStore* dbe, 
00015                                              const std::string & subdet, int noise)
00016 : dbe_(dbe),
00017   subdet_(subdet),
00018   noise_(noise)
00019 {
00020 
00021   // defaults are for HB
00022 
00023   HistLim ndigis(50, 0., 50.);
00024   HistLim sime(120, 0., 0.6);
00025   HistLim digiAmp(350, -100., 600.);
00026   HistLim ratio(250, 0., 2500.);
00027   HistLim sumAmp(100, -500., 1500.);
00028 
00029   HistLim nbin(10,0.,10.);
00030 
00031   HistLim pedestal(75, 0., 15.);
00032   HistLim pedestalfC(400,-10.,30.);
00033 
00034   HistLim frac(52, -0.02, 1.02);
00035 
00036   HistLim pedLim(80, 0., 8.); 
00037   HistLim pedWidthLim(100, 0., 2.); 
00038 
00039   HistLim gainLim(120, 0.,0.6); 
00040   HistLim gainWidthLim(100, 0.,0.3); 
00041 
00042   HistLim ietaLim( 82, -41., 41.);
00043   HistLim iphiLim(72, 0., 72.);
00044 
00045   if(subdet_ == "HE")
00046     {
00047       sime        = HistLim(100, 0., 0.4);
00048       digiAmp     = HistLim(250, -100., 400.);
00049     }
00050   else if(subdet_ == "HF")
00051     {
00052       ndigis      = HistLim(20, 0., 20.);
00053       sime        = HistLim(30, 0., 30.);
00054       digiAmp     = HistLim(300, -100., 500.);
00055       ratio       = HistLim(50, 0., 50.);
00056       pedLim      = HistLim(100, 0., 20.); 
00057       pedWidthLim = HistLim(100, 0., 5.); 
00058 
00059     }
00060   else if(subdet_ == "HO")
00061     {
00062       sime    = HistLim(100, 0., 0.2);
00063       digiAmp = HistLim(300, 0., 300.);
00064     }
00065   
00066   Char_t histo[100];
00067   const char * sub = subdet_.c_str();
00068   if ( dbe_ ) {
00069     dbe_->setCurrentFolder("HcalDigisV/HcalDigiTask");
00070   }
00071 
00072   /*
00073   std::cout << " HcalSubdetDigiMonitor : "
00074             << "  subdet " << subdet_ 
00075             << "  noise_ " << noise_ 
00076             << std::endl;
00077   */
00078 
00079   if(noise_ == 0) {   
00080 
00081 
00082     // map of sum of amplitudes (sum lin.digis(4,5,6,7) - ped) all depths
00083     sprintf (histo, "HcalDigiTask_ieta_iphi_map_of_amplitudes_fC_%s", sub ) ;
00084     meAmplIetaIphi= book2D(histo,  ietaLim, iphiLim);
00085     // just 1D of all cells' amplitudes 
00086     sprintf (histo, "HcalDigiTask_sum_all_amplitudes_%s", sub);
00087     meSumAmp = book1D(histo, sumAmp);
00088 
00089     sprintf (histo, "HcalDigiTask_number_of_amplitudes_above_10fC_%s", sub);
00090     menDigis = book1D(histo, ndigis);
00091 
00092     sprintf (histo, "HcalDigiTask_ADC0_adc_depth1_%s", sub);
00093     meADC0_depth1 = book1D(histo, pedestal);
00094     sprintf (histo, "HcalDigiTask_ADC0_adc_depth2_%s", sub);
00095     meADC0_depth2 = book1D(histo, pedestal);
00096     sprintf (histo, "HcalDigiTask_ADC0_adc_depth3_%s", sub);
00097     meADC0_depth3 = book1D(histo, pedestal);
00098     sprintf (histo, "HcalDigiTask_ADC0_adc_depth4_%s", sub);
00099     meADC0_depth4 = book1D(histo, pedestal);
00100    
00101     sprintf (histo, "HcalDigiTask_ADC0_fC_depth1_%s", sub);
00102     meADC0fC_depth1 = book1D(histo, pedestalfC);    
00103     sprintf (histo, "HcalDigiTask_ADC0_fC_depth2_%s", sub);
00104     meADC0fC_depth2 = book1D(histo, pedestalfC);
00105     sprintf (histo, "HcalDigiTask_ADC0_fC_depth3_%s", sub);
00106     meADC0fC_depth3 = book1D(histo, pedestalfC);
00107     sprintf (histo, "HcalDigiTask_ADC0_fC_depth4_%s", sub);
00108     meADC0fC_depth4 = book1D(histo, pedestalfC);
00109 
00110     sprintf (histo, "HcalDigiTask_signal_amplitude_%s", sub);
00111     meSignalAmp  = book1D(histo, digiAmp );
00112     sprintf (histo, "HcalDigiTask_signal_amplitude_depth1_%s", sub);
00113     meSignalAmp1 = book1D(histo, digiAmp );
00114     sprintf (histo, "HcalDigiTask_signal_amplitude_depth2_%s", sub);
00115     meSignalAmp2 = book1D(histo, digiAmp );
00116     sprintf (histo, "HcalDigiTask_signal_amplitude_depth3_%s", sub);
00117     meSignalAmp3 = book1D(histo, digiAmp );
00118     sprintf (histo, "HcalDigiTask_signal_amplitude_depth4_%s", sub);
00119     meSignalAmp4 = book1D(histo, digiAmp );
00120 
00121   
00122     sprintf (histo, "HcalDigiTask_signal_amplitude_vs_bin_all_depths_%s", sub);
00123     meSignalTimeSlice = book2D(histo, nbin, digiAmp);
00124 
00125     sprintf (histo, "HcalDigiTask_all_amplitudes_vs_bin_%s", sub);
00126     meAll10slices = book2D(histo, nbin, digiAmp);
00127 
00128     sprintf (histo, "HcalDigiTask_bin_5_frac_%s", sub);
00129     meBin5Frac = book1D(histo, frac);
00130     sprintf (histo, "HcalDigiTask_bin_6_7_frac_%s", sub);
00131     meBin67Frac = book1D(histo, frac);
00132 
00133     
00134     sprintf (histo, "HcalDigiTask_amplitude_vs_simhits_%s", sub);
00135     meDigiSimhit = book2D(histo, sime, digiAmp);
00136     sprintf (histo, "HcalDigiTask_amplitude_vs_simhits_depth1_%s", sub);
00137     meDigiSimhit1 = book2D(histo, sime, digiAmp);
00138     sprintf (histo, "HcalDigiTask_amplitude_vs_simhits_depth2_%s", sub);
00139     meDigiSimhit2 = book2D(histo, sime, digiAmp);
00140     sprintf (histo, "HcalDigiTask_amplitude_vs_simhits_depth3_%s", sub);
00141     meDigiSimhit3 = book2D(histo, sime, digiAmp);
00142     sprintf (histo, "HcalDigiTask_amplitude_vs_simhits_depth4_%s", sub);
00143     meDigiSimhit4 = book2D(histo, sime, digiAmp);
00144   
00145     sprintf (histo, "HcalDigiTask_amplitude_vs_simhits_profile_%s", sub);
00146     meDigiSimhitProfile = bookProfile(histo, sime, digiAmp);
00147     sprintf (histo, "HcalDigiTask_amplitude_vs_simhits_profile_depth1_%s",sub);
00148     meDigiSimhitProfile1 = bookProfile(histo, sime, digiAmp);
00149     sprintf (histo, "HcalDigiTask_amplitude_vs_simhits_profile_depth2_%s",sub);
00150     meDigiSimhitProfile2 = bookProfile(histo, sime, digiAmp);
00151     sprintf (histo, "HcalDigiTask_amplitude_vs_simhits_profile_depth3_%s",sub);
00152     meDigiSimhitProfile3 = bookProfile(histo, sime, digiAmp);
00153     sprintf (histo, "HcalDigiTask_amplitude_vs_simhits_profile_depth4_%s",sub);
00154     meDigiSimhitProfile4 = bookProfile(histo, sime, digiAmp);
00155   
00156     sprintf (histo, "HcalDigiTask_ratio_amplitude_vs_simhits_%s", sub);
00157     meRatioDigiSimhit = book1D(histo, ratio);
00158     sprintf (histo, "HcalDigiTask_ratio_amplitude_vs_simhits_depth1_%s", sub);
00159     meRatioDigiSimhit1 = book1D(histo, ratio);
00160     sprintf (histo, "HcalDigiTask_ratio_amplitude_vs_simhits_depth2_%s", sub);
00161     meRatioDigiSimhit2 = book1D(histo, ratio);
00162     sprintf (histo, "HcalDigiTask_ratio_amplitude_vs_simhits_depth3_%s", sub);
00163     meRatioDigiSimhit3 = book1D(histo, ratio);
00164     sprintf (histo, "HcalDigiTask_ratio_amplitude_vs_simhits_depth4_%s", sub);
00165     meRatioDigiSimhit4 = book1D(histo, ratio);
00166 
00167   }
00168   else {  // noise only  
00169     
00170     // EVENT "1" distributions of all cells properties 
00171     
00172          
00173     if(subdet_ == "HB" || subdet_ == "HE" || subdet_ == "HF") {
00174       sprintf (histo, "HcalDigiTask_gain_capId0_Depth1_%s", sub);
00175       meGain0Depth1 = book1D(histo,gainLim);
00176       sprintf (histo, "HcalDigiTask_gain_capId1_Depth1_%s", sub);
00177       meGain1Depth1 = book1D(histo,gainLim);
00178       sprintf (histo, "HcalDigiTask_gain_capId2_Depth1_%s", sub);
00179       meGain2Depth1 = book1D(histo,gainLim);
00180       sprintf (histo, "HcalDigiTask_gain_capId3_Depth1_%s", sub);
00181       meGain3Depth1 = book1D(histo,gainLim);
00182 
00183       sprintf (histo, "HcalDigiTask_gain_capId0_Depth2_%s", sub);
00184       meGain0Depth2 = book1D(histo,gainLim);
00185       sprintf (histo, "HcalDigiTask_gain_capId1_Depth2_%s", sub);
00186       meGain1Depth2 = book1D(histo,gainLim);
00187       sprintf (histo, "HcalDigiTask_gain_capId2_Depth2_%s", sub);
00188       meGain2Depth2 = book1D(histo,gainLim);
00189       sprintf (histo, "HcalDigiTask_gain_capId3_Depth2_%s", sub);
00190       meGain3Depth2 = book1D(histo,gainLim);
00191 
00192       sprintf (histo, "HcalDigiTask_gainWidth_capId0_Depth1_%s", sub);
00193       meGainWidth0Depth1 = book1D(histo,gainWidthLim);
00194       sprintf (histo, "HcalDigiTask_gainWidth_capId1_Depth1_%s", sub);
00195       meGainWidth1Depth1 = book1D(histo,gainWidthLim);
00196       sprintf (histo, "HcalDigiTask_gainWidth_capId2_Depth1_%s", sub);
00197       meGainWidth2Depth1 = book1D(histo,gainWidthLim);    
00198       sprintf (histo, "HcalDigiTask_gainWidth_capId3_Depth1_%s", sub);
00199       meGainWidth3Depth1 = book1D(histo,gainWidthLim);
00200     
00201       sprintf (histo, "HcalDigiTask_gainWidth_capId0_Depth2_%s", sub);
00202       meGainWidth0Depth2 = book1D(histo,gainWidthLim);
00203       sprintf (histo, "HcalDigiTask_gainWidth_capId1_Depth2_%s", sub);
00204       meGainWidth1Depth2 = book1D(histo,gainWidthLim);
00205       sprintf (histo, "HcalDigiTask_gainWidth_capId2_Depth2_%s", sub);
00206       meGainWidth2Depth2 = book1D(histo,gainWidthLim);    
00207       sprintf (histo, "HcalDigiTask_gainWidth_capId3_Depth2_%s", sub);
00208       meGainWidth3Depth2 = book1D(histo,gainWidthLim);
00209     
00210       sprintf (histo, "HcalDigiTask_pedestal_capId0_Depth1_%s", sub);
00211       mePed0Depth1 = book1D(histo,pedLim);
00212       sprintf (histo, "HcalDigiTask_pedestal_capId1_Depth1_%s", sub);
00213       mePed1Depth1 = book1D(histo,pedLim);
00214       sprintf (histo, "HcalDigiTask_pedestal_capId2_Depth1_%s", sub);
00215       mePed2Depth1 = book1D(histo,pedLim);
00216       sprintf (histo, "HcalDigiTask_pedestal_capId3_Depth1_%s", sub);
00217       mePed3Depth1 = book1D(histo,pedLim);
00218 
00219       sprintf (histo, "HcalDigiTask_pedestal_capId0_Depth2_%s", sub);
00220       mePed0Depth2 = book1D(histo,pedLim);
00221       sprintf (histo, "HcalDigiTask_pedestal_capId1_Depth2_%s", sub);
00222       mePed1Depth2 = book1D(histo,pedLim);
00223       sprintf (histo, "HcalDigiTask_pedestal_capId2_Depth2_%s", sub);
00224       mePed2Depth2 = book1D(histo,pedLim);
00225       sprintf (histo, "HcalDigiTask_pedestal_capId3_Depth2_%s", sub);
00226       mePed3Depth2 = book1D(histo,pedLim);
00227 
00228       sprintf (histo, "HcalDigiTask_pedestal_width_capId0_Depth1_%s", sub);
00229       mePedWidth0Depth1 = book1D(histo,pedWidthLim);
00230       sprintf (histo, "HcalDigiTask_pedestal_width_capId1_Depth1_%s", sub);
00231       mePedWidth1Depth1 = book1D(histo,pedWidthLim);
00232       sprintf (histo, "HcalDigiTask_pedestal_width_capId2_Depth1_%s", sub);
00233       mePedWidth2Depth1 = book1D(histo,pedWidthLim);
00234       sprintf (histo, "HcalDigiTask_pedestal_width_capId3_Depth1_%s", sub);
00235       mePedWidth3Depth1 = book1D(histo,pedWidthLim);
00236 
00237       sprintf (histo, "HcalDigiTask_pedestal_width_capId0_Depth2_%s", sub);
00238       mePedWidth0Depth2 = book1D(histo,pedWidthLim);
00239       sprintf (histo, "HcalDigiTask_pedestal_width_capId1_Depth2_%s", sub);
00240       mePedWidth1Depth2 = book1D(histo,pedWidthLim);
00241       sprintf (histo, "HcalDigiTask_pedestal_width_capId2_Depth2_%s", sub);
00242       mePedWidth2Depth2 = book1D(histo,pedWidthLim);
00243       sprintf (histo, "HcalDigiTask_pedestal_width_capId3_Depth2_%s", sub);
00244       mePedWidth3Depth2 = book1D(histo,pedWidthLim);
00245 
00246 
00247     }
00248 
00249     if(subdet_ == "HE") {
00250       sprintf (histo, "HcalDigiTask_gain_capId0_Depth3_%s", sub);
00251       meGain0Depth3 = book1D(histo,gainLim);
00252       sprintf (histo, "HcalDigiTask_gain_capId1_Depth3_%s", sub);
00253       meGain1Depth3 = book1D(histo,gainLim);
00254       sprintf (histo, "HcalDigiTask_gain_capId2_Depth3_%s", sub);
00255       meGain2Depth3 = book1D(histo,gainLim);
00256       sprintf (histo, "HcalDigiTask_gain_capId3_Depth3_%s", sub);
00257       meGain3Depth3 = book1D(histo,gainLim);
00258 
00259       sprintf (histo, "HcalDigiTask_gainWidth_capId0_Depth3_%s", sub);
00260       meGainWidth0Depth3 = book1D(histo,gainWidthLim);
00261       sprintf (histo, "HcalDigiTask_gainWidth_capId1_Depth3_%s", sub);
00262       meGainWidth1Depth3 = book1D(histo,gainWidthLim);
00263       sprintf (histo, "HcalDigiTask_gainWidth_capId2_Depth3_%s", sub);
00264       meGainWidth2Depth3 = book1D(histo,gainWidthLim);    
00265       sprintf (histo, "HcalDigiTask_gainWidth_capId3_Depth3_%s", sub);
00266       meGainWidth3Depth3 = book1D(histo,gainWidthLim);
00267     
00268       sprintf (histo, "HcalDigiTask_pedestal_capId0_Depth3_%s", sub);
00269       mePed0Depth3 = book1D(histo,pedLim);
00270       sprintf (histo, "HcalDigiTask_pedestal_capId1_Depth3_%s", sub);
00271       mePed1Depth3 = book1D(histo,pedLim);
00272       sprintf (histo, "HcalDigiTask_pedestal_capId2_Depth3_%s", sub);
00273       mePed2Depth3 = book1D(histo,pedLim);
00274       sprintf (histo, "HcalDigiTask_pedestal_capId3_Depth3_%s", sub);
00275       mePed3Depth3 = book1D(histo,pedLim);
00276 
00277       sprintf (histo, "HcalDigiTask_pedestal_width_capId0_Depth3_%s", sub);
00278       mePedWidth0Depth3 = book1D(histo,pedWidthLim);
00279       sprintf (histo, "HcalDigiTask_pedestal_width_capId1_Depth3_%s", sub);
00280       mePedWidth1Depth3 = book1D(histo,pedWidthLim);
00281       sprintf (histo, "HcalDigiTask_pedestal_width_capId2_Depth3_%s", sub);
00282       mePedWidth2Depth3 = book1D(histo,pedWidthLim);
00283       sprintf (histo, "HcalDigiTask_pedestal_width_capId3_Depth3_%s", sub);
00284       mePedWidth3Depth3 = book1D(histo,pedWidthLim);
00285 
00286     }
00287 
00288     if(subdet_ == "HO") {
00289       sprintf (histo, "HcalDigiTask_gain_capId0_Depth4_%s", sub);
00290       meGain0Depth4 = book1D(histo,gainLim);
00291       sprintf (histo, "HcalDigiTask_gain_capId1_Depth4_%s", sub);
00292       meGain1Depth4 = book1D(histo,gainLim);
00293       sprintf (histo, "HcalDigiTask_gain_capId2_Depth4_%s", sub);
00294       meGain2Depth4 = book1D(histo,gainLim);
00295       sprintf (histo, "HcalDigiTask_gain_capId3_Depth4_%s", sub);
00296       meGain3Depth4 = book1D(histo,gainLim);
00297 
00298       sprintf (histo, "HcalDigiTask_gainWidth_capId0_Depth4_%s", sub);
00299       meGainWidth0Depth4 = book1D(histo,gainWidthLim);
00300       sprintf (histo, "HcalDigiTask_gainWidth_capId1_Depth4_%s", sub);
00301       meGainWidth1Depth4 = book1D(histo,gainWidthLim);
00302       sprintf (histo, "HcalDigiTask_gainWidth_capId2_Depth4_%s", sub);
00303       meGainWidth2Depth4 = book1D(histo,gainWidthLim);    
00304       sprintf (histo, "HcalDigiTask_gainWidth_capId3_Depth4_%s", sub);
00305       meGainWidth3Depth4 = book1D(histo,gainWidthLim);
00306 
00307     
00308       sprintf (histo, "HcalDigiTask_pedestal_capId0_Depth4_%s", sub);
00309       mePed0Depth4 = book1D(histo,pedLim);
00310       sprintf (histo, "HcalDigiTask_pedestal_capId1_Depth4_%s", sub);
00311       mePed1Depth4 = book1D(histo,pedLim);
00312       sprintf (histo, "HcalDigiTask_pedestal_capId2_Depth4_%s", sub);
00313       mePed2Depth4 = book1D(histo,pedLim);
00314       sprintf (histo, "HcalDigiTask_pedestal_capId3_Depth4_%s", sub);
00315       mePed3Depth4 = book1D(histo,pedLim);
00316 
00317       sprintf (histo, "HcalDigiTask_pedestal_width_capId0_Depth4_%s", sub);
00318       mePedWidth0Depth4 = book1D(histo,pedWidthLim);
00319       sprintf (histo, "HcalDigiTask_pedestal_width_capId1_Depth4_%s", sub);
00320       mePedWidth1Depth4 = book1D(histo,pedWidthLim);
00321       sprintf (histo, "HcalDigiTask_pedestal_width_capId2_Depth4_%s", sub);
00322       mePedWidth2Depth4 = book1D(histo,pedWidthLim);
00323       sprintf (histo, "HcalDigiTask_pedestal_width_capId3_Depth4_%s", sub);
00324       mePedWidth3Depth4 = book1D(histo,pedWidthLim);
00325 
00326     }
00327 
00328     sprintf (histo, "HcalDigiTask_gainMap_Depth1_%s", sub);
00329     meGainMap1 = book2D(histo, ietaLim, iphiLim);
00330     sprintf (histo, "HcalDigiTask_gainMap_Depth2_%s", sub);
00331     meGainMap2 = book2D(histo, ietaLim, iphiLim);
00332     sprintf (histo, "HcalDigiTask_gainMap_Depth3_%s", sub);
00333     meGainMap3 = book2D(histo, ietaLim, iphiLim);
00334     sprintf (histo, "HcalDigiTask_gainMap_Depth4_%s", sub);
00335     meGainMap4 = book2D(histo, ietaLim, iphiLim);
00336     
00337     sprintf (histo, "HcalDigiTask_pwidthMap_Depth1_%s", sub);
00338     mePwidthMap1 = book2D(histo, ietaLim, iphiLim);
00339     sprintf (histo, "HcalDigiTask_pwidthMap_Depth2_%s", sub);
00340     mePwidthMap2 = book2D(histo, ietaLim, iphiLim);
00341     sprintf (histo, "HcalDigiTask_pwidthMap_Depth3_%s", sub);
00342     mePwidthMap3 = book2D(histo, ietaLim, iphiLim);
00343     sprintf (histo, "HcalDigiTask_pwidthMap_Depth4_%s", sub);
00344     mePwidthMap4 = book2D(histo, ietaLim, iphiLim);
00345  
00346   } //end of noise-only
00347 }
00348 
00349 
00350 MonitorElement * HcalSubdetDigiMonitor::book1D(const std::string & name, 
00351                                     HcalSubdetDigiMonitor::HistLim lim)
00352 {
00353   return dbe_->book1D(name, name, lim.n, lim.min, lim.max);
00354 }
00355 
00356 
00357 MonitorElement * HcalSubdetDigiMonitor::book2D(const std::string & name,
00358                                     HcalSubdetDigiMonitor::HistLim lim1,
00359                                     HcalSubdetDigiMonitor::HistLim lim2)
00360 {
00361   return dbe_->book2D(name, name, lim1.n, lim1.min, lim1.max,
00362                                   lim2.n, lim2.min, lim2.max);
00363 }
00364 
00365 MonitorElement * HcalSubdetDigiMonitor::bookProfile(const std::string & name,
00366                                     HcalSubdetDigiMonitor::HistLim lim1,
00367                                     HcalSubdetDigiMonitor::HistLim lim2)
00368 {
00369   return dbe_->bookProfile(name, name, lim1.n, lim1.min, lim1.max,
00370                                   lim2.n, lim2.min, lim2.max);
00371 }
00372 
00373 
00374 

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