1 void MakeEMCALFullMisAlignment(){
2 // Create TClonesArray of full 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, dy, dz, dpsi, dtheta, dphi;
13 TRandom *rnd = new TRandom(4321);
14 Double_t sigmatr = 0.1; // max shift in cm w.r.t. local RS
15 Double_t sigmarot = 0.1; // max rot in degrees w.r.t. local RS
17 // null shifts and rotations
19 const TString basepath = "EMCAL/FullSupermodule";
20 const TString hbasepath = "EMCAL/HalfSupermodule";
23 Int_t iIndex=0; //let all modules have index=0 in a layer with no LUT
24 AliGeomManager::ELayerID iLayer = AliGeomManager::kInvalidLayer;
25 UShort_t volid = AliGeomManager::LayerToVolUID(iLayer,iIndex); //dummy volume identity
30 dx = rnd->Gaus(0.,sigmatr);
31 dy = rnd->Gaus(0.,sigmatr);
32 dz = rnd->Gaus(0.,sigmatr);
33 dpsi = rnd->Gaus(0.,sigmarot);
34 dtheta = rnd->Gaus(0.,sigmarot);
35 dphi = rnd->Gaus(0.,sigmarot);
38 cout<<pathstr<<" "<<dx<<" "<<dy<<" "<<dz<<" "<<dpsi<<" "<<dtheta<<" "<<dphi<<"\n";
39 new(alobj[j++]) AliAlignObjAngles(pathstr, volid, dx, dy, dz, dpsi, dtheta, dphi, kFALSE);
43 dx = rnd->Gaus(0.,sigmatr);
44 dy = rnd->Gaus(0.,sigmatr);
45 dz = rnd->Gaus(0.,sigmatr);
46 dpsi = rnd->Gaus(0.,sigmarot);
47 dtheta = rnd->Gaus(0.,sigmarot);
48 dphi = rnd->Gaus(0.,sigmarot);
51 new(alobj[j++]) AliAlignObjAngles(pathstr, volid, dx, dy, dz, dpsi, dtheta, dphi, kTRUE);
54 if( gSystem->Getenv("TOCDB") != TString("kTRUE") ){
56 TFile f("EMCALfullMisalignment.root","RECREATE");
57 if(!f) cerr<<"cannot open file for output\n";
59 f.WriteObject(array,"T0FullObjs ","kSingleKey");
62 // save in CDB storage
63 const char* Storage = gSystem->Getenv("STORAGE");
64 AliCDBManager* cdb = AliCDBManager::Instance();
65 AliCDBStorage* storage = cdb->GetStorage(Storage);
66 AliCDBMetaData* md = new AliCDBMetaData();
67 md->SetResponsible("Jennifer Clay");
68 md->SetComment("Full misalignment for EMCAL");
69 md->SetAliRootVersion(gSystem->Getenv("ARVERSION"));
70 AliCDBId id("EMCAL/Align/Data",0,9999999);
71 storage->Put(array,id,md);