]> git.uio.no Git - u/mrichter/AliRoot.git/blame_incremental - MUON/AlirootRun_MUONtest.sh
Added protection and 2 levels for problems
[u/mrichter/AliRoot.git] / MUON / AlirootRun_MUONtest.sh
... / ...
CommitLineData
1#!/bin/sh
2# $Id$
3# with galice.root, galice_sim.root
4
5CURDIR=`pwd`
6OUTDIR=test_out
7
8rm -fr $OUTDIR
9mkdir $OUTDIR
10cp $ALICE_ROOT/MUON/.rootrc $ALICE_ROOT/MUON/rootlogon.C $OUTDIR
11cd $OUTDIR
12
13RUN=0
14FULLPATH="$CURDIR/$OUTDIR"
15NEVENTS=100
16SEED=1234567
17
18echo "Running simulation ..."
19
20aliroot -b >& testSim.out << EOF
21// Uncoment following lines to run simulation with local residual mis-alignment
22// (generated via MUONGenerateGeometryData.C macro)
23// AliCDBManager* man = AliCDBManager::Instance();
24// man->SetDefaultStorage("local://$ALICE_ROOT");
25// man->SetSpecificStorage("MUON/Align/Data","local://$ALICE_ROOT/MUON/ResMisAlignCDB");
26gRandom->SetSeed($SEED);
27AliCDBManager::Instance()->SetRun($RUN);
28AliSimulation MuonSim("$ALICE_ROOT/MUON/Config.C");
29MuonSim.SetMakeTrigger("MUON");
30// MuonSim.SetWriteRawData("MUON","raw.root");
31MuonSim.SetWriteRawData("MUON");
32MuonSim.Run($NEVENTS);
33.q
34EOF
35
36echo "Removing Digits files ..."
37mkdir MUON.Digits
38mv MUON.Digits*.root MUON.Digits/
39mv galice.root MUON.Digits/
40
41echo "Running reconstruction ..."
42
43aliroot -b >& testReco.out << EOF
44AliCDBManager::Instance()->SetRun($RUN);
45gRandom->SetSeed($SEED);
46AliMagFMaps* field = new AliMagFMaps("Maps","Maps", 1, 1., 10., AliMagFMaps::k5kG);
47AliTracker::SetFieldMap(field, kFALSE);
48AliReconstruction MuonRec("galice.root");
49MuonRec.SetInput("$FULLPATH/");
50MuonRec.SetRunVertexFinder(kFALSE);
51MuonRec.SetRunLocalReconstruction("MUON");
52MuonRec.SetRunTracking("MUON");
53MuonRec.SetFillESD("MUON");
54MuonRec.SetLoadAlignData("MUON");
55MuonRec.SetNumberOfEventsPerFile($NEVENTS);
56// Uncoment following line to run reconstruction with the orginal tracking method
57// instead of the kalman one (default)
58//MuonRec.SetOption("MUON","Original");
59// Use the following to change clustering method
60//MuonRec.SetOption("MUON","MLEM"); // new scheme AZs clustering
61//MuonRec.SetOption("MUON","SIMPLEFIT"); // new scheme simple fitting
62//MuonRec.SetOption("MUON","COG"); // new scheme basic center-of-gravity only
63// Use the following to disconnect the status map creation (only for debug!)
64// as this speeds up startup a bit...
65//MuonRec.SetOption("MUON","NOSTATUSMAP");
66// Use the following to write to disk the digits (from raw data)
67//MuonRec.SetOption("MUON","SAVEDIGITS");
68MuonRec.Run();
69.q
70EOF
71
72if [ ! -e MUON.Digits.root ]; then
73 echo "Moving Digits files back ..."
74 mv MUON.Digits/MUON.Digits.root .
75fi
76mv MUON.Digits/galice.root ./galice_sim.root
77
78echo "Running Trigger efficiency ..."
79aliroot -b >& testTriggerResults.out << EOF
80.L $ALICE_ROOT/MUON/MUONTriggerEfficiency.C+
81MUONTriggerEfficiency("galice_sim.root", "galice.root", 1);
82.q
83EOF
84
85echo "Running efficiency ..."
86
87aliroot -b >& testResults.out << EOF
88.L $ALICE_ROOT/MUON/MUONefficiency.C+
89// no argument assumes Upsilon but MUONefficiency(443) works on Jpsi
90MUONefficiency("galice_sim.root");
91.q
92EOF
93
94echo "Running check ..."
95
96aliroot -b >& testCheck.out << EOF
97gSystem->Load("libMUONevaluation");
98.L $ALICE_ROOT/MUON/MUONCheck.C+
99MUONCheck(0, 9, "galice_sim.root", "galice.root", "AliESDs.root");
100.q
101EOF
102
103echo "Running dumps for selected event (5) ..."
104
105aliroot -b << EOF
106AliMUONSimData simData("galice_sim.root");
107simData.DumpKine(5); > dump.kine
108simData.DumpHits(5); > dump.hits
109simData.DumpDigits(5); > dump.digits
110simData.DumpSDigits(5); > dump.sdigits
111
112AliMUONRecData recData("galice.root");
113recData.DumpRecPoints(5); > dump.recpoints
114recData.DumpTracks(5); > dump.tracks
115recData.DumpRecTrigger(5); > dump.rectrigger
116.q
117EOF
118
119echo "Finished"
120echo "... see results in test_out"
121
122cd $CURDIR