CMS 3D CMS Logo

CSCMonitorModule_updateFracHistos.cc

Go to the documentation of this file.
00001 /*
00002  * =====================================================================================
00003  *
00004  *       Filename:  CSCMonitorModule_updateFracHistos.cc
00005  *
00006  *    Description:  Method updateFracHistos of CSCMonitorModule implementation.
00007  *    This method should be called after run or on demand.  
00008  *
00009  *        Version:  1.0
00010  *        Created:  04/23/2008 01:46:05 PM
00011  *       Revision:  none
00012  *       Compiler:  gcc
00013  *
00014  *         Author:  Valdas Rapsevicius (VR), Valdas.Rapsevicius@cern.ch
00015  *        Company:  CERN, CH
00016  *
00017  * =====================================================================================
00018  */
00019 
00020 #include "DQM/CSCMonitorModule/interface/CSCMonitorModule.h"
00021 
00022 void CSCMonitorModule::updateFracHistos() {
00023 
00024   MonitorElement *me1 = NULL, *me2 = NULL, *me3 = NULL;
00025 
00026   //
00027   // Calculate Fractional Histograms
00028   //
00029 
00030   if (MEEMU("DMB_Format_Errors_Fract", me1) && MEEMU("DMB_Reporting", me2) && MEEMU("DMB_Format_Errors", me3)) 
00031     me1->getTH1()->Divide(me3->getTH1(), me2->getTH1());
00032 
00033   if (MEEMU("CSC_Format_Errors_Fract", me1) && MEEMU("CSC_Reporting", me2) && MEEMU("CSC_Format_Errors", me3)) 
00034     me1->getTH1()->Divide(me3->getTH1(), me2->getTH1());
00035 
00036   if (MEEMU("DMB_Unpacked_Fract", me1) && MEEMU("DMB_Reporting", me2) && MEEMU("DMB_Unpacked", me3)) 
00037     me1->getTH1()->Divide(me3->getTH1(), me2->getTH1());
00038 
00039   if (MEEMU("CSC_Unpacked_Fract", me1) && MEEMU("CSC_Reporting", me2) && MEEMU("CSC_Unpacked", me3)) 
00040     me1->getTH1()->Divide(me3->getTH1(), me2->getTH1());
00041 
00042   if (MEEMU("DMB_wo_ALCT_Fract", me1) && MEEMU("DMB_Reporting", me2) && MEEMU("DMB_wo_ALCT", me3)) 
00043     me1->getTH1()->Divide(me3->getTH1(), me2->getTH1());
00044 
00045   if (MEEMU("CSC_wo_ALCT_Fract", me1) && MEEMU("CSC_Reporting", me2) && MEEMU("CSC_wo_ALCT", me3)) 
00046     me1->getTH1()->Divide(me3->getTH1(), me2->getTH1());
00047 
00048   if (MEEMU("DMB_wo_CLCT_Fract", me1) && MEEMU("DMB_Reporting", me2) && MEEMU("DMB_wo_CLCT", me3)) 
00049     me1->getTH1()->Divide(me3->getTH1(), me2->getTH1());
00050 
00051   if (MEEMU("CSC_wo_CLCT_Fract", me1) && MEEMU("CSC_Reporting", me2) && MEEMU("CSC_wo_CLCT", me3)) 
00052     me1->getTH1()->Divide(me3->getTH1(), me2->getTH1());
00053 
00054   if (MEEMU("DMB_wo_CFEB_Fract", me1) && MEEMU("DMB_Reporting", me2) && MEEMU("DMB_wo_CFEB", me3)) 
00055     me1->getTH1()->Divide(me3->getTH1(), me2->getTH1());
00056 
00057   if (MEEMU("CSC_wo_CFEB_Fract", me1) && MEEMU("CSC_Reporting", me2) && MEEMU("CSC_wo_CFEB", me3)) 
00058     me1->getTH1()->Divide(me3->getTH1(), me2->getTH1());
00059 
00060   if (MEEMU("CSC_DMB_input_fifo_full_Fract", me1) && MEEMU("CSC_Reporting", me2) && MEEMU("CSC_DMB_input_fifo_full", me3)) 
00061     me1->getTH1()->Divide(me3->getTH1(), me2->getTH1());
00062 
00063   if (MEEMU("DMB_input_fifo_full_Fract", me1) && MEEMU("DMB_Reporting", me2) && MEEMU("DMB_input_fifo_full", me3)) 
00064     me1->getTH1()->Divide(me3->getTH1(), me2->getTH1());
00065 
00066   if (MEEMU("CSC_DMB_input_timeout_Fract", me1) && MEEMU("CSC_Reporting", me2) && MEEMU("CSC_DMB_input_timeout", me3)) 
00067     me1->getTH1()->Divide(me3->getTH1(), me2->getTH1());
00068 
00069   if (MEEMU("DMB_input_timeout_Fract", me1) && MEEMU("DMB_Reporting", me2) && MEEMU("DMB_input_timeout", me3)) 
00070     me1->getTH1()->Divide(me3->getTH1(), me2->getTH1());
00071 
00072   if (MEEMU("CSC_L1A_out_of_sync_Fract", me1) && MEEMU("CSC_Reporting", me2) && MEEMU("CSC_L1A_out_of_sync", me3)) 
00073     me1->getTH1()->Divide(me3->getTH1(), me2->getTH1());
00074 
00075   if (MEEMU("DMB_Format_Warnings_Fract", me1) && MEEMU("DMB_Reporting", me2) && MEEMU("DMB_Format_Warnings", me3))
00076     me1->getTH1()->Divide(me3->getTH1(), me2->getTH1());
00077 
00078   if (MEEMU("CSC_Format_Warnings_Fract", me1) && MEEMU("CSC_Reporting", me2) && MEEMU("CSC_Format_Warnings", me3))
00079     me1->getTH1()->Divide(me3->getTH1(), me2->getTH1());
00080 
00081   //
00082   // Set detector information
00083   //
00084   
00085   if (MEEMU("CSC_Reporting", me1)) {
00086 
00087     // Getting reference and reporting histograms for CSC_Reporting
00088     const TH2* ref = dynamic_cast<const TH2*>(me1->getRefRootObject());
00089     const TH2* rep = dynamic_cast<const TH2*>(me1->getTH1());
00090     if (ref) {
00091       summary.ReadReportingChambersRef(rep, ref, 
00092         effParameters.getUntrackedParameter<double>("threshold_cold", 0.1), 
00093         effParameters.getUntrackedParameter<double>("sigfail_cold"  , 5.0), 
00094         effParameters.getUntrackedParameter<double>("threshold_hot" , 0.1), 
00095         effParameters.getUntrackedParameter<double>("sigfail_hot"   , 2.0));
00096     } else {
00097       summary.ReadReportingChambers(rep, 1.0);
00098     }
00099 
00100     double threshold = effParameters.getUntrackedParameter<double>("threshold_err", 0.1);
00101     double sigfail   = effParameters.getUntrackedParameter<double>("sigfail_err", 5.0);
00102 
00103     if (MEEMU("CSC_Format_Errors", me2)) {
00104       const TH2* err = dynamic_cast<TH2*>(me2->getTH1());
00105       summary.ReadErrorChambers(rep, err, cscdqm::FORMAT_ERR, threshold, sigfail);
00106     }
00107 
00108     if (MEEMU("CSC_L1A_out_of_sync", me2)) {
00109       const TH2* err = dynamic_cast<const TH2*>(me2->getTH1());
00110       summary.ReadErrorChambers(rep, err, cscdqm::L1SYNC_ERR, threshold, sigfail);
00111     }
00112 
00113     if (MEEMU("CSC_DMB_input_fifo_full", me2)) {
00114       const TH2* err = dynamic_cast<const TH2*>(me2->getTH1());
00115       summary.ReadErrorChambers(rep, err, cscdqm::FIFOFULL_ERR, threshold, sigfail);
00116     }
00117 
00118     if (MEEMU("CSC_DMB_input_timeout", me2)) {
00119       const TH2* err = dynamic_cast<const TH2*>(me2->getTH1());
00120       summary.ReadErrorChambers(rep, err, cscdqm::INPUTTO_ERR, threshold, sigfail);
00121     }
00122 
00123     threshold = effParameters.getUntrackedParameter<double>("threshold_nodata", 1.0);
00124     sigfail   = effParameters.getUntrackedParameter<double>("sigfail_nodata", 5.0);
00125 
00126     if (MEEMU("CSC_wo_ALCT", me2)) {
00127       const TH2* err = dynamic_cast<const TH2*>(me2->getTH1());
00128       summary.ReadErrorChambers(rep, err, cscdqm::NODATA_ALCT, threshold, sigfail);
00129     }
00130 
00131     if (MEEMU("CSC_wo_CLCT", me2)) {
00132       const TH2* err = dynamic_cast<const TH2*>(me2->getTH1());
00133       summary.ReadErrorChambers(rep, err, cscdqm::NODATA_CLCT, threshold, sigfail);
00134     }
00135 
00136     if (MEEMU("CSC_wo_CFEB", me2)) {
00137       const TH2* err = dynamic_cast<const TH2*>(me2->getTH1());
00138       summary.ReadErrorChambers(rep, err, cscdqm::NODATA_CFEB, threshold, sigfail);
00139     }
00140 
00141     if (MEEMU("CSC_Format_Warnings", me2)) {
00142       const TH2* err = dynamic_cast<const TH2*>(me2->getTH1());
00143       summary.ReadErrorChambers(rep, err, cscdqm::CFEB_BWORDS, threshold, sigfail);
00144     }
00145   }
00146 
00147   //
00148   // Write Global DQM shifter chamber error maps 
00149   //
00150    
00151   if (MEEventInfo("reportSummaryMap", me1)) {
00152     TH2* tmp = dynamic_cast<TH2*>(me1->getTH1());
00153     summary.WriteChamberState(tmp, 0x1, 3, true, false);
00154     summary.WriteChamberState(tmp, HWSTATUSERRORBITS, 2, false, true);
00155   }
00156 
00157   if (MEEMU("CSC_STATS_occupancy", me1)){
00158     TH2* tmp = dynamic_cast<TH2*>(me1->getTH1());
00159     summary.WriteChamberState(tmp, 0x4, 2, true, false);
00160     summary.WriteChamberState(tmp, 0x8, 4, false, false);
00161   }
00162 
00163   if (MEEMU("CSC_STATS_format_err", me1)){
00164     TH2* tmp = dynamic_cast<TH2*>(me1->getTH1());
00165     summary.WriteChamberState(tmp, 0x10, 2, true, false);
00166   }
00167 
00168   if (MEEMU("CSC_STATS_l1sync_err", me1)){
00169     TH2* tmp = dynamic_cast<TH2*>(me1->getTH1());
00170     summary.WriteChamberState(tmp, 0x20, 2, true, false);
00171   }
00172 
00173   if (MEEMU("CSC_STATS_fifofull_err", me1)){
00174     TH2* tmp = dynamic_cast<TH2*>(me1->getTH1());
00175     summary.WriteChamberState(tmp, 0x40, 2, true, false);
00176   }
00177 
00178   if (MEEMU("CSC_STATS_inputto_err", me1)){
00179     TH2* tmp = dynamic_cast<TH2*>(me1->getTH1());
00180     summary.WriteChamberState(tmp, 0x80, 2, true, false);
00181   }
00182 
00183   if (MEEMU("CSC_STATS_wo_alct", me1)){
00184     TH2* tmp = dynamic_cast<TH2*>(me1->getTH1());
00185     summary.WriteChamberState(tmp, 0x100, 2, true, false);
00186   }
00187 
00188   if (MEEMU("CSC_STATS_wo_clct", me1)){
00189     TH2* tmp = dynamic_cast<TH2*>(me1->getTH1());
00190     summary.WriteChamberState(tmp, 0x200, 2, true, false);
00191   }
00192 
00193   if (MEEMU("CSC_STATS_wo_cfeb", me1)){
00194     TH2* tmp = dynamic_cast<TH2*>(me1->getTH1());
00195     summary.WriteChamberState(tmp, 0x400, 2, true, false);
00196   }
00197 
00198   if (MEEMU("CSC_STATS_cfeb_bwords", me1)){
00199     TH2* tmp = dynamic_cast<TH2*>(me1->getTH1());
00200     summary.WriteChamberState(tmp, 0x800, 2, true, false);
00201   }
00202 
00203   //
00204   // Write summary information
00205   //
00206 
00207   if (MEEMU("Physics_ME1", me1)){
00208     TH2* tmp = dynamic_cast<TH2*>(me1->getTH1());
00209     summary.Write(tmp, 1);
00210   }
00211 
00212   if (MEEMU("Physics_ME2", me1)){
00213     TH2* tmp = dynamic_cast<TH2*>(me1->getTH1());
00214     summary.Write(tmp, 2);
00215   }
00216 
00217   if (MEEMU("Physics_ME3", me1)){
00218     TH2* tmp = dynamic_cast<TH2*>(me1->getTH1());
00219     summary.Write(tmp, 3);
00220   }
00221 
00222   if (MEEMU("Physics_ME4", me1)){
00223     TH2* tmp = dynamic_cast<TH2*>(me1->getTH1());
00224     summary.Write(tmp, 4);
00225   }
00226 
00227   if (MEEMU("Physics_EMU", me1)) {
00228     TH2* tmp=dynamic_cast<TH2*>(me1->getTH1());
00229     summary.WriteMap(tmp);
00230   }
00231 
00232   // Looping via addresses (scope: side->station->ring) and
00233   // filling in HW efficiencies
00234   cscdqm::Address adr;
00235   adr.mask.station = adr.mask.ring = adr.mask.chamber = adr.mask.layer = adr.mask.cfeb = adr.mask.hv = false;
00236   adr.mask.side = true;
00237 
00238   double e_detector = 0, e_side = 0, e_station = 0, e_ring = 0;
00239 
00240   for (adr.side = 1; adr.side <= N_SIDES; adr.side++) {
00241     
00242     e_side = 0;
00243     adr.mask.station = true;
00244 
00245     for (adr.station = 1; adr.station <= N_STATIONS; adr.station++) {
00246 
00247       e_station = 0;
00248       adr.mask.ring = true;
00249 
00250       for (adr.ring = 1; adr.ring <= summary.getDetector().NumberOfRings(adr.station); adr.ring++) {
00251 
00252         e_ring = summary.GetEfficiencyHW(adr);
00253         e_station += e_ring;
00254 
00255         if (summary.getDetector().NumberOfRings(adr.station) > 1) {
00256 
00257           if (MEReportSummaryContents(summary.getDetector().AddressName(adr), me1)) {
00258 
00259             me1->Fill(e_ring);
00260 
00261           }
00262 
00263         }
00264 
00265       }
00266 
00267       adr.mask.ring = false;
00268       e_station = e_station / summary.getDetector().NumberOfRings(adr.station);
00269       if (MEReportSummaryContents(summary.getDetector().AddressName(adr), me1)) me1->Fill(e_station);
00270       e_side += e_station;
00271 
00272     }
00273 
00274     adr.mask.station = false;
00275     e_side = e_side / N_STATIONS;
00276     if (MEReportSummaryContents(summary.getDetector().AddressName(adr), me1)) me1->Fill(e_side);
00277     e_detector += e_side; 
00278 
00279   }
00280 
00281   e_detector = e_detector / N_SIDES;
00282   if (MEEventInfo("reportSummary", me1)) me1->Fill(e_detector);
00283 
00284 }
00285 

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