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 **************************************************************************/
18 Revision 1.3 2001/10/21 18:35:19 hristov
19 A pointer was set to zero in the default constructor to avoid memory management problems
21 Revision 1.2 2001/08/30 09:48:12 hristov
22 The operator[] is replaced by At() or AddAt() in case of TObjArray.
24 Revision 1.1 2001/07/25 17:28:32 morsch
25 LHC related code. First commit.
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)
65 void AliLHC::AddIRegion(AliLhcIRegion *region)
69 fIRegions->Add(region);
73 void AliLHC::AddProcess(AliLhcProcess *process)
76 // Add process to list
77 fProcesses->Add(process);
81 void AliLHC::SetBeams(AliLhcBeam *beam1, AliLhcBeam *beam2 )
95 fNmax = Int_t(fTimeMax/fTimeStep);
96 fTimeA = new Float_t[fNmax];
101 TIter next(fIRegions);
102 AliLhcIRegion *region;
104 // Loop over generators and initialize
105 while((region = (AliLhcIRegion*)next())) {
107 region->SetMonitor(fNmax);
110 Beam(0)->SetMonitor(fNmax);
111 Beam(1)->SetMonitor(fNmax);
113 TIter nextp(fProcesses);
114 AliLhcProcess *process;
116 // Loop over generators and initialize
117 while((process = (AliLhcProcess*)nextp())) {
119 process->SetMonitor(fNmax);
123 void AliLHC::EvolveTime()
126 // Simulate Time Evolution
128 while (fTime <= fTimeMax) {
129 printf("\n Time: %f %f", fTime, fTimeStep);
133 TIter next(fProcesses);
134 AliLhcProcess *process;
136 // Evolve for each process
137 while((process = (AliLhcProcess*)next())) {
138 process->Evolve(fTimeStep);
142 // Update and Monitoring
144 TIter nextregion(fIRegions);
145 AliLhcIRegion *region;
147 while((region = (AliLhcIRegion*)nextregion())) {
148 printf("\n Region: %s, Luminosity %10.3e",
149 region->GetName(), region->Luminosity());
154 fTimeA[fNt] = fTime/3600.;
160 void AliLHC::Evaluate()
162 // Evaluation of the results
163 TIter nextregion(fIRegions);
164 AliLhcIRegion *region;
166 // Loop over generators and initialize
167 while((region = (AliLhcIRegion*)nextregion())) {
171 TIter next(fProcesses);
172 AliLhcProcess *process;
174 // Evolve for each process
175 while((process = (AliLhcProcess*)next())) {
176 process->DrawPlots();
179 Beam(0)->DrawPlots();
182 AliLHC& AliLHC::operator=(const AliLHC & rhs)
184 // Assignment operator