11/29/2010

Rename files in linux

for file in `ls $DATA/*.dat`

do
   mv "$file" "`basename $file .dat`.QGSjetII.dat"
done

where  basename command removing directories and suffix from file names

for example
 basename include/stdio.h .h
              Output "stdio".

11/18/2010

set environment variable in shell scripts

  1. put export commands in example.sh
  2. source example.sh

11/15/2010

Uncertainty calculations

1 adding or subtracting 
a=10+/-1
b=20+/-2
c=a+b=30+/-3
 d=b-a=10+/-3
2 multiplying or dividing

a=10+/-1
b=20+/-2
c=a*b=200+/-(1/10+2/20)*200=200+/-40
d=b/a=2+/-(1/10+2/20)*2=2+/-0.4

11/08/2010

qsub submit a job to jekyll

qsub basesub.job
文件内容(basesub.job)
#PBS -l walltime=01:00:00
#PBS -l nodes=1:ppn=1
#PBS -N PROCESSNAME
#PBS -S /bin/bash
#PBS -j oe

WD=/home/guofeng/Desktop/ADST_backup/prog2010/Nov/prog1101_jumps_simulation/

cd ${WD}
./Process_all_data.sh

11/05/2010

Root graph drawing options

gr->Draw("ACP");
gr->Draw("AB");

Google image index, looks cool

http://www.google.com/logos/index.html

Research 11/05/2010

Get average number of muons from two primaries, to see if there is difference

11/02/2010

Get mean and rms out of histogram

Assuming TH1* h, you can do
  h->GetMean()
  h->GetRMS()
  h->GetEntries()