CMS 3D CMS Logo

/afs/cern.ch/work/a/aaltunda/public/www/CMSSW_5_3_14/src/EventFilter/Utilities/src/TriggerReportDef.cc

Go to the documentation of this file.
00001 #include "EventFilter/Utilities/interface/TriggerReportDef.h"
00002 
00003 namespace evf{
00004   TriggerReportStatic::TriggerReportStatic() : trigPathsInMenu(0), endPathsInMenu(0), datasetsInMenu(0){}
00005   void funcs::reset(TriggerReportStatic *trs){
00006     trs->lumiSection = 0;
00007     trs->prescaleIndex = 0;
00008     trs->nbExpected=0;
00009     trs->nbReporting=0;
00010     //copy the event summary
00011     trs->eventSummary.totalEvents = 0;
00012     trs->eventSummary.totalEventsPassed = 0;
00013     trs->eventSummary.totalEventsFailed = 0;
00014     
00015     for(size_t i = 0; i < max_paths; i++)
00016       {
00017         // reset individual path summaries
00018         trs->trigPathSummaries[i].timesRun = 0;
00019         trs->trigPathSummaries[i].timesPassed = 0; 
00020         trs->trigPathSummaries[i].timesPassedPs = 0; 
00021         trs->trigPathSummaries[i].timesPassedL1 = 0; 
00022         trs->trigPathSummaries[i].timesFailed = 0;
00023         trs->trigPathSummaries[i].timesExcept = 0;
00024       }
00025     for(size_t i = 0; i < max_endpaths; i++)
00026       {
00027         trs->endPathSummaries[i].timesRun    = 0;
00028         trs->endPathSummaries[i].timesPassed = 0;
00029         trs->endPathSummaries[i].timesPassedPs = 0; 
00030         trs->endPathSummaries[i].timesPassedL1 = 0; 
00031         trs->endPathSummaries[i].timesFailed = 0;
00032         trs->endPathSummaries[i].timesExcept = 0;
00033       }
00034     for (unsigned int i=0;i<max_datasets;i++) trs->datasetSummaries[i].timesPassed=0;
00035     //    trigPathsInMenu = 0;
00036     //    endPathsInMenu  = 0;
00037   }
00038   void funcs::addToReport(TriggerReportStatic *trs, TriggerReportStatic *trp, unsigned int lumisection){
00039     if(trs->trigPathsInMenu==0) trs->trigPathsInMenu = trp->trigPathsInMenu;
00040     if(trs->endPathsInMenu==0) trs->endPathsInMenu = trp->endPathsInMenu;
00041     if(trs->datasetsInMenu==0) trs->datasetsInMenu = trp->datasetsInMenu;
00042     // set LS and PS
00043     trs->lumiSection = lumisection;
00044     if(trp->eventSummary.totalEvents!=0) //do not update PS if no events seen
00045       trs->prescaleIndex = trp->prescaleIndex;
00046     // expected and reporting are incremented at each update by the corresponding contrib
00047     trs->nbExpected += trp->nbExpected;
00048     trs->nbReporting += trp->nbReporting;
00049     //add to the event summary
00050     trs->eventSummary.totalEvents += trp->eventSummary.totalEvents;
00051     trs->eventSummary.totalEventsPassed += trp->eventSummary.totalEventsPassed;
00052     trs->eventSummary.totalEventsFailed += trp->eventSummary.totalEventsFailed;
00053     //traverse the trigger report and sum relevant parts, check otherwise
00054     // loop on paths
00055     for(int i = 0; i < trp->trigPathsInMenu; i++)
00056       {
00057         
00058         // fill individual path summaries
00059         trs->trigPathSummaries[i].timesRun += trp->trigPathSummaries[i].timesRun;
00060         trs->trigPathSummaries[i].timesPassed += trp->trigPathSummaries[i].timesPassed;
00061         trs->trigPathSummaries[i].timesPassedPs += trp->trigPathSummaries[i].timesPassedPs;
00062         trs->trigPathSummaries[i].timesPassedL1 += trp->trigPathSummaries[i].timesPassedL1;
00063         trs->trigPathSummaries[i].timesFailed += trp->trigPathSummaries[i].timesFailed; 
00064         trs->trigPathSummaries[i].timesExcept += trp->trigPathSummaries[i].timesExcept;
00065       }
00066     for(int i = 0; i < trp->endPathsInMenu; i++)
00067       {
00068         trs->endPathSummaries[i].timesRun += trp->endPathSummaries[i].timesRun;
00069         trs->endPathSummaries[i].timesPassed += trp->endPathSummaries[i].timesPassed;
00070         trs->endPathSummaries[i].timesPassedPs += trp->endPathSummaries[i].timesPassedPs;
00071         trs->endPathSummaries[i].timesPassedL1 += trp->endPathSummaries[i].timesPassedL1;
00072         trs->endPathSummaries[i].timesFailed += trp->endPathSummaries[i].timesFailed;
00073         trs->endPathSummaries[i].timesExcept += trp->endPathSummaries[i].timesExcept;
00074       }
00075     for(int i = 0; i < trp->datasetsInMenu; i++)
00076       {
00077         trs->datasetSummaries[i].timesPassed += trp->datasetSummaries[i].timesPassed;
00078       }
00079   }
00080 }