AliRoot Core  3dc7879 (3dc7879)
MUONGenerateGeometryData.C
Go to the documentation of this file.
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 //
31 
32 #if !defined(__CINT__) || defined(__MAKECINT__)
33 
34 #include "AliMUON.h"
35 #include "AliMUONGeometryBuilder.h"
37 
38 #include "AliRun.h"
39 #include "AliCDBManager.h"
40 #include "AliMC.h"
41 
42 #include <Riostream.h>
43 #include <TROOT.h>
44 #include <TInterpreter.h>
45 
46 #endif
47 
48 void MUONGenerateGeometryData(Bool_t transforms = true,
49  Bool_t svmaps = true,
50  Bool_t writeEnvelopes = true)
51 {
56 
57  // Default CDB and run number
59  man->SetDefaultStorage("local://$ALICE_ROOT/OCDB");
60  man->SetRun(0);
61 
62  // Initialize
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;
68 
69  // Get MUON detector
70  AliMUON* muon = (AliMUON*)gAlice->GetModule("MUON");
71  if (!muon) {
72  cerr << "MUON detector not defined." << endl;
73  return;
74  }
75 
76  // Get geometry builder
77  AliMUONGeometryBuilder* builder = muon ->GetGeometryBuilder();
78 
79  if (transforms) {
80  cout << "Generating transformation file ..." << endl;
81  builder->GetTransformer()->WriteTransformations("transform.dat.out");
82  }
83 
84  if (svmaps) {
85  cout << "Generating svmaps file ..." << endl;
86  builder->WriteSVMaps("svmap.dat.out", true, writeEnvelopes);
87  }
88 }
Manager class for geometry construction via geometry builders.
TROOT * gROOT
AliDetector class for MUON subsystem providing simulation data management.
Definition: AliMUON.h:37
const AliMUONGeometryTransformer * GetTransformer() const
Return geometry transformer.
AliModule * GetModule(const char *name) const
Definition: AliRun.cxx:191
void MUONGenerateGeometryData(Bool_t transforms=true, Bool_t svmaps=true, Bool_t writeEnvelopes=true)
virtual void Init()
Definition: AliMC.cxx:1624
AliRun * gAlice
Definition: AliRun.cxx:62
void SetRun(Int_t run)
Bool_t WriteTransformations(const TString &fileName) const
AliMUONGeometryBuilder * GetGeometryBuilder() const
Return geometry builder.
Definition: AliMUON.h:50
void SetDefaultStorage(const char *dbString)
AliMUON * muon()
virtual const char * GetConfigFunction() const
Definition: AliRun.h:50
void WriteSVMaps()
Write sensitive volume maps.
static AliCDBManager * Instance(TMap *entryCache=NULL, Int_t run=-1)
AliMC * GetMCApp() const
Definition: AliRun.h:53