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"
38 fIRegions = new TList;
39 fProcesses = new TList;
42 fBeams = new TObjArray(2);
43 //PH (*fBeams)[0] = 0;
44 //PH (*fBeams)[1] = 0;
52 AliLHC::AliLHC(const AliLHC& lhc)
66 void AliLHC::AddIRegion(AliLhcIRegion *region)
70 fIRegions->Add(region);
74 void AliLHC::AddProcess(AliLhcProcess *process)
77 // Add process to list
78 fProcesses->Add(process);
82 void AliLHC::SetBeams(AliLhcBeam *beam1, AliLhcBeam *beam2 )
96 fNmax = Int_t(fTimeMax/fTimeStep);
97 fTimeA = new Float_t[fNmax];
102 TIter next(fIRegions);
103 AliLhcIRegion *region;
105 // Loop over generators and initialize
106 while((region = (AliLhcIRegion*)next())) {
108 region->SetMonitor(fNmax);
111 Beam(0)->SetMonitor(fNmax);
112 Beam(1)->SetMonitor(fNmax);
114 TIter nextp(fProcesses);
115 AliLhcProcess *process;
117 // Loop over generators and initialize
118 while((process = (AliLhcProcess*)nextp())) {
120 process->SetMonitor(fNmax);
124 void AliLHC::EvolveTime()
127 // Simulate Time Evolution
129 while (fTime <= fTimeMax) {
130 printf("\n Time: %f %f", fTime, fTimeStep);
134 TIter next(fProcesses);
135 AliLhcProcess *process;
137 // Evolve for each process
138 while((process = (AliLhcProcess*)next())) {
139 process->Evolve(fTimeStep);
143 // Update and Monitoring
145 TIter nextregion(fIRegions);
146 AliLhcIRegion *region;
148 while((region = (AliLhcIRegion*)nextregion())) {
149 printf("\n Region: %s, Luminosity %10.3e",
150 region->GetName(), region->Luminosity());
155 fTimeA[fNt] = fTime/3600.;
161 void AliLHC::Evaluate()
163 // Evaluation of the results
164 TIter nextregion(fIRegions);
165 AliLhcIRegion *region;
167 // Loop over generators and initialize
168 while((region = (AliLhcIRegion*)nextregion())) {
172 TIter next(fProcesses);
173 AliLhcProcess *process;
175 // Evolve for each process
176 while((process = (AliLhcProcess*)next())) {
177 process->DrawPlots();
180 Beam(0)->DrawPlots();
183 AliLHC& AliLHC::operator=(const AliLHC & /*rhs*/)
185 // Assignment operator