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(!gGeoManager) TGeoManager::Import("geometry.root");
8 // needed for the constructors with local coordinates not to fail
12 Double_t dx=0., dy=0., dz=0., dpsi=0., dtheta=0., dphi=0.;
14 const TString fbasepath = "EMCAL/FullSupermodule";
15 const TString hbasepath = "EMCAL/HalfSupermodule";
18 Int_t iIndex=0; // let all modules have index=0 in a layer with no LUT
19 AliGeomManager::ELayerID iLayer = AliGeomManager::kInvalidLayer;
20 UShort_t volid = AliGeomManager::LayerToVolUID(iLayer,iIndex);
28 new(alobj[j++]) AliAlignObjAngles(pathstr, volid, dx, dy, dz, dpsi, dtheta, dphi, kTRUE);
34 new(alobj[j++]) AliAlignObjAngles(pathstr, volid, dx, dy, dz, dpsi, dtheta, dphi, kTRUE);
37 if( gSystem->Getenv("TOCDB") != TString("kTRUE") ){
39 TFile f("EMCALzeroMisalignment.root","RECREATE");
40 if(!f) cerr<<"cannot open file for output\n";
42 f.WriteObject(array,"EMCALAlignObjs","kSingleKey");
45 // save in CDB storage
46 const char* Storage = gSystem->Getenv("STORAGE");
47 AliCDBManager* cdb = AliCDBManager::Instance();
48 AliCDBStorage* storage = cdb->GetStorage(Storage);
49 AliCDBMetaData* md = new AliCDBMetaData();
50 md->SetResponsible("Jennifer Clay");
51 md->SetComment("Zero misalignment for EMCAL");
52 md->SetAliRootVersion(gSystem->Getenv("ARVERSION"));
53 AliCDBId id("EMCAL/Align/Data",0,9999999);
54 storage->Put(array,id,md);