1 void MakeTPCAltroMapping(){
2 // Create TObjArray of TPC altro mapping objects and
5 const char* macroname = "MakeTPCAltroMapping.C";
7 TObjArray mappingsArray(6);
9 TString path = gSystem->Getenv("ALICE_ROOT");
10 path += "/TPC/mapping/Patch";
12 for(Int_t i = 0; i < 6; i++) {
16 AliAltroMapping *mapping = new AliTPCAltroMapping(path2.Data());
17 mappingsArray.Add(mapping);
20 if( TString(gSystem->Getenv("TOCDB")) != TString("kTRUE") ){
22 const char* filename = "TPCAltroMapping.root";
23 TFile f(filename,"RECREATE");
25 Error(macroname,"cannot open file for output\n");
28 Info(macroname,"Saving altro mapping objects to the file %s", filename);
30 f.WriteObject(&mappingsArray,"TPCAtroMappings","kSingleKey");
33 // save in CDB storage
34 TString Storage = gSystem->Getenv("STORAGE");
35 if(!Storage.BeginsWith("local://") && !Storage.BeginsWith("alien://")) {
36 Error(macroname,"STORAGE variable set to %s is not valid. Exiting\n",Storage.Data());
39 Info(macroname,"Saving altro mapping objects in CDB storage %s",
41 AliCDBManager* cdb = AliCDBManager::Instance();
42 AliCDBStorage* storage = cdb->GetStorage(Storage.Data());
44 Error(macroname,"Unable to open storage %s\n",Storage.Data());
47 AliCDBMetaData* md = new AliCDBMetaData();
48 md->SetResponsible("Marian Ivanov");
49 md->SetComment("Default ALTRO mapping for TPC");
50 md->SetAliRootVersion(gSystem->Getenv("ARVERSION"));
51 AliCDBId id("TPC/Calib/Mapping",0,AliCDBRunRange::Infinity());
52 storage->Put(&mappingsArray,id,md);
57 mappingsArray.Delete();