// ------------------------------------------------------------------ // ----- TGet4v1Rec.cxx ----- // ----- Created 22/07/2013 by P.-A. Loizeau ----- // ----- Adapted from TGet4v1Rec.cxx ----- // ----- in RocLib/beamtime/tof-tdctest rev.4862 ----- // ------------------------------------------------------------------ #include "TGet4v1Rec.h" TimeWindowCond::TimeWindowCond(): TNamed("", "Time Window Condition"), fdLowT (0.0), fdHighT(0.0) { } TimeWindowCond::TimeWindowCond( const char* name, Double_t tLow, Double_t tHigh ): TNamed( name, "Time Window Condition" ), fdLowT (tLow), fdHighT(tHigh) { } void TimeWindowCond::SetValues( Double_t tLow, Double_t tHigh ) { fdLowT = tLow; fdHighT = tHigh; } void TimeWindowCond::Clear(Option_t *t) { TNamed::Clear( t ); fdLowT = 0.0; fdHighT = 0.0; } Bool_t TimeWindowCond::Test( Double_t dValToTest) { if( fdLowT <= dValToTest && dValToTest <= fdHighT) return kTRUE; else return kFALSE; } TGet4v1Rec::TGet4v1Rec() : fRocId (0), fIter(), fMsgTypes (NULL), fSysTypes (NULL), fSysUserTypes (NULL), fAUXch (NULL), fTrigger_All (NULL), fTrigger_AUX (NULL), fTrigger_All_100 (NULL), fTrigger_All_us (NULL), fTrigger_All_ms (NULL), fTrigger_All_s (NULL), fTriggerWind (), fAUXWind (), fSelfTrigWind (), fEvntMultipl (NULL), fALLt (NULL), fDATAt (NULL), fERRORt (NULL), fSLOWCt (NULL), fSelfTriggT (NULL), fEPOCHt (NULL), fAllSelectedT (NULL), fAllLongT (NULL), fDataLongT (NULL), fErrorLongT (NULL), fSlowCLongT (NULL), fSelfTriggLongT (NULL), fEpochLongT (NULL), fAllEpoch2LongT (NULL), fAllSelLongT (NULL), fLastTm (0), fLastTriggerTm (0), fStartSyncTm (0), fStopSyncTm (0), fUnprocessedMsg (), fDabcSeparator (-1), bIgnoreData (kFALSE), fIgnoreCnt (0), fIgnoreTime (0), fCollectTime (0), fuCurrEpoch (0), fuEpochCycle (0), fDistribEpochs (NULL), fDistribEpochs2 (NULL), fEpochShiftsPerChip (NULL), fEpochShiftsDurationPerChip (NULL), fbBufferWithLastFullEpoch (kFALSE), fbEpochSinceTrigger (kFALSE), fbSelectionRocDone (kTRUE), fDataSelfTriggerPerEvent (NULL), fDataSelfTrigDistanceNs (NULL), fDataSelfTrigDistanceUs (NULL), fDataSelfTrigDistanceMs (NULL), fDataSelfTrigDistanceS (NULL), fNbEventsPerMbsEvent (NULL), fNbNotEmptyEventsPerMbsEvent (NULL), fChannelsMapping (NULL), fChannelInputMessCount (NULL), fChannelMultiplicity (NULL), fdRateEvolutionBinSize (0.0), fb24bitsReadoutDetected (kFALSE), fb32bitsReadoutDetected (kFALSE), fGet4V1SlowControlType(NULL), fGet4V1SlowControlScaler(NULL), fGet4V1SlowControlDeadTime(NULL), fGet4V1SlowControlHamming(NULL), fGet4V1SlowControlSeuEvo(NULL), fGet4ErrorChip(NULL), fGet4ErrorChan(NULL), fGet4ErrorPatt(NULL), fGet4V1DllLockBit(NULL) { /* fRocId = 0; fAUXch = 0; fMsgTypes = 0; fSysTypes = 0; fSysUserTypes = 0; fTrigger_All = 0; fTrigger_All_100 = 0; fTrigger_All_us = 0; fTrigger_All_ms = 0; fTrigger_All_s = 0; fTriggerWind = 0; // time window to assign hits to event fAUXWind = 0; // time window to assign AUX to event fEvntMultipl = 0; // event multiplicity in time window after trigger signal fLastTm = 0; // fLastTriggerTm = 0; */ for (unsigned n=0;n> 32; if( 0 < ulNb32bCycles) return (ULong64_t)( ulNb32bCycles * ( 0x100000000ULL ) )<<14; // epoch nb lost due to 32 bit limit, shifted in ns else return 0; } ULong64_t TGet4v1Rec::GetSuperCycleEp2Offset( UInt_t uGet4Id) { // Nb of epoch lost by MessageTime function due to 32b limit // ULong64_t ulNb32bCycles = GetFullEpoch2Number( uGet4Id) / ( 0x100000000ULL ); ULong64_t ulNb32bCycles = GetFullEpoch2Number( uGet4Id) >> 32; if( 0 < ulNb32bCycles) return (ULong64_t)( ulNb32bCycles * ( 0x100000000ULL ) )* // epoch nb lost due to 32 bit limit (ULong64_t)( get4tdc::kdEpochInPs / 1000 ); // Get4 epoch in ns return 0; } Double_t TGet4v1Rec::GetSuperCycleEp2OffsetD( UInt_t uGet4Id) { // Nb of epoch lost by MessageTime function due to 32b limit // ULong64_t ulNb32bCycles = GetFullEpoch2Number( uGet4Id) / ( 0x100000000ULL ); ULong64_t ulNb32bCycles = GetFullEpoch2Number( uGet4Id) >> 32; if( 0 < ulNb32bCycles) return (Double_t)( ulNb32bCycles * ( 0x100000000ULL ) )* // epoch nb lost due to 32 bit limit (Double_t)( get4tdc::kdEpochInPs) / 1000.0 ; // Get4 epoch in ns return 0.0; }