]> git.uio.no Git - u/mrichter/AliRoot.git/blob - MUON/commonConfig.C
Coverity fix
[u/mrichter/AliRoot.git] / MUON / commonConfig.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 /// \ingroup macros
19 /// \file commonConfig.C
20 /// \brief Configuration macro 
21 /// for MUON spectrometer Monte Carlo simulation
22
23 enum PprTrigConf_t {
24     kDefaultPPTrig, kDefaultPbPbTrig
25 };
26
27 const char * pprTrigConfName[] = {
28     "p-p","Pb-Pb"
29 };
30
31 // Options 
32 static AliMagF::BMap_t smag = AliMagF::k5kG;
33 static PprTrigConf_t strig = kDefaultPPTrig; // default PP trigger configuration
34 static TString comment;
35
36 // Functions
37 void  LoadPythia();
38
39 void commonConfig(Bool_t setRootGeometry = kFALSE,
40                   const char* digitstore="AliMUONDigitStoreV2S")
41 {
42   cout << "Running commonConfig.C ... " << endl;
43
44   //=======================================================================
45   // Load Pythia libraries
46   //=======================================================================
47
48   LoadPythia();
49
50   //=======================================================================
51   // ALICE steering object (AliRunLoader)
52   //=======================================================================
53
54   // Set Root geometry file
55   if ( setRootGeometry ) {
56     AliSimulation::Instance()->SetGeometryFile("$ALICE_ROOT/MUON/geometry/geometry.root");
57   }
58
59   AliRunLoader* rl 
60     = AliRunLoader::Open("galice.root",
61                           AliConfig::GetDefaultEventFolderName(),
62                           "recreate");
63   if ( ! rl ) {
64     gAlice->Fatal("Config.C","Can not instatiate the Run Loader");
65     return;
66   }
67   rl->SetCompressionLevel(2);
68   rl->SetNumberOfEventsPerFile(100);
69   gAlice->SetRunLoader(rl);
70   
71   //======================================================================
72   // Trigger configuration
73   //=======================================================================
74
75   gAlice->SetTriggerDescriptor(pprTrigConfName[strig]);
76   cout << "Trigger configuration is set to  " << pprTrigConfName[strig] << endl;
77
78   // ============================= 
79   // Magnetic field
80   // ============================= 
81
82   // Field (L3 0.5 T)
83   // Field (L3 0.5 T)
84   TGeoGlobalMagField::Instance()->SetField(new AliMagF("Maps","Maps", -1., -1, AliMagF::k5kG));
85  
86   //============================================================= 
87   //=================== Alice BODY parameters =============================
88   AliBODY *BODY = new AliBODY("BODY","Alice envelop");
89   //=================== ABSO parameters ============================
90   AliABSO *ABSO = new AliABSOv3("ABSO", "Muon Absorber");
91   //=================== DIPO parameters ============================
92   AliDIPO *DIPO = new AliDIPOv3("DIPO", "Dipole version 2");
93   //================== HALL parameters ============================
94   AliHALL *HALL = new AliHALLv3("HALL", "Alice Hall");
95   //=================== PIPE parameters ============================
96   AliPIPE *PIPE = new AliPIPEv3("PIPE", "Beam Pipe");
97   //=================== SHIL parameters ============================
98   AliSHIL *SHIL = new AliSHILv3("SHIL", "Shielding Version 2");
99
100   //=================== MUON Subsystem ===========================
101   AliMUON *MUON = new AliMUONv1("MUON", "default");
102
103   // The 3 switches below are to be used for the trigger code
104   // their default value is set in AliMUON.h
105   // activate trigger cluster-size (0=default, 1=cluster-size according to AliMUONResponseTriggerV1
106   //  MUON->SetTriggerResponseV1(0);
107   // activate 4/4 trigger coincidence (0=default (coinc 3/4), 1=coinc 4/4)
108   //  MUON->SetTriggerCoinc44(0);
109   // activate trigger chamber efficiency by cells (0=default, 1=trigger efficiency according to AliMUONTriggerEfficiencyCells
110   //  MUON->SetTriggerEffCells(0);
111
112   // Use SetDigitStoreClassName() to change the digitStore implementation used by (s)digitizer
113   MUON->SetDigitStoreClassName(digitstore);
114   
115   cout << "MUON DigitStore is " << MUON->DigitStoreClassName().Data() << endl;
116   
117   // Noise-only digits in tracker/trigger (0=no noise, 1=default (noise in tracker), 2=noise in tracker and trigger):
118   //MUON->SetDigitizerWithNoise(kFALSE);
119
120   // Use non-high performance raw data decoder 
121   //MUON->SetFastTrackerDecoder(kFALSE);  
122   //MUON->SetFastTriggerDecoder(kFALSE);  
123   
124   //
125   // If SetAlign, the detection elements transformations
126   // are taken from the input file and not from the code
127   // MUON->SetAlign("transform.dat");
128
129   // To generate and read scaler trigger events in rawdata
130   // MUON->SetTriggerScalerEvent();
131   
132   // To switch off the tail effect
133   // MUON->SetTailEffect(kFALSE);
134
135   // If you want to play with builders, first reset the geometry builder,
136   // and then add yours.
137   //  MUON->ResetGeometryBuilder();
138   //  MUON->AddGeometryBuilder(new AliMUONSt1GeometryBuilderV2(MUON));
139   //  MUON->AddGeometryBuilder(new AliMUONSt2GeometryBuilderV2(MUON));
140   //  MUON->AddGeometryBuilder(new AliMUONSlatGeometryBuilder(MUON));
141   //  MUON->AddGeometryBuilder(new AliMUONTriggerGeometryBuilder(MUON));
142
143   cout << "Running commonConfig.C finished ... " << endl;
144 }
145
146 void LoadPythia()
147 {
148   // Load Pythia related libraries
149   gSystem->Load("liblhapdf.so");      // Parton density functions
150   gSystem->Load("libEGPythia6.so");   // TGenerator interface
151   gSystem->Load("libpythia6.so");     // Pythia
152   gSystem->Load("libAliPythia6.so");  // ALICE specific implementations
153 }