rm -fr $OUTDIR
mkdir $OUTDIR
-cp .rootrc $OUTDIR
+cp $ALICE_ROOT/MUON/.rootrc $ALICE_ROOT/MUON/rootlogon.C $OUTDIR
cd $OUTDIR
+FULLPATH="$CURDIR/$OUTDIR"
+# Minimum number of events to have enough stat. for invariant mass fit
+# 10000 is ok, 20000 is really fine
+NEVENTS=100
+SEED=1234567
+
+
echo "Running simulation ..."
aliroot -b >& testSim.out << EOF
-AliSimulation MuonSim
-MuonSim.SetConfigFile("$ALICE_ROOT/MUON/Config.C")
-// Minimum number of events to have enough stat. for invariant mass fit
-// 10000 is ok, 20000 is really fine
-MuonSim.Run(10000)
+// Uncoment following lines to run simulation with local residual mis-alignment
+// (generated via MUONGenerateGeometryData.C macro)
+// AliCDBManager* man = AliCDBManager::Instance();
+// man->SetDefaultStorage("local://$ALICE_ROOT");
+// man->SetSpecificStorage("MUON","local://$ALICE_ROOT/MUON/ResMisAlignCDB");
+gRandom->SetSeed($SEED);
+AliSimulation MuonSim("$ALICE_ROOT/MUON/Config.C");
+MuonSim.SetMakeTrigger("MUON");
+MuonSim.Run($NEVENTS);
.q
EOF
echo "Running reconstruction ..."
aliroot -b >& testReco.out << EOF
-TPluginManager* pluginManager = gROOT->GetPluginManager();
-pluginManager->AddHandler("AliReconstructor", "MUON","AliMUONReconstructor", "MUON","AliMUONReconstructor()")
-AliReconstruction MuonRec("galice.root")
-MuonRec.SetRunTracking("")
-MuonRec.SetRunVertexFinder(kFALSE)
-MuonRec.SetRunLocalReconstruction("MUON")
-MuonRec.SetFillESD("MUON")
-MuonRec.Run()
+gRandom->SetSeed($SEED);
+AliMagFMaps* field = new AliMagFMaps("Maps","Maps", 1, 1., 10., AliMagFMaps::k5kG);
+AliTracker::SetFieldMap(field, kFALSE);
+AliReconstruction MuonRec("galice.root");
+MuonRec.SetRunTracking("");
+MuonRec.SetRunVertexFinder(kFALSE);
+MuonRec.SetRunLocalReconstruction("MUON");
+MuonRec.SetFillESD("MUON");
+MuonRec.SetLoadAlignData("MUON")
+MuonRec.Run();
+.q
+EOF
+
+echo "Running Trigger efficiency ..."
+
+aliroot -b >& testTriggerResults.out << EOF
+.L $ALICE_ROOT/MUON/MUONTriggerEfficiency.C+
+MUONTriggerEfficiency("galice.root",0);
.q
EOF
echo "Running efficiency ..."
aliroot -b >& testEfficiency.out << EOF
-.includepath $ALICE_ROOT/STEER
-.includepath $ALICE_ROOT/MUON
-.L $ALICE_ROOT/MUON/MUONefficiency.C++
+.L $ALICE_ROOT/MUON/MUONefficiency.C+
// no argument assumes Upsilon but MUONefficiency(443) handles Jpsi
MUONefficiency();
.q
more testReco.out | grep 'RunLocalReconstruction: Execution time for MUON' >> testTime.out
more testReco.out | grep 'Execution time for filling ESD ' >> testTime.out
-rm gphysi.dat
-rm *.root
-rm testSim.out
-rm testReco.out
-rm *.eps
+#rm gphysi.dat
+#rm *.root
+#rm testSim.out
+#rm testReco.out
+#rm *.eps
echo "Finished"
echo "... see results in testlong_out"