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 #include "AliLhcIRegion.h"
20 #include "AliLhcProcess.h"
21 #include "AliLhcBeam.h"
28 fIRegions = new TList;
29 fProcesses = new TList;
32 fBeams = new TObjArray(2);
33 //PH (*fBeams)[0] = 0;
34 //PH (*fBeams)[1] = 0;
42 AliLHC::AliLHC(const AliLHC& lhc)
56 void AliLHC::AddIRegion(AliLhcIRegion *region)
60 fIRegions->Add(region);
64 void AliLHC::AddProcess(AliLhcProcess *process)
67 // Add process to list
68 fProcesses->Add(process);
72 void AliLHC::SetBeams(AliLhcBeam *beam1, AliLhcBeam *beam2 )
86 fNmax = Int_t(fTimeMax/fTimeStep);
87 fTimeA = new Float_t[fNmax];
92 TIter next(fIRegions);
93 AliLhcIRegion *region;
95 // Loop over generators and initialize
96 while((region = (AliLhcIRegion*)next())) {
98 region->SetMonitor(fNmax);
101 Beam(0)->SetMonitor(fNmax);
102 Beam(1)->SetMonitor(fNmax);
104 TIter nextp(fProcesses);
105 AliLhcProcess *process;
107 // Loop over generators and initialize
108 while((process = (AliLhcProcess*)nextp())) {
110 process->SetMonitor(fNmax);
114 void AliLHC::EvolveTime()
117 // Simulate Time Evolution
119 while (fTime <= fTimeMax) {
120 printf("\n Time: %f %f", fTime, fTimeStep);
124 TIter next(fProcesses);
125 AliLhcProcess *process;
127 // Evolve for each process
128 while((process = (AliLhcProcess*)next())) {
129 process->Evolve(fTimeStep);
133 // Update and Monitoring
135 TIter nextregion(fIRegions);
136 AliLhcIRegion *region;
138 while((region = (AliLhcIRegion*)nextregion())) {
139 printf("\n Region: %s, Luminosity %10.3e",
140 region->GetName(), region->Luminosity());
145 fTimeA[fNt] = fTime/3600.;
151 void AliLHC::Evaluate()
153 // Evaluation of the results
154 TIter nextregion(fIRegions);
155 AliLhcIRegion *region;
157 // Loop over generators and initialize
158 while((region = (AliLhcIRegion*)nextregion())) {
162 TIter next(fProcesses);
163 AliLhcProcess *process;
165 // Evolve for each process
166 while((process = (AliLhcProcess*)next())) {
167 process->DrawPlots();
170 Beam(0)->DrawPlots();
173 AliLHC& AliLHC::operator=(const AliLHC & /*rhs*/)
175 // Assignment operator