]>
Commit | Line | Data |
---|---|---|
12391a12 | 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 | /* $Id$ */ | |
16 | //_________________________________________________________________________ | |
17 | // Macros performing the full simulation chain | |
18 | // Use Case : | |
19 | // root> .L Simulation.C++ | |
20 | // root> sim(2, "GSD", "PHOS EMCAL") --> generates 2 events (Config.C) | |
21 | // and produces Digits and SDigits | |
22 | // for PHOS and EMCAL | |
23 | // root> sim(2, "GSDM", "PHOS EMCAL") --> same as before but before making Digits | |
24 | // the 2 signal events are merged with one | |
25 | // background event in ./bgrd/galice.root | |
26 | // author : Yves Schutz (CERN/SUBATECH) | |
27 | // February 2004 | |
28 | //_________________________________________________________________________ | |
baf5b427 | 29 | #include "AliSimulation.h" |
30 | #include "TString.h" | |
31 | #include "AliPHOSGetter.h" | |
32 | #include "AliEMCALGetter.h" | |
33 | #include "Riostream.h" | |
34 | ||
12391a12 | 35 | void simu(Int_t nevents=1, TString opt="GSD", TString name="all") |
baf5b427 | 36 | { |
37 | AliSimulation sim ; | |
38 | // Generation and simulation | |
39 | if ( !opt.Contains("G") ) | |
40 | sim.SetRunGeneration(kFALSE) ; | |
41 | // Making SDigits | |
42 | if ( !opt.Contains("S") ) | |
43 | sim.SetMakeSDigits("") ; | |
44 | else | |
45 | sim.SetMakeSDigits(name.Data()) ; | |
46 | // Making Digits | |
47 | if ( !opt.Contains("D") ) | |
48 | sim.SetMakeDigits("") ; | |
49 | else | |
50 | sim.SetMakeDigits(name.Data()) ; | |
51 | //Merging | |
4f36a998 | 52 | if ( opt.Contains("M") ) |
d1c7b18e | 53 | sim.MergeWith("./bgrd/galice.root", 1) ; |
baf5b427 | 54 | // to implement |
12391a12 | 55 | sim.Run(nevents) ; |
4f36a998 | 56 | |
57 | if ( !opt.Contains("M") ) { | |
58 | // Checking result | |
59 | if ( name.Contains("PHOS") ) { | |
60 | cout << ">>>>>>>>>>>> PHOS " << endl ; | |
61 | AliPHOSGetter * gime = AliPHOSGetter::Instance("galice.root") ; | |
62 | Int_t event ; | |
63 | for (event = 0; event < gime->MaxEvent(); event++) { | |
64 | cout << "event # " << event << endl ; | |
65 | gime->Event(event, "SD") ; | |
66 | cout << " SDigits # " << gime->SDigits()->GetEntries() << endl ; | |
67 | cout << " Digits # " << gime->Digits()->GetEntries() << endl ; | |
68 | } | |
baf5b427 | 69 | } |
4f36a998 | 70 | if ( name.Contains("EMCAL") ) { |
71 | cout << ">>>>>>>>>>>> EMCAL " << endl ; | |
72 | AliEMCALGetter * gime = AliEMCALGetter::Instance("galice.root"); | |
73 | Int_t event ; | |
74 | for (event = 0; event < gime->MaxEvent(); event++) { | |
75 | cout << "event # " << event << endl ; | |
76 | gime->Event(event, "SD") ; | |
77 | cout << " SDigits # " << gime->SDigits()->GetEntries() << endl ; | |
78 | cout << " Digits # " << gime->Digits()->GetEntries() << endl ; | |
79 | } | |
baf5b427 | 80 | } |
81 | } | |
82 | } |