3 ###############################################################################
5 # Aim is to submit simulation/reconstruction jobs for multiplicity dependence check
6 # For local running one can use the instructions in runSim() function.
7 # submitMultiplicityScan() --> main function to submit jobs for each event with a given multiplicity
8 # runSim() --> runs the macros for simulation and reconstruction
9 # To see how to run these functions look below
11 ###############################################################################
13 # global variables to be set
14 DATE=`date +%Y_%m_%d_%H`
15 nEvents=1 #fixed to 1 to make an event by event job submission
17 ###############################################################################
18 submitIonTailXTalkScan()
22 # cals the submitMultiplicityScan fuction for
23 # --> IonTail ON/OFF, XTALK ON/OFF, in reconstruction and MC
24 ###############################################################################
25 ## example --> for 5 multiplicity bins, each most central event having 15000 track multiplicity.
26 ## For each multiplicity bin total statistic is 75000
28 cd $ALICE_ROOT/test/testdEdx
29 source submitSimJobs.sh
30 submitIonTailXTalkScan 8 1000000 50 /hera/alice/marsland/software/bin/set_private_TPCdev.sh > out.log 2>&1 &
32 ###############################################################################
41 echo "4 parameters needed --> multiplicity bins, maximum number of tracks, maximum number of central events, source file for root"
46 testDir=$baseDir/test_$nMultBins\_$maxNTracks\_$nEventsCentral\_$DATE
47 DirCheckCreate $testDir
50 for ((iontail=0; iontail<2 ; iontail=iontail+1))
52 for ((xtalk=0; xtalk<2 ; xtalk=xtalk+1))
55 MultiplicityScan $nMultBins $maxNTracks $nEventsCentral $alirootSourceFile $iontail $xtalk
61 ###############################################################################
65 # Function which runs rec.C and sim.C for given multiplicity and event number.
66 # (if submitMultiplicityScan function is called, this parameter is always fixed to 1, i.e event by event)
67 # Input parameters are
68 # 1) total track multiplicity
69 # 2) number of events to be processed for given total track multiplicity (if submitMultiplicityScan() is called, it is 1)
70 # 3) script to source a specific aliroot
72 ###############################################################################
73 ## example --> 2 events with total multiplicity of 1000 tracks
75 cd $ALICE_ROOT/test/testdEdx
76 source submitSimJobs.sh
77 runSim 100 1 0 0 /hera/alice/marsland/software/bin/set_private_TPCdev.sh > out.log 2>&1 &
79 ###############################################################################
81 export TestdEdxNTracks=$1
88 echo "5 parameters needed --> multiplicity, number of events, source file for aliroot, iontail switch (0 or 1), xTalk switch (0 or 1)"
92 echo " Running dEdx digitzer test job"
93 echo " NEvents = $nevents"
94 echo " NTracks per event $TestdEdxNTracks"
97 ## main body of the simulation part
98 rm -rf *.root *.dat *.log fort* hlt hough raw* recraw/*.root recraw/*.log GRP*
99 printf "\n ======================================================================\n\n"
100 echo Running: aliroot -b -q sim.C\($nevents,$ionTail,$xTalk\)
101 aliroot -b -q sim.C\($nevents,$ionTail,$xTalk\) 2>&1 | tee sim.log
102 mv syswatch.log simwatch.log
103 printf "\n ======================================================================\n\n"
104 echo Running: aliroot -b -q rec.C\($ionTail\,$xTalk\)
105 aliroot -b -q rec.C\($ionTail\,$xTalk\) 2>&1 | tee rec.log
106 mv syswatch.log recwatch.log
107 ## OCDB entries to be dumped in human readable format
108 source $ALICE_ROOT/PWGPP/CalibMacros/AliOCDBtoolkit.sh
109 printf "\n ======================================================================\n\n"
110 echo Running: ocdbMakeTable AliESDs.root "ESD" OCDBrec.list
111 ocdbMakeTable AliESDs.root "ESD" OCDBrec.list
112 printf "\n ======================================================================\n\n"
113 echo Running: ocdbMakeTable galice.root MC OCDBsim.list
114 ocdbMakeTable galice.root MC OCDBsim.list
115 ocdbFileName=$(cat OCDBrec.list | grep "TPC/Calib/RecoParam" | gawk '{print $2"/"$3}' )
116 printf "\n ======================================================================\n\n"
117 echo Running: dumpObject $ocdbFileName "object" "XML" RecoParam
118 dumpObject $ocdbFileName "object" "XML" RecoParam
123 ###############################################################################
126 # Here we submit the jobs for the simulation//reconstruction for one setting of IonTail and XTalk configuration
128 # 1. multiplicity bins to be investigated (default 5)
129 # 2. max multiplicity for whole processing (default 75000 tracks --> 5 central PbPb event )
130 # 3. number of central events to be used (default 5)
131 # 4. file to source aliroot
132 # (2)/(3) should be a reasonable multiplicity estimate (e.g. 15000 tracks which is 1 central PbPb event)
133 # Jobs will be submitted per event
135 # For each setting new directory will be created - indicating muiltiplicity
136 # dir<ntracks>/dir<eventNr>
138 ###############################################################################
139 ## example --> for 5 multiplicity bins, each most central event having 15000 track multiplicity.
140 ## For each multiplicity bin total statistic is 75000
142 cd $ALICE_ROOT/test/testdEdx
143 source submitSimJobs.sh
144 MultiplicityScan 8 1000000 50 /hera/alice/marsland/software/bin/set_private_TPCdev.sh 0 1 > out.log 2>&1 &
146 ###############################################################################
156 if [ $# -ne 6 ]; then
157 echo "6 parameters needed --> multiplicity bins, maximum number of tracks, maximum number of central events, source file for root, iontail switch (0 or 1), xTalk switch (0 or 1)"
162 testDir=$baseDir/IonTail_XTalk_$ionTail\_$xTalk
163 DirCheckCreate $testDir
166 # create multiplicity bins
167 multPerCentralEvent=$(echo $maxNTracks/$nEventsCentral | bc)
168 echo "multiplicity per most central event is $multPerCentralEvent"
169 for ((i=0; i<$nMultBins ; i=i+1))
172 multSteps=$(echo $multPerCentralEvent/$nMultBins | bc)
173 multBin=$(echo $multPerCentralEvent - $multSteps*$i | bc)
174 multBinDir=$testDir/mult_$multBin
175 DirCheckCreate $multBinDir
179 nEventsPerMultBin=$(echo $maxNTracks/$multBin | bc)
180 echo $nEventsPerMultBin
181 for ((j=1; j<$(echo $nEventsPerMultBin+1 | bc) ; j=j+1))
184 eventDir=$multBinDir/event_$j
185 DirCheckCreate $eventDir
187 cp -r $ALICE_ROOT/test/testdEdx/GRP $ALICE_ROOT/test/testdEdx/OCDB* $ALICE_ROOT/test/testdEdx/*.* .
188 #cp $ALICE_ROOT/test/testdEdx/*.* .
190 qsub -V -cwd -l h_rt=24:0:0,h_rss=6G -P alice -b y -r y -o outSim.log -e errSim.log $baseDir/submitSimJobs.sh runSim $multBin $nEvents $4 $5 $6
197 ###############################################################################
202 # check if the directory exist. If so, delete it
206 if [ -d "$dirName" ]; then
207 echo " $dirName already exist delete it and create a new one "
213 ###############################################################################