00001 #ifndef TGET4V1PARAM_H 00002 #define TGET4V1PARAM_H 00003 00004 #include "TGo4Parameter.h" 00005 #include "TGet4v1Event.h" 00006 00007 class TGo4EventElement; 00008 00009 #define MAX_SEC_TDC 8 00010 00011 class TGet4v1Param : public TGo4Parameter { 00012 public: 00013 00014 // default constructor - important for streamer 00015 TGet4v1Param(); 00016 00017 TGet4v1Param(const char* name); 00018 00019 virtual ~TGet4v1Param(); 00020 00021 /* implemented to copy setup of active roc to roc event */ 00022 virtual Bool_t UpdateFrom(TGo4Parameter* rhs); 00023 00024 /* Actual set roc event configuration. To be used from setup macro*/ 00025 Bool_t SetConfigRocs(); 00026 00027 UInt_t numRocs; // maximum roc id in use +1 00028 00029 Bool_t activeRoc[MAX_ROC]; //enable roc of id 00030 00031 Bool_t noTrigger; // ignore trigger window and take all messages with initial event division 00032 00033 Int_t triggerSignal; // 0 .. 3 is AUXs, 10-11 is SYNCs 00034 00035 Bool_t globalTrigger; // true for selecting messages under global corrected time window, false for using separate windows for each roc 00036 00037 UInt_t masterRoc; // id number of ROC which is time/trigger reference for global roc 00038 00039 UInt_t maxBufferTriggers; // maximum number of triggers in same mbs input buffer until retrieving next 00040 UInt_t maxBufferLoops; // maximum number of loops over same mbs input buffer until retrieving next 00041 00042 Double_t timeScale[MAX_ROC]; // scaling factor for time correction 00043 00044 Int_t timeShift[MAX_ROC]; // instrumental time shift between triggers of each ROC 00045 00046 Bool_t doSorting; // perform time sorting of messages 00047 00048 Bool_t bGet4Debug; // provide debug information about Get4 errors 00049 00050 Bool_t bTriggerAfterData; // kFALSE = SYNC arriving before the event data, kTRUE = after 00051 00053 Int_t iEventNbGap; // -1 = check Off, Gap in event nember between get4 events 00054 UInt_t uSyncCycleSize; // No Online Change - Size of the synchronization cycle in epochs 00055 ULong64_t uRocCycleSize; // No Online Change - Size of roc epoch counter cycle in epochs 00056 UInt_t uMainSyncCycleSize; // No Online Change - Size of the synchronization cycle in Main clock (250MHz) epochs 00057 UInt_t uNbRocsGet4; // No Online Change - Nb of Rocs "GET4" in setup 00058 UInt_t uGet4RocsMapping[MAX_ROC]; // No Online Change - Roc-GET4 id among indexes of all rocs 00059 UInt_t uNbGet4; // No Online Change - Total Nb of active FEET boards in setup 00060 UInt_t uGet4Mapping[MAX_GET4]; // No Online Change - Get4 Mapping: there should be always at least 2*nbfeets entries here 00061 UInt_t uGet4Active[MAX_GET4]; // Activated Get4 chips (indexes after remapping => not hardware map !) 00062 UInt_t uGet4EdgeInversion[MAX_GET4]; // Edges inversion: affect all channels of a GET4 chip 00063 UInt_t uSilentMode; // Remove all printouts => Blind mode! 00064 UInt_t uDebugHistoOn; // No Online Change - Enable/Disable general debug histograms 00065 UInt_t uDebugPrintOn; // Number of data messages to be printed on screen for debug 00066 UInt_t uGet4Print; // Number of data messages to be printed on screen for debug 00067 00068 UInt_t uNbTriggerChan; // Number of Get4 channels to use for the coincidence trigger, max 8 00069 UInt_t uCoincidenceWinSize; // Size of the coincidence window for trigger building 00070 UInt_t uTriggerChannels[8]; // Channels to be used for building a coincidence trigger 00071 /*************************************/ 00072 00073 /************* GET4 v1.0 *************/ 00074 Bool_t b32bReadoutModeGet4v1; // Get4 v1.0 readout mode: kFALSE = 24 bits, kTRUE = 32 bits 00075 /*************************************/ 00076 /************* GET4 v1.x debug *******/ 00077 Double_t dMaxTot; // Maximal allowed Tot for 24 bits hit building, in ps 00078 Bool_t bTotHistoEnable; // Enable Tot histograms 00079 Bool_t bDebugHistoEnable; // Enable the time difference, finetime and DNL histograms 00080 UInt_t uNbEventsDnlUpdate; // Nb of events between 2 updates of the DNL histograms 00081 UInt_t uGet4TimeDiffChip1; // Index of first chip to be used for time difference histos 00082 UInt_t uGet4TimeDiffChip2; // Index of first chip to be used for time difference histos 00083 /*************************************/ 00084 /*********** free-streaming **********/ 00085 Bool_t bFreeStreaming; // kFALSE = Sync trigger/no trigger, kTRUE= online detection/selection from data 00086 UInt_t uNbSecondarySelectionCh; // Nb of secondary channels to use for event detection/selection 00087 UInt_t uMainSelectionTdc; // TDC index of the main signal for online selection. Selection window is relative to this 00088 UInt_t uMainSelectionChannel; // Channel of the main signal for online selection. Selection window is relative to this 00089 UInt_t uSecondarySelectionTdc[MAX_SEC_TDC]; // TDC index of the secondary signals for online selection. 00090 UInt_t uSecondarySelectionChannel[MAX_SEC_TDC]; // Channel of the secondary signals for online selection. 00091 Double_t dCoincidenceWindowStart; // Beginning of time window in which secondary channels have to be present, relative to main channel 00092 Double_t dCoincidenceWindowStop; // End of time window in which secondary channels have to be present, relative to main channel 00093 Bool_t bAllowEventMixing; // kFALSE = 1 hit => max 1 event, kTRUE = 1 hit => all trigger window matching events inside MBS event 00094 /*************************************/ 00095 00096 00098 void SetNbRocsGet4(UInt_t num); 00099 00101 Int_t FindGet4RocId(UInt_t rocid) const; 00102 00104 UInt_t DefineGet4IndexOffset(UInt_t rocid) const; 00105 00107 void SetNbGet4(UInt_t num); 00108 00110 UInt_t RemapGet4Chip(UInt_t chip) const; 00111 UInt_t RemapGet4Chip(UInt_t roc, UInt_t chip) const; 00112 00114 Bool_t IsValidRoc(UInt_t board) const { return board < numRocs; } 00115 00117 Bool_t IsValidGet4Chip(UInt_t chip) const { return chip < uNbGet4; } 00118 00120 Bool_t IsActiveRoc(UInt_t board) const { return (board < numRocs)? (kTRUE == activeRoc[board]): kFALSE ; } 00121 00123 Bool_t IsActiveGet4Chip(UInt_t chip) const { return (chip < uNbGet4)? (1 == uGet4Active[chip]): kFALSE; } 00124 00125 Bool_t PrintGet4Options(); 00126 00127 00128 ClassDef(TGet4v1Param, 1) 00129 }; 00130 00131 #endif // TGET4V1PARAM_H