]> git.uio.no Git - u/mrichter/AliRoot.git/blob - TRD/Cal/AliTRDCreateOCDBPIDLQ.C
Protection against non existing online gain table (Theo)
[u/mrichter/AliRoot.git] / TRD / Cal / AliTRDCreateOCDBPIDLQ.C
1 void AliTRDCreateOCDBPIDLQ(const char *fn){
2
3   TObjArray *content = new TObjArray;
4   TFile *in = TFile::Open(fn);
5   TKey *key = NULL;
6   TObject *tmp = NULL;
7   TIter iter(in->GetListOfKeys());
8   while((key = (TKey *)iter())){
9     tmp = key->ReadObj();
10     printf("Putting %s into the OCDB\n", tmp->GetName());
11     content->Add(tmp);
12   }
13
14   AliCDBMetaData *metaData= new AliCDBMetaData(); 
15   metaData->SetObjectClassName("TObjArray");
16   metaData->SetResponsible("Markus Fasel");
17   metaData->SetBeamPeriod(1);
18   metaData->SetAliRootVersion("05-21-01"); //root version
19   metaData->SetComment("TRD PID Reference Histos for the 1D Likelihood method");
20   
21   AliCDBId id("TRD/Calib/PIDLQ1D", 0, AliCDBRunRange::Infinity()); 
22   AliCDBManager *man = AliCDBManager::Instance();
23   AliCDBStorage *gStorLoc = man->GetStorage("local:///u/mfasel/OCDB");//$ALICE_ROOT/OCDB");
24   if (!gStorLoc) {
25     return;
26   }
27   gStorLoc->Put(content, id, metaData); 
28   in->Close();
29
30   return;
31 }