Temporary disable the raw version, it will be taken from FEE
[u/mrichter/AliRoot.git] / TRD / MakeTRDZeroMisAlignment.C
CommitLineData
d3a9c52a 1void MakeTRDZeroMisAlignment(){
2 // Create TClonesArray of zero misalignment objects for TRD
3 //
4 TClonesArray *array = new TClonesArray("AliAlignObjAngles",1000);
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 Double_t dx=0.,dy=0.,dz=0.,rx=0.,ry=0.,rz=0.;
13
14 Int_t j=0;
15 UShort_t volid;
16 const char *symname;
17
18 // create the chambers' alignment objects
ae079791 19 for (Int_t iLayer = AliGeomManager::kTRD1; iLayer <= AliGeomManager::kTRD6; iLayer++) {
20 for (Int_t iModule = 0; iModule < AliGeomManager::LayerSize(iLayer); iModule++) {
21 volid = AliGeomManager::LayerToVolUID(iLayer,iModule);
22 symname = AliGeomManager::SymName(volid);
d3a9c52a 23 new(alobj[j++]) AliAlignObjAngles(symname,volid,dx,dy,dz,rx,ry,rz,kTRUE);
24 }
25 }
26
5bd470e1 27 if( gSystem->Getenv("TOCDB") != TString("kTRUE") ){
d3a9c52a 28 // save on file
29 TFile f("TRDzeroMisalignment.root","RECREATE");
30 if(!f) cerr<<"cannot open file for output\n";
31 f.cd();
32 f.WriteObject(array,"TRDAlignObjs","kSingleKey");
33 f.Close();
34 }else{
35 // save in CDB storage
5bd470e1 36 const char* Storage = gSystem->Getenv("STORAGE");
d3a9c52a 37 AliCDBManager* cdb = AliCDBManager::Instance();
38 AliCDBStorage* storage = cdb->GetStorage(Storage);
39 AliCDBMetaData* md = new AliCDBMetaData();
40 md->SetResponsible("Dariusz Miskowiec");
41 md->SetComment("Zero misalignment for TRD");
5bd470e1 42 md->SetAliRootVersion(gSystem->Getenv("ARVERSION"));
d3a9c52a 43 AliCDBId id("TRD/Align/Data",0,9999999);
44 storage->Put(array,id,md);
45 }
46
47 array->Delete();
48
49}
50
51