]> git.uio.no Git - u/mrichter/AliRoot.git/blame - VZERO/MakeVZEROFullMisAlignment.C
AdcThreshold set to MIP/2
[u/mrichter/AliRoot.git] / VZERO / MakeVZEROFullMisAlignment.C
CommitLineData
1895a097 1void MakeVZEROFullMisAlignment(){
2 // Create TClonesArray of full misalignment objects for VZERO
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",10);
8 TClonesArray &alobj = *array;
9
10 AliAlignObjAngles a;
11
12 Double_t dx, dy, dz, dpsi, dtheta, dphi;
13 TRandom *rnd = new TRandom(4321);
d3a9c52a 14 Double_t sigmatr = 0.1; // max shift in cm
15 Double_t sigmarot = 0.5; // max rot in degrees
1895a097 16
17 // null shifts and rotations
18
d3a9c52a 19 const char *V0right="VZERO/V0C";
20 const char *V0left="VZERO/V0A";
1895a097 21
22 Int_t iIndex=0; //let all modules have index=0 in a layer with no LUT
ae079791 23 AliGeomManager::ELayerID iLayer = AliGeomManager::kInvalidLayer;
24 UShort_t volid = AliGeomManager::LayerToVolUID(iLayer,iIndex);
1895a097 25
26 dx = rnd->Gaus(0.,sigmatr);
27 dy = rnd->Gaus(0.,sigmatr);
28 dz = rnd->Gaus(0.,sigmatr);
29 dpsi = rnd->Gaus(0.,sigmarot);
30 dtheta = rnd->Gaus(0.,sigmarot);
31 dphi = rnd->Gaus(0.,sigmarot);
32 new(alobj[0]) AliAlignObjAngles(V0right, volid, dx, dy, dz, dpsi, dtheta,
33 dphi, kFALSE);
34 dx = rnd->Gaus(0.,sigmatr);
35 dy = rnd->Gaus(0.,sigmatr);
36 dz = rnd->Gaus(0.,sigmatr);
37 dpsi = rnd->Gaus(0.,sigmarot);
38 dtheta = rnd->Gaus(0.,sigmarot);
39 dphi = rnd->Gaus(0.,sigmarot);
40 new(alobj[1]) AliAlignObjAngles(V0left, volid, dx, dy, dz, dpsi, dtheta,
41 dphi,kFALSE);
42
5bd470e1 43 if( gSystem->Getenv("TOCDB") != TString("kTRUE") ){
1895a097 44 // save on file
45 TFile f("V0fullMisalignment.root","RECREATE");
46 if(!f) cerr<<"cannot open file for output\n";
47 f.cd();
48 f.WriteObject(array,"V0FullObjs ","kSingleKey");
49 f.Close();
50 }else{
51 // save in CDB storage
5bd470e1 52 const char* Storage = gSystem->Getenv("STORAGE");
1895a097 53 AliCDBManager* cdb = AliCDBManager::Instance();
54 AliCDBStorage* storage = cdb->GetStorage(Storage);
55 AliCDBMetaData* md = new AliCDBMetaData();
56 md->SetResponsible("Brigitte Cheynis");
57 md->SetComment("Alignment objects for V0 full misalignment");
5bd470e1 58 md->SetAliRootVersion(gSystem->Getenv("ARVERSION"));
1895a097 59 AliCDBId id("VZERO/Align/Data",0,9999999);
60 storage->Put(array,id,md);
61 }
62
63 array->Delete();
64
65}
66