CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_5_3_0/src/Validation/HcalDigis/src/HcalSubdetDigiMonitor.h

Go to the documentation of this file.
00001 #ifndef HcalDigis_HcalSubdetDigiMonitor_h
00002 #define HcalDigis_HcalSubdetDigiMonitor_h
00003 
00004 #include "DQMServices/Core/interface/DQMStore.h"
00005 #include <string>
00006 #include "DQMServices/Core/interface/MonitorElement.h"
00007 
00008 class HcalSubdetDigiMonitor
00009 {
00010 public:
00011 
00012   HcalSubdetDigiMonitor(DQMStore* dbe, const std::string & subdet, int noise);
00013 
00014   // Ndigis 
00015   void fillmeNdigis(double v1)
00016   {fillElement(meNdigis, v1);}
00017 
00018   // occupancies filling
00019   void fillmeOccupancy_map_depth1(double v1, double v2)
00020   {fillElements(meOccupancy_map_depth1, v1, v2);}
00021   void fillmeOccupancy_map_depth2(double v1, double v2)
00022   {fillElements(meOccupancy_map_depth2, v1, v2);}
00023   void fillmeOccupancy_map_depth3(double v1, double v2)
00024   {fillElements(meOccupancy_map_depth3, v1, v2);}
00025   void fillmeOccupancy_map_depth4(double v1, double v2)
00026   {fillElements(meOccupancy_map_depth4, v1, v2);}
00027 
00028   void fillmeOccupancy_vs_ieta_depth1(double v1, double v2)
00029   {fillElements(meOccupancy_vs_ieta_depth1, v1, v2);}
00030   void fillmeOccupancy_vs_ieta_depth2(double v1, double v2)
00031   {fillElements(meOccupancy_vs_ieta_depth2, v1, v2);}
00032   void fillmeOccupancy_vs_ieta_depth3(double v1, double v2)
00033   {fillElements(meOccupancy_vs_ieta_depth3, v1, v2);}
00034   void fillmeOccupancy_vs_ieta_depth4(double v1, double v2)
00035   {fillElements(meOccupancy_vs_ieta_depth4, v1, v2);}
00036 
00037   // occupancies handling
00038   double getBinContent_depth1(int i, int j)
00039   {return getMeElementBinContent(meOccupancy_map_depth1, i, j);} 
00040   double getBinContent_depth2(int i, int j)
00041   {return getMeElementBinContent(meOccupancy_map_depth2, i, j);} 
00042   double getBinContent_depth3(int i, int j)
00043   {return getMeElementBinContent(meOccupancy_map_depth3, i, j);} 
00044   double getBinContent_depth4(int i, int j)
00045   {return getMeElementBinContent(meOccupancy_map_depth4, i, j);} 
00046 
00047   void setBinContent_depth1(int i, int j, double v)
00048   {setMeElementBinContent(meOccupancy_map_depth1, i, j, v);} 
00049   void setBinContent_depth2(int i, int j, double v)
00050   {setMeElementBinContent(meOccupancy_map_depth2, i, j, v);} 
00051   void setBinContent_depth3(int i, int j, double v)
00052   {setMeElementBinContent(meOccupancy_map_depth3, i, j, v);} 
00053   void setBinContent_depth4(int i, int j, double v)
00054   {setMeElementBinContent(meOccupancy_map_depth4, i, j, v);} 
00055 
00056 
00057   //
00058   void fillmeAmplIetaIphi1(double v1, double v2, double v3)
00059   {fillElements(meAmplIetaIphi1, v1, v2, v3);}
00060   void fillmeAmplIetaIphi2(double v1, double v2, double v3)
00061   {fillElements(meAmplIetaIphi2, v1, v2, v3);}
00062   void fillmeAmplIetaIphi3(double v1, double v2, double v3)
00063   {fillElements(meAmplIetaIphi3, v1, v2, v3);}
00064   void fillmeAmplIetaIphi4(double v1, double v2, double v3)
00065   {fillElements(meAmplIetaIphi4, v1, v2, v3);}  
00066 
00067 
00068   void fillmeSumAmp(double v1)
00069   {fillElement(meSumAmp, v1);}
00070 
00071   void fillmenDigis(double v1)
00072   {fillElement(menDigis, v1 );}
00073 
00074   void fillmeADC0_depth1(double v1)
00075   {fillElement(meADC0_depth1, v1 );}
00076   void fillmeADC0_depth2(double v1)
00077   {fillElement(meADC0_depth2, v1 );}
00078   void fillmeADC0_depth3(double v1)
00079   {fillElement(meADC0_depth3, v1);}
00080   void fillmeADC0_depth4(double v1)
00081   {fillElement(meADC0_depth4, v1);}
00082 
00083   void fillmeADC0fC_depth1(double v1)
00084   {fillElement(meADC0fC_depth1, v1);}
00085   void fillmeADC0fC_depth2(double v1)
00086   {fillElement(meADC0fC_depth2, v1);}
00087   void fillmeADC0fC_depth3(double v1)
00088   {fillElement(meADC0fC_depth3, v1);}
00089   void fillmeADC0fC_depth4(double v1)
00090   {fillElement(meADC0fC_depth4, v1);}
00091 
00092   void fillmeSignalAmp(double v1)
00093   {fillElement(meSignalAmp, v1);}
00094   void fillmeSignalAmp1(double v1)
00095   {fillElement(meSignalAmp1, v1);}
00096   void fillmeSignalAmp2(double v1)
00097   {fillElement(meSignalAmp2, v1);}
00098   void fillmeSignalAmp3(double v1)
00099   {fillElement(meSignalAmp3, v1);}
00100   void fillmeSignalAmp4(double v1)
00101   {fillElement(meSignalAmp4, v1);}
00102 
00103   void fillmeSignalTimeSlice(double v1, double v2)
00104   {fillElements(meSignalTimeSlice, v1, v2);}
00105 
00106   void fillmeAll10slices(double v1, double v2)
00107   {fillElements(meAll10slices, v1, v2);}
00108 
00109   void fillmeAll10slices1D(double v1, double v2)
00110   {fillElements(meAll10slices1D, v1, v2);}
00111 
00112   void fillmeBin5Frac(double v1)
00113   {fillElement(meBin5Frac, v1);}
00114   void fillmeBin67Frac(double v1)
00115   {fillElement(meBin67Frac, v1);}
00116 
00117   void fillmeDigiSimhit(double v1, double v2)
00118   {fillElements(meDigiSimhit, v1, v2);}
00119   void fillmeDigiSimhit1(double v1, double v2)
00120   {fillElements(meDigiSimhit1, v1, v2);}
00121   void fillmeDigiSimhit2(double v1, double v2)
00122   {fillElements(meDigiSimhit2, v1, v2);}
00123   void fillmeDigiSimhit3(double v1, double v2)
00124   {fillElements(meDigiSimhit3, v1, v2);}
00125   void fillmeDigiSimhit4(double v1, double v2)
00126   {fillElements(meDigiSimhit4, v1, v2);}
00127 
00128   void fillmeDigiSimhitProfile(double v1, double v2)
00129   {fillElements(meDigiSimhitProfile, v1, v2);}
00130   void fillmeDigiSimhitProfile1(double v1, double v2)
00131   {fillElements(meDigiSimhitProfile1, v1, v2);}
00132   void fillmeDigiSimhitProfile2(double v1, double v2)
00133   {fillElements(meDigiSimhitProfile2, v1, v2);}
00134   void fillmeDigiSimhitProfile3(double v1, double v2)
00135   {fillElements(meDigiSimhitProfile3, v1, v2);}
00136   void fillmeDigiSimhitProfile4(double v1, double v2)
00137   {fillElements(meDigiSimhitProfile4, v1, v2);}
00138 
00139   void fillmeRatioDigiSimhit(double v1)
00140   {fillElement(meRatioDigiSimhit, v1);}
00141   void fillmeRatioDigiSimhit1(double v1)
00142   {fillElement(meRatioDigiSimhit1, v1);}
00143   void fillmeRatioDigiSimhit2(double v1)
00144   {fillElement(meRatioDigiSimhit2, v1);}
00145   void fillmeRatioDigiSimhit3(double v1)
00146   {fillElement(meRatioDigiSimhit3, v1);}
00147   void fillmeRatioDigiSimhit4(double v1)
00148   {fillElement(meRatioDigiSimhit4, v1);}
00149 
00150 
00151   // DB constants 
00152 
00153   void fillmeGain0Depth1(double v1)
00154   {fillElement(meGain0Depth1, v1);}
00155   void fillmeGain1Depth1(double v1)
00156   {fillElement(meGain1Depth1, v1);}
00157   void fillmeGain2Depth1(double v1)
00158   {fillElement(meGain2Depth1, v1);}
00159   void fillmeGain3Depth1(double v1)
00160   {fillElement(meGain3Depth1, v1);}
00161   void fillmeGain0Depth2(double v1)
00162   {fillElement(meGain0Depth2, v1);}
00163   void fillmeGain1Depth2(double v1)
00164   {fillElement(meGain1Depth2, v1);}
00165   void fillmeGain2Depth2(double v1)
00166   {fillElement(meGain2Depth2, v1);}
00167   void fillmeGain3Depth2(double v1)
00168   {fillElement(meGain3Depth2, v1);}
00169   void fillmeGain0Depth3(double v1)
00170   {fillElement(meGain0Depth3, v1);}
00171   void fillmeGain1Depth3(double v1)
00172   {fillElement(meGain1Depth3, v1);}
00173   void fillmeGain2Depth3(double v1)
00174   {fillElement(meGain2Depth3, v1);}
00175   void fillmeGain3Depth3(double v1)
00176   {fillElement(meGain3Depth3, v1);}
00177   void fillmeGain0Depth4(double v1)
00178   {fillElement(meGain0Depth4, v1);}
00179   void fillmeGain1Depth4(double v1)
00180   {fillElement(meGain1Depth4, v1);}
00181   void fillmeGain2Depth4(double v1)
00182   {fillElement(meGain2Depth4, v1);}
00183   void fillmeGain3Depth4(double v1)
00184   {fillElement(meGain3Depth4, v1);}
00185 
00186   void fillmeGainWidth0Depth1(double v1)
00187   {fillElement(meGainWidth0Depth1, v1);}
00188   void fillmeGainWidth1Depth1(double v1)
00189   {fillElement(meGainWidth1Depth1, v1);}
00190   void fillmeGainWidth2Depth1(double v1)
00191   {fillElement(meGainWidth2Depth1, v1);}
00192   void fillmeGainWidth3Depth1(double v1)
00193   {fillElement(meGainWidth3Depth1, v1);}
00194   void fillmeGainWidth0Depth2(double v1)
00195   {fillElement(meGainWidth0Depth2, v1);}
00196   void fillmeGainWidth1Depth2(double v1)
00197   {fillElement(meGainWidth1Depth2, v1);}
00198   void fillmeGainWidth2Depth2(double v1)
00199   {fillElement(meGainWidth2Depth2, v1);}
00200   void fillmeGainWidth3Depth2(double v1)
00201   {fillElement(meGainWidth3Depth2, v1);}
00202   void fillmeGainWidth0Depth3(double v1)
00203   {fillElement(meGainWidth0Depth3, v1);}
00204   void fillmeGainWidth1Depth3(double v1)
00205   {fillElement(meGainWidth1Depth3, v1);}
00206   void fillmeGainWidth2Depth3(double v1)
00207   {fillElement(meGainWidth2Depth3, v1);}
00208   void fillmeGainWidth3Depth3(double v1)
00209   {fillElement(meGainWidth3Depth3, v1);}
00210   void fillmeGainWidth0Depth4(double v1)
00211   {fillElement(meGainWidth0Depth4, v1);}
00212   void fillmeGainWidth1Depth4(double v1)
00213   {fillElement(meGainWidth1Depth4, v1);}
00214   void fillmeGainWidth2Depth4(double v1)
00215   {fillElement(meGainWidth2Depth4, v1);}
00216   void fillmeGainWidth3Depth4(double v1)
00217   {fillElement(meGainWidth3Depth4, v1);}
00218 
00219   void fillmePed0Depth1(double v1)
00220   {fillElement(mePed0Depth1, v1);}
00221   void fillmePed1Depth1(double v1)
00222   {fillElement(mePed1Depth1, v1);}
00223   void fillmePed2Depth1(double v1)
00224   {fillElement(mePed2Depth1, v1);}
00225   void fillmePed3Depth1(double v1)
00226   {fillElement(mePed3Depth1, v1);}
00227   void fillmePed0Depth2(double v1)
00228   {fillElement(mePed0Depth2, v1);}
00229   void fillmePed1Depth2(double v1)
00230   {fillElement(mePed1Depth2, v1);}
00231   void fillmePed2Depth2(double v1)
00232   {fillElement(mePed2Depth2, v1);}
00233   void fillmePed3Depth2(double v1)
00234   {fillElement(mePed3Depth2, v1);}
00235   void fillmePed0Depth3(double v1)
00236   {fillElement(mePed0Depth3, v1);}
00237   void fillmePed1Depth3(double v1)
00238   {fillElement(mePed1Depth3, v1);}
00239   void fillmePed2Depth3(double v1)
00240   {fillElement(mePed2Depth3, v1);}
00241   void fillmePed3Depth3(double v1)
00242   {fillElement(mePed3Depth3, v1);}
00243   void fillmePed0Depth4(double v1)
00244   {fillElement(mePed0Depth4, v1);}
00245   void fillmePed1Depth4(double v1)
00246   {fillElement(mePed1Depth4, v1);}
00247   void fillmePed2Depth4(double v1)
00248   {fillElement(mePed2Depth4, v1);}
00249   void fillmePed3Depth4(double v1)
00250   {fillElement(mePed3Depth4, v1);}
00251 
00252 
00253   void fillmePedWidth0Depth1(double v1)
00254   {fillElement(mePedWidth0Depth1, v1);}
00255   void fillmePedWidth1Depth1(double v1)
00256   {fillElement(mePedWidth1Depth1, v1);}
00257   void fillmePedWidth2Depth1(double v1)
00258   {fillElement(mePedWidth2Depth1, v1);}
00259   void fillmePedWidth3Depth1(double v1)
00260   {fillElement(mePedWidth3Depth1, v1);}
00261   void fillmePedWidth0Depth2(double v1)
00262   {fillElement(mePedWidth0Depth2, v1);}
00263   void fillmePedWidth1Depth2(double v1)
00264   {fillElement(mePedWidth1Depth2, v1);}
00265   void fillmePedWidth2Depth2(double v1)
00266   {fillElement(mePedWidth2Depth2, v1);}
00267   void fillmePedWidth3Depth2(double v1)
00268   {fillElement(mePedWidth3Depth2, v1);}
00269   void fillmePedWidth0Depth3(double v1)
00270   {fillElement(mePedWidth0Depth3, v1);}
00271   void fillmePedWidth1Depth3(double v1)
00272   {fillElement(mePedWidth1Depth3, v1);}
00273   void fillmePedWidth2Depth3(double v1)
00274   {fillElement(mePedWidth2Depth3, v1);}
00275   void fillmePedWidth3Depth3(double v1)
00276   {fillElement(mePedWidth3Depth3, v1);}
00277   void fillmePedWidth0Depth4(double v1)
00278   {fillElement(mePedWidth0Depth4, v1);}
00279   void fillmePedWidth1Depth4(double v1)
00280   {fillElement(mePedWidth1Depth4, v1);}
00281   void fillmePedWidth2Depth4(double v1)
00282   {fillElement(mePedWidth2Depth4, v1);}
00283   void fillmePedWidth3Depth4(double v1)
00284   {fillElement(mePedWidth3Depth4, v1);}
00285 
00286   void fillmeGainMap1(double v1, double v2, double v3)
00287   {fillElements(meGainMap1, v1, v2, v3);}
00288   void fillmeGainMap2(double v1, double v2, double v3)
00289   {fillElements(meGainMap2, v1, v2, v3);}
00290   void fillmeGainMap3(double v1, double v2, double v3)
00291   {fillElements(meGainMap3, v1, v2, v3);}
00292   void fillmeGainMap4(double v1, double v2, double v3)
00293   {fillElements(meGainMap4, v1, v2, v3);}
00294 
00295   void fillmePwidthMap1(double v1, double v2, double v3)
00296   {fillElements(mePwidthMap1, v1, v2, v3);}
00297   void fillmePwidthMap2(double v1, double v2, double v3)
00298   {fillElements(mePwidthMap2, v1, v2, v3);}
00299   void fillmePwidthMap3(double v1, double v2, double v3)
00300   {fillElements(mePwidthMap3, v1, v2, v3);}
00301   void fillmePwidthMap4(double v1, double v2, double v3)
00302   {fillElements(mePwidthMap4, v1, v2, v3);}
00303 
00304 private:
00305 
00306   void fillElement(MonitorElement* me, double value)
00307   {
00308     if(me) me->Fill(value);
00309   }
00310   void fillElements(MonitorElement* me, double v1, double v2)
00311   {
00312     if(me) me->Fill(v1, v2);
00313   }
00314   void fillElements(MonitorElement* me, double v1, double v2, double v3)
00315   {
00316     if(me) me->Fill(v1, v2, v3);
00317   }
00318 
00319   double getMeElementBinContent(MonitorElement* me, int i, int j)
00320   {
00321     double tmp = 0.;
00322     if(me) tmp = me->getBinContent(i,j);
00323     return tmp;
00324   }
00325 
00326   void setMeElementBinContent(MonitorElement* me, int i, int j, double v)
00327   {
00328     if(me) me->setBinContent(i,j,v);
00329   }
00330 
00331 
00332   // little embedded struct
00333   struct HistLim
00334   {
00335     HistLim(int nbin, float mini, float maxi)
00336     : n(nbin), min(mini), max(maxi) {}
00337     int n;
00338     float min;
00339     float max;
00340   };
00341  
00342   // utilities to create MonitorElements
00343   MonitorElement * book1D(const std::string & name, HistLim lim);
00344   MonitorElement * book2D(const std::string & name, HistLim lim1,
00345                                                     HistLim lim2);
00346   MonitorElement * bookProfile(const std::string & name, HistLim lim1, 
00347                                                          HistLim lim2);
00348 
00349   DQMStore* dbe_;
00350   std::string subdet_;
00351   int noise_;
00352 
00353   MonitorElement* meNdigis;
00354 
00355   MonitorElement* meOccupancy_map_depth1;
00356   MonitorElement* meOccupancy_map_depth2;
00357   MonitorElement* meOccupancy_map_depth3;
00358   MonitorElement* meOccupancy_map_depth4;
00359   MonitorElement* meOccupancy_vs_ieta_depth1;
00360   MonitorElement* meOccupancy_vs_ieta_depth2;
00361   MonitorElement* meOccupancy_vs_ieta_depth3;
00362   MonitorElement* meOccupancy_vs_ieta_depth4;
00363 
00364 
00365   MonitorElement* meAmplIetaIphi1;
00366   MonitorElement* meAmplIetaIphi2;
00367   MonitorElement* meAmplIetaIphi3;
00368   MonitorElement* meAmplIetaIphi4;
00369   MonitorElement* meSumAmp;
00370   MonitorElement* menDigis;
00371 
00372   MonitorElement* meADC0_depth1;
00373   MonitorElement* meADC0_depth2;
00374   MonitorElement* meADC0_depth3;
00375   MonitorElement* meADC0_depth4; 
00376   MonitorElement* meADC0fC_depth1;
00377   MonitorElement* meADC0fC_depth2;
00378   MonitorElement* meADC0fC_depth3;
00379   MonitorElement* meADC0fC_depth4;
00380 
00381   MonitorElement* meSignalAmp;
00382   MonitorElement* meSignalAmp1;
00383   MonitorElement* meSignalAmp2;
00384   MonitorElement* meSignalAmp3;
00385   MonitorElement* meSignalAmp4;
00386 
00387   MonitorElement* meSignalTimeSlice;
00388   MonitorElement* meAll10slices;
00389   MonitorElement* meAll10slices1D;
00390   MonitorElement* meBin5Frac;
00391   MonitorElement* meBin67Frac;
00392 
00393   MonitorElement* meDigiSimhit;
00394   MonitorElement* meDigiSimhit1;
00395   MonitorElement* meDigiSimhit2;
00396   MonitorElement* meDigiSimhit3;
00397   MonitorElement* meDigiSimhit4;
00398 
00399   MonitorElement* meRatioDigiSimhit;
00400   MonitorElement* meRatioDigiSimhit1;
00401   MonitorElement* meRatioDigiSimhit2;
00402   MonitorElement* meRatioDigiSimhit3;
00403   MonitorElement* meRatioDigiSimhit4;
00404 
00405   MonitorElement* meDigiSimhitProfile;
00406   MonitorElement* meDigiSimhitProfile1;
00407   MonitorElement* meDigiSimhitProfile2;
00408   MonitorElement* meDigiSimhitProfile3;
00409   MonitorElement* meDigiSimhitProfile4;
00410 
00411   // DB constants 
00412 
00413   MonitorElement* meGain0Depth1;
00414   MonitorElement* meGain1Depth1;
00415   MonitorElement* meGain2Depth1;
00416   MonitorElement* meGain3Depth1;
00417   MonitorElement* meGain0Depth2;
00418   MonitorElement* meGain1Depth2;
00419   MonitorElement* meGain2Depth2;
00420   MonitorElement* meGain3Depth2;
00421   MonitorElement* meGain0Depth3;
00422   MonitorElement* meGain1Depth3;
00423   MonitorElement* meGain2Depth3;
00424   MonitorElement* meGain3Depth3;
00425   MonitorElement* meGain0Depth4;
00426   MonitorElement* meGain1Depth4;
00427   MonitorElement* meGain2Depth4;
00428   MonitorElement* meGain3Depth4;
00429 
00430   MonitorElement* meGainWidth0Depth1;
00431   MonitorElement* meGainWidth1Depth1;
00432   MonitorElement* meGainWidth2Depth1;
00433   MonitorElement* meGainWidth3Depth1;
00434   MonitorElement* meGainWidth0Depth2;
00435   MonitorElement* meGainWidth1Depth2;
00436   MonitorElement* meGainWidth2Depth2;
00437   MonitorElement* meGainWidth3Depth2;
00438   MonitorElement* meGainWidth0Depth3;
00439   MonitorElement* meGainWidth1Depth3;
00440   MonitorElement* meGainWidth2Depth3;
00441   MonitorElement* meGainWidth3Depth3;
00442   MonitorElement* meGainWidth0Depth4;
00443   MonitorElement* meGainWidth1Depth4;
00444   MonitorElement* meGainWidth2Depth4;
00445   MonitorElement* meGainWidth3Depth4;
00446 
00447   MonitorElement* mePed0Depth1;
00448   MonitorElement* mePed1Depth1;
00449   MonitorElement* mePed2Depth1;
00450   MonitorElement* mePed3Depth1;
00451   MonitorElement* mePed0Depth2;
00452   MonitorElement* mePed1Depth2;
00453   MonitorElement* mePed2Depth2;
00454   MonitorElement* mePed3Depth2;
00455   MonitorElement* mePed0Depth3;
00456   MonitorElement* mePed1Depth3;
00457   MonitorElement* mePed2Depth3;
00458   MonitorElement* mePed3Depth3;
00459   MonitorElement* mePed0Depth4;
00460   MonitorElement* mePed1Depth4;
00461   MonitorElement* mePed2Depth4;
00462   MonitorElement* mePed3Depth4;
00463 
00464   MonitorElement* mePedWidth0Depth1;
00465   MonitorElement* mePedWidth1Depth1;
00466   MonitorElement* mePedWidth2Depth1;
00467   MonitorElement* mePedWidth3Depth1;
00468   MonitorElement* mePedWidth0Depth2;
00469   MonitorElement* mePedWidth1Depth2;
00470   MonitorElement* mePedWidth2Depth2;
00471   MonitorElement* mePedWidth3Depth2;
00472   MonitorElement* mePedWidth0Depth3;
00473   MonitorElement* mePedWidth1Depth3;
00474   MonitorElement* mePedWidth2Depth3;
00475   MonitorElement* mePedWidth3Depth3;
00476   MonitorElement* mePedWidth0Depth4;
00477   MonitorElement* mePedWidth1Depth4;
00478   MonitorElement* mePedWidth2Depth4;
00479   MonitorElement* mePedWidth3Depth4;
00480 
00481 
00482   // CapID-0 only 
00483   MonitorElement* meGainMap1;
00484   MonitorElement* meGainMap2;
00485   MonitorElement* meGainMap3;
00486   MonitorElement* meGainMap4;
00487   MonitorElement* mePwidthMap1;
00488   MonitorElement* mePwidthMap2; 
00489   MonitorElement* mePwidthMap3; 
00490   MonitorElement* mePwidthMap4; 
00491 
00492 };
00493 
00494 #endif
00495