]> git.uio.no Git - u/mrichter/AliRoot.git/blob - MUON/MUONGenerateGeometryData.C
From Artur:
[u/mrichter/AliRoot.git] / MUON / MUONGenerateGeometryData.C
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:
19 // (transform_*.dat, svmap_*.dat).
20 // To be run from aliroot:
21 // .x MUONGenerateGeometryData.C
22 //
23 // The generated files do not replace the existing ones
24 // but have different names (with extension ".out").
25 // To compare/replace the existing files with generated ones
26 // run the scripts in MUON/data: 
27 //   compare_data [transform] [svmaps]
28 //   reset_data [transform] [svmaps]
29 //
30 //  Author: I. Hrivnacova, IPN Orsay
31
32 void MUONGenerateGeometryData(Bool_t transforms = true, Bool_t svmaps = true)
33 {
34   // Initialize
35   gAlice->Init("$ALICE_ROOT/MUON/Config.C");
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();
47
48   if (transforms) {
49     cout << "Generating transformation files ..." << endl;
50     builder->WriteTransformations();
51   }  
52
53   if (svmaps) {
54     cout << "Generating svmaps files ..." << endl;
55     builder->WriteSVMaps();
56   }  
57 }