]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PMD/CreateGainCDB.C
Using detector quality flag (taken from ALICE logbook) to decide whether to rpodcue...
[u/mrichter/AliRoot.git] / PMD / CreateGainCDB.C
1 void CreateGainCDB(TString type="IDEAL"){
2
3         AliCDBManager* man = AliCDBManager::Instance();
4         
5         if(type == "IDEAL"){
6                 man->SetDefaultStorage("local://CDB_IDEAL");
7         }else if (type == "DECALIB"){
8                 man->SetDefaultStorage("local://CDB_DECALIB");
9         }else{
10                 cout << "Not a valid type!" << endl;
11                 break;
12         
13         }
14         
15         AliPMDCalibData *calibda = new AliPMDCalibData();
16         
17         TRandom random;
18         AliCDBId id("PMD/Calib/Gain",0,0);
19         
20         const Int_t kDet = 2;
21         const Int_t kMod = 24;
22         const Int_t kRow = 48;
23         const Int_t kCol = 96;
24
25         if(type == "IDEAL"){
26                 // SET 1 (IDEAL)        
27                 for(int a=0;a<kDet;a++) 
28                         for(int b=0;b<kMod;b++) 
29                                 for(int c=0;c<kRow;c++) 
30                                         for(int d=0;d<kCol;d++) 
31                                                 calibda->SetGainFact(a, b, c, d, random.Gaus(15,2));
32                 id.SetRunRange(0,50);
33                 
34                 
35                 
36         } else if (type == "DECALIB"){
37                 // SET 2 (DECALIB)      
38                 for(int a=0;a<kDet;a++) 
39                         for(int b=0;b<kMod;b++) 
40                                 for(int c=0;c<kRow;c++) 
41                                         for(int d=0;d<kCol;d++) 
42                                                 calibda->SetGainFact(a, b, c, d, TMath::Abs(random.Gaus(5,0.2)));
43                 id.SetRunRange(0,25);
44         }
45
46
47         
48         
49         AliCDBMetaData md;
50         
51         man->Put(calibda, id, &md);
52
53
54 }