Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-07-14 07:55:48

0001 #! /bin/bash
0002 
0003 #include common helper functions to make it easier across years
0004 source helperCalibHGCROC.sh
0005 
0006 PlotBaseDir=..
0007 runList=../configs/FOCalTest2026/DataDB_LaserTestFocal_202606.csv
0008 
0009 # running example:
0010 # bash runCalibration_2024.sh fbockExt2 muoncalibA1 improvedWBC4th
0011 
0012 
0013 dataDirRaw=""
0014 dataDirOut=""
0015 
0016 if [ $1 = "fbockTB" ]; then 
0017   dataDirRaw=/media/fbock/ALICE2-4TB/202607_FoCalTB/HGCROCData
0018   dataDirOut=/media/fbock/ALICE2-4TB/202607_FoCalTB/HGCROCData
0019   PlotBaseDir=/media/fbock/ALICE2-4TB/202607_FoCalTB/
0020 else
0021   echo "Please select a known user name, otherwise I don't know where the data is"
0022   exit
0023 fi
0024 
0025 # run pedest extraction for different run numbers
0026 if [ $2 = "pedestal" ]; then
0027 #   runs='154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222';
0028 #   runs='160';
0029 #   runs='164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179' ;
0030 #   runs='180 181 182 183 184 185 186 187 188 189 190 191' ;
0031 #   runs='192 205 206 207 208 209 210 211 212 213 214 215 216'
0032   runs='217 218 219 220 221 222'
0033   # different number of KCUs & asics
0034   for runNr in $runs; do 
0035     printf -v runNrPed "%03d" "$runNr"
0036     Pedestal $2 $runNrPed $dataDirRaw $dataDirOut Run$runNrPed pdf
0037 #     ./DataPrep -a -d 1 -p -i $dataDirRaw/rawHGCROC_$runNrPed.root -f -o $dataDirOut/rawHGCROC_wPed_$runNrPed.root -O $PlotBaseDir/PlotsPedestal/Run$runNrPed -r $runList
0038   done
0039 fi
0040 
0041 if [ $2 = "toaPhase" ]; then   
0042   if [ $3 = "FullSetB" ]; then
0043     runNrPed='071'
0044     if [ $4 = "Hadron" ]; then 
0045       runs=''
0046     elif [ $4 = "Muon" ]; then 
0047       runs='072' # 1st 0,0
0048     fi
0049   elif [ $3 = "HVScan" ]; then
0050     runNrPed='188'
0051     if [ $4 = "Muon" ]; then
0052       runs='202' # 1st 0,0
0053     fi
0054   fi
0055   if [ $4 = "Hadron" ]; then 
0056     for runNr in $runs; do 
0057       ./DataPrep -d 1 -f -i $dataDirRaw/rawHGCROC_$runNr.root -o $dataDirOut/rawHGCROC_toaPhase_$runNr.root -O $PlotBaseDir/ToAPhaseExtraction/Run$runNr -r $runList -g $dataDirOut/rawHGCROC_wPed_$runNrPed.root #-F png
0058     done
0059   elif [ $4 = "Muon" ]; then 
0060     for runNr in $runs; do 
0061       echo $runNr
0062       ./DataPrep -d 1 -f -i $dataDirRaw/rawHGCROC_wPed_$runNr.root -o $dataDirOut/rawHGCROC_toaPhase_$runNr.root -O $PlotBaseDir/ToAPhaseExtraction/Run$runNr -r $runList -g $dataDirRaw/rawHGCROC_wPed_$runNrPed.root
0063       #./DataPrep -d 1 -f -i $dataDirRaw/rawHGCROC_miptrigg_wPedwMuon_wBC_$runNr.root -o $dataDirOut/rawHGCROC_toaPhase_$runNr.root -O $PlotBaseDir/ToAPhaseExtraction/Run$runNr -r $runList -g $dataDirRaw/rawHGCROC_miptrigg_wPedwMuon_wBC_$runNr.root #-F png
0064     done
0065   fi
0066 
0067 fi
0068 
0069 if [ $2 = "wave" ]; then
0070   echo "Add runnumbers before you try this & remove exit"
0071   exit
0072   runs=''
0073   for runNr in $runs; do
0074     WaveformHGCROC $3 $runNr $dataDirRaw Run_$runNr
0075   done
0076 fi
0077 
0078 
0079 if [ $2 == "calibMuon" ]; then
0080   toaPhaseOffset=''
0081   badChannelMap=../configs/FOCalTest2026/dummyFocalTB.txt
0082 #   runs='154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179';
0083 #   runs='156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222';
0084   runs='193';
0085 
0086 #   runs='154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222';
0087 
0088   for runNr in $runs; do
0089     MuonCalibHGCROC $3 $runNr $runNr $dataDirRaw $dataDirOut Run_$runNr $badChannelMap $toaPhaseOffset  
0090   done
0091 fi