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.1 2001/07/25 17:28:32 morsch
19 LHC related code. First commit.
23 #include "AliLhcIRegion.h"
24 #include "AliLhcProcess.h"
25 #include "AliLhcBeam.h"
32 fIRegions = new TList;
33 fProcesses = new TList;
36 fBeams = new TObjArray(2);
37 //PH (*fBeams)[0] = 0;
38 //PH (*fBeams)[1] = 0;
45 AliLHC::AliLHC(const AliLHC& lhc)
58 void AliLHC::AddIRegion(AliLhcIRegion *region)
62 fIRegions->Add(region);
66 void AliLHC::AddProcess(AliLhcProcess *process)
69 // Add process to list
70 fProcesses->Add(process);
74 void AliLHC::SetBeams(AliLhcBeam *beam1, AliLhcBeam *beam2 )
88 fNmax = Int_t(fTimeMax/fTimeStep);
89 fTimeA = new Float_t[fNmax];
94 TIter next(fIRegions);
95 AliLhcIRegion *region;
97 // Loop over generators and initialize
98 while((region = (AliLhcIRegion*)next())) {
100 region->SetMonitor(fNmax);
103 Beam(0)->SetMonitor(fNmax);
104 Beam(1)->SetMonitor(fNmax);
106 TIter nextp(fProcesses);
107 AliLhcProcess *process;
109 // Loop over generators and initialize
110 while((process = (AliLhcProcess*)nextp())) {
112 process->SetMonitor(fNmax);
116 void AliLHC::EvolveTime()
119 // Simulate Time Evolution
121 while (fTime <= fTimeMax) {
122 printf("\n Time: %f %f", fTime, fTimeStep);
126 TIter next(fProcesses);
127 AliLhcProcess *process;
129 // Evolve for each process
130 while((process = (AliLhcProcess*)next())) {
131 process->Evolve(fTimeStep);
135 // Update and Monitoring
137 TIter nextregion(fIRegions);
138 AliLhcIRegion *region;
140 while((region = (AliLhcIRegion*)nextregion())) {
141 printf("\n Region: %s, Luminosity %10.3e",
142 region->GetName(), region->Luminosity());
147 fTimeA[fNt] = fTime/3600.;
153 void AliLHC::Evaluate()
155 // Evaluation of the results
156 TIter nextregion(fIRegions);
157 AliLhcIRegion *region;
159 // Loop over generators and initialize
160 while((region = (AliLhcIRegion*)nextregion())) {
164 TIter next(fProcesses);
165 AliLhcProcess *process;
167 // Evolve for each process
168 while((process = (AliLhcProcess*)next())) {
175 AliLHC& AliLHC::operator=(const AliLHC & rhs)
177 // Assignment operator