1 /**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
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 **************************************************************************/
19 // Class for a simple description of the LHC.
20 // The LHC is described by two beams,
21 // the interaction regions and the
22 // beam loss processes.
23 // Run paramters can be set in order to simulate the time evolution
24 // of emittance, number of particles per bunch and luminosity.
25 // Author: Andreas Morsch
26 // andreas.morsch@cern.ch
29 #include "AliLhcIRegion.h"
30 #include "AliLhcProcess.h"
31 #include "AliLhcBeam.h"
39 fIRegions(new TList()),
40 fProcesses(new TList()),
41 fBeams(new TObjArray(2)),
59 AliLHC::AliLHC(const AliLHC& lhc):
89 void AliLHC::AddIRegion(AliLhcIRegion *region)
93 fIRegions->Add(region);
97 void AliLHC::AddProcess(AliLhcProcess *process)
100 // Add process to list
101 fProcesses->Add(process);
105 void AliLHC::SetBeams(AliLhcBeam *beam1, AliLhcBeam *beam2 )
111 (*fBeams)[0] = beam1;
112 (*fBeams)[1] = beam2;
119 fNmax = Int_t(fTimeMax/fTimeStep);
120 fTimeA = new Float_t[fNmax];
125 TIter next(fIRegions);
126 AliLhcIRegion *region;
128 // Loop over generators and initialize
129 while((region = (AliLhcIRegion*)next())) {
131 region->SetMonitor(fNmax);
134 Beam(0)->SetMonitor(fNmax);
135 Beam(1)->SetMonitor(fNmax);
137 TIter nextp(fProcesses);
138 AliLhcProcess *process;
140 // Loop over generators and initialize
141 while((process = (AliLhcProcess*)nextp())) {
143 process->SetMonitor(fNmax);
147 void AliLHC::EvolveTime()
150 // Simulate Time Evolution
152 while (fTime <= fTimeMax) {
153 printf("\n Time: %f %f", fTime, fTimeStep);
157 TIter next(fProcesses);
158 AliLhcProcess *process;
160 // Evolve for each process
161 while((process = (AliLhcProcess*)next())) {
162 process->Evolve(fTimeStep);
166 // Update and Monitoring
168 TIter nextregion(fIRegions);
169 AliLhcIRegion *region;
171 while((region = (AliLhcIRegion*)nextregion())) {
172 printf("\n Region: %s, Luminosity %10.3e",
173 region->GetName(), region->Luminosity());
178 fTimeA[fNt] = fTime/3600.;
184 void AliLHC::Evaluate()
186 // Evaluation of the results
187 TIter nextregion(fIRegions);
188 AliLhcIRegion *region;
190 // Loop over generators and initialize
191 while((region = (AliLhcIRegion*)nextregion())) {
195 TIter next(fProcesses);
196 AliLhcProcess *process;
198 // Evolve for each process
199 while((process = (AliLhcProcess*)next())) {
200 process->DrawPlots();
203 Beam(0)->DrawPlots();
206 AliLHC& AliLHC::operator=(const AliLHC & /*rhs*/)
208 // Assignment operator