]> git.uio.no Git - u/mrichter/AliRoot.git/blob - MUON/AlirootRun_MUONtest.sh
Correct function Compare() for "pixels" from MLEM cluster finder.
[u/mrichter/AliRoot.git] / MUON / AlirootRun_MUONtest.sh
1 #!/bin/sh
2 # $Id$
3 # with galice.root, galice_sim.root 
4
5 if [ $# -ne 1 ]; then
6   NEVENTS=100
7   echo "Number of events not specified. Using $NEVENTS"
8 else
9   NEVENTS=$1
10 fi
11
12 CURDIR=`pwd`
13 OUTDIR=test_out.$NEVENTS
14
15 rm -fr $OUTDIR
16 mkdir $OUTDIR
17 cp $ALICE_ROOT/MUON/.rootrc $ALICE_ROOT/MUON/rootlogon.C $OUTDIR
18 cd $OUTDIR
19
20 DUMPEVENT=5
21 RUN=0
22 FULLPATH="$CURDIR/$OUTDIR"
23 SEED=1234567
24 SIMDIR="generated"
25
26 echo "Running simulation  ..."
27
28 aliroot -b >& testSim.out << EOF 
29 // Uncoment following lines to run simulation with local residual mis-alignment
30 // (generated via MUONGenerateGeometryData.C macro)
31 // AliCDBManager* man = AliCDBManager::Instance();
32 // man->SetDefaultStorage("local://$ALICE_ROOT");
33 // man->SetSpecificStorage("MUON/Align/Data","local://$ALICE_ROOT/MUON/ResMisAlignCDB");
34 gRandom->SetSeed($SEED);
35 AliCDBManager::Instance()->SetRun($RUN);
36 AliSimulation MuonSim("$ALICE_ROOT/MUON/Config.C");
37 MuonSim.SetMakeTrigger("MUON");
38 MuonSim.SetWriteRawData("MUON","raw.root",kTRUE);
39 MuonSim.Run($NEVENTS);
40 .q
41 EOF
42
43 echo "Moving generated files to $SIMDIR"
44 mkdir $SIMDIR
45 mv MUON*.root Kinematics*.root galice.root TrackRefs*.root $SIMDIR
46
47 echo "Running reconstruction  ..."
48
49 aliroot -b >& testReco.out << EOF
50 AliCDBManager::Instance()->SetRun($RUN);
51 gRandom->SetSeed($SEED);
52 AliMagFMaps* field = new AliMagFMaps("Maps","Maps", 1, 1., 10., AliMagFMaps::k5kG);
53 AliTracker::SetFieldMap(field, kFALSE);
54 AliReconstruction* MuonRec = new AliReconstruction("galice.root");
55 MuonRec.SetInput("$FULLPATH/raw.root");
56 MuonRec.SetRunVertexFinder(kFALSE);
57 MuonRec.SetRunLocalReconstruction("MUON");
58 MuonRec.SetRunTracking("MUON");
59 MuonRec.SetFillESD("");
60 MuonRec.SetLoadAlignData("MUON");
61 MuonRec.SetNumberOfEventsPerFile(1000);
62 MuonRec.SetOption("MUON","SAVEDIGITS");
63 // Change the line above with the line below to run without local reconstruction
64 // MuonRec.SetOption("MUON","SAVEDIGITS NOLOCALRECONSTRUCTION");
65 MuonRec.Run();
66 delete MuonRec;
67 .q
68 EOF
69
70 echo "Running Trigger efficiency  ..."
71 aliroot -b >& testTriggerResults.out << EOF
72 .L $ALICE_ROOT/MUON/MUONTriggerEfficiency.C+
73 MUONTriggerEfficiency("$SIMDIR/galice.root", "galice.root", 1);
74 .q
75 EOF
76
77 echo "Running efficiency  ..."
78
79 aliroot -b >& testResults.out << EOF
80 .L $ALICE_ROOT/MUON/MUONefficiency.C+
81 // no argument assumes Upsilon but MUONefficiency(443) works on Jpsi
82 MUONefficiency("$SIMDIR/galice.root");
83 .q
84 EOF
85
86 echo "Running check ..."
87 aliroot -b >& testCheck.out << EOF
88 gSystem->Load("libMUONevaluation");
89 .L $ALICE_ROOT/MUON/MUONCheck.C+
90 MUONCheck(0, $NEVENTS-1, "generated/galice.root", "galice.root", "AliESDs.root"); 
91 .q
92 EOF
93
94
95 echo "Running dumps for selected event ($DUMPEVENT) ..."
96
97 aliroot -b  << EOF
98 AliMUONMCDataInterface mcdSim("$SIMDIR/galice.root");
99 mcdSim.DumpKine($DUMPEVENT);       > dump.kine
100 mcdSim.DumpHits($DUMPEVENT);       > dump.hits
101 mcdSim.DumpTrackRefs($DUMPEVENT);  > dump.trackrefs
102 mcdSim.DumpDigits($DUMPEVENT,true);  > dump.simdigits
103 mcdSim.DumpSDigits($DUMPEVENT,true); > dump.sdigits
104
105 AliMUONDataInterface dRec("galice.root");
106 dRec.DumpRecPoints($DUMPEVENT);  > dump.recpoints
107 dRec.DumpTracks($DUMPEVENT);     > dump.tracks
108 dRec.DumpTriggerTracks($DUMPEVENT); > dump.triggertracks
109 dRec.DumpTrigger($DUMPEVENT);  > dump.trigger
110 dRec.DumpDigits($DUMPEVENT,true); > dump.recdigits
111 .q
112 EOF
113
114
115 echo "Finished"  
116 echo "... see results in test_out"
117
118 cd $CURDIR