00001 #include "FastShowerUtils/ShowerDemoMoni.h"
00002 #include "FastShowerUtils/Showerer.h"
00003 #include "FastShowerUtils/ShowererPtr.h"
00004 #include "FastShowerUtils/Pinger/ComplexStatsCollector.h"
00005 #include "FastShowerUtils/Gridlet.h"
00006 #include "FastShowerUtils/IConfigurer.h"
00007
00008 #include "FastShowerUtils/ElectronBarConfigurer.h"
00009 #include "FastShowerUtils/GridletForger.h"
00010
00011 #include "FastShowerUtils/ParticleInfo.h"
00012 #include "FastShowerUtils/Pinger/ComplexArmer.h"
00013
00014 #include <cmath>
00015 #include <algorithm>
00016 #include <string>
00017 #include <fstream>
00018 #include <iostream>
00019 namespace FastShower{
00020 ShowerDemoMoni::ShowerDemoMoni():ShowerDemoBase(){
00021 }
00022
00023 void ShowerDemoMoni::execute(){
00024 int maxEvt = 10;
00025 int maxNum = 4;
00026 std::string gFile("gridlets.txt");
00027 std::fstream ofile;
00028 ofile.open(gFile.c_str(), ios::out);
00029 cout<<"*****************************************"<<endl;
00030 cout<<"* ShowerDemo Execute *"<<endl;
00031 cout<<"*****************************************"<<endl;
00032 for(int ievt = 0; ievt!=maxEvt;++ievt){
00033
00034 for(int num = 0; num!=maxNum; ++num){
00035 cout<<"DEMO Event: "<<ievt<<endl<<endl;
00036 cout<<"sentry 01"<<endl;
00037 ParticleInfo pi;
00038
00039
00040
00041 if(num==0)
00042 pi = ParticleInfo( 0.075, -0.0875, 1.00, 211);
00043 cout<<"sentry 01.1"<<endl;
00044 if(num==1)
00045 pi = ParticleInfo( 1.255, 1.7175, 0.25, 211);
00046 cout<<"sentry 01.2"<<endl;
00047 if(num==2)
00048 pi = ParticleInfo( -2.023, -1.263, 0.70, 211);
00049 cout<<"sentry 01.3"<<endl;
00050 if(num==3)
00051 pi = ParticleInfo( 0.921, -1.528, 1.35, 211);
00052
00053 cout<<"sentry 02"<<endl;
00054 Gridlet* g = gridletForger()->makeGridlet(pi);
00055 cout<<"sentry 03"<<endl;
00056
00057
00058
00059
00060
00061
00062
00063
00064
00065
00066
00067
00068
00069 cout<<"DEMO: Showered Gridlet:"<<endl<<endl;
00070 cout<<*g;
00071 ofile<<*g;
00072 cout<<"DEMO: Showered Gridlet dumped:"<<endl<<endl;
00073 }
00074 }
00075
00076 }
00077 void ShowerDemoMoni::finalise() const{
00078 cout<<"ShowerDemoMoni: Finalise "<<endl;
00079 ComplexStatsCollector sc;
00080 IDebug* gfDbg = gridletForger();
00081 gfDbg->ping( sc );
00082 }
00083 }
00084
00085
00086
00087
00088
00089
00090
00091
00092
00093
00094