Ubuntu
Change colors in xtrem:
cat /etc/X11/app-defaults/XTerm-color /etc/X11/app-defaults/XTerm > ~/XTerm
nano ~/XTerm
comment
!#include "XTerm"
add
*VT100*foreground: green
add
*VT100*background: black
bash
Install Packages
Install both:
package_download.sh
and
expect_package_download.sh
(for this you need to have
expect
package installed).
package_download.sh
#!bin/bash
this_catalog=`pwd`
echo "Remember that ATHENA environment must be set!"
if [ $# -lt 1 ]
then
echo "Too few arguments: sh package_download.sh FILE_LIST.txt"
exit 1
fi
if [ $# -gt 1 ]
then
echo "Too many arguments: sh package_download.sh FILE_LIST.txt"
exit 1
fi
echo "Write CERN username:"
read cern_username
echo "Write $cern_username@cern.ch NICE password:"
read -s cern_password
while read filename
do
if test -d $this_catalog/$filename
then #file exist
rm -r -f $this_catalog/$filename
fi
expect expect_package_download.sh $filename $cern_username $cern_password
cd $filename/cmt
cmt config
cmt make
cd $this_catalog
done < $this_catalog/$1
expect_package_download.sh
#!/usr/bin/expect
set filename [lindex $argv 0]
set user [lindex $argv 1]
set passw [lindex $argv 2]
spawn cmt co $filename
expect "assword:"
send "$passw\r"
while { true } {
expect {
"assword: " { send "$passw\r" }
"CMT" { break }
}
}
interact
Sample link_file.txt:
ForwardDetectors/ALFA/ALFA_BeamAnalysis
ForwardDetectors/ALFA/ALFA_BeamTransport
ForwardDetectors/ALFA/ALFA_SimEv
ForwardDetectors/ALFA/ALFA_RecEv/ALFA_GloRecEv
ForwardDetectors/ALFA/ALFA_RecEv/ALFA_LocRecEv
ForwardDetectors/ALFA/ALFA_G4_SD
ForwardDetectors/ALFA/ALFA_Geometry
ForwardDetectors/ALFA/ALFA_GeoModel
ForwardDetectors/ALFA/ALFA_TestBeam
ForwardDetectors/FPTracker
ForwardDetectors/FNTracker
Backup
#! /bin/bash
# add directories that should be backuped
declare -a bcat
bcat[1]="parametryzacja"
bcat[2]="unfolding"
bcat[3]="MADX_vs_FPTrack"
echo $USER backup: $(date)
echo Making backup directory
backupcatalog="atlas_backup_$(date +"%y_%m_%d")"
echo $backupcatalog
if [ -d $backupcatalog ]
then rm -r $backupcatalog/*
else mkdir $backupcatalog
fi
echo Copying files
i=1;
while (($i < 4 ))
do
find ${bcat[${i}]} \( ! -name "*~" \) \( ! -name "*.pdf" \) \( ! -name "*.eps" \) \( ! -name "*.jpg" \) \( ! -name "*.png" \) \( ! -name "*.root" \) | cpio -vdump $backupcatalog
i=$((i+1))
done
echo Making tarball
tar -zcf $backupcatalog.tar.gz $backupcatalog
rm -r -f $backupcatalog
echo End backup
C++
root
Nice plots
TCanvas * c1 = new TCanvas("name_c1", "", 400, 400);
TH2D * h2 = new TH2D("h2", "", 100, -1., 1., 100, -1., 1.);
//***** Set margins *****
c1->SetLeftMargin(0.1);
c1->SetBottomMargin(0.11);
c1->SetRightMargin(0.12);
c1->SetTopMargin(0.05);
//***** Set number od colors in pallete *****
int ncol = 10;
int colors1[ncol];
TColor *col;
double dg=1/(double)ncol;
double grey=0;
for (int i=0; i<ncol; i++)
{
colors[i]= 2*i+ncol;
col = gROOT->GetColor(colors[i]);
col->SetRGB(grey, grey, grey);
grey = grey+dg;
}
h2->SetContour(ncol);
//***** Set plot parameters *****
c1->SetFillColor(0);
h2->GetXaxis()->SetTitleSize(0.04);
h2->GetXaxis()->SetTitleOffset(1.2);
h2->GetXaxis()->SetLabelSize(0.04);
h2->GetXaxis()->SetLabelOffset(0.002);
h2->GetYaxis()->SetTitleSize(0.04);
h2->GetYaxis()->SetTitleOffset(1.2);
h2->GetYaxis()->SetLabelSize(0.04);
h2->GetYaxis()->SetLabelOffset(0.002);
h2->GetXaxis()->SetTitle("p_{T} [GeV]") ;
h2->GetYaxis()->SetTitle("E [TeV]") ;
h2->SetMaximum(1.e3);
h2->SetMinimum(1);
//***** Set style *****
TStyle * mystyle = new TStyle("mystyle","mystyle");
mystyle->SetFillColor(0);
mystyle->SetPadColor(0);
mystyle->SetPadBorderSize(0);
mystyle->SetPadBorderMode(0);
mystyle->SetTitleFillColor(0);
mystyle->SetTitleBorderSize(0);
mystyle->SetFrameBorderMode(0);
mystyle->SetOptStat(kFALSE);
mystyle->SetPalette(ncol,colors);
mystyle->SetNumberContours(ncol);
gROOT->SetStyle("mystyle");
gROOT->ForceStyle();
//***** Legend *****
TLegend *legend = new TLegend(.40,.85,.70,.95);
legend->AddEntry(MAD_energy_graph_2D[0][0],"MAD-X","l");
legend->AddEntry(FPT_energy_graph_2D[0][0],"FPTracker","l");
legend->SetBorderSize(1);
legend->SetFillColor(0);
legend->SetMargin(0.2);
legend->SetColumnSeparation(0.);
legend->SetEntrySeparation(0.2);
legend->SetTextSize(0.035);
legend->Draw();