00001 #ifndef TROCPARAM_H 00002 #define TROCPARAM_H 00003 00004 #include "TGo4Parameter.h" 00005 #include "TRocEvent.h" 00006 00008 #define NB_CHAN_GET4 4 00009 00010 #define GET4_PRINT 6 // ROC messages 00011 #define GET4_SYNC_CYCLE_SIZE 25 // Epochs ( nb-1 unsynchronized, 1 synchronized) 00012 00013 #define MAIN_CLK_SYNC_SIZE 40 00014 #define NB_SYNC_JUMP_RESET 2 00015 00016 #define CHIP_PER_FEET 2 // chips 00017 #define CHAN_PER_CHIP 4 // chan 00018 #define NB_BIN_GET4_FTS 128 // bins ( = 2^NB_BITS_FTS) 00019 00020 #define COSY_RUN 0 // Cosy Run from which the manual corrections should be taken => 0 = inactive 00021 00022 // If 1 epochs will be counted by software for each chip, readjusted 00023 // after invalid epochs blocks and used everywhere instead of ROC epochs 00024 // assigned to epochs data messages 00025 #define USE_LOCAL_EPOCHS 1 00026 00027 #define BUFFERS_NB 3 // Number of 25 epochs blocks buffers to use for messages and hits ordering/matching 00028 // More buffers allow to recover from more lost synch epoch messages, but take more memory 00029 00030 #define DEBUG 1 // adds debug histograms related to consecutive same edges 00031 #define DEBUG_PRINT 0 // adds lots of debug printout in the analysis window 00032 #define DEBUG_SORT 1 // adds debug histograms related to the 00033 // data message time ordering 00034 #define SILENT_MODE 0 // If 1, no text output for errors 00035 #define SILENT_SYNC_MODE 0 // If 1, no text output for synchronization errors 00036 /*************************************/ 00037 00038 class TGo4EventElement; 00039 00040 class TRocParam : public TGo4Parameter { 00041 public: 00042 00043 // default constructor - important for streamer 00044 TRocParam(); 00045 00046 TRocParam(const char* name); 00047 00048 virtual ~TRocParam(); 00049 00050 /* implemented to copy setup of active roc to roc event */ 00051 virtual Bool_t UpdateFrom(TGo4Parameter* rhs); 00052 00053 /* Actual set roc event configuration. To be used from setup macro*/ 00054 Bool_t SetConfigRocs(); 00055 00056 UInt_t numRocs; // maximum roc id in use +1 00057 00058 Bool_t activeRoc[MAX_ROC]; //enable roc of id 00059 00060 Bool_t baselineCalibr; // enables pedestal calibration code 00061 00062 roc::SysMessageUserTypes pedInitState; // e.g. roc::SYSMSG_USER_RECONFIGURE 00063 00064 TString pedestalFile; // leave empty to not load 00065 00066 TString pedSaveToFile; // leave empty to not save 00067 00068 Long64_t pedTtriCalibrPeriod; // in nanoseconds 00069 00070 Int_t pedExractionMethod; // not yet implemented!!! 0 - median (fast), 1 - gaussian fit (works for externally trigered data) 00071 00072 //TString pedestalFile; // optional file name for pedestals 00073 00074 Bool_t dynamicPedestal; // dynamically measure pedestals in spill pause 00075 00076 Bool_t pedestalAcquisition; // switch manual pedestal acquisiton on/off 00077 00078 Bool_t storePedestalFile; // mark to store pedestals at next event. automatically done when switching off manual ped acquisition 00079 00080 Int_t pedVerbose; // -1 - nothing; 0 - only errors and warnings; 1 - calibr on/off messages; 2 or higher - debug 00081 00082 Int_t nxDiffCh; // channel, used for diff calculations (-1 disable) 00083 00084 Int_t numNX; // number of nXYTERs, used for analysis allowed 0, 1, 2 and 4. 00085 00086 Bool_t noTrigger; // ignore trigger window and take all messages with initial event division 00087 00088 Int_t triggerSignal; // 0 .. 3 is AUXs, 10-11 is SYNCs 00089 00090 Bool_t globalTrigger; // true for selecting messages under global corrected time window, false for using separate windows for each roc 00091 00092 UInt_t masterRoc; // id number of ROC which is time/trigger reference for global roc 00093 00094 UInt_t maxBufferTriggers; // maximum number of triggers in same mbs input buffer until retrieving next 00095 UInt_t maxBufferLoops; // maximum number of loops over same mbs input buffer until retrieving next 00096 00097 Double_t timeScale[MAX_ROC]; // scaling factor for time correction 00098 00099 Int_t timeShift[MAX_ROC]; // instrumental time shift between triggers of each ROC 00100 00101 Bool_t ttriMode[MAX_ROC][MAX_NX]; // 1 - nXYTER is in the Test Trigger (i.e. externally triggered) mode; 00102 00103 Bool_t doSorting; // perform time sorting of messages 00104 00105 Bool_t bGet4Debug; // provide debug information about Get4 errors 00106 00108 Bool_t NoGet4Cleaning; // write directly fExtentedMessages in buffer, no get4 cleaning 00109 00110 Int_t iEventNbGap; // -1 = check Off, Gap in event nember between get4 events 00111 UInt_t uSyncCycleSize; // No Online Change - Size of the synchronization cycle in epochs 00112 ULong64_t uRocCycleSize; // No Online Change - Size of roc epoch counter cycle in epochs 00113 UInt_t uMainSyncCycleSize; // No Online Change - Size of the synchronization cycle in Main clock (250MHz) epochs 00114 UInt_t uNbBlockJumpedReset; // Nb of sync cycle epoch block to jump when a "GET4 RESET" message is received 00115 UInt_t uNbRocsGet4; // No Online Change - Nb of Rocs "GET4" in setup 00116 UInt_t uFeetRocsMapping[MAX_ROC]; // No Online Change - Roc-GET4 id among indexes of all rocs 00117 UInt_t uNbFeets; // No Online Change - Total Nb of active FEET boards in setup 00118 UInt_t uGet4Mapping[MAX_FEET*2]; // No Online Change - Get4 Mapping: there should be always at least 2*nbfeets entries here 00119 UInt_t uGet4Active[MAX_FEET*2]; // Activated Get4 chips (indexes after remapping => not hardware map !) 00120 UInt_t uGet4EdgeInversion[MAX_FEET*2]; // Edges inversion: affect all channels of a GET4 chip 00121 UInt_t uUseLocalEpochs; // Use ROC (0) / Local (1) epochs 00122 UInt_t uNbBuffers; // No Online Change - Number of buffers to use for messages and hits ordering/matching 00123 UInt_t uCosyRun; // For manual corrections: Cosy run values to use 00124 UInt_t uSilentMode; // Remove all printouts => Blind mode! 00125 UInt_t uSilentSyncMode; // Remove printouts about wrong sync size in epochs 00126 UInt_t uManualDebug; // PAL:TO REMOVE For manual corrections: 0 disable the messages about 00127 UInt_t uDebugHistoOn; // No Online Change - Enable/Disable general debug histograms 00128 UInt_t uDebugPrintOn; // Number of data messages to be printed on screen for debug 00129 UInt_t uGet4Print; // Number of data messages to be printed on screen for debug 00130 UInt_t uSortingHistoOn; // No Online Change - Enable/Disable debug histograms for time ordering 00131 00132 /*************************************/ 00133 00135 void SetNbRocsGet4(UInt_t num); 00136 00138 Int_t FindFeetRocId(UInt_t rocid) const; 00139 00141 UInt_t DefineGet4IndexOffset(UInt_t rocid) const; 00142 00144 void SetNbFeets(UInt_t num); 00145 00147 UInt_t RemapGet4Chip(UInt_t chip) const; 00148 00150 Bool_t IsValidGet4Chip(UInt_t chip) const { return chip < 2*uNbFeets; } 00151 00152 Bool_t PrintGet4Options(); 00153 00154 00155 ClassDef(TRocParam, 13) 00156 }; 00157 00158 #endif