]> git.uio.no Git - u/mrichter/AliRoot.git/blob - ITS/AliITSTriggerConditions.h
Most of these updates are related to the offline software needed for the pixel trigge...
[u/mrichter/AliRoot.git] / ITS / AliITSTriggerConditions.h
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          ResetAll();
35
36     virtual void          SetRunNumber(UInt_t num) {fRunNumber=num;}
37     virtual UInt_t        GetRunNumber() const {return fRunNumber;}
38     virtual void          SetFirmWareVersion(UShort_t num) {fFirmWareVersion=num;}
39     virtual UShort_t      GetFirmWareVersion() const {return fFirmWareVersion;}
40     virtual void          SetGlobalDescription(const Char_t* descr) {fGlobalDescription=descr;}
41     virtual const Char_t* GetGlobalDescription() const {return fGlobalDescription.Data();}
42     virtual void          SetVersionRegister(UShort_t num) {fVersionRegister=num;}
43     virtual UShort_t      GetVersionRegister() const {return fVersionRegister;}
44     virtual void          SetInputConditionsVersion(UShort_t num) {fInputConditionsVersion=num;}
45     virtual UShort_t      GetInputConditionsVersion() const {return fInputConditionsVersion;}
46     virtual void          SetParametersVersion(UShort_t num) {fParametersVersion=num;}
47     virtual UShort_t      GetParametersVersion() const {return fParametersVersion;}
48
49     virtual void          SetInActiveChip(UInt_t eq, UInt_t hs, UInt_t chip) 
50       {fInActiveChips.SetBitNumber(GetChipKey(eq,hs,chip));}
51     virtual void          ResetInActiveChips() {fInActiveChips.ResetAllBits();}
52     virtual void          SetActiveChip(UInt_t eq, UInt_t hs, UInt_t chip) 
53       {fInActiveChips.SetBitNumber(GetChipKey(eq,hs,chip),kFALSE);}
54     virtual void          DumpInActiveChips() const;
55
56     virtual Bool_t        IsChipActive(UInt_t eq, UInt_t hs, UInt_t chip) const 
57       {return !IsChipInActive(eq,hs,chip);}
58     virtual Bool_t        IsChipInActive(UInt_t eq, UInt_t hs, UInt_t chip) const 
59       {return fInActiveChips.TestBitNumber(GetChipKey(eq,hs,chip));}
60     virtual Bool_t        GetNextInActiveChip(Int_t& eq, Int_t& hs, Int_t& chip) const;
61
62     virtual void          ClearAlgorithms();
63     virtual void          ClearAlgoParamsI(UShort_t aIndex);
64     virtual void          ClearAlgoParamsL(const Char_t* aLabel);
65
66     virtual void          AddAlgo(UShort_t id, const Char_t* aLabel, const Char_t* aDescr);
67     virtual void          AddAlgoParam(UShort_t id, const Char_t* pName, Int_t pValue);
68
69     virtual UShort_t      GetNumAlgo() const {return fNumAlgo;}
70     virtual Short_t       GetAlgoIndexL(const Char_t* aLabel) const;
71     virtual Short_t       GetAlgoIDI(UShort_t aIndex) const;
72     virtual const Char_t* GetAlgoLabelI(UShort_t aIndex) const;
73     virtual const Char_t* GetAlgoDescriptionI(UShort_t aIndex) const;
74
75     virtual Short_t       GetNumAlgoParamI(UShort_t aIndex) const;
76     virtual const Char_t* GetAlgoParamNameII(UShort_t aIndex, UShort_t pIndex) const;
77     virtual Int_t         GetAlgoParamValueII(UShort_t aIndex, UShort_t pIndex) const;
78     virtual Int_t         GetAlgoParamValueIN(UShort_t aIndex, const Char_t* pName) const;
79     virtual Short_t       GetNumAlgoParamL(const Char_t* aLabel) const;
80     virtual const Char_t* GetAlgoParamNameLI(const Char_t* aLabel, UShort_t pIndex) const;
81     virtual Int_t         GetAlgoParamValueLI(const Char_t* aLabel, UShort_t pIndex) const;
82     virtual Int_t         GetAlgoParamValueLN(const Char_t* aLabel, const Char_t* pName) const;
83
84     virtual void          ReadFromTextFile(const Char_t* fileName);
85
86  protected:
87     UInt_t    fRunNumber;              // Run number
88     UShort_t  fFirmWareVersion;        // PIT Processing firmware version
89     TString   fGlobalDescription;      // PIT Global description
90     UShort_t  fVersionRegister;        // PIT Version register value
91     UShort_t  fInputConditionsVersion; // PIT Input configuration version
92     UShort_t  fParametersVersion;      // PIT Parameters version
93     TBits     fInActiveChips;          // Map of PIT de-activated chips
94     UShort_t  fNumAlgo;                // Number of algorithms used
95     TObjArray fAlgoList;               // List of conditions for each algorithm used
96
97     UInt_t  GetChipKey(Int_t eq, Int_t hs, Int_t chip) const;
98     void    GetChipFromKey(UInt_t key, Int_t& eq, Int_t& hs, Int_t& chip) const;
99     Bool_t  SplitStringIn2(TString orig, TString& word1, TString& word2, Char_t sep);
100     TString GetStringBetween(TString orig, Char_t sep1, Char_t sep2);
101
102     ClassDef(AliITSTriggerConditions,1) // Trigger conditions class
103 };
104
105 #endif