CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_4_1_8_patch9/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){}
00005   void funcs::reset(TriggerReportStatic *trs){
00006     trs->lumiSection = 0;
00007     trs->prescaleIndex = 0;
00008     //copy the event summary
00009     trs->eventSummary.totalEvents = 0;
00010     trs->eventSummary.totalEventsPassed = 0;
00011     trs->eventSummary.totalEventsFailed = 0;
00012     
00013     for(size_t i = 0; i < max_paths; i++)
00014       {
00015         // reset individual path summaries
00016         trs->trigPathSummaries[i].timesRun = 0;
00017         trs->trigPathSummaries[i].timesPassed = 0; 
00018         trs->trigPathSummaries[i].timesPassedPs = 0; 
00019         trs->trigPathSummaries[i].timesPassedL1 = 0; 
00020         trs->trigPathSummaries[i].timesFailed = 0;
00021         trs->trigPathSummaries[i].timesExcept = 0;
00022       }
00023     for(size_t i = 0; i < max_endpaths; i++)
00024       {
00025         trs->endPathSummaries[i].timesRun    = 0;
00026         trs->endPathSummaries[i].timesPassed = 0;
00027         trs->endPathSummaries[i].timesPassedPs = 0; 
00028         trs->endPathSummaries[i].timesPassedL1 = 0; 
00029         trs->endPathSummaries[i].timesFailed = 0;
00030         trs->endPathSummaries[i].timesExcept = 0;
00031       }
00032     //    trigPathsInMenu = 0;
00033     //    endPathsInMenu  = 0;
00034   }
00035   void funcs::addToReport(TriggerReportStatic *trs, TriggerReportStatic *trp, unsigned int lumisection){
00036     if(trs->trigPathsInMenu==0) trs->trigPathsInMenu = trp->trigPathsInMenu;
00037     if(trs->endPathsInMenu==0) trs->endPathsInMenu = trp->endPathsInMenu;
00038     // set LS and PS
00039     trs->lumiSection = lumisection;
00040     if(trp->eventSummary.totalEvents!=0) //do not update PS if no events seen
00041       trs->prescaleIndex = trp->prescaleIndex;
00042     
00043     //add to the event summary
00044     trs->eventSummary.totalEvents += trp->eventSummary.totalEvents;
00045     trs->eventSummary.totalEventsPassed += trp->eventSummary.totalEventsPassed;
00046     trs->eventSummary.totalEventsFailed += trp->eventSummary.totalEventsFailed;
00047     //traverse the trigger report and sum relevant parts, check otherwise
00048     // loop on paths
00049     for(int i = 0; i < trp->trigPathsInMenu; i++)
00050       {
00051         
00052         // fill individual path summaries
00053         trs->trigPathSummaries[i].timesRun += trp->trigPathSummaries[i].timesRun;
00054         trs->trigPathSummaries[i].timesPassed += trp->trigPathSummaries[i].timesPassed;
00055         trs->trigPathSummaries[i].timesPassedPs += trp->trigPathSummaries[i].timesPassedPs;
00056         trs->trigPathSummaries[i].timesPassedL1 += trp->trigPathSummaries[i].timesPassedL1;
00057         trs->trigPathSummaries[i].timesFailed += trp->trigPathSummaries[i].timesFailed; 
00058         trs->trigPathSummaries[i].timesExcept += trp->trigPathSummaries[i].timesExcept;
00059       }
00060     for(int i = 0; i < trp->endPathsInMenu; i++)
00061       {
00062         trs->endPathSummaries[i].timesRun += trp->endPathSummaries[i].timesRun;
00063         trs->endPathSummaries[i].timesPassed += trp->endPathSummaries[i].timesPassed;
00064         trs->endPathSummaries[i].timesPassedPs += trp->endPathSummaries[i].timesPassedPs;
00065         trs->endPathSummaries[i].timesPassedL1 += trp->endPathSummaries[i].timesPassedL1;
00066         trs->endPathSummaries[i].timesFailed += trp->endPathSummaries[i].timesFailed;
00067         trs->endPathSummaries[i].timesExcept += trp->endPathSummaries[i].timesExcept;
00068       }
00069   }
00070 }