1 void MakeT0ZeroMisAlignment(){
2 // Create TClonesArray of zero misalignment objects for T0
4 TClonesArray *array = new TClonesArray("AliAlignObjParams",10);
5 TClonesArray &alobj = *array;
7 Double_t dx=0, dy=0, dz=0, dpsi=0, dtheta=0, dphi=0;
12 AliGeomManager::ELayerID iLayer = AliGeomManager::kInvalidLayer;
13 UShort_t volid = AliGeomManager::LayerToVolUID(iLayer,iIndex);
16 for (Int_t imod=0; imod<24; imod++)
26 new(alobj[j++]) AliAlignObjParams(symName.Data(), volid, dx, dy, dz, dpsi, dtheta, dphi, kTRUE);
29 const char* macroname = "MakeT0ZeroMisAlignment.C";
30 if( TString(gSystem->Getenv("TOCDB")) != TString("kTRUE") ){
32 const char* filename = "T0zeroMisalignment.root";
33 TFile f(filename,"RECREATE");
35 Error(macroname,"cannot open file for output\n");
38 Info(macroname,"Saving alignment objects to the file %s", filename);
40 f.WriteObject(array,"T0AlignObjs","kSingleKey");
43 // save in CDB storage
44 TString Storage = gSystem->Getenv("STORAGE");
45 if(!Storage.BeginsWith("local://") && !Storage.BeginsWith("alien://")) {
46 Error(macroname,"STORAGE variable set to %s is not valid. Exiting\n",Storage.Data());
49 Info(macroname,"Saving alignment objects in CDB storage %s",
51 AliCDBManager* cdb = AliCDBManager::Instance();
52 AliCDBStorage* storage = cdb->GetStorage(Storage.Data());
54 Error(macroname,"Unable to open storage %s\n",Storage.Data());
57 AliCDBMetaData* md = new AliCDBMetaData();
58 md->SetResponsible("Tomasz Malkiewicz");
59 md->SetComment("Zero misalignment for T0, produced with sigmatr=0.05 and sigmarot=0.3 in the local RS");
60 md->SetAliRootVersion(gSystem->Getenv("$ARVERSION"));
61 AliCDBId id("T0/Align/Data",0,AliCDBRunRange::Infinity());
62 storage->Put(array,id,md);