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.2 2001/08/30 09:48:12 hristov
19 The operator[] is replaced by At() or AddAt() in case of TObjArray.
21 Revision 1.1 2001/07/25 17:28:32 morsch
22 LHC related code. First commit.
26 #include "AliLhcIRegion.h"
27 #include "AliLhcProcess.h"
28 #include "AliLhcBeam.h"
35 fIRegions = new TList;
36 fProcesses = new TList;
39 fBeams = new TObjArray(2);
40 //PH (*fBeams)[0] = 0;
41 //PH (*fBeams)[1] = 0;
49 AliLHC::AliLHC(const AliLHC& lhc)
62 void AliLHC::AddIRegion(AliLhcIRegion *region)
66 fIRegions->Add(region);
70 void AliLHC::AddProcess(AliLhcProcess *process)
73 // Add process to list
74 fProcesses->Add(process);
78 void AliLHC::SetBeams(AliLhcBeam *beam1, AliLhcBeam *beam2 )
92 fNmax = Int_t(fTimeMax/fTimeStep);
93 fTimeA = new Float_t[fNmax];
98 TIter next(fIRegions);
99 AliLhcIRegion *region;
101 // Loop over generators and initialize
102 while((region = (AliLhcIRegion*)next())) {
104 region->SetMonitor(fNmax);
107 Beam(0)->SetMonitor(fNmax);
108 Beam(1)->SetMonitor(fNmax);
110 TIter nextp(fProcesses);
111 AliLhcProcess *process;
113 // Loop over generators and initialize
114 while((process = (AliLhcProcess*)nextp())) {
116 process->SetMonitor(fNmax);
120 void AliLHC::EvolveTime()
123 // Simulate Time Evolution
125 while (fTime <= fTimeMax) {
126 printf("\n Time: %f %f", fTime, fTimeStep);
130 TIter next(fProcesses);
131 AliLhcProcess *process;
133 // Evolve for each process
134 while((process = (AliLhcProcess*)next())) {
135 process->Evolve(fTimeStep);
139 // Update and Monitoring
141 TIter nextregion(fIRegions);
142 AliLhcIRegion *region;
144 while((region = (AliLhcIRegion*)nextregion())) {
145 printf("\n Region: %s, Luminosity %10.3e",
146 region->GetName(), region->Luminosity());
151 fTimeA[fNt] = fTime/3600.;
157 void AliLHC::Evaluate()
159 // Evaluation of the results
160 TIter nextregion(fIRegions);
161 AliLhcIRegion *region;
163 // Loop over generators and initialize
164 while((region = (AliLhcIRegion*)nextregion())) {
168 TIter next(fProcesses);
169 AliLhcProcess *process;
171 // Evolve for each process
172 while((process = (AliLhcProcess*)next())) {
179 AliLHC& AliLHC::operator=(const AliLHC & rhs)
181 // Assignment operator