]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PMD/ocdbmacro/MakePMDGainCDB.C
Do not include from subdirectories
[u/mrichter/AliRoot.git] / PMD / ocdbmacro / MakePMDGainCDB.C
1 /**************************************************************************
2  * To Create PMD Default Gain Object. 
3  * sjena@cern.ch
4  * Mon Nov 22 19:54:27 CET 2010
5  * OCDB/PMD/Calib/Gain                    
6  **************************************************************************/
7
8 void MakePMDGainCDB(TString type="IDEAL"){
9
10         AliCDBManager* man = AliCDBManager::Instance();
11         
12         if(type == "IDEAL"){
13                 man->SetDefaultStorage("local://CDB_IDEAL");
14         }else if (type == "DECALIB"){
15                 man->SetDefaultStorage("local://CDB_DECALIB");
16         }else{
17                 cout << "Not a valid type!" << endl;
18                 break;
19         
20         }
21         
22         AliPMDCalibData *calibda = new AliPMDCalibData();
23         
24         TRandom random;
25         AliCDBId id("PMD/Calib/Gain",0,0);
26         
27         const Int_t kDet = 2;
28         const Int_t kMod = 24;
29         const Int_t kRow = 48;
30         const Int_t kCol = 96;
31
32         if(type == "IDEAL"){
33                 // SET 1 (IDEAL)        
34                 for(int a=0;a<kDet;a++) 
35                         for(int b=0;b<kMod;b++) 
36                                 for(int c=0;c<kRow;c++) 
37                                         for(int d=0;d<kCol;d++) 
38                                                 calibda->SetGainFact(a, b, c, d, random.Gaus(15,2));
39                 id.SetRunRange(0,50);
40                 
41                 
42                 
43         } else if (type == "DECALIB"){
44                 // SET 2 (DECALIB)      
45                 for(int a=0;a<kDet;a++) 
46                         for(int b=0;b<kMod;b++) 
47                                 for(int c=0;c<kRow;c++) 
48                                         for(int d=0;d<kCol;d++) 
49                                                 calibda->SetGainFact(a, b, c, d, TMath::Abs(random.Gaus(5,0.2)));
50                 id.SetRunRange(0,25);
51         }
52
53
54         
55         
56         AliCDBMetaData md;
57         md.SetResponsible("Satyajit Jena");
58         md.SetComment("Default Gain CDB");
59         man->Put(calibda, id, &md);
60
61
62 }