]> git.uio.no Git - u/mrichter/AliRoot.git/blob - EMCAL/AliEMCALTriggerDCSConfigDB.h
Add gain fluctuations in simulation (Evi)
[u/mrichter/AliRoot.git] / EMCAL / AliEMCALTriggerDCSConfigDB.h
1 #ifndef ALIEMCALTRIGGERDCSCONFIGDB_H
2 #define ALIEMCALTRIGGERDCSCONFIGDB_H
3 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4  * See cxx source for full Copyright notice                               */
5
6 /*
7  
8  
9
10 Adapted from TRD: thanks!
11 Author: R. GUERNANE LPSC Grenoble CNRS/IN2P3
12 */
13
14 #ifndef ROOT_TObject
15 #include "TObject.h"
16 #endif
17
18 class AliCDBEntry;
19
20 class AliEMCALTriggerDCSConfig;
21
22 class AliEMCALTriggerDCSConfigDB : public TObject 
23 {
24 public:
25         
26         static AliEMCALTriggerDCSConfigDB*  Instance();
27         static void                         Terminate();
28
29         void                                SetRun(Long64_t run);
30         Long64_t                            GetRun() const { return fRun; }
31         const AliEMCALTriggerDCSConfig*     GetTriggerDCSConfig();
32         void                                GetSTUSegmentation(Int_t ssg[], Int_t spg[], Int_t ssj[], Int_t spj[]);
33         Int_t                               GetTRUSegmentation(Int_t iTRU);
34         Int_t                               GetTRUGTHRL0(Int_t iTRU);   
35         
36 protected:
37
38         // For caching see also implentation of GetCachedCDBObject in the .cxx file
39         // For now, only one cached object but let the possibility to have more
40         enum { kCDBCacheSize = 1    };   // Number of cached objects
41         enum { kIDTriggerConfig = 0 };   // IDs of cached objects
42
43         const TObject *GetCachedCDBObject(Int_t id);
44   
45         void           Invalidate();
46     
47         AliCDBEntry   *GetCDBEntry(const Char_t *cdbPath);
48         const TObject *CacheCDBEntry(Int_t id, const Char_t *cdbPath);
49
50         static AliEMCALTriggerDCSConfigDB* fgInstance;                 //  Instance of this class (singleton implementation)
51         static Bool_t                      fgTerminated;               //  Defines if this class has already been terminated
52
53         AliCDBEntry*                       fCDBEntries[kCDBCacheSize]; //  Cache for CDB entries
54         TObject*                           fCDBCache[kCDBCacheSize];   //  Cache for calibration objects.
55
56         Long64_t                           fRun;                       //  Run Number
57   
58  private:
59
60         AliEMCALTriggerDCSConfigDB();                                  //  This is a singleton, constructor is private!  
61         AliEMCALTriggerDCSConfigDB(const AliEMCALTriggerDCSConfigDB &c);   
62         AliEMCALTriggerDCSConfigDB &operator=(const AliEMCALTriggerDCSConfigDB &c); 
63         virtual ~AliEMCALTriggerDCSConfigDB();
64
65         ClassDef(AliEMCALTriggerDCSConfigDB, 1)                         //  Provides central access to the CDB
66 };
67
68 #endif
69