// ------------------------------------------------------------------ // ----- 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; 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 (int 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; }