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 **************************************************************************/
20 #include "AliLhcIRegion.h"
21 #include "AliLhcProcess.h"
22 #include "AliLhcBeam.h"
29 fIRegions = new TList;
30 fProcesses = new TList;
33 fBeams = new TObjArray(2);
40 AliLHC::AliLHC(const AliLHC& lhc)
53 void AliLHC::AddIRegion(AliLhcIRegion *region)
57 fIRegions->Add(region);
61 void AliLHC::AddProcess(AliLhcProcess *process)
64 // Add process to list
65 fProcesses->Add(process);
69 void AliLHC::SetBeams(AliLhcBeam *beam1, AliLhcBeam *beam2 )
83 fNmax = Int_t(fTimeMax/fTimeStep);
84 fTimeA = new Float_t[fNmax];
89 TIter next(fIRegions);
90 AliLhcIRegion *region;
92 // Loop over generators and initialize
93 while((region = (AliLhcIRegion*)next())) {
95 region->SetMonitor(fNmax);
98 Beam(0)->SetMonitor(fNmax);
99 Beam(1)->SetMonitor(fNmax);
101 TIter nextp(fProcesses);
102 AliLhcProcess *process;
104 // Loop over generators and initialize
105 while((process = (AliLhcProcess*)nextp())) {
107 process->SetMonitor(fNmax);
111 void AliLHC::EvolveTime()
114 // Simulate Time Evolution
116 while (fTime <= fTimeMax) {
117 printf("\n Time: %f %f", fTime, fTimeStep);
121 TIter next(fProcesses);
122 AliLhcProcess *process;
124 // Evolve for each process
125 while((process = (AliLhcProcess*)next())) {
126 process->Evolve(fTimeStep);
130 // Update and Monitoring
132 TIter nextregion(fIRegions);
133 AliLhcIRegion *region;
135 while((region = (AliLhcIRegion*)nextregion())) {
136 printf("\n Region: %s, Luminosity %10.3e",
137 region->GetName(), region->Luminosity());
142 fTimeA[fNt] = fTime/3600.;
148 void AliLHC::Evaluate()
150 // Evaluation of the results
151 TIter nextregion(fIRegions);
152 AliLhcIRegion *region;
154 // Loop over generators and initialize
155 while((region = (AliLhcIRegion*)nextregion())) {
159 TIter next(fProcesses);
160 AliLhcProcess *process;
162 // Evolve for each process
163 while((process = (AliLhcProcess*)next())) {
170 AliLHC& AliLHC::operator=(const AliLHC & rhs)
172 // Assignment operator