00001 #include "TGet4v1Rec.h" 00002 00003 #include "TLatex.h" 00004 00005 TGet4v1Rec::TGet4v1Rec() 00006 { 00007 fRocId = 0; 00008 00009 fAUXch = 0; 00010 fMsgTypes = 0; 00011 fSysTypes = 0; 00012 fSysUserTypes = 0; 00013 fTrigger_All = 0; 00014 fTrigger_All_100 = 0; 00015 fTrigger_All_us = 0; 00016 fTrigger_All_ms = 0; 00017 fTrigger_All_s = 0; 00018 fTriggerWind = 0; // time window to assign hits to event 00019 fAUXWind = 0; // time window to assign AUX to event 00020 fEvntMultipl = 0; // event multiplicity in time window after trigger signal 00021 00022 fLastTm = 0; // 00023 fLastTriggerTm = 0; 00024 00025 for (int n=0;n<MAX_AUX;n++) fLastAuxTm[n] = 0; 00026 for (int n=0;n<MAX_SYNC;n++) { 00027 fLastSyncTm[n] = 0; 00028 fLastSyncId[n] = 0; 00029 } 00030 fStartSyncTm = 0; 00031 fStopSyncTm = 0; 00032 00033 for (int aux=0;aux<MAX_AUX;aux++) 00034 fAUXt[aux] = 0; // time distribution of aux signals 00035 for (int n=0;n<MAX_SYNC;n++) 00036 fSYNCt[n] = 0; // time distribution of sync signals 00037 fALLt = 0; 00038 fDATAt = 0; 00039 fSelfTriggT = 0; 00040 00041 fUnprocessedMsg.clear(); 00042 00043 fDabcSeparator=-1; 00044 00045 bIgnoreData = kFALSE; 00046 fIgnoreCnt = 0; 00047 fIgnoreTime = 0; // time when ignore message was generated 00048 fCollectTime = 0; // time when collect message was generated 00049 00051 /*************************************/ 00052 00053 /* Modified part */ 00054 00055 // Epochs 00056 fuCurrEpoch = 0; // current epoch on the roc 00057 fuEpochCycle = 0; // Number of time the epoch counter cycled 00058 for( Int_t iGet4 = 0; iGet4 < MAX_GET4_PER_ROC; iGet4++) 00059 { 00060 fuCurrEpoch2[iGet4] = 0; // current epoch2 for each get4 chip 00061 fuEpoch2Cycle[iGet4] = 0; // Number of time the epoch2 counter cycled 00062 } 00063 00064 // Buffers 00065 fbBufferWithLastFullEpoch = kFALSE; 00066 fPrevEpochsBuffer[0].clear(); // buffer of all ROC messages in current epoch and previous one 00067 fPrevEpochsBuffer[1].clear(); // buffer of all ROC messages in current epoch and previous one 00068 fbEpochSinceTrigger = kFALSE; 00069 fPrevEpochsBuffer[0].clear(); // buffer of all ROC messages in current epoch and previous one 00070 fPrevEpochsBuffer[1].clear(); // buffer of all ROC messages in current epoch and previous one 00071 for( Int_t iGet4 = 0; iGet4 < MAX_GET4_PER_ROC; iGet4++) 00072 { 00073 fbBufferWithLastFullEpoch2[iGet4] = kFALSE; 00074 fPrevEpochs2Buffer[iGet4][0].clear(); // buffer of all get4 messages in current epoch and previous one 00075 fPrevEpochs2Buffer[iGet4][1].clear(); // buffer of all get4 messages in current epoch and previous one 00076 fbEpoch2SinceTrigger[iGet4]= kFALSE; 00077 fAfterTriggEpochs2Buffer[iGet4][0].clear(); // buffer of all get4 messages in current epoch and previous one 00078 fAfterTriggEpochs2Buffer[iGet4][1].clear(); // buffer of all get4 messages in current epoch and previous one 00079 00080 for( Int_t iGet4Chan = 0; iGet4Chan < NB_CHAN_GET4; iGet4Chan++) 00081 { 00082 fTrigger_Get4Channel[iGet4][iGet4Chan] = 0; 00083 fTriggerMs_Get4Channel[iGet4][iGet4Chan] = 0; 00084 fTriggerS_Get4Channel[iGet4][iGet4Chan] = 0; 00085 fbDllFlag[iGet4][iGet4Chan] = kFALSE; 00086 00087 fLastExtMess[iGet4][iGet4Chan].Clear(); 00088 } 00089 fGet4V1HitsDistanceNs[iGet4] = 0; 00090 fGet4V1HitsDistanceUs[iGet4] = 0; 00091 fGet4V1HitsDistanceMs[iGet4] = 0; 00092 fGet4V1HitsDistanceS[iGet4] = 0; 00093 } 00094 fb32bitsReadoutDetected = kFALSE; 00095 00096 // HitsSelection 00097 fbPastEpochsRocDone = kFALSE; 00098 fbSelectionRocDone = kTRUE; 00099 for( Int_t iGet4 = 0; iGet4 < MAX_GET4_PER_ROC; iGet4++) 00100 { 00101 fbPastEpochs2Done[iGet4] = kFALSE; 00102 fbSelectionDone[iGet4] = kTRUE; 00103 } 00104 00105 // Triggering on data themselves 00106 fulLastTimeMainChannel = 0; 00107 fuLastEpoch2MainChannel = 0; 00108 for( Int_t iSecTriggerChan = 0; iSecTriggerChan < MAX_SEC_TDC; iSecTriggerChan++) 00109 { 00110 fulLastTimeSecChannel[iSecTriggerChan] = 0; 00111 fuLastEpoch2SecChannel[iSecTriggerChan] = 0; 00112 } 00113 } 00114 00115 UInt_t TGet4v1Rec::GetFullEpochNumber() 00116 { 00117 return (UInt_t)(fuCurrEpoch + (MAIN_EPOCH_CYCLE_SIZE +1)*fuEpochCycle); 00118 } 00119 UInt_t TGet4v1Rec::GetFullEpoch2Number( UInt_t uGet4Id) 00120 { 00121 return (UInt_t)(fuCurrEpoch2[uGet4Id] + 00122 (GET4_EPOCH_CYCLE_SIZE +1)*fuEpoch2Cycle[uGet4Id]); 00123 } 00124