1 /**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
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 **************************************************************************/
19 /// \file MUONGenerateGeometryData.C
20 /// \brief Macro for generating the geometry data files:
21 /// transform.dat, svmap.dat.
23 /// To be run from aliroot:
25 /// .x MUONGenerateGeometryData.C
27 /// The generated files do not replace the existing ones
28 /// but have different names (with extension ".out").
30 /// \author: I. Hrivnacova, IPN Orsay
32 #if !defined(__CINT__) || defined(__MAKECINT__)
35 #include "AliMUONGeometryBuilder.h"
36 #include "AliMUONGeometryTransformer.h"
39 #include "AliCDBManager.h"
42 #include <Riostream.h>
44 #include <TInterpreter.h>
48 void MUONGenerateGeometryData(Bool_t transforms = true,
50 Bool_t writeEnvelopes = true)
52 /// \param transforms option to generete transform.dat
53 /// \param svmaps option to generete svmap.dat
54 /// \param writeEnvelope option to include virtual envelopes
55 /// in the volume paths
57 // Default CDB and run number
58 AliCDBManager* man = AliCDBManager::Instance();
59 man->SetDefaultStorage("local://$ALICE_ROOT/OCDB");
63 TString configFileName = "$ALICE_ROOT/MUON/Config.C";
64 gROOT->LoadMacro(configFileName.Data());
65 gInterpreter->ProcessLine(gAlice->GetConfigFunction());
66 gAlice->GetMCApp()->Init();
67 cout << "Init done " << endl;
70 AliMUON* muon = (AliMUON*)gAlice->GetModule("MUON");
72 cerr << "MUON detector not defined." << endl;
76 // Get geometry builder
77 AliMUONGeometryBuilder* builder = muon ->GetGeometryBuilder();
80 cout << "Generating transformation file ..." << endl;
81 builder->GetTransformer()->WriteTransformations("transform.dat.out");
85 cout << "Generating svmaps file ..." << endl;
86 builder->WriteSVMaps("svmap.dat.out", true, writeEnvelopes);