Updates
[u/mrichter/AliRoot.git] / PWGLF / FORWARD / analysis2 / sim / Simulate.C
CommitLineData
421f877c 1/**
2 * @file Simulate.C
3 * @author Christian Holm Christensen <cholm@nbi.dk>
4 * @date Wed Oct 15 13:28:09 2014
5 *
6 * @brief Steering script for the simulation
7 */
a0bdf9a4 8/**
a0bdf9a4 9 * Run the simulation
10 *
11 * @param nev Number of events per job
12 * @param run Run number to simulate
13 */
f8b7a926 14void Simulate(Int_t nev=1, UInt_t run=0)
15{
16 // -----------------------------------------------------------------
17 //
421f877c 18 // - Get GRP parameters. Defines global "grp" as a pointer to GRPData
19 // - Load base class definitions in BaseConfig.C
20 // - Get which detectors are turned on in "detCfg".
21 // - Create the OCDB configuration object "ocdbCfg"
22 //
f8b7a926 23 gROOT->Macro(Form("GRP.C(%d)", run));
421f877c 24 gROOT->Macro("BaseConfig.C");
25 gROOT->Macro("DetConfig.C");
26 gROOT->Macro("OCDBConfig.C");
f8b7a926 27
a0bdf9a4 28 // --- Get GRP to deduce collision system --------------------------
29 Bool_t isAA = grp->IsAA();
30 Bool_t isPP = grp->IsPP();
31 Bool_t is10h = grp->period.EqualTo("LHC10h");
32
f8b7a926 33 // -----------------------------------------------------------------
34 //
35 // Basic setup
36 //
37 AliSimulation steer;
ee275c29 38 TString sDigits, fromHits;
39 detCfg->GetSDigitString(sDigits);
40 detCfg->GetHits2DigitsString(fromHits);
41 steer.SetMakeSDigits(sDigits);
42 steer.SetMakeDigitsFromHits(fromHits);
a0bdf9a4 43
44 // -----------------------------------------------------------------
45 //
46 // Vertex, Mag.field, and trigger from OCDB
47 //
48 steer.SetTriggerConfig(!isAA ? "p-p" : "Pb-Pb");//Replace with "ocdb"
f8b7a926 49 steer.UseMagFieldFromGRP();
50 steer.UseVertexFromCDB();
51
52 // -----------------------------------------------------------------
53 //
ee275c29 54 // OCDB and specific storages
f8b7a926 55 //
56 AliCDBManager* cdb = AliCDBManager::Instance();
57 cdb->SetDefaultStorageFromRun(grp->run);
ee275c29 58 ocdbCfg->Init(true);
f8b7a926 59
60 // -----------------------------------------------------------------
61 //
ee275c29 62 // The rest - disable QA and HLT (memory heavy) for PbPb
f8b7a926 63 //
64 if (isAA) steer.SetRunQA(":");
ee275c29 65 if (is10h) steer.SetRunHLT("");
66
f8b7a926 67 TStopwatch timer;
68 timer.Start();
69 steer.Run(nev);
70 timer.Stop();
71 timer.Print();
72}
a0bdf9a4 73//
74// EOF
75//