LIStreamHunter Class Reference

#include <LIStreamHunter.h>

Inheritance diagram for LIStreamHunter:
JobCModule

List of all members.

Public Member Functions

 LIStreamHunter ()
 ~LIStreamHunter ()
JobCResult Ana (const MomNavigator *mom)
void EndJob ()

Private Attributes

Int_t runNumber
Int_t runNumberSub
Int_t runType
Int_t lastRunNumber
Int_t lastRunNumberSub
Int_t foundSummaries
VldTimeStamp timeStamp
Int_t timeSec
Int_t timeNanoSec
Int_t calibPoint
Int_t pulserBox
Int_t led
Int_t pulseHeight
Int_t pulseWidth
Int_t lastLed
Int_t lastPulseHeight
Int_t lastPulseWidth
Int_t lastPulserBox
Int_t lastCalibPoint
Int_t numSummaries
Int_t numSummariesSub

Detailed Description

Definition at line 28 of file LIStreamHunter.h.


Constructor & Destructor Documentation

LIStreamHunter::LIStreamHunter (  ) 

Definition at line 40 of file LIStreamHunter.cxx.

References Msg::kDebug, and MSG.

00041 {
00042   MSG("LIStreamHunter",Msg::kDebug) 
00043     << "Running LIStreamHunter Constructor..." << endl;
00044 
00045   runNumber=0;
00046   runNumberSub=0;
00047   runType=0;
00048 
00049   lastRunNumber=-1;
00050   lastRunNumberSub=-1;
00051   foundSummaries=0;
00052 
00053   timeSec=-1;
00054   timeNanoSec=-1;
00055   calibPoint=-1;
00056   pulserBox=-1;
00057   led=-1;
00058   pulseHeight=-1;
00059   pulseWidth=-1;
00060   
00061   lastLed=0;
00062   lastPulseHeight=0;
00063   lastPulseWidth=0;
00064   lastPulserBox=0;
00065   lastCalibPoint=0;
00066 
00067   numSummaries=0;
00068   numSummariesSub=0;
00069 
00070   MSG("LIStreamHunter",Msg::kDebug) 
00071     << "Finished LIStreamHunter Constructor" << endl;
00072 };

LIStreamHunter::~LIStreamHunter (  ) 

Definition at line 76 of file LIStreamHunter.cxx.

References Msg::kDebug, and MSG.

00076                                {
00077 
00078   MSG("LIStreamHunter",Msg::kDebug) 
00079     << "Running LIStreamHunter destructor..." << endl;
00080 
00081 
00082   MSG("LIStreamHunter",Msg::kDebug) 
00083     << "Finished LIStreamHunter destructor" << endl;
00084 }


Member Function Documentation

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

Implement this for read only access to the MomNavigator

Reimplemented from JobCModule.

Definition at line 88 of file LIStreamHunter.cxx.

References calibPoint, RawRecord::FindRawBlock(), foundSummaries, RawLIAdcSummaryBlock::GetCalibPoint(), MomNavigator::GetFragment(), RawLIAdcSummaryBlock::GetLed(), VldTimeStamp::GetNanoSec(), RawLIAdcSummaryBlock::GetNumberOfSummaries(), RawLIAdcSummaryBlock::GetPulseHeight(), RawLIAdcSummaryBlock::GetPulserBox(), RawLIAdcSummaryBlock::GetPulseWidth(), RawRecord::GetRawHeader(), RawDaqHeader::GetRun(), RawDaqHeader::GetRunType(), VldTimeStamp::GetSec(), RawDaqHeader::GetSubRun(), RawLIAdcSummaryBlock::GetTimeStamp(), Msg::kInfo, JobCResult::kPassed, Msg::kVerbose, lastCalibPoint, lastLed, lastPulseHeight, lastPulserBox, lastPulseWidth, lastRunNumber, lastRunNumberSub, led, MSG, numSummariesSub, pulseHeight, pulserBox, pulseWidth, runNumber, runNumberSub, runType, JobCResult::SetError(), JobCResult::SetFailed(), timeNanoSec, timeSec, and timeStamp.

00089 {
00090   JobCResult result(JobCResult::kPassed);
00091 
00092   //check that mom exists.
00093   assert(mom);
00094   
00095   //find raw record in mom
00096   RawRecord *rawrec = dynamic_cast<RawRecord *>
00097     (mom->GetFragment("RawRecord"));
00098   
00099   if (!rawrec) {
00100     MSG("LIStreamHunter",Msg::kInfo) 
00101       <<"No raw record found"<<endl;
00102     result.SetError().SetFailed();
00103     return result;
00104   }
00105 
00106   //get raw header
00107   const RawDaqHeader *RawHdr=
00108      dynamic_cast<const RawDaqHeader*>(rawrec->GetRawHeader());
00109   if (RawHdr){
00110     runNumber=RawHdr->GetRun();
00111     runNumberSub=RawHdr->GetSubRun();
00112     runType=RawHdr->GetRunType();
00113   }
00114 
00115   //print number of summaries in previous sub run
00116   if (runNumberSub!=lastRunNumberSub){
00117     if (foundSummaries==1 && numSummariesSub==0){
00118       MSG("LIStreamHunter",Msg::kInfo) 
00119         << " ** Empty LightInjection stream **" << endl;
00120     }
00121     else if (numSummariesSub>0){
00122       MSG("LIStreamHunter",Msg::kInfo) 
00123         << numSummariesSub << " summaries found" << endl << endl;
00124     }  
00125     numSummariesSub=0;
00126     foundSummaries=0;
00127   }
00128 
00129   if (runNumber>lastRunNumber){
00130     MSG("LIStreamHunter",Msg::kInfo) 
00131       << "***************************" << endl
00132       << "** New Run Number: " << runNumber << " **" << endl 
00133       << "***************************" << endl; 
00134     lastRunNumberSub=-1;//might only have one sub run so reset here
00135   }
00136   lastRunNumber=runNumber;
00137   if (runNumberSub!=lastRunNumberSub){
00138     MSG("LIStreamHunter",Msg::kInfo) 
00139       << "Analysing Sub Run " << runNumberSub << " ..." << endl; 
00140   }
00141   lastRunNumberSub=runNumberSub;
00142 
00143   //get LI Summary block from rawdatablock
00144   const RawLIAdcSummaryBlock *rawliadcsummaryblock=0;
00145   rawliadcsummaryblock=dynamic_cast<const RawLIAdcSummaryBlock*>
00146   (rawrec->FindRawBlock("RawLIAdcSummaryBlock"));
00147 
00148 //   const RawDaqSnarlHeader *rawdaqsnarlheader= 
00149 //     dynamic_cast<const RawDaqSnarlHeader*>
00150 //     (rawrec->FindRawBlock("RawDaqSnarlHeader"));
00151 
00152 //   if(!rawdaqsnarlheader){  
00153 //     //result.SetError().SetFailed();
00154 //     //return result;
00155 //     MSG("LIStreamHunter",Msg::kInfo) 
00156 //       << "not rawdaqsnarlheader=" << rawdaqsnarlheader << endl;
00157 //   }
00158 //   else{
00159 //     MSG("LIStreamHunter",Msg::kInfo) 
00160 //       << "Found rawdaqsnarlheader=" << rawdaqsnarlheader << endl
00161 //       << "TrigSrc=" << rawdaqsnarlheader->GetTrigSrc() << endl
00162 //       << "ErrorCode=" << rawdaqsnarlheader->GetErrorCode() << endl
00163 //       << "NumRawDigits=" << rawdaqsnarlheader->GetNumRawDigits()<< endl;
00164 //   }
00165   
00166   if(!rawliadcsummaryblock){ 
00167     MSG("LIStreamHunter",Msg::kInfo) 
00168       <<"No rawliadcsummaryblock found"<<endl;
00169     result.SetError().SetFailed();
00170     return result;
00171   }
00172 
00173   timeStamp=rawliadcsummaryblock->GetTimeStamp();
00174   timeSec=timeStamp.GetSec();
00175   timeNanoSec=timeStamp.GetNanoSec();
00176   calibPoint=rawliadcsummaryblock->GetCalibPoint();
00177   pulserBox=rawliadcsummaryblock->GetPulserBox();
00178   led=rawliadcsummaryblock->GetLed();
00179   pulseHeight=rawliadcsummaryblock->GetPulseHeight();
00180   pulseWidth=rawliadcsummaryblock->GetPulseWidth();
00181   
00182   if(led!=lastLed || pulseHeight!=lastPulseHeight ||
00183      pulseWidth!=lastPulseWidth || pulserBox!=lastPulserBox ||
00184      calibPoint!=lastCalibPoint){
00185     
00186     TDatime datime;
00187     datime.Set(timeSec);
00188     MSG("LIStreamHunter",Msg::kVerbose)  
00189       << "PB=" << pulserBox 
00190       << " Led=" << led
00191       << " calpt=" << calibPoint
00192       << " Hgt=" << pulseHeight
00193       << " Wth=" << pulseWidth
00194       << " at " << datime.GetTime() 
00195       << " on " << datime.GetDate() << endl;   
00196   }
00197   lastLed=led;
00198   lastPulseHeight=pulseHeight;
00199   lastPulseWidth=pulseWidth;
00200   lastPulserBox=pulserBox;
00201   lastCalibPoint=calibPoint;
00202 
00203   //count number of summaries
00204   numSummariesSub+=rawliadcsummaryblock->GetNumberOfSummaries();
00205   //set control flag
00206   foundSummaries=1;
00207   
00208   return result;
00209 }

void LIStreamHunter::EndJob (  )  [virtual]

Implement for notification of end of job

Reimplemented from JobCModule.

Definition at line 213 of file LIStreamHunter.cxx.

References foundSummaries, Msg::kInfo, MSG, and numSummariesSub.

00214 {
00215   if (foundSummaries==0){
00216     MSG("LIStreamHunter",Msg::kInfo) 
00217       <<endl
00218       << " ** No LightInjection stream found **" 
00219       <<endl
00220       <<endl;
00221   }
00222   else if (foundSummaries==1 && numSummariesSub==0){
00223     MSG("LIStreamHunter",Msg::kInfo) 
00224       << " ** Empty LightInjection stream **" << endl;
00225   }
00226   else if (numSummariesSub>0){
00227     MSG("LIStreamHunter",Msg::kInfo) 
00228       << numSummariesSub << " summaries found" << endl << endl;
00229   }
00230   return;
00231 }


Member Data Documentation

Int_t LIStreamHunter::calibPoint [private]

Definition at line 51 of file LIStreamHunter.h.

Referenced by Ana().

Definition at line 46 of file LIStreamHunter.h.

Referenced by Ana(), and EndJob().

Definition at line 61 of file LIStreamHunter.h.

Referenced by Ana().

Int_t LIStreamHunter::lastLed [private]

Definition at line 57 of file LIStreamHunter.h.

Referenced by Ana().

Definition at line 58 of file LIStreamHunter.h.

Referenced by Ana().

Definition at line 60 of file LIStreamHunter.h.

Referenced by Ana().

Definition at line 59 of file LIStreamHunter.h.

Referenced by Ana().

Definition at line 44 of file LIStreamHunter.h.

Referenced by Ana().

Definition at line 45 of file LIStreamHunter.h.

Referenced by Ana().

Int_t LIStreamHunter::led [private]

Definition at line 53 of file LIStreamHunter.h.

Referenced by Ana().

Definition at line 63 of file LIStreamHunter.h.

Definition at line 64 of file LIStreamHunter.h.

Referenced by Ana(), and EndJob().

Int_t LIStreamHunter::pulseHeight [private]

Definition at line 54 of file LIStreamHunter.h.

Referenced by Ana().

Int_t LIStreamHunter::pulserBox [private]

Definition at line 52 of file LIStreamHunter.h.

Referenced by Ana().

Int_t LIStreamHunter::pulseWidth [private]

Definition at line 55 of file LIStreamHunter.h.

Referenced by Ana().

Int_t LIStreamHunter::runNumber [private]

Definition at line 40 of file LIStreamHunter.h.

Referenced by Ana().

Definition at line 41 of file LIStreamHunter.h.

Referenced by Ana().

Int_t LIStreamHunter::runType [private]

Definition at line 42 of file LIStreamHunter.h.

Referenced by Ana().

Int_t LIStreamHunter::timeNanoSec [private]

Definition at line 50 of file LIStreamHunter.h.

Referenced by Ana().

Int_t LIStreamHunter::timeSec [private]

Definition at line 49 of file LIStreamHunter.h.

Referenced by Ana().

Definition at line 48 of file LIStreamHunter.h.

Referenced by Ana().


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

Generated on 22 Nov 2017 for loon by  doxygen 1.6.1