forked from alisw/AliDPG
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathSimulationConfig.C
160 lines (134 loc) · 3.61 KB
/
SimulationConfig.C
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
/*
* AliDPG - ALICE Experiment Data Preparation Group
* Simulation configuration script
*
*/
/*****************************************************************/
/*****************************************************************/
/*****************************************************************/
enum ESimulation_t {
kSimulationDefault,
kSimulationMuon,
kSimulationEmbedBkg,
kSimulationEmbedSig,
kSimulationCustom,
kNSimulations
};
const Char_t *SimulationName[kNSimulations] = {
"Default",
"Muon",
"EmbedBkg",
"EmbedSig",
"Custom"
};
/*****************************************************************/
SimulationConfig(AliSimulation &sim, ESimulation_t tag)
{
switch(tag) {
// Default
case kSimulationDefault:
SimulationDefault(sim);
return;
// Muon
case kSimulationMuon:
SimulationDefault(sim);
sim.SetMakeSDigits("MUON VZERO T0 AD");
sim.SetMakeDigitsFromHits("ITS");
sim.SetRunHLT("");
return;
// EmbedBkg
case kSimulationEmbedBkg:
SimulationDefault(sim);
sim.SetMakeSDigits("ALL");
sim.SetMakeDigitsFromHits("");
return;
// EmbedSig
case kSimulationEmbedSig:
SimulationDefault(sim);
sim.SetMakeSDigits("ALL");
sim.SetMakeDigitsFromHits("");
TString bgstr = gSystem->Getenv("CONFIG_BGEVDIR");
if (!bgstr.IsNull()) {
if (bgstr.BeginsWith("alien://") && !gGrid && !TGrid::Connect("alien://")) {
printf("Failed to create a grid connection\n");
abort();
}
if (!bgstr.EndsWith("/")) bgstr += "/";
bgstr += "galice.root";
sim.EmbedInto(bgstr.Data());
}
return;
// Custom
case kSimulationCustom:
if ((gROOT->LoadMacro("SimulationCustom.C")) != 0) {
printf("ERROR: cannot find SimulationCustom.C\n");
abort();
return;
}
SimulationCustom(sim);
return;
}
}
SimulationDefault(AliSimulation &sim)
{
Int_t year = atoi(gSystem->Getenv("CONFIG_YEAR"));
//
// set OCDB source
TString ocdbConfig = "default,snapshot";
if (gSystem->Getenv("CONFIG_OCDB"))
ocdbConfig = gSystem->Getenv("CONFIG_OCDB");
if (ocdbConfig.Contains("alien")) {
// set OCDB
gROOT->LoadMacro("$ALIDPG_ROOT/MC/OCDBConfig.C");
OCDBDefault(0);
}
else {
// set OCDB snapshot mode
sim.SetCDBSnapshotMode("OCDBsim.root");
AliCDBManager *cdbm = AliCDBManager::Instance();
cdbm->SetDefaultStorage("local://");
// cdbm->SetSnapshotMode("OCDBsim.root");
}
//
//
if (year < 2015) sim.SetMakeSDigits("TRD TOF PHOS HMPID EMCAL MUON ZDC PMD T0 VZERO FMD");
else sim.SetMakeSDigits("TRD TOF PHOS HMPID EMCAL MUON ZDC PMD T0 VZERO FMD AD");
sim.SetMakeDigitsFromHits("ITS TPC");
//
// HLT settings
TString hltConfig = "auto";
if (gSystem->Getenv("CONFIG_HLT"))
hltConfig = gSystem->Getenv("CONFIG_HLT");
sim.SetRunHLT(hltConfig.Data());
//
// material budget settings
if (gSystem->Getenv("CONFIG_MATERIAL")) {
Float_t material = atof(gSystem->Getenv("CONFIG_MATERIAL"));
sim.AliModule::SetDensityFactor(material);
}
//
//
SimulationConfigPHOS(sim);
//
//
sim.UseVertexFromCDB();
sim.UseMagFieldFromGRP();
//
//
sim.SetRunQA(":");
//
}
/*** PHOS ****************************************************/
SimulationConfigPHOS(AliSimulation &sim)
{
Int_t year = atoi(gSystem->Getenv("CONFIG_YEAR"));
AliPHOSSimParam *simParam = AliPHOSSimParam::GetInstance();
if (year < 2015) {
simParam->SetCellNonLineairyA(0.001);
simParam->SetCellNonLineairyB(0.2);
simParam->SetCellNonLineairyC(1.02);
}
else {
simParam->SetCellNonLinearity(kFALSE);
}
}