• Main Page
  • Related Pages
  • Namespaces
  • Data Structures
  • Files
  • File List
  • Globals

beamtime/tof-tdctest/go4/VFTX/TVftxEvent.cxx (r4864/r4267)

Go to the documentation of this file.
00001 /* Generated by Together */
00002 
00003 #include "TVftxEvent.h"
00004 #include "TGo4Version.h"
00005 #if __GO4BUILDVERSION__ > 40502
00006    #include "go4iostream.h"
00007 #else
00008    #include "Riostream.h"
00009 #endif
00010 /*
00011 void TVftxBoardData::Clear()
00012 {
00013    iTriggerTime = 0;
00014    for( Int_t iChan = 0; iChan < FPGA_TDC_NBCHAN; iChan++)
00015    {
00016       iMultiplicity[iChan] = 0;
00017       for( Int_t iHit = 0; iHit < MaxMult; iHit++)
00018       {
00019          iFineTime[iChan][iHit]     = -1;
00020          iCoarseTime[iChan][iHit]   = -1;
00021          uFutureBit[iChan][iHit]    =  0;
00022          dTimeCorr[iChan][iHit]     = -1;
00023          dFineTimeCorr[iChan][iHit] = -1; 
00024       }
00025    }
00026 }
00027 Double_t TVftxBoardData::GetCalibratedTime( UInt_t uChan, UInt_t uMult)
00028 {
00029    // Return either the calibrated time
00030    // when possible, otherwise 0
00031    if( uChan < FPGA_TDC_NBCHAN && uMult < MaxMult )
00032       return dTimeCorr[uChan][uMult];
00033       else return 0.0;
00034 }
00035 Double_t TVftxBoardData::GetCoarseCorrectedTime( UInt_t uChan, UInt_t uMult)
00036 {
00037    // Return the calibrated time with a correction for coarse counter overflow relative to trigger
00038    // when possible, otherwise 0
00039    if( uChan < FPGA_TDC_NBCHAN && uMult < MaxMult )
00040    {
00041       Double_t dCoarseCorrectedTime = dTimeCorr[uChan][uMult];
00042 
00043       if( VFTX_COARSE_OVERFLW_CHK < iCoarseTime[ uChan ][ uMult ] - iTriggerTime )
00044          dCoarseCorrectedTime -= ((TDC_FIFO_COARSE_CT>>TDC_FIFO_COARSE_CT_SHIFT)+1)*(Double_t)CLOCK_TIME;
00045       if( iCoarseTime[ uChan ][ uMult ] - iTriggerTime  < -1*VFTX_COARSE_OVERFLW_CHK )
00046          dCoarseCorrectedTime += ((TDC_FIFO_COARSE_CT>>TDC_FIFO_COARSE_CT_SHIFT)+1)*(Double_t)CLOCK_TIME;
00047 
00048       return dCoarseCorrectedTime;
00049    }
00050       else return 0.0;
00051 }
00052 */
00053 TVftxEvent::TVftxEvent(const char* name, Short_t id) :
00054    TGo4EventElement(name,name,id)
00055 {
00056    cout << "**** TVftxEvent: Create instance " << name <<" with composite id "<<id<< endl;
00057 }
00058 TVftxEvent::TVftxEvent() :
00059    TGo4EventElement()
00060 {
00061 }
00062 
00063 TVftxEvent::~TVftxEvent()
00064 {
00065 }
00066 
00067 void  TVftxEvent::Clear(Option_t *t)
00068 {
00069   // all members should be cleared.
00070    for(Int_t imodule = 0; imodule < MAX_FPGA_TDC; imodule ++) 
00071    {
00072       fVftxBoards[imodule].Clear();
00073    }
00074    SetValid(kFALSE);
00075 }
00076 
00077 Double_t TVftxEvent::GetCoarseCorrectedTime( UInt_t uBoard, UInt_t uChan, UInt_t uMult)
00078 {
00079    // Return the calibrated time with a correction for coarse counter overflow relative to trigger
00080    // when possible, otherwise 0
00081    if( uBoard < MAX_FPGA_TDC )
00082       return fVftxBoards[uBoard].GetCoarseCorrectedTime( uChan, uMult);
00083       else return 0.0;
00084 }
00085 Double_t TVftxEvent::GetCalibratedTime( UInt_t uBoard, UInt_t uChan, UInt_t uMult, UInt_t uCoarseCorrected )
00086 {
00087    // Return either the calibrated time or the calibrated time with a correction
00088    // for coarse counter overflow relative to trigger
00089    // depending on the uCoarseCorrectedvalue
00090    // when not possible, returns 0
00091    if( uBoard < MAX_FPGA_TDC )
00092    {
00093       if( 1 == uCoarseCorrected )
00094          return fVftxBoards[uBoard].GetCoarseCorrectedTime( uChan, uMult);
00095       else return fVftxBoards[uBoard].GetCalibratedTime( uChan, uMult);
00096    }
00097       else return 0.0;
00098 }

Generated on Tue Dec 10 2013 04:52:21 for ROCsoft by  doxygen 1.7.1