]>
Commit | Line | Data |
---|---|---|
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: | |
248cc056 | 19 | // volpath.dat, transform.dat, svmap.dat. |
5e377ba0 | 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"). | |
5e377ba0 | 25 | // |
26 | // Author: I. Hrivnacova, IPN Orsay | |
27 | ||
7d6a7daa | 28 | #if !defined(__CINT__) || defined(__MAKECINT__) |
29 | ||
30 | #include "AliMUON.h" | |
31 | #include "AliMUONGeometryBuilder.h" | |
32 | #include "AliMUONGeometryTransformer.h" | |
33 | ||
34 | #include "AliRun.h" | |
35 | ||
36 | #include <Riostream.h> | |
37 | ||
38 | #endif | |
39 | ||
7120ee1e | 40 | void MUONGenerateGeometryData(Bool_t volpaths = true, |
41 | Bool_t transforms = true, | |
4665bb48 | 42 | Bool_t svmaps = true, |
43 | Bool_t writeEnvelopes = true) | |
5e377ba0 | 44 | { |
45 | // Initialize | |
d3467161 | 46 | gAlice->Init("$ALICE_ROOT/MUON/Config.C"); |
5e377ba0 | 47 | cout << "Init done " << endl; |
48 | ||
49 | // Get MUON detector | |
50 | AliMUON* muon = (AliMUON*)gAlice->GetModule("MUON"); | |
51 | if (!muon) { | |
7d6a7daa | 52 | cerr << "MUON detector not defined." << endl; |
53 | return; | |
5e377ba0 | 54 | } |
55 | ||
56 | // Get geometry builder | |
57 | AliMUONGeometryBuilder* builder = muon ->GetGeometryBuilder(); | |
7120ee1e | 58 | |
59 | if (volpaths) { | |
60 | cout << "Generating volpath file ..." << endl; | |
61 | builder->GetTransformer()->WriteVolumePaths("volpath.dat.out"); | |
62 | } | |
5e377ba0 | 63 | |
64 | if (transforms) { | |
7120ee1e | 65 | cout << "Generating transformation file ..." << endl; |
66 | builder->GetTransformer()->WriteTransformations("transform.dat.out"); | |
5e377ba0 | 67 | } |
68 | ||
69 | if (svmaps) { | |
7120ee1e | 70 | cout << "Generating svmaps file ..." << endl; |
4665bb48 | 71 | builder->WriteSVMaps("svmap.dat.out", true, writeEnvelopes); |
5e377ba0 | 72 | } |
73 | } |