RunSummary Class Reference

#include <RunSummary.h>

Inheritance diagram for RunSummary:
JobCModule

List of all members.

Public Member Functions

 RunSummary ()
 ~RunSummary ()
JobCResult Ana (const MomNavigator *mom)
void BeginJob ()
void EndJob ()
const RegistryDefaultConfig () const
void Config (const Registry &r)

Private Member Functions

void FilesOUT ()
void SFileOUT (TString *ts=0)

Private Attributes

Int_t fRunNum
Short_t fSubRunNum
std::ios_base::openmode out_mode
Int_t fMaxPlane [3]
Int_t fNumEvent
Int_t fNumSignalEvent
Int_t fNumSM1PhysEvent
Int_t fNumSM2PhysEvent
Int_t fNumBlockEvent
Int_t fMailRuns
Int_t fMailEvent
Int_t fMailSignalEvent
Int_t fMailTime
Int_t fTotalRuns
Int_t fTotalEvent
Int_t fTotalSignalEvent
Int_t fTotalTime
VldTimeStamp fStartTime
VldTimeStamp fEndTime
Detector::Detector_t fDet
Bool_t fRunOUT
Int_t NDaqSnarls
Int_t NDaqMonitors
Int_t NLightInjections
Int_t NDigitDataBlocks
Int_t NRunConfigBlocks
Int_t NRunCommentBlocks
Int_t NRunStartBlocks
Int_t NSubRunEndBlocks
Int_t NRunEndBlocks
Int_t NTpSinglesSummaryBlocks
Int_t NCrateMonitorBlocks
Int_t NVarcErrorInTfBlocks
Int_t NLiTpmtDigitsBlocks
Int_t NLIAdcSummaryBlocks
Int_t NLITimingSummaryBlocks
Int_t fNPlanesPhys
std::string fSplitFileName
std::string fSplitFileDir
Bool_t fMonthlyDir
Bool_t fAppendFiles

Detailed Description

Definition at line 18 of file RunSummary.h.


Constructor & Destructor Documentation

RunSummary::RunSummary (  ) 

Definition at line 65 of file RunSummary.cxx.

References fRunNum, out_mode, and RSMSyn.

00065                        {
00066   RSMSyn << "RunSummary::RunSummary" << endl;
00067   fRunNum = 0;
00068   fSubRunNum = 0;
00069 
00070   fNumEvent = 0;
00071   fNumSignalEvent = 0;
00072   fNumSM1PhysEvent = 0;
00073   fNumSM2PhysEvent = 0;
00074   fNumBlockEvent = 0;
00075   fMaxPlane[0] = 0;
00076   fMaxPlane[1] = 0;
00077   fMaxPlane[2] = 0;
00078 
00079   fMailRuns = 0;
00080   fMailEvent = 0;
00081   fMailSignalEvent = 0;
00082   fMailTime = 0;
00083 
00084   fTotalRuns = 0;
00085   fTotalEvent = 0;
00086   fTotalSignalEvent = 0;
00087   fTotalTime = 0;
00088 
00089   fStartTime=VldTimeStamp((time_t) 0, 0);
00090   fEndTime=VldTimeStamp((time_t) 0, 0);
00091 
00092   NDaqSnarls=0;
00093   NDaqMonitors=0;
00094   NLightInjections=0;
00095 
00096   NDigitDataBlocks=0;
00097   NRunConfigBlocks=0;
00098   NRunCommentBlocks=0;
00099   NRunStartBlocks=0;
00100   NSubRunEndBlocks=0;
00101   NRunEndBlocks=0;
00102   NTpSinglesSummaryBlocks=0;
00103   NCrateMonitorBlocks=0;
00104   NVarcErrorInTfBlocks=0;
00105   NLiTpmtDigitsBlocks=0;
00106   NLIAdcSummaryBlocks=0;
00107   NLITimingSummaryBlocks=0;
00108 
00109   fRunOUT = false;
00110 
00111   out_mode = ios::out | ios::app;
00112 }

RunSummary::~RunSummary (  ) 

Definition at line 114 of file RunSummary.cxx.

References RSMSyn.

00114                         {
00115   RSMSyn << "RunSummary::~RunSummary" << endl;
00116 }


Member Function Documentation

JobCResult RunSummary::Ana ( const MomNavigator mom  )  [virtual]

Implement this for read only access to the MomNavigator

Reimplemented from JobCModule.

Definition at line 245 of file RunSummary.cxx.

References VldTimeStamp::Add(), RawChannelId::AsString(), digit(), fDet, fEndTime, FilesOUT(), RawRecord::FindRawBlock(), fMaxPlane, fNPlanesPhys, fNumBlockEvent, fNumEvent, fNumSignalEvent, fNumSM1PhysEvent, fNumSM2PhysEvent, fRunNum, fRunOUT, fStartTime, fSubRunNum, Registry::Get(), RawDigit::GetADC(), RawDigit::GetChannel(), RawDigit::GetCrateT0(), RawDigitDataBlock::GetDatumIter(), RawSubRunEndBlock::GetDeadTime(), VldContext::GetDetector(), RawSubRunEndBlock::GetDroppedTimeFrames(), PlexSEIdAltL::GetEnd(), RawRunEndBlock::GetEndTime(), RawSubRunEndBlock::GetEndTime(), RawTpSinglesSummaryBlock::GetEndTimeStamp(), VldTimeStamp::GetNanoSec(), RawSubRunEndBlock::GetNumberOfErrors(), RawSubRunEndBlock::GetNumberOfNonSnarls(), RawSubRunEndBlock::GetNumberOfSnarls(), RawRunEndBlock::GetNumberOfSnarls(), PlexSEIdAltL::GetPlane(), RawRecord::GetRawBlockIter(), RawRecord::GetRawHeader(), PlexHandle::GetReadoutType(), RawRunStartBlock::GetRun(), RawRunCommentBlock::GetRun(), RawRunEndBlock::GetRun(), RawSubRunEndBlock::GetRun(), RawRunConfigBlock::GetRun(), RawDaqHeader::GetRun(), RawRunCommentBlock::GetRunComment(), RawRunConfigBlock::GetRunConfig(), VldTimeStamp::GetSec(), PlexHandle::GetSEIdAltL(), RawRunEndBlock::GetStartTime(), RawSubRunEndBlock::GetStartTime(), RawRunStartBlock::GetStartTime(), RawTpSinglesSummaryBlock::GetStartTimeStamp(), RawRunStartBlock::GetSubRun(), RawRunCommentBlock::GetSubRun(), RawRunEndBlock::GetSubRun(), RawSubRunEndBlock::GetSubRun(), RawDaqHeader::GetSubRun(), RawRunConfigBlock::GetSubRun(), RawDigit::GetTDC(), RecMinos::GetTempTags(), RawSubRunEndBlock::GetTerminationCode(), RawRunEndBlock::GetTerminationCode(), VldContext::GetTimeStamp(), RawSubRunEndBlock::GetTotalTimeFrames(), RawSnarlHeaderBlock::GetTriggerTime(), RecMinosHdr::GetVldContext(), PlexSEIdAltL::IsValid(), PlexSEIdAltL::IsVetoShield(), JobCResult::kPassed, ReadoutType::kScintStrip, MAXSMPLANE, NCrateMonitorBlocks, NDaqMonitors, NDaqSnarls, NDigitDataBlocks, NLIAdcSummaryBlocks, NLightInjections, NLITimingSummaryBlocks, NLiTpmtDigitsBlocks, NRunCommentBlocks, NRunConfigBlocks, NRunEndBlocks, NRunStartBlocks, NSubRunEndBlocks, NTpSinglesSummaryBlocks, NVarcErrorInTfBlocks, RSMDeb, RSMInf, RSMVer, RSMWar, and SM1PLANES.

00245                                                   {
00246   RSMVer << "RunSummary::Ana" << endl;
00247   JobCResult result(JobCResult::kPassed);  // The default result
00248 
00249   const char* rcInStr = 0;
00250 
00251   TIter momitr = const_cast<MomNavigator*>(mom)->FragmentIter();
00252   TObject* momobj = 0;
00253   while ((momobj=momitr())) {
00254     RawRecord* rawrec  = 0;
00255     if ((rawrec=dynamic_cast<RawRecord*>(momobj))) {
00256       const RawDaqHeader* dhdr =
00257         dynamic_cast<const RawDaqHeader*>(rawrec->GetRawHeader());
00258 
00259       VldContext vldc = dhdr->GetVldContext();
00260       VldTimeStamp vldt = vldc.GetTimeStamp();
00261 
00262       if (fRunNum!=dhdr->GetRun() || fSubRunNum!=dhdr->GetSubRun()) {
00263         RSMDeb << "Run change: " <<
00264           fRunNum << "-" << fSubRunNum << " -> " <<
00265           dhdr->GetRun() << "-" << dhdr->GetSubRun() << endl;
00266         FilesOUT();
00267 
00268         fRunOUT = false;
00269         fRunNum = dhdr->GetRun();
00270         fSubRunNum = dhdr->GetSubRun();
00271         fDet = vldc.GetDetector();
00272         fStartTime = vldt;
00273         fEndTime = vldt;
00274       }
00275       if(!rawrec->GetTempTags().Get("stream",rcInStr)) continue;
00276 
00277       //DaqSnarl Stream
00278       if (!strcmp("DaqSnarl",rcInStr)) {
00279         NDaqSnarls++;
00280       }
00281 
00282       //DaqMonitor Stream
00283       if (!strcmp("DaqMonitor",rcInStr)) {
00284         NDaqMonitors++;
00285       }
00286 
00287       if (!strcmp("LightInjection",rcInStr)) {
00288         NLightInjections++;
00289       }
00290 
00291       if (fEndTime<vldt && vldt>fStartTime) {
00292         fEndTime = vldt;
00293       }
00294 
00295       PlexHandle ph(vldc);
00296       Int_t totadc = 0;
00297       Int_t plane_hits[MAXSMPLANE][2];
00298       Int_t hitplanes = 0;
00299       Int_t sm1hitplanes_tot = 0;
00300       Int_t sm2hitplanes_tot = 0;
00301       Int_t hitplanes_con = 0;
00302       for (int i=0;i<MAXSMPLANE;i++) {
00303         plane_hits[i][0]=0;
00304         plane_hits[i][1]=0;
00305       }
00306 
00307       TIter rawitr = rawrec->GetRawBlockIter();
00308       TObject *rawobj = 0;
00309       while ((rawobj=rawitr())) {
00310         RawDigitDataBlock* dblock = 0;
00311         if ((dblock = dynamic_cast<RawDigitDataBlock*>(rawobj))) {
00312           NDigitDataBlocks++;
00313           const RawSnarlHeaderBlock* hdrblk =
00314             dynamic_cast<const RawSnarlHeaderBlock*>
00315             (rawrec->FindRawBlock("RawSnarlHeaderBlock"));
00316           VldTimeStamp trigger_time = hdrblk->GetTriggerTime();
00317 
00318           fNumEvent++;
00319 
00320           TIter digitr = dblock->GetDatumIter();
00321           TObject *digobj = 0;
00322           while ((digobj=digitr())) {
00323             RawDigit* digit = dynamic_cast<RawDigit*>(digobj);
00324             if (!digit) continue;
00325             RawChannelId rawid =  digit->GetChannel();
00326 
00327             VldTimeStamp vt_T0 = digit->GetCrateT0();
00328             vt_T0.Add(VldTimeStamp(0,(Int_t)(1.5625*digit->GetTDC())));
00329             if(vt_T0 < trigger_time) continue;
00330 
00331             PlexSEIdAltL seidl = ph.GetSEIdAltL(rawid);
00332             if (!(seidl.IsVetoShield()) && seidl.IsValid()) {
00333               if(ph.GetReadoutType(rawid)==ReadoutType::kScintStrip)
00334                 totadc += digit->GetADC();
00335 
00336               Int_t planenum = seidl.GetPlane();
00337 
00338               Int_t view_index = ((Int_t)seidl.GetEnd()) - 1;
00339               if (view_index<0 || view_index>1) {
00340                 RSMWar << "Bad View Index " << view_index << endl;
00341                 continue;
00342               }
00343 
00344               if (planenum<=MAXSMPLANE) {
00345                 plane_hits[planenum][view_index]++;
00346                 if(planenum>fMaxPlane[view_index+1])
00347                   fMaxPlane[view_index+1] = planenum;
00348                 if(planenum>fMaxPlane[0])
00349                   fMaxPlane[0] = planenum;
00350               }
00351               else {
00352                 cout << "Weird Plane" << endl;
00353                 cout << seidl << endl;
00354                 cout << rawid.AsString("e") << endl;
00355               }
00356             }
00357           }//digitr()
00358         }//RawDigitDataBlock
00359 
00360         RawRunConfigBlock* rrcfgb = 0;
00361         if ((rrcfgb = dynamic_cast<RawRunConfigBlock*>(rawobj))) {
00362           NRunConfigBlocks++;
00363           RSMDeb << "RawRunConfigBlock for: " <<
00364             rrcfgb->GetRun() << "-" << rrcfgb->GetSubRun() << endl <<
00365             "[" << rrcfgb->GetRunConfig() << "]" << endl;
00366           string cfg = rrcfgb->GetRunConfig();
00367           if (cfg.find("ropIdMask") == string::npos) {
00368             RSMWar << "  No ropIdMask in cfg\n";
00369           }
00370           else {
00371             string rtname;
00372             rtname = cfg.substr(cfg.find("ropIdMask"),cfg.length()-1);
00373             rtname = rtname.substr(rtname.find("=")+1,rtname.length());
00374             rtname = rtname.substr(0,rtname.find(";"));
00375             RSMInf << "ropIdMask=" << rtname << endl;
00376           }
00377         }//RawRunConfigBlock
00378 
00379         RawRunCommentBlock* rrcmtb = 0;
00380         if ((rrcmtb = dynamic_cast<RawRunCommentBlock*>(rawobj))) {
00381           NRunCommentBlocks++;
00382           RSMDeb << "RawRunCommentBlock for: " <<
00383             rrcmtb->GetRun() << "-" << rrcmtb->GetSubRun() << endl <<
00384             "[" << rrcmtb->GetRunComment() << "]" << endl;
00385         }//RawRunCommentBlock
00386 
00387         RawRunStartBlock* rrsb = 0;
00388         if ((rrsb = dynamic_cast<RawRunStartBlock*>(rawobj))) {
00389           NRunStartBlocks++;
00390           RSMDeb << "RawRunStartBlock for: " <<
00391             rrsb->GetRun() << "-" << rrsb->GetSubRun() << endl <<
00392             "StartTime: " << rrsb->GetStartTime() << endl;
00393         }//RawRunStartBlock
00394 
00395         RawSubRunEndBlock* rsreb = 0;
00396         if ((rsreb = dynamic_cast<RawSubRunEndBlock*>(rawobj))) {
00397           NSubRunEndBlocks++;
00398           RSMDeb << "RawSubRunEndBlock for: "
00399                  << rsreb->GetRun() << "-"
00400                  << rsreb->GetSubRun() << endl
00401                  << "StartTime: " << rsreb->GetStartTime()
00402                  << " EndTime:" << rsreb->GetEndTime() << endl
00403                  << "TermCode:" << rsreb->GetTerminationCode()
00404                  << " # Snarls:" << rsreb->GetNumberOfSnarls()
00405                  << " # NonSnarls:" << rsreb->GetNumberOfNonSnarls()
00406                  << " # Errors:" << rsreb->GetNumberOfErrors() << endl
00407                  << "# TimeFrames:" << rsreb->GetTotalTimeFrames()
00408                  << " Dropped:" << rsreb->GetDroppedTimeFrames() << endl
00409                  << "Dead Time:" << rsreb->GetDeadTime().GetSec()
00410                  << "(" << rsreb->GetDeadTime().GetNanoSec() << ")"
00411                  << endl;
00412         }//RawSubRunEndBlock
00413 
00414         RawRunEndBlock* rreb = 0;
00415         if ((rreb = dynamic_cast<RawRunEndBlock*>(rawobj))) {
00416           NRunEndBlocks++;
00417           RSMDeb << "RawRunEndBlock for: "
00418                  << rreb->GetRun() << "-"
00419                  << rreb->GetSubRun() << endl
00420                  << "StartTime: " << rreb->GetStartTime()
00421                  << " EndTime:" << rreb->GetEndTime() << endl
00422                  << "TermCode:" << rreb->GetTerminationCode()
00423                  << " # Snarls:" << rreb->GetNumberOfSnarls()
00424                  << " # NonSnarls:" << rsreb->GetNumberOfNonSnarls()
00425                  << " # Errors:" << rsreb->GetNumberOfErrors() << endl
00426                  << "# TimeFrames:" << rsreb->GetTotalTimeFrames()
00427                  << " Dropped:" << rsreb->GetDroppedTimeFrames() << endl
00428                  << "Dead Time:" << rsreb->GetDeadTime().GetSec()
00429                  << "(" << rsreb->GetDeadTime().GetNanoSec() << ")"
00430                  << endl;
00431         }//if RawRunEndBlock
00432 
00433         RawTpSinglesSummaryBlock* rtpssb = 0;
00434         if ((rtpssb=dynamic_cast<RawTpSinglesSummaryBlock*>(rawobj))) {
00435           NTpSinglesSummaryBlocks++;
00436           VldTimeStamp StartTime = rtpssb->GetStartTimeStamp();
00437           if(fEndTime < rtpssb->GetEndTimeStamp() &&
00438              rtpssb->GetEndTimeStamp() > fStartTime)
00439             fEndTime = rtpssb->GetEndTimeStamp();
00440         }//RawTpSinglesSummaryBlock
00441 
00442         RawCrateMonitorBlock* rcmb = 0;
00443         if ((rcmb=dynamic_cast<RawCrateMonitorBlock*>(rawobj))) {
00444           NCrateMonitorBlocks++;
00445         }//RawCrateMonitorBlock
00446 
00447         RawVarcErrorInTfBlock* rveb = 0;
00448         if ((rveb=dynamic_cast<RawVarcErrorInTfBlock*>(rawobj))) {
00449           NVarcErrorInTfBlocks++;
00450         }//RawVarcErrorInTfBlock
00451 
00452         RawLiTpmtDigitsBlock* rlitdb = 0;
00453         if ((rlitdb=dynamic_cast<RawLiTpmtDigitsBlock*>(rawobj))) {
00454           NLiTpmtDigitsBlocks++;
00455         }//RawLiTpmtDigitsBlock
00456 
00457         RawLIAdcSummaryBlock *rliasb = 0;
00458         if ((rliasb = dynamic_cast<RawLIAdcSummaryBlock*>(rawobj))) {
00459           NLIAdcSummaryBlocks++;
00460         }//RawLIAdcSummaryBlock
00461 
00462         RawLITimingSummaryBlock *rlitsb = 0;
00463         if ((rlitsb = dynamic_cast<RawLITimingSummaryBlock*>(rawobj))) {
00464           NLITimingSummaryBlocks++;
00465         }//RawLITimingSummaryBlock
00466       }//rawitr()
00467       for (int i=0;i<MAXSMPLANE;i++) {
00468         if (plane_hits[i][0]>0 && plane_hits[i][1]>0) {
00469           hitplanes++;
00470           if((i+1)>SM1PLANES) sm2hitplanes_tot++;
00471           else sm1hitplanes_tot++;
00472         }
00473         else {
00474           if(hitplanes>hitplanes_con) hitplanes_con=hitplanes;
00475           hitplanes = 0;
00476         }
00477       }
00478       if (totadc > 3000) {
00479         fNumSignalEvent++;
00480         if(sm1hitplanes_tot>=fNPlanesPhys) fNumSM1PhysEvent++;
00481         if(sm2hitplanes_tot>=fNPlanesPhys) fNumSM2PhysEvent++;
00482         if(hitplanes_con>=fNPlanesPhys) fNumBlockEvent++;
00483       }
00484 
00485     }
00486   }
00487   return result;
00488 }

void RunSummary::BeginJob ( void   )  [virtual]

Implement for notification of begin of job

Reimplemented from JobCModule.

Definition at line 490 of file RunSummary.cxx.

References fAppendFiles, fEndTime, fMailEvent, fMailRuns, fMailSignalEvent, fMailTime, fMaxPlane, fNumBlockEvent, fNumEvent, fNumSignalEvent, fNumSM1PhysEvent, fNumSM2PhysEvent, fRunNum, fRunOUT, fStartTime, fSubRunNum, fTotalEvent, fTotalRuns, fTotalSignalEvent, fTotalTime, NCrateMonitorBlocks, NDaqMonitors, NDaqSnarls, NDigitDataBlocks, NLIAdcSummaryBlocks, NLightInjections, NLITimingSummaryBlocks, NLiTpmtDigitsBlocks, NRunCommentBlocks, NRunConfigBlocks, NRunEndBlocks, NRunStartBlocks, NSubRunEndBlocks, NTpSinglesSummaryBlocks, NVarcErrorInTfBlocks, out_mode, and RSMSyn.

00490                           {
00491   RSMSyn << "RunSummary::BeginJob" << endl;
00492   fRunNum = 0;
00493   fSubRunNum = 0;
00494 
00495   fNumEvent = 0;
00496   fNumSignalEvent = 0;
00497   fNumSM1PhysEvent = 0;
00498   fNumSM2PhysEvent = 0;
00499   fNumBlockEvent = 0;
00500   fMaxPlane[0] = 0; fMaxPlane[1] = 0; fMaxPlane[2] = 0;
00501 
00502   fMailRuns = 0;
00503   fMailEvent = 0;
00504   fMailSignalEvent = 0;
00505   fMailTime = 0;
00506 
00507   fTotalRuns = 0;
00508   fTotalEvent = 0;
00509   fTotalSignalEvent = 0;
00510   fTotalTime = 0;
00511 
00512   fStartTime=VldTimeStamp((time_t) 0, 0);
00513   fEndTime=VldTimeStamp((time_t) 0, 0);
00514 
00515   NDaqSnarls=0;
00516   NDaqMonitors=0;
00517   NLightInjections=0;
00518 
00519   NDigitDataBlocks=0;
00520   NRunConfigBlocks=0;
00521   NRunCommentBlocks=0;
00522   NRunStartBlocks=0;
00523   NSubRunEndBlocks=0;
00524   NRunEndBlocks=0;
00525   NTpSinglesSummaryBlocks=0;
00526   NCrateMonitorBlocks=0;
00527   NVarcErrorInTfBlocks=0;
00528   NLiTpmtDigitsBlocks=0;
00529   NLIAdcSummaryBlocks=0;
00530   NLITimingSummaryBlocks=0;
00531 
00532   fRunOUT = false;
00533 
00534   //ios_base::openmode out_mode;
00535   out_mode = ios::out | ios::app;
00536   if(!fAppendFiles) out_mode = ios::out;
00537 }

void RunSummary::Config ( const Registry r  )  [virtual]

Return the actual configuration. If your module directly pulls its configuration from the fConfig Registry, you don't need to override this. Override if you have local config variables.

Reimplemented from JobCModule.

Definition at line 579 of file RunSummary.cxx.

References fAppendFiles, fMonthlyDir, fNPlanesPhys, fSplitFileDir, fSplitFileName, Registry::Get(), and RSMSyn.

00579                                          {
00580   RSMSyn << "RunSummary::Config" << endl;
00581   int tmpi = 0;
00582   const char* tmps = 0;
00583 
00584   if(r.Get("NPlanesPhys",tmpi)) fNPlanesPhys=tmpi;
00585   if(r.Get("SplitFileName",tmps)) fSplitFileName=tmps;
00586   if(r.Get("SplitFileDir",tmps)) fSplitFileDir=tmps;
00587   if(r.Get("MonthlyDir",tmpi)) fMonthlyDir=static_cast<bool>(tmpi);
00588   if(r.Get("AppendFiles",tmpi)) fAppendFiles=static_cast<bool>(tmpi);
00589 }

const Registry & RunSummary::DefaultConfig ( void   )  const [virtual]

Get the default configuration registry. This should normally be overridden. One useful idiom is to implement it like:

const Registry& MyModule::DefaultConfig() const { static Registry cfg; // never is destroyed if (cfg.Size()) return cfg; // already filled it // set defaults: cfg.Set("TheAnswer",42); cfg.Set("Units","unknown"); return cfg; }

Reimplemented from JobCModule.

Definition at line 560 of file RunSummary.cxx.

References JobCModule::GetName(), Registry::LockValues(), RSMSyn, Registry::Set(), and Registry::UnLockValues().

00560                                                 {
00561   RSMSyn << "RunSummary::DefaultConfig" << endl;
00562 
00563   static Registry r;
00564 
00565   string name = this->JobCModule::GetName();
00566   r.SetName((name+".config.default").c_str());
00567   r.UnLockValues();
00568 
00569   r.Set("NPlanesPhys",16);
00570   r.Set("SplitFileName","S%08d_%04d.txt");
00571   r.Set("SplitFileDir","./");
00572   r.Set("MonthlyDir",0);
00573   r.Set("AppendFiles",1);
00574 
00575   r.LockValues();
00576   return r;
00577 }

void RunSummary::EndJob (  )  [virtual]

Implement for notification of end of job

Reimplemented from JobCModule.

Definition at line 539 of file RunSummary.cxx.

References FilesOUT(), fMailEvent, fMailRuns, fMailSignalEvent, fMailTime, fRunNum, fSubRunNum, fTotalEvent, fTotalRuns, fTotalSignalEvent, fTotalTime, RSMDeb, RSMInf, and RSMSyn.

00539                         {
00540   RSMSyn << "RunSummary::EndJob" << endl;
00541 
00542   RSMDeb << "Final output in EndJob: " <<
00543     fRunNum << "-" << fSubRunNum << endl;
00544   FilesOUT();
00545 
00546   if (fTotalRuns>0) {
00547     RSMInf << "All ptrig:"
00548       << fTotalRuns << " Runs, "
00549       << fTotalEvent << " Events, "
00550       << fTotalSignalEvent << " Passing Noise Filter, "
00551       << fTotalTime << " Total Seconds" << endl;
00552     RSMInf << "Mail File:"
00553       << fMailRuns << " Runs, "
00554       << fMailEvent << " Events, "
00555       << fMailSignalEvent << " Passing Noise Filter, "
00556       << fMailTime << " Total Seconds" << endl;
00557   }
00558 }

void RunSummary::FilesOUT (  )  [private]

Definition at line 195 of file RunSummary.cxx.

References fEndTime, fMaxPlane, fNumBlockEvent, fNumEvent, fNumSignalEvent, fNumSM1PhysEvent, fNumSM2PhysEvent, fRunNum, fRunOUT, fStartTime, fSubRunNum, fTotalEvent, fTotalRuns, fTotalSignalEvent, fTotalTime, VldTimeStamp::GetSec(), NCrateMonitorBlocks, NDaqMonitors, NDaqSnarls, NDigitDataBlocks, NLIAdcSummaryBlocks, NLightInjections, NLITimingSummaryBlocks, NLiTpmtDigitsBlocks, NRunCommentBlocks, NRunConfigBlocks, NRunEndBlocks, NRunStartBlocks, NSubRunEndBlocks, NTpSinglesSummaryBlocks, NVarcErrorInTfBlocks, RSMDeb, RSMErr, and SFileOUT().

Referenced by Ana(), and EndJob().

00195                           {
00196   RSMDeb << "RunSummary::FilesOUT" << endl;
00197 
00198   if (fRunOUT) {
00199     RSMErr << "Multiple output attempt for: " <<
00200       fRunNum << "-" << fSubRunNum << endl;
00201     return;
00202   }
00203 
00204   if (fRunNum==0 && fSubRunNum==0) {
00205     RSMDeb << "Output attempt for: " <<
00206       fRunNum << "-" << fSubRunNum << endl;
00207     return;
00208   }
00209 
00210   fTotalRuns++;
00211   fTotalEvent = fTotalEvent + fNumEvent;
00212   fTotalSignalEvent = fTotalSignalEvent + fNumSignalEvent;
00213   fTotalTime = fTotalTime + fEndTime.GetSec() - fStartTime.GetSec();
00214 
00215   SFileOUT();
00216 
00217   fNumEvent = 0;
00218   fNumSignalEvent = 0;
00219   fNumSM1PhysEvent = 0;
00220   fNumSM2PhysEvent = 0;
00221   fNumBlockEvent = 0;
00222   fMaxPlane[0] = 0; fMaxPlane[1] = 0; fMaxPlane[2] = 0;
00223 
00224   NDaqSnarls=0;
00225   NDaqMonitors=0;
00226   NLightInjections=0;
00227 
00228   NDigitDataBlocks=0;
00229   NRunConfigBlocks=0;
00230   NRunCommentBlocks=0;
00231   NRunStartBlocks=0;
00232   NSubRunEndBlocks=0;
00233   NRunEndBlocks=0;
00234   NTpSinglesSummaryBlocks=0;
00235   NCrateMonitorBlocks=0;
00236   NVarcErrorInTfBlocks=0;
00237   NLiTpmtDigitsBlocks=0;
00238   NLIAdcSummaryBlocks=0;
00239   NLITimingSummaryBlocks=0;
00240 
00241   fRunOUT = true;
00242   return;
00243 }

void RunSummary::SFileOUT ( TString *  ts = 0  )  [private]

Definition at line 118 of file RunSummary.cxx.

References UtilRSM::CheckDir(), exit(), fEndTime, fMaxPlane, fMonthlyDir, fNPlanesPhys, fNumBlockEvent, fNumEvent, fNumSignalEvent, fNumSM1PhysEvent, fNumSM2PhysEvent, fRunNum, fSplitFileDir, fSplitFileName, fStartTime, fSubRunNum, VldTimeStamp::GetDate(), VldTimeStamp::GetSec(), NCrateMonitorBlocks, NDaqMonitors, NDaqSnarls, NDigitDataBlocks, NLIAdcSummaryBlocks, NLightInjections, NLITimingSummaryBlocks, NLiTpmtDigitsBlocks, NRunCommentBlocks, NRunConfigBlocks, NRunEndBlocks, NRunStartBlocks, NSubRunEndBlocks, NTpSinglesSummaryBlocks, NVarcErrorInTfBlocks, out_mode, RSMDeb, RSMInf, and sdir.

Referenced by FilesOUT().

00118                                      {
00119   RSMDeb << "RunSummary::SFileOUT" << endl;
00120 
00121   char file_name[25];
00122 
00123   Int_t Year = fEndTime.GetDate()/10000;
00124   Int_t Month = fEndTime.GetDate()/100 - 100*Year;
00125 
00126   string fdir = fSplitFileDir + "/";
00127   if (fMonthlyDir) {
00128     char sdir[10];
00129     sprintf(sdir,"%04d_%02d",Year,Month);
00130     fdir += sdir; fdir+="/";
00131   }
00132 
00133   if(!UtilRSM::CheckDir(fdir.c_str())) exit(0);
00134 
00135   sprintf(file_name,fSplitFileName.c_str(),fRunNum,fSubRunNum);
00136   ofstream fout((fdir+file_name).c_str(), out_mode);
00137 
00138   RSMInf << "Writing to " << file_name << " in " << fdir << endl;
00139 
00140   if (ts) {
00141     fout << *ts;
00142   }
00143   else {
00144     fout << "Run " <<  fRunNum << ":" << fSubRunNum << endl;
00145     fout << "  start:" << fStartTime << endl;
00146     fout << "  end:" << fEndTime << endl;
00147     fout << "  " << fEndTime.GetSec()-fStartTime.GetSec()
00148          << " seconds in run" << endl;
00149     fout << "  " << fNumEvent << " Events, ";
00150     fout << fNumSignalEvent << " Signal Events" << endl;
00151     fout << "  " << fNumSM1PhysEvent << " SM1 Events with >= ";
00152     fout << fNPlanesPhys << " planes hits" << endl;
00153     fout << "  " << fNumSM2PhysEvent << " SM2 Events with >= ";
00154     fout << fNPlanesPhys << " planes hits" << endl;
00155     fout << "  " << fNumBlockEvent << " Events with >= ";
00156     fout << fNPlanesPhys << " consecutive planes hits" << endl;
00157     if (fMaxPlane[1]==fMaxPlane[2]) {
00158       fout << "  " << fMaxPlane[0] << " Maximum Plane" << endl;
00159     }
00160     else {
00161       fout << "  " << fMaxPlane[1] << "," << fMaxPlane[2]
00162            << " Maximum Planes" << endl;
00163     }
00164     fout << "  " << NDaqSnarls << " DaqSnarls" << endl;
00165     fout << "   " << NDigitDataBlocks
00166                   << " RawDigitDataBlocks" << endl;
00167     fout << "  " << NDaqMonitors << " DaqMonitors" << endl;
00168     fout << "   " << NRunConfigBlocks
00169                   << " RawRunConfigBlocks" << endl;
00170     fout << "   " << NRunCommentBlocks
00171                   << " RawRunCommentBlocks" << endl;
00172     fout << "   " << NRunStartBlocks
00173                   << " RawRunStartBlocks" << endl;
00174     fout << "   " << NSubRunEndBlocks
00175                   << " RawSubRunEndBlocks" << endl;
00176     fout << "   " << NRunEndBlocks
00177                   << " RawRunEndBlocks" << endl;
00178     fout << "   " << NTpSinglesSummaryBlocks
00179                   << " RawTpSinglesSummaryBlocks" << endl;
00180     fout << "   " << NCrateMonitorBlocks
00181                   << " RawCrateMonitorBlocks" << endl;
00182     fout << "   " << NVarcErrorInTfBlocks
00183                   << " RawVarcErrorInTfBlocks" << endl;
00184     fout << "   " << NLiTpmtDigitsBlocks
00185                   << " RawLiTpmtDigitsBlocks" << endl;
00186     fout << "  " << NLightInjections << " LightInjections" << endl;
00187     fout << "   " << NLIAdcSummaryBlocks
00188                   << " RawLIAdcSummaryBlocks" << endl;
00189     fout << "   " << NLITimingSummaryBlocks
00190                   << " RawLITimingSummaryBlocks" << endl;
00191   }
00192   fout.close();
00193 }


Member Data Documentation

Bool_t RunSummary::fAppendFiles [private]

Definition at line 86 of file RunSummary.h.

Referenced by BeginJob(), and Config().

Definition at line 58 of file RunSummary.h.

Referenced by Ana().

Definition at line 57 of file RunSummary.h.

Referenced by Ana(), BeginJob(), FilesOUT(), and SFileOUT().

Int_t RunSummary::fMailEvent [private]

Definition at line 47 of file RunSummary.h.

Referenced by BeginJob(), and EndJob().

Int_t RunSummary::fMailRuns [private]

Definition at line 46 of file RunSummary.h.

Referenced by BeginJob(), and EndJob().

Definition at line 48 of file RunSummary.h.

Referenced by BeginJob(), and EndJob().

Int_t RunSummary::fMailTime [private]

Definition at line 49 of file RunSummary.h.

Referenced by BeginJob(), and EndJob().

Int_t RunSummary::fMaxPlane[3] [private]

Definition at line 39 of file RunSummary.h.

Referenced by Ana(), BeginJob(), FilesOUT(), and SFileOUT().

Bool_t RunSummary::fMonthlyDir [private]

Definition at line 85 of file RunSummary.h.

Referenced by Config(), and SFileOUT().

Int_t RunSummary::fNPlanesPhys [private]

Definition at line 82 of file RunSummary.h.

Referenced by Ana(), Config(), and SFileOUT().

Int_t RunSummary::fNumBlockEvent [private]

Definition at line 44 of file RunSummary.h.

Referenced by Ana(), BeginJob(), FilesOUT(), and SFileOUT().

Int_t RunSummary::fNumEvent [private]

Definition at line 40 of file RunSummary.h.

Referenced by Ana(), BeginJob(), FilesOUT(), and SFileOUT().

Int_t RunSummary::fNumSignalEvent [private]

Definition at line 41 of file RunSummary.h.

Referenced by Ana(), BeginJob(), FilesOUT(), and SFileOUT().

Definition at line 42 of file RunSummary.h.

Referenced by Ana(), BeginJob(), FilesOUT(), and SFileOUT().

Definition at line 43 of file RunSummary.h.

Referenced by Ana(), BeginJob(), FilesOUT(), and SFileOUT().

Int_t RunSummary::fRunNum [private]

Definition at line 34 of file RunSummary.h.

Referenced by Ana(), BeginJob(), EndJob(), FilesOUT(), and SFileOUT().

Bool_t RunSummary::fRunOUT [private]

Definition at line 60 of file RunSummary.h.

Referenced by Ana(), BeginJob(), and FilesOUT().

std::string RunSummary::fSplitFileDir [private]

Definition at line 84 of file RunSummary.h.

Referenced by Config(), and SFileOUT().

std::string RunSummary::fSplitFileName [private]

Definition at line 83 of file RunSummary.h.

Referenced by Config(), and SFileOUT().

Definition at line 56 of file RunSummary.h.

Referenced by Ana(), BeginJob(), FilesOUT(), and SFileOUT().

Short_t RunSummary::fSubRunNum [private]

Definition at line 35 of file RunSummary.h.

Referenced by Ana(), BeginJob(), EndJob(), FilesOUT(), and SFileOUT().

Int_t RunSummary::fTotalEvent [private]

Definition at line 52 of file RunSummary.h.

Referenced by BeginJob(), EndJob(), and FilesOUT().

Int_t RunSummary::fTotalRuns [private]

Definition at line 51 of file RunSummary.h.

Referenced by BeginJob(), EndJob(), and FilesOUT().

Definition at line 53 of file RunSummary.h.

Referenced by BeginJob(), EndJob(), and FilesOUT().

Int_t RunSummary::fTotalTime [private]

Definition at line 54 of file RunSummary.h.

Referenced by BeginJob(), EndJob(), and FilesOUT().

Definition at line 75 of file RunSummary.h.

Referenced by Ana(), BeginJob(), FilesOUT(), and SFileOUT().

Int_t RunSummary::NDaqMonitors [private]

Definition at line 64 of file RunSummary.h.

Referenced by Ana(), BeginJob(), FilesOUT(), and SFileOUT().

Int_t RunSummary::NDaqSnarls [private]

Definition at line 63 of file RunSummary.h.

Referenced by Ana(), BeginJob(), FilesOUT(), and SFileOUT().

Definition at line 68 of file RunSummary.h.

Referenced by Ana(), BeginJob(), FilesOUT(), and SFileOUT().

Definition at line 78 of file RunSummary.h.

Referenced by Ana(), BeginJob(), FilesOUT(), and SFileOUT().

Definition at line 65 of file RunSummary.h.

Referenced by Ana(), BeginJob(), FilesOUT(), and SFileOUT().

Definition at line 79 of file RunSummary.h.

Referenced by Ana(), BeginJob(), FilesOUT(), and SFileOUT().

Definition at line 77 of file RunSummary.h.

Referenced by Ana(), BeginJob(), FilesOUT(), and SFileOUT().

Definition at line 70 of file RunSummary.h.

Referenced by Ana(), BeginJob(), FilesOUT(), and SFileOUT().

Definition at line 69 of file RunSummary.h.

Referenced by Ana(), BeginJob(), FilesOUT(), and SFileOUT().

Int_t RunSummary::NRunEndBlocks [private]

Definition at line 73 of file RunSummary.h.

Referenced by Ana(), BeginJob(), FilesOUT(), and SFileOUT().

Int_t RunSummary::NRunStartBlocks [private]

Definition at line 71 of file RunSummary.h.

Referenced by Ana(), BeginJob(), FilesOUT(), and SFileOUT().

Definition at line 72 of file RunSummary.h.

Referenced by Ana(), BeginJob(), FilesOUT(), and SFileOUT().

Definition at line 74 of file RunSummary.h.

Referenced by Ana(), BeginJob(), FilesOUT(), and SFileOUT().

Definition at line 76 of file RunSummary.h.

Referenced by Ana(), BeginJob(), FilesOUT(), and SFileOUT().

std::ios_base::openmode RunSummary::out_mode [private]

Definition at line 37 of file RunSummary.h.

Referenced by BeginJob(), and SFileOUT().


The documentation for this class was generated from the following files:

Generated on 22 Nov 2017 for loon by  doxygen 1.6.1