1 void MakeADZeroMisAlignment()
3 // Create TClonesArray of zero misalignment objects for AD
5 const char* macroname = "MakeADZeroMisAlignment.C";
7 TClonesArray *array = new TClonesArray("AliAlignObjParams",10);
8 TClonesArray &alobj = *array;
10 Double_t dx=0., dy=0., dz=0.;
11 Double_t dpsi=0., dtheta=0., dphi=0.;
13 const char * ADC1 = "AD/ADC1";
14 const char * ADC2 = "AD/ADC2";
15 const char * ADA1 = "AD/ADA1";
16 const char * ADA2 = "AD/ADA2";
19 AliGeomManager::ELayerID iLayer = AliGeomManager::kInvalidLayer;
20 UShort_t volid = AliGeomManager::LayerToVolUID(iLayer,iIndex);
22 new( alobj[0] ) AliAlignObjParams( ADC1, volid, dx, dy, dz, dpsi, dtheta, dphi, kTRUE );
23 new( alobj[1] ) AliAlignObjParams( ADC2, volid, dx, dy, dz, dpsi, dtheta, dphi, kTRUE );
24 new( alobj[2] ) AliAlignObjParams( ADA1, volid, dx, dy, dz, dpsi, dtheta, dphi, kTRUE );
25 new( alobj[3] ) AliAlignObjParams( ADA2, volid, dx, dy, dz, dpsi, dtheta, dphi, kTRUE );
27 if ( TString(gSystem->Getenv("TOCDB")) != TString("kTRUE") ) {
30 const char* filename = "ADzeroMisalignment.root";
31 TFile f( filename, "RECREATE");
33 Error( macroname, "cannot open file for output\n");
36 Info( macroname,"Saving alignment objects to the file %s", filename);
38 f.WriteObject( array, "ADAlignObjs", "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", storage.Data() );
50 AliCDBManager* cdb = AliCDBManager::Instance();
51 AliCDBStorage* storageCDB = cdb->GetStorage(storage.Data());
53 Error( macroname,"Unable to open storage %s\n", storageCDB.Data());
56 AliCDBMetaData* md = new AliCDBMetaData();
57 md->SetResponsible( "Ernesto Lopez" );
58 md->SetComment( "Alignment objects for AD zero misalignment" );
59 md->SetAliRootVersion( gSystem->Getenv("ARVERSION") );
60 AliCDBId id( "AD/Align/Data", 0, AliCDBRunRange::Infinity() );
61 storageCDB->Put( array, id, md );