Line data Source code
1 : #ifndef ALIDAQ_H
2 : #define ALIDAQ_H
3 :
4 : /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
5 : * See cxx source for full Copyright notice */
6 :
7 : //////////////////////////////////////////////////////////////////////////////
8 : // //
9 : // The AliDAQ class is responsible for handling all the information about //
10 : // Data Acquisition configuration. It defines the detector indexing, //
11 : // the number of DDLs and LDCs per detector. //
12 : // The number of LDCs per detector is used only in the simulation in order //
13 : // to define the configuration of the dateStream application. Therefore the //
14 : // numbers in the corresponding array can be changed without affecting the //
15 : // rest of the aliroot code. //
16 : // The equipment ID (DDL ID) is an integer (32-bit) number defined as: //
17 : // Equipment ID = (detectorID << 8) + DDLIndex //
18 : // where the detectorID is given by fgkDetectorName array and DDLIndex is //
19 : // the index of the corresponding DDL inside the detector partition. //
20 : // Due to DAQ/HLT limitations, the ddl indexes should be consequtive, or //
21 : // at least without big gaps in between. //
22 : // The sub-detector code use only this class in the simulation and reading //
23 : // of the raw data. //
24 : // //
25 : // cvetan.cheshkov@cern.ch 2006/06/09 //
26 : // //
27 : //////////////////////////////////////////////////////////////////////////////
28 :
29 : #include <TObject.h>
30 :
31 : class AliDAQ: public TObject {
32 : public:
33 :
34 24 : AliDAQ() {};
35 : AliDAQ(const AliDAQ& source);
36 : AliDAQ& operator = (const AliDAQ& source);
37 24 : virtual ~AliDAQ() {};
38 :
39 : static Int_t DetectorID(const char *detectorName);
40 : static const char *DetectorName(Int_t detectorID);
41 :
42 : static Int_t DdlIDOffset(const char *detectorName);
43 : static Int_t DdlIDOffset(Int_t detectorID);
44 :
45 : static const char *DetectorNameFromDdlID(Int_t ddlID, Int_t &ddlIndex);
46 : static Int_t DetectorIDFromDdlID(Int_t ddlID, Int_t &ddlIndex);
47 :
48 : static Int_t DdlID(const char *detectorName, Int_t ddlIndex);
49 : static Int_t DdlID(Int_t detectorID, Int_t ddlIndex);
50 : static const char *DdlFileName(const char *detectorName, Int_t ddlIndex);
51 : static const char *DdlFileName(Int_t detectorID, Int_t ddlIndex);
52 :
53 : static Int_t NumberOfDdls(const char *detectorName);
54 : static Int_t NumberOfDdls(Int_t detectorID);
55 :
56 : static Float_t NumberOfLdcs(const char *detectorName);
57 : static Float_t NumberOfLdcs(Int_t detectorID);
58 :
59 : static void PrintConfig();
60 :
61 : static const char *ListOfTriggeredDetectors(UInt_t detectorPattern);
62 : static UInt_t DetectorPattern(const char *detectorList);
63 : static UInt_t DetectorPatternOffline(const char *detectorList);
64 :
65 : static const char *OfflineModuleName(const char *detectorName);
66 : static const char *OfflineModuleName(Int_t detectorID);
67 :
68 : static const char *OnlineName(const char *detectorName);
69 : static const char *OnlineName(Int_t detectorID);
70 :
71 : static void SetRun1();
72 : static void SetRun2();
73 0 : static Int_t GetRunPeriod() {return fgkRunPeriod;}
74 32 : static Int_t GetFirstSTUDDL() {return fgkFirstSTUDDL;}
75 24 : static Int_t GetLastSTUDDL() {return fgkLastSTUDDL;}
76 :
77 : enum {
78 : kNDetectors = 25, // Number of detectors
79 : kHLTId = 30 // HLT detector index
80 : };
81 :
82 : enum DetectorBits {kSPD = 0x0001, kSDD = 0x0002, kSSD = 0x0004, kITS = 0x0007,
83 : kTPC = 0x0008, kTRD = 0x0010, kTOF = 0x0020, kHMPID = 0x0040,
84 : kPHOS = 0x0080, kCPV = 0x0100, kPMD = 0x0200, kMUONTRK = 0x0400,
85 : kMUONTRG = 0x0800, kMUON = 0x0c00, kFMD = 0x1000, kT0 = 0x2000, kVZERO = 0x4000,
86 : kZDC = 0x8000, kACORDE = 0x10000, kTRG = 0x20000, kEMCAL = 0x40000,
87 : kDAQTEST = 0x80000, kEMPTY= 0x100000, kAD = 0x200000, kMFT = 0x400000, kFIT = 0x800000, kHLT = 0x40000000};
88 :
89 : enum DetectorBitsQualityFlag {kACORDE_QF = 0x000001, kAD_QF = 0x000002, kCPV_QF = 0x000004, kDAQ_TEST_QF = 0x000008,
90 : kEMCAL_QF = 0x000010, kFMD_QF = 0x000020, kHLT_QF = 0x000040, kHMPID_QF = 0x000080,
91 : kMUON_TRG_QF = 0x000100, kMUON_TRK_QF = 0x000200, kPHOS_QF = 0x000400, kPMD_QF = 0x000800,
92 : kSDD_QF = 0x001000, kSPD_QF = 0x002000, kSSD_QF = 0x004000, kT0_QF = 0x008000,
93 : kTOF_QF = 0x010000, kTPC_QF = 0x020000, kTRD_QF = 0x040000, kTRIGGER_QF = 0x080000,
94 : kV0_QF = 0x100000, kZDC_QF = 0x200000};
95 :
96 : private:
97 :
98 : static const char *fgkDetectorName[kNDetectors]; // Detector names
99 : static Int_t fgkNumberOfDdls[kNDetectors]; // Number of DDLs per detector
100 : static Float_t fgkNumberOfLdcs[kNDetectors]; // Number of LDCs per detector (not fixed - used only for the raw data simulation)
101 : static const char* fgkOfflineModuleName[kNDetectors]; // Names of the offline modules corresponding to the detectors
102 : static const char* fgkOnlineName[kNDetectors]; // Online (DAQ/ECS) detector names
103 : static Int_t fgkRunPeriod; // 1 corresponds to Run1, 1 - to Run2
104 : static Int_t fgkFirstSTUDDL; // ID of the first STU DDLwithin the EMCAL range
105 : static Int_t fgkLastSTUDDL; // ID of the last STU DDL within the EMCAL range
106 :
107 176 : ClassDef(AliDAQ, 6) // ALICE DAQ Configuration class
108 : };
109 :
110 : #endif
|