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)
55 void AliLHC::AddIRegion(AliLhcIRegion *region)
59 fIRegions->Add(region);
63 void AliLHC::AddProcess(AliLhcProcess *process)
66 // Add process to list
67 fProcesses->Add(process);
71 void AliLHC::SetBeams(AliLhcBeam *beam1, AliLhcBeam *beam2 )
85 fNmax = Int_t(fTimeMax/fTimeStep);
86 fTimeA = new Float_t[fNmax];
91 TIter next(fIRegions);
92 AliLhcIRegion *region;
94 // Loop over generators and initialize
95 while((region = (AliLhcIRegion*)next())) {
97 region->SetMonitor(fNmax);
100 Beam(0)->SetMonitor(fNmax);
101 Beam(1)->SetMonitor(fNmax);
103 TIter nextp(fProcesses);
104 AliLhcProcess *process;
106 // Loop over generators and initialize
107 while((process = (AliLhcProcess*)nextp())) {
109 process->SetMonitor(fNmax);
113 void AliLHC::EvolveTime()
116 // Simulate Time Evolution
118 while (fTime <= fTimeMax) {
119 printf("\n Time: %f %f", fTime, fTimeStep);
123 TIter next(fProcesses);
124 AliLhcProcess *process;
126 // Evolve for each process
127 while((process = (AliLhcProcess*)next())) {
128 process->Evolve(fTimeStep);
132 // Update and Monitoring
134 TIter nextregion(fIRegions);
135 AliLhcIRegion *region;
137 while((region = (AliLhcIRegion*)nextregion())) {
138 printf("\n Region: %s, Luminosity %10.3e",
139 region->GetName(), region->Luminosity());
144 fTimeA[fNt] = fTime/3600.;
150 void AliLHC::Evaluate()
152 // Evaluation of the results
153 TIter nextregion(fIRegions);
154 AliLhcIRegion *region;
156 // Loop over generators and initialize
157 while((region = (AliLhcIRegion*)nextregion())) {
161 TIter next(fProcesses);
162 AliLhcProcess *process;
164 // Evolve for each process
165 while((process = (AliLhcProcess*)next())) {
166 process->DrawPlots();
169 Beam(0)->DrawPlots();
172 AliLHC& AliLHC::operator=(const AliLHC & rhs)
174 // Assignment operator