]> git.uio.no Git - u/mrichter/AliRoot.git/blame - MUON/MUONGenerateGeometryData.C
- Updated input parameter for modifs in AliMUONGeometryMisAligner class
[u/mrichter/AliRoot.git] / MUON / MUONGenerateGeometryData.C
CommitLineData
5e377ba0 1/**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
3 * *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
6 * *
7 * Permission to use, copy, modify and distribute this software and its *
8 * documentation strictly for non-commercial purposes is hereby granted *
9 * without fee, provided that the above copyright notice appears in all *
10 * copies and that both the copyright notice and this permission notice *
11 * appear in the supporting documentation. The authors make no claims *
12 * about the suitability of this software for any purpose. It is *
13 * provided "as is" without express or implied warranty. *
14 **************************************************************************/
15
16// $Id$
17//
18// Macro for generating the geometry data files:
f1565555 19// (volpath.dat, transform.dat, svmap.dat)
20// and local CDB storage with zero-misalignment
5e377ba0 21// To be run from aliroot:
22// .x MUONGenerateGeometryData.C
23//
24// The generated files do not replace the existing ones
25// but have different names (with extension ".out").
5e377ba0 26//
27// Author: I. Hrivnacova, IPN Orsay
28
7120ee1e 29void MUONGenerateGeometryData(Bool_t volpaths = true,
30 Bool_t transforms = true,
f1565555 31 Bool_t svmaps = true,
32 Bool_t zeroAlign = true)
5e377ba0 33{
34 // Initialize
d3467161 35 gAlice->Init("$ALICE_ROOT/MUON/Config.C");
5e377ba0 36 cout << "Init done " << endl;
37
38 // Get MUON detector
39 AliMUON* muon = (AliMUON*)gAlice->GetModule("MUON");
40 if (!muon) {
41 AliFatal("MUON detector not defined.");
42 return 0;
43 }
44
45 // Get geometry builder
46 AliMUONGeometryBuilder* builder = muon ->GetGeometryBuilder();
7120ee1e 47
48 if (volpaths) {
49 cout << "Generating volpath file ..." << endl;
50 builder->GetTransformer()->WriteVolumePaths("volpath.dat.out");
51 }
5e377ba0 52
53 if (transforms) {
7120ee1e 54 cout << "Generating transformation file ..." << endl;
55 builder->GetTransformer()->WriteTransformations("transform.dat.out");
5e377ba0 56 }
57
58 if (svmaps) {
7120ee1e 59 cout << "Generating svmaps file ..." << endl;
5e377ba0 60 builder->WriteSVMaps();
61 }
f1565555 62
63 if (zeroAlign) {
64 cout << "Generating CDB storage with zero misalignment data ..." << endl;
65
66 // Create zero alignment data
67 TClonesArray* array
68 = builder->GetTransformer()->CreateZeroAlignmentData();
69
70 // CDB manager
71 AliCDBManager* cdbManager = AliCDBManager::Instance();
72 cdbManager->SetDefaultStorage("local://$ALICE_ROOT");
73
74 AliCDBMetaData* cdbData = new AliCDBMetaData();
75 cdbData->SetResponsible("Dimuon Offline project");
76 cdbData->SetComment("MUON alignment objects for ideal geometry");
77 AliCDBId id("MUON/Align/Data", 0, 0);
78 cdbManager->Put(array, id, cdbData);
79
80 delete array;
81 }
5e377ba0 82}