]> git.uio.no Git - u/mrichter/AliRoot.git/blame_incremental - PHOS/TestSuite.csh
Update master to aliroot
[u/mrichter/AliRoot.git] / PHOS / TestSuite.csh
... / ...
CommitLineData
1#! /bin/tcsh -f
2#
3# Prepare the environment
4#
5mkdir $HOME/PHOSTestSuite ; cd $HOME/PHOSTestSuite
6cp $ALICE_ROOT/PHOS/grunTestSuite.C .
7cp $ALICE_ROOT/PHOS/ConfigTestSuite.C .
8#
9#begin data
10set MINHITS=68
11set MAXHITS=72
12set MINSDIGITS=68
13set MAXSDIGITS=72
14set MINDIGITS=40
15set MAXDIGITS=48
16set MINEMCRECPOINTS=1
17set MAXEMCRECPOINTS=2
18set MINCPVRECPOINTS=0
19set MAXCPVRECPOINTS=2
20set MINTRACKSEGMENTS=1
21set MAXTRACKSEGMENTS=2
22set MINRECPARTICLES=1
23set MAXRECPARTICLES=2
24#end data
25#
26echo PHOS Test Suite run on `date` > TestSuite.log
27echo "=======================================================================" >> TestSuite.log
28echo AliROOT version `which aliroot` >> TestSuite.log
29echo Root version `which root` >> TestSuite.log
30echo "=======================================================================" >> TestSuite.log
31#
32# SIMULATION
33#
34echo " **** SIMULATION **** " >> TestSuite.log
35aliroot -b -q grunTestSuite.C\(100\) >>& TestSuite.log
36echo '{ ' > tempo.C
37echo " Int_t minhits = $MINHITS ;" >> tempo.C
38echo " Int_t maxhits = $MAXHITS ;" >> tempo.C
39echo ' AliPHOSGetter * gime = AliPHOSGetter::Instance("galice.root") ;' >> tempo.C
40echo ' TH1F * hitmul = new TH1F("hitmul", "PHOS Test Suite", 100, 0., 200.) ; ' >> tempo.C
41echo ' Int_t max = gime->MaxEvent() ; ' >> tempo.C
42echo ' Int_t evt = 0 ; ' >> tempo.C
43echo ' for ( evt = 0 ; evt < max ; evt++ ) { ' >> tempo.C
44echo ' gime->Event(evt,"H") ; ' >> tempo.C
45echo ' hitmul->Fill(gime->Hits()->GetEntries()) ; ' >> tempo.C
46echo ' } ' >> tempo.C
47echo ' TF1 * gaus = new TF1("gaus", "gaus", 0., 200.) ; ' >> tempo.C
48echo ' hitmul->Fit(gaus,"", "", 40, 100) ; ' >> tempo.C
49echo ' if( gaus->GetParameter(1) > maxhits || gaus->GetParameter(1) < minhits ) ' >> tempo.C
50echo ' printf("ERRORSIM 1") ; ' >> tempo.C
51echo ' else ' >> tempo.C
52echo ' printf("ERRORSIM 0") ; ' >> tempo.C
53echo '} ' >> tempo.C
54aliroot -b -q tempo.C >>& TestSuite.log
55set ERRORSIM = `cat TestSuite.log | grep ERRORSIM | awk '{print $2}'`
56if($ERRORSIM) then
57 echo ERROR
58 uuencode TestSuite.log TestSuite.log | mail -s 'PHOS INSTALLATION ERROR' yves.schutz@cern.ch
59 exit(0)
60endif
61rm tempo.C
62#
63# RECONSTRUCTION
64#
65echo " **** RECONSTRUCTION **** " >> TestSuite.log
66aliroot -b >>& TestSuite.log <<EOF
67 AliPHOSSDigitizer sd("galice.root") ;
68 sd.ExecuteTask("deb all") ;
69 AliPHOSDigitizer d("galice.root") ;
70 d.ExecuteTask("deb all") ;
71 AliPHOSClusterizerv1 cl("galice.root") ;
72 cl.ExecuteTask("deb all") ;
73 AliPHOSTrackSegmentMakerv1 ts("galice.root") ;
74 ts.ExecuteTask("deb all") ;
75 AliPHOSPIDv1 pd("galice.root") ;
76 pd.ExecuteTask("deb all") ;
77 .q
78EOF
79echo '{ ' > tempo.C
80echo " Int_t minsdig = $MINSDIGITS ;" >> tempo.C
81echo " Int_t maxsdig = $MAXSDIGITS ;" >> tempo.C
82echo " Int_t mindig = $MINDIGITS ;" >> tempo.C
83echo " Int_t maxdig = $MAXDIGITS ;" >> tempo.C
84echo " Int_t minemcrp = $MINEMCRECPOINTS ;" >> tempo.C
85echo " Int_t maxemcrp = $MAXEMCRECPOINTS ;" >> tempo.C
86echo " Int_t mincpvrp = $MINCPVRECPOINTS ;" >> tempo.C
87echo " Int_t maxcpvrp = $MAXCPVRECPOINTS ;" >> tempo.C
88echo " Int_t mints = $MINTRACKSEGMENTS ;" >> tempo.C
89echo " Int_t maxts = $MAXTRACKSEGMENTS ;" >> tempo.C
90echo " Int_t minpa = $MINRECPARTICLES ;" >> tempo.C
91echo " Int_t maxpa = $MAXRECPARTICLES ;" >> tempo.C
92echo ' AliPHOSGetter * gime = AliPHOSGetter::Instance("galice.root") ;' >> tempo.C
93echo ' TH1F * sdigmul = new TH1F("sdigmul", " SDigits PHOS Test Suite", 100, 0., 200.) ; ' >> tempo.C
94echo ' TH1F * digmul = new TH1F("digmul", " Digits PHOS Test Suite", 100, 0., 200.) ; ' >> tempo.C
95echo ' TH1F * emcrpmul= new TH1F("emcrpmul", " EMCRecPoints PHOS Test Suite", 100, 0., 200.) ; ' >> tempo.C
96echo ' TH1F * cpvrpmul= new TH1F("cpvrpmul", " CPVRecPoints PHOS Test Suite", 100, 0., 200.) ; ' >> tempo.C
97echo ' TH1F * tsmul = new TH1F("tsmul", " TrackSegments PHOS Test Suite", 100, 0., 200.) ; ' >> tempo.C
98echo ' TH1F * pamul = new TH1F("pamul", " RecParticles PHOS Test Suite", 100, 0., 200.) ; ' >> tempo.C
99echo ' Int_t max = gime->MaxEvent() ; ' >> tempo.C
100echo ' Int_t evt = 0 ; ' >> tempo.C
101echo ' for ( evt = 0 ; evt < max ; evt++ ) { ' >> tempo.C
102echo ' gime->Event(evt,"SDRTP") ; ' >> tempo.C
103echo ' sdigmul->Fill(gime->SDigits()->GetEntries()) ; ' >> tempo.C
104echo ' digmul->Fill(gime->Digits()->GetEntries()) ; ' >> tempo.C
105echo ' emcrpmul->Fill(gime->EmcRecPoints()->GetEntries()) ; ' >> tempo.C
106echo ' cpvrpmul->Fill(gime->CpvRecPoints()->GetEntries()) ; ' >> tempo.C
107echo ' tsmul->Fill(gime->TrackSegments()->GetEntries()) ; ' >> tempo.C
108echo ' pamul->Fill(gime->RecParticles()->GetEntries()) ; ' >> tempo.C
109echo ' } ' >> tempo.C
110echo ' TF1 * gaus = new TF1("gaus", "gaus", 0., 200.) ; ' >> tempo.C
111echo ' sdigmul->Fit(gaus, "", "", 40., 100.) ; ' >> tempo.C
112echo ' sdigmul->Draw() ; ' >> tempo.C
113echo ' if( gaus->GetParameter(1) > maxsdig || gaus->GetParameter(1) < minsdig ) ' >> tempo.C
114echo ' printf("ERRORREC 1 sdigits\n") ; ' >> tempo.C
115echo ' digmul->Fit(gaus, "", "", 20., 80.) ; ' >> tempo.C
116echo ' if( gaus->GetParameter(1) > maxdig || gaus->GetParameter(1) < mindig ) ' >> tempo.C
117echo ' printf("ERRORREC 1 digits\n") ; ' >> tempo.C
118echo ' emcrpmul->Fit(gaus, "", "", 0., 4.) ; ' >> tempo.C
119echo ' if( gaus->GetParameter(1) > maxemcrp || gaus->GetParameter(1) < minemcrp ) ' >> tempo.C
120echo ' printf("ERRORREC 1 emc recpoints\n") ; ' >> tempo.C
121echo ' cpvrpmul->Fit(gaus, "", "", 0., 4.) ; ' >> tempo.C
122echo ' if( gaus->GetParameter(1) > maxcpvrp || gaus->GetParameter(1) < mincpvrp ) ' >> tempo.C
123echo ' printf("ERRORREC 1 cpv recpoints\n") ; ' >> tempo.C
124echo ' tsmul->Fit(gaus, "", "", 0., 4.) ; ' >> tempo.C
125echo ' if( gaus->GetParameter(1) > maxts || gaus->GetParameter(1) < mints ) ' >> tempo.C
126echo ' printf("ERRORREC 1 track segments\n") ; ' >> tempo.C
127echo ' pamul->Fit(gaus, "", "", 0., 4. ) ; ' >> tempo.C
128echo ' if( gaus->GetParameter(1) > maxpa || gaus->GetParameter(1) < minpa ) ' >> tempo.C
129echo ' printf("ERRORREC 1 recparticles\n") ; ' >> tempo.C
130echo '} ' >> tempo.C
131aliroot -b -q tempo.C >>& TestSuite.log
132set ERRORREC = `cat TestSuite.log | grep ERRORREC | awk '{print $2}'`
133if($ERRORREC) then
134 echo ERROR
135 uuencode TestSuite.log TestSuite.log | mail -s 'PHOS INSTALLATION ERROR' yves.schutz@cern.ch
136 exit(0)
137endif
138#rm tempo.C
139#/cd $HOME
140#rm -fr $HOME/PHOSTestSuite