]> git.uio.no Git - u/mrichter/AliRoot.git/blame - TPC/MakeTPCFullMisAlignment.C
VZERO volumes now placed in common mother.
[u/mrichter/AliRoot.git] / TPC / MakeTPCFullMisAlignment.C
CommitLineData
1895a097 1void MakeTPCFullMisAlignment(){
2 // Create TClonesArray of full misalignment objects for TPC
3 //
4 if(!gGeoManager) TGeoManager::Import("geometry.root");
5 // needed for the constructors with local coordinates not to fail
6
7 TClonesArray *array = new TClonesArray("AliAlignObjAngles",100);
8 TClonesArray &alobj = *array;
9
10 TRandom *rnd = new TRandom(4357);
11 AliAlignObjAngles o;
12 Int_t j = 0;
d3a9c52a 13 Double_t dx, dy, dz, dpsi, dtheta, dphi;
14
1895a097 15 // RS = local
d3a9c52a 16 // sigma translation = 0.1 mm
17 // sigma rotation = 0.1 mrad
1895a097 18 Float_t sigmatr=0.01;
d3a9c52a 19 Float_t sigmarot = 0.006;
20
1895a097 21 for (Int_t iLayer = AliAlignObj::kTPC1; iLayer <= AliAlignObj::kTPC2; iLayer++) {
22 for (Int_t iModule = 0; iModule < AliAlignObj::LayerSize(iLayer); iModule++) {
23
5bd470e1 24 dx = rnd->Gaus(0,sigmatr);
25 dy = rnd->Gaus(0,sigmatr);
26 dz = rnd->Gaus(0,sigmatr);
27 dpsi = rnd->Gaus(0,sigmarot);
28 dtheta = rnd->Gaus(0,sigmarot);
29 dphi = rnd->Gaus(0,sigmarot);
1895a097 30
31 UShort_t volid = AliAlignObj::LayerToVolUID(iLayer,iModule);
7e154d52 32 const char *symname = AliAlignObj::SymName(volid);
d3a9c52a 33 new(alobj[j++]) AliAlignObjAngles(symname, volid, dx, dy, dz, dpsi, dtheta, dphi, kFALSE);
1895a097 34 }
35 }
36
37
5bd470e1 38 if( gSystem->Getenv("TOCDB") != TString("kTRUE") ){
1895a097 39 // save on file
40 TFile f("TPCfullMisalignment.root","RECREATE");
41 if(!f) cerr<<"cannot open file for output\n";
42 f.cd();
43 f.WriteObject(array,"TPCAlignObjs","kSingleKey");
44 f.Close();
45 }else{
46 // save in CDB storage
5bd470e1 47 const char* Storage = gSystem->Getenv("STORAGE");
1895a097 48 AliCDBManager* cdb = AliCDBManager::Instance();
49 AliCDBStorage* storage = cdb->GetStorage(Storage);
50 AliCDBMetaData* md = new AliCDBMetaData();
51 md->SetResponsible("Marian Ivanov");
52 md->SetComment("Full misalignment for TPC, sigmatr=0.01 and sigmarot=0.6 in the local RS");
5bd470e1 53 md->SetAliRootVersion(gSystem->Getenv("ARVERSION"));
1895a097 54 AliCDBId id("TPC/Align/Data",0,9999999);
55 storage->Put(array,id,md);
56 }
57
58 array->Delete();
59
60}
61