Line data Source code
1 : #ifndef AliITSTriggerConditions_H
2 : #define AliITSTriggerConditions_H
3 :
4 : ////////////////////////////////////////////////////////////////////////////////////
5 : // Author: Henrik Tydesjo //
6 : // //
7 : // Implementation of conditions data from Pixel Trigger (PIT) //
8 : // //
9 : // The information is propagated from pixel trigger system to DCS file exchange //
10 : // server (text file format). The ReadFromTextFile method will populate this //
11 : // object with the values from the text file. Via a Preprocessor, this object //
12 : // can be stored in OCDB. //
13 : // //
14 : // One can also manually create conditions data that may be interesting for //
15 : // simulation. //
16 : // //
17 : ////////////////////////////////////////////////////////////////////////////////////
18 :
19 : #include <TObject.h>
20 : #include <TObjArray.h>
21 : #include <TString.h>
22 : #include <TBits.h>
23 :
24 : class AliITSTriggerConditions : public TObject{
25 : public:
26 : AliITSTriggerConditions();
27 : AliITSTriggerConditions(const AliITSTriggerConditions& cond);
28 : virtual ~AliITSTriggerConditions();
29 : AliITSTriggerConditions& operator=(const AliITSTriggerConditions& cond);
30 :
31 : virtual Bool_t IsEqualTo(AliITSTriggerConditions *cond) const;
32 :
33 : virtual void DumpAll() const;
34 : virtual void PrintAsInPIT() const;
35 : virtual void ResetAll();
36 :
37 0 : virtual void SetRunNumber(UInt_t num) {fRunNumber=num;}
38 0 : virtual UInt_t GetRunNumber() const {return fRunNumber;}
39 0 : virtual void SetFirmWareVersion(UShort_t num) {fFirmWareVersion=num;}
40 0 : virtual UShort_t GetFirmWareVersion() const {return fFirmWareVersion;}
41 0 : virtual void SetGlobalDescription(const Char_t* descr) {fGlobalDescription=descr;}
42 0 : virtual const Char_t* GetGlobalDescription() const {return fGlobalDescription.Data();}
43 0 : virtual void SetVersionRegister(UShort_t num) {fVersionRegister=num;}
44 0 : virtual UShort_t GetVersionRegister() const {return fVersionRegister;}
45 0 : virtual void SetInputConditionsVersion(UShort_t num) {fInputConditionsVersion=num;}
46 0 : virtual UShort_t GetInputConditionsVersion() const {return fInputConditionsVersion;}
47 0 : virtual void SetParametersVersion(UShort_t num) {fParametersVersion=num;}
48 0 : virtual UShort_t GetParametersVersion() const {return fParametersVersion;}
49 :
50 : virtual void SetInActiveChip(UInt_t eq, UInt_t hs, UInt_t chip)
51 0 : {fInActiveChips.SetBitNumber(GetChipKey(eq,hs,chip));}
52 0 : virtual void ResetInActiveChips() {fInActiveChips.ResetAllBits();}
53 : virtual void SetActiveChip(UInt_t eq, UInt_t hs, UInt_t chip)
54 0 : {fInActiveChips.SetBitNumber(GetChipKey(eq,hs,chip),kFALSE);}
55 : virtual void DumpInActiveChips() const;
56 :
57 : virtual Bool_t IsChipActive(UInt_t eq, UInt_t hs, UInt_t chip) const
58 296 : {return !IsChipInActive(eq,hs,chip);}
59 : virtual Bool_t IsChipInActive(UInt_t eq, UInt_t hs, UInt_t chip) const
60 296 : {return fInActiveChips.TestBitNumber(GetChipKey(eq,hs,chip));}
61 : virtual Bool_t GetNextInActiveChip(Int_t& eq, Int_t& hs, Int_t& chip) const;
62 :
63 : virtual void ClearAlgorithms();
64 : virtual void ClearAlgoParamsI(UShort_t aIndex);
65 : virtual void ClearAlgoParamsL(const Char_t* aLabel);
66 :
67 : virtual void AddAlgo(UShort_t id, const Char_t* aLabel, const Char_t* aDescr);
68 : virtual void AddAlgoParam(UShort_t id, const Char_t* pName, Int_t pValue);
69 :
70 16 : virtual UShort_t GetNumAlgo() const {return fNumAlgo;}
71 : virtual Short_t GetAlgoIndexL(const Char_t* aLabel) const;
72 : virtual Short_t GetAlgoIDI(UShort_t aIndex) const;
73 : virtual const Char_t* GetAlgoLabelI(UShort_t aIndex) const;
74 : virtual const Char_t* GetAlgoDescriptionI(UShort_t aIndex) const;
75 :
76 : virtual Short_t GetNumAlgoParamI(UShort_t aIndex) const;
77 : virtual const Char_t* GetAlgoParamNameII(UShort_t aIndex, UShort_t pIndex) const;
78 : virtual Int_t GetAlgoParamValueII(UShort_t aIndex, UShort_t pIndex) const;
79 : virtual Int_t GetAlgoParamValueIN(UShort_t aIndex, const Char_t* pName) const;
80 : virtual Short_t GetNumAlgoParamL(const Char_t* aLabel) const;
81 : virtual const Char_t* GetAlgoParamNameLI(const Char_t* aLabel, UShort_t pIndex) const;
82 : virtual Int_t GetAlgoParamValueLI(const Char_t* aLabel, UShort_t pIndex) const;
83 : virtual Int_t GetAlgoParamValueLN(const Char_t* aLabel, const Char_t* pName) const;
84 :
85 : virtual void ReadFromTextFile(const Char_t* fileName);
86 :
87 : protected:
88 : UInt_t fRunNumber; // Run number
89 : UShort_t fFirmWareVersion; // PIT Processing firmware version
90 : TString fGlobalDescription; // PIT Global description
91 : UShort_t fVersionRegister; // PIT Version register value
92 : UShort_t fInputConditionsVersion; // PIT Input configuration version
93 : UShort_t fParametersVersion; // PIT Parameters version
94 : TBits fInActiveChips; // Map of PIT de-activated chips
95 : UShort_t fNumAlgo; // Number of algorithms used
96 : TObjArray fAlgoList; // List of conditions for each algorithm used
97 :
98 : UInt_t GetChipKey(Int_t eq, Int_t hs, Int_t chip) const;
99 : void GetChipFromKey(UInt_t key, Int_t& eq, Int_t& hs, Int_t& chip) const;
100 : Bool_t SplitStringIn2(TString orig, TString& word1, TString& word2, Char_t sep);
101 : TString GetStringBetween(TString orig, Char_t sep1, Char_t sep2);
102 :
103 154 : ClassDef(AliITSTriggerConditions,1) // Trigger conditions class
104 : };
105 :
106 : #endif
|