Updated names of the environment variables (no dollar sign). Gaussian distribution...
[u/mrichter/AliRoot.git] / TOF / MakeTOFZeroMisAlignment.C
CommitLineData
b355f61e 1void MakeTOFZeroMisAlignment(){
b355f61e 2 // Create TClonesArray of zero misalignment objects for TOF
d3a9c52a 3 //
b355f61e 4 TClonesArray *array = new TClonesArray("AliAlignObjAngles",2000);
5 TClonesArray &alobj = *array;
6
7 if(!gGeoManager) TGeoManager::Import("geometry.root");
8 // needed for the constructors with local coordinates not to fail
9
10 AliAlignObjAngles a;
11
12 AliAlignObj::ELayerID idTOF = AliAlignObj::kTOF;
13 Int_t i;
14 Int_t j=0;
15 Double_t dx=0., dy=0., dz=0., dpsi=0., dtheta=0., dphi=0.;
16
17 for(i=0; i<AliAlignObj::LayerSize(idTOF); i++) {
d3a9c52a 18 new(alobj[j++]) AliAlignObjAngles(AliAlignObj::SymName(idTOF,i), AliAlignObj::LayerToVolUID(idTOF,i), dx, dy, dz, dpsi, dtheta, dphi, kTRUE);
b355f61e 19 }
20
5bd470e1 21 if( gSystem->Getenv("TOCDB") != TString("kTRUE") ){
d3a9c52a 22 // save on file
23 TFile f("TOFzeroMisalignment.root","RECREATE");
24 if(!f) cerr<<"cannot open file for output\n";
25 f.cd();
26 f.WriteObject(array,"TOFAlignObjs","kSingleKey");
27 f.Close();
28 }else{
29 // save in CDB storage
5bd470e1 30 const char* Storage = gSystem->Getenv("STORAGE");
d3a9c52a 31 AliCDBManager* cdb = AliCDBManager::Instance();
32 AliCDBStorage* storage = cdb->GetStorage(Storage);
33 AliCDBMetaData* md = new AliCDBMetaData();
34 md->SetResponsible("Silvia Arcelli");
35 md->SetComment("Zero misalignment for TOF");
36 md->SetAliRootVersion("HEAD");
37 AliCDBId id("TOF/Align/Data",0,9999999);
38 storage->Put(array,id,md);
39 }
b355f61e 40
41 array->Delete();
42
43}
44
45