Removed generation of alignment data, now
[u/mrichter/AliRoot.git] / MUON / MakeMUONFullMisAlignment.C
CommitLineData
1895a097 1void MakeMUONFullMisAlignment(Bool_t volpaths = true,
2 Bool_t transforms = true,
3 Bool_t svmaps = true)
4// Macro for generating the geometry data files:
5// (volpath.dat, transform.dat, svmap.dat)
6// and local CDB storage with full misalignment
7//
8// The generated files do not replace the existing ones
9// but have different names (with extension ".out").
10//
11// Author: I. Hrivnacova, IPN Orsay
12//
13{
14 // Initialize
15 gAlice->Init("$ALICE_ROOT/MUON/Config.C");
16 cout << "Init done " << endl;
17
18 // Get MUON detector
19 AliMUON* muon = (AliMUON*)gAlice->GetModule("MUON");
20 if (!muon) {
21 AliFatal("MUON detector not defined.");
22 return 0;
23 }
24
25 // Get geometry builder
26 AliMUONGeometryBuilder* builder = muon ->GetGeometryBuilder();
27
28 if (volpaths) {
29 cout << "Generating volpath file ..." << endl;
30 builder->GetTransformer()->WriteVolumePaths("volpath.dat.out");
31 }
32
33 if (transforms) {
34 cout << "Generating transformation file ..." << endl;
35 builder->GetTransformer()->WriteTransformations("transform.dat.out");
36 }
37
38 if (svmaps) {
39 cout << "Generating svmaps file ..." << endl;
40 builder->WriteSVMaps();
41 }
42
43 cout << "Generating full misalignment data in MUON/FullMisAlignCDB/Data..." << endl;
44
45 AliMUONGeometryMisAligner misAligner(0.0, 0.03, 0.0, 0.03, 0.0, 0.03);
46 AliMUONGeometryTransformer* newTransform
47 = misAligner.MisAlign(builder->GetTransformer(), true);
48 TClonesArray* array = newTransform->GetMisAlignmentData();
49
5bd470e1 50 if( gSystem->Getenv("TOCDB") != TString("kTRUE") ){
1895a097 51 // Create a File to store the alignment data
52 TFile f("MUONfullMisalignment.root","RECREATE");
53 if(!f) {cerr<<"cannot open file for output\n";}
54
55 f.cd();
56 f.WriteObject(array,"MUONAlignObjs ","kSingleKey");
57 f.Close();
58 array->Delete();
59 }else{
60 // save in CDB storage
5bd470e1 61 const char* Storage = gSystem->Getenv("STORAGE");
1895a097 62
63 AliCDBManager* cdbManager = AliCDBManager::Instance();
64 AliCDBStorage* storage = cdbManager->GetStorage(Storage);
65 AliCDBMetaData* cdbData = new AliCDBMetaData();
66 cdbData->SetResponsible("Dimuon Offline project");
67 cdbData->SetComment("MUON alignment objects with full misalignment");
5bd470e1 68 cdbData->SetAliRootVersion(gSystem->Getenv("ARVERSION"));
1895a097 69 AliCDBId id("MUON/Align/Data", 0, 9999999);
70 storage->Put(array, id, cdbData);
71
72 delete newTransform;
73 }
74
75
76}