]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PWGLF/FORWARD/analysis2/sim/OCDBConfig.C
Various updates for the production scripts
[u/mrichter/AliRoot.git] / PWGLF / FORWARD / analysis2 / sim / OCDBConfig.C
1 struct VirtualOCDBCfg
2 {
3   /** 
4    * This member function must return the default prefix. 
5    * 
6    * @return Prefix of OCDB specific storages
7    */
8   virtual const char* Prefix() const { return ""; }
9   /** 
10    * This member function should define the real setup. 
11    * 
12    * @param forSim Whether we're setting up for simulations or not 
13    */
14   virtual void Init(Bool_t forSim) 
15   {
16     ::Fatal("VirtualOCDBConfig", "Dummy init called - redefine!");
17   }
18   /** 
19    * Set the specific storage for a given key (possibly wild-carded). 
20    * 
21    * @param key    Key 
22    * @param ideal  Whether it is residual or ideal
23    */
24   void AddStore(const char*    key, 
25                 Bool_t         ideal)
26   {
27     AliCDBManager* cdb = AliCDBManager::Instance();
28     const char* prefix = Prefix();
29     TString     path   = Form("alien://Folder=/alice/simulation/%s/%s",
30                               prefix, !ideal ? "Residual" : "Ideal");
31     ::Info("AddStore", "%s -> %s", key, path.Data());
32     cdb->SetSpecificStorage(key, path);
33   }
34 };
35 VirtualOCDBCfg* ocdbCfg = 0;
36
37 /** 
38  * Specific implementation.  Note, this requires that GRP.C has been
39  * loaded and exectuted before calling Init.
40  */
41 struct OCDBCfg : public VirtualOCDBCfg
42 {
43   const char* Prefix() const { return "2008/v4-15-Release"; }
44   void Init(Bool_t forSim)
45   {
46     Bool_t is10h = grp->period.EqualTo("LHC10h");
47     
48     // --- ITS  (1 Total) ----------------------------------------------
49     AddStore("ITS/Align/Data",          forSim);
50     if (!forSim) 
51       AddStore("ITS/Align/SPDSparseDead",false);
52   
53     // --- MUON (1 object) ---------------------------------------------
54     AddStore("MUON/Align/Data",         forSim); 
55
56     // ---- TPC (6 total) ----------------------------------------------
57     AddStore("TPC/Calib/TimeGain",      forSim);
58     AddStore("TPC/Calib/ClusterParam",  forSim);
59     AddStore("TPC/Calib/AltroConfig",   forSim);
60     AddStore("TPC/Calib/Correction",    forSim);
61     AddStore("TPC/Align/Data",          forSim);
62     AddStore("TPC/Calib/TimeDrift",     forSim);
63     AddStore("TPC/Calib/RecoParam",     (forSim && !is10h));
64     
65     // --- ZDC for 2010 the following is needed ------------------------
66     // (https://savannah.cern.ch/task/?func=detailitem&item_id=33180#comment46)
67     if (is10h) AddStore("ZDC/Align/Data",true); 
68   }
69 };
70
71
72 void OCDBConfig()
73 {
74   ::Info("OCDBConfig", "Creating OCDB configuration");
75   ocdbCfg = new OCDBCfg;
76 }
77
78
79