1 void MakeEMCALAltroMapping(){
2 // Create TObjArray of EMCAL altro mapping objects and
5 const char* macroname = "MakeEMCALAltroMapping.C";
7 TObjArray mappingsArray(6);
9 TString path = gSystem->Getenv("ALICE_ROOT");
10 path += "/EMCAL/mapping/RCU";
12 TString side[] = {"A","C"};//+ and - pseudarapidity supermodules
13 for(Int_t j = 0; j < 2; j++){
14 for(Int_t i = 0; i < 2; i++) {
19 printf("File: %s\n",path2.Data());
20 AliAltroMapping *mapping = new AliCaloAltroMapping(path2.Data());
21 mappingsArray.Add(mapping);
25 if( TString(gSystem->Getenv("TOCDB")) != TString("kTRUE") ){
27 const char* filename = "EMCALAltroMapping.root";
28 TFile f(filename,"RECREATE");
30 Error(macroname,"cannot open file for output\n");
33 Info(macroname,"Saving altro mapping objects to the file %s", filename);
35 f.WriteObject(&mappingsArray,"EMCALAtroMappings","kSingleKey");
38 // save in CDB storage
39 TString Storage = gSystem->Getenv("STORAGE");
40 if(!Storage.BeginsWith("local://") && !Storage.BeginsWith("alien://")) {
41 Error(macroname,"STORAGE variable set to %s is not valid. Exiting\n",Storage.Data());
44 Info(macroname,"Saving altro mapping objects in CDB storage %s",
46 AliCDBManager* cdb = AliCDBManager::Instance();
47 AliCDBStorage* storage = cdb->GetStorage(Storage.Data());
49 Error(macroname,"Unable to open storage %s\n",Storage.Data());
52 AliCDBMetaData* md = new AliCDBMetaData();
53 md->SetResponsible("Jennifer Klay");
54 md->SetComment("Default ALTRO mapping for EMCAL");
55 md->SetAliRootVersion(gSystem->Getenv("ARVERSION"));
56 AliCDBId id("EMCAL/Calib/Mapping",0,AliCDBRunRange::Infinity());
57 storage->Put(&mappingsArray,id,md);
62 mappingsArray.Delete();