1 void MakeEMCALZeroMisAlignment(){
2 // Create TClonesArray of zero misalignment objects for EMCAL
4 TClonesArray *array = new TClonesArray("AliAlignObjAngles",10);
5 TClonesArray &alobj = *array;
7 if(!AliGeomManager::GetGeometry()){
8 if(!(AliCDBManager::Instance())->IsDefaultStorageSet())
9 AliCDBManager::Instance()->SetDefaultStorage("local://$ALICE_ROOT");
10 AliCDBManager::Instance()->SetRun(0);
11 AliGeomManager::LoadGeometry();
15 Double_t dx=0., dy=0., dz=0., dpsi=0., dtheta=0., dphi=0.;
17 const TString fbasepath = "EMCAL/FullSupermodule";
18 const TString hbasepath = "EMCAL/HalfSupermodule";
21 Int_t iIndex=0; // let all modules have index=0 in a layer with no LUT
22 AliGeomManager::ELayerID iLayer = AliGeomManager::kInvalidLayer;
23 UShort_t volid = AliGeomManager::LayerToVolUID(iLayer,iIndex);
31 new(alobj[j++]) AliAlignObjAngles(pathstr, volid, dx, dy, dz, dpsi, dtheta, dphi, kTRUE);
37 new(alobj[j++]) AliAlignObjAngles(pathstr, volid, dx, dy, dz, dpsi, dtheta, dphi, kTRUE);
40 const char* macroname = "MakeEMCALZeroMisAlignment.C";
41 if( gSystem->Getenv("TOCDB") != TString("kTRUE") ){
43 const char* filename = "EMCALzeroMisalignment.root";
44 TFile f(filename,"RECREATE");
46 Error(macroname,"cannot open file for output\n");
49 Info(macroname,"Saving alignment objects to the file %s", filename);
51 f.WriteObject(array,"EMCALAlignObjs","kSingleKey");
54 // save in CDB storage
55 TString Storage = gSystem->Getenv("STORAGE");
56 if(!Storage.BeginsWith("local://") && !Storage.BeginsWith("alien://")) {
57 Error(macroname,"STORAGE variable set to %s is not valid. Exiting\n",Storage.Data());
60 Info(macroname,"Saving alignment objects in CDB storage %s",
62 AliCDBManager* cdb = AliCDBManager::Instance();
63 AliCDBStorage* storage = cdb->GetStorage(Storage.Data());
65 Error(macroname,"Unable to open storage %s\n",Storage.Data());
68 AliCDBMetaData* md = new AliCDBMetaData();
69 md->SetResponsible("Jennifer Clay");
70 md->SetComment("Zero misalignment for EMCAL");
71 md->SetAliRootVersion(gSystem->Getenv("ARVERSION"));
72 AliCDBId id("EMCAL/Align/Data",0,AliCDBRunRange::Infinity());
73 storage->Put(array,id,md);