Double Chooz Tutorialsource $THRONG_DIR/configDChooz_Lyon.shor
source $THRONG_DIR/configDChooz_Lyon.csh
Host cvs.in2p3.fr User YOUR CVS USER ID RSAAuthentication yes PubkeyAuthentication yes Protocol 2 ForwardX11 no ForwardAgent no IdentityFile ~/.ssh/key_for_cvs.in2p3.frWhere ~/.ssh/key_for_cvs.in2p3.fr is the file that holds the private key that matches the public key you sent to IN2P3 when you established your CVS account. You may be able to find this key at $HOME/.ssh/id_rsa of your computer. Also see how to protect your key.
cd DCDB make cd ../DCBase make cd ../..Then configure and build the simulation
cd DOGS/DCGLG4sim/GLG4sim/ ./configurePick 3 for hbook or 2 for root
make cd .. ./configurePick the same as you did for GLG4sim
make
/event/output_mode full
$THRONG_DIR/$USER/DOGS/bin/dcglg4sim mac/Antineutrino_hepevt.mac 1>Antineutrino_hepevt.out 2>Antineutrino_hepevt.errThis runs $THRONG_DIR/$USER/DOGS/bin/dcglg4sim and directs the standard output and standard error to files.
#!/bin/bash # Run with: qsub -eo -l t=200000,M=512MB,platform=LINUX,scr=500MB Batch.sh cd $THRONG_DIR/$USER/DOGS/DCGLG4sim source $THRONG_DIR/configDChooz_Lyon.sh $THRONG_DIR/$USER/DOGS/bin/dcglg4sim mac/Antineutrino_hepevt.mac 1>Antineutrino_hepevt.out 2>Antineutrino_hepevt.err
root -l
TFile tf("hepevt_DCgen500t.root");
event_tree->Draw("totScintEdep");
event_tree->Draw("totScintEdep","pdg_code==2112");
event_tree->SetLineColor(kRed);
event_tree->Draw("totScintEdep","pdg_code==-11","same");
event_tree->SetLineColor(kBlack);
event_tree->Draw("totScintEdep","pdg_code==22");
event_tree->Draw("delta_UT","delta_UT<1.e5");
event_tree->Draw("totScintEdep","delta_UT<1.e5");
event_tree->Draw("x0:y0","pdg_code==-11");
event_tree->Draw("z0:sqrt(x0*x0+y0*y0)","pdg_code==-11");
.q
$CERN_BIN/pawX11 h/fil 1 hepevt_dcgen500t.hbook 32768 n/plo 1.totscintedep n/plo 1.totscintedep pdg_code.eq.2112 set hcol 2 n/plo 1.totscintedep pdg_code.eq.-11 ! ! ! s set hcol 1 n/plo 1.totscintedep pdg_code.eq.22 n/plo 1.delta_UT delta_UT.lt.1.e5 n/plo 1.totscintedep delta_UT<1.e5 n/plo 1.x0%y0 pdg_code.eq.-11 n/plo 1.z0%(x0**2+y0**2) pdg_code.eq.-11 quit
There are programs in DOGS/DCGLG4sim/examples to do this.
DOGS/DCGLG4sim/examples/readntuple.f is a sample code to read the DCGLG4sim
Ntuple, do some simple calculations, and output a different Ntuple.
To be usefull you need to add your own code to readntuple.f where indicated
near the end of the program.
call HLIMIT(NWPAWC)
C
C Set up the input Ntuple
C
call HROPEN(17,'dcglg4sim', FileName ,'P',LRECL,ISTAT)
if( istat.ne.0 ) then
print *,'HROPEN: istat = ',istat
endif
call HRIN(1,999999,0)
CALL HBNAME(1,'DATA',izero,'$CLEAR')
CALL HBNAME(1,'DATA',eventID,'$SET')
C
call HNOENT(1,entries)
write(6,100)entries
100 format('Number of entries ',i6)
...
C
C loop over all the events of the input ntuple
C
do 10 j=1, entries
if( j.ne.1) then
C fast call
call HGNTF(1,j,ierr)
else
call hgnt(1,j,ierr)
endif
...
DOGS/DCGLG4sim/examples/RecoVS.cc is a sample code to read the DCGLG4sim simple root format, do some calculations, and output an Ntuple. The reconstruction in this code is based on Minuit and is contained in the MinFit routine near the end.
Access to the TTree is via the following code:
//Open up the root tree from the simulation
TFile InFile(argc[1],"READ");
TTree *InTree = (TTree *) InFile.Get("event_tree");
TEvent_TreeV *Tevent=new TEvent_TreeV(InTree);
Int_t nevent = InTree->GetEntries();
...
for (Int_t j=0;j<nevent-1;j++){
//Get the event
InTree->GetEntry(j);
...
for(int i=0;i<Tevent->photon_hit_n_photon_hits;i++){
PHeight=Tevent->photon_hit_hit_count[i];
Tnum=(int)Tevent->photon_hit_hit_pmt[i];
...
There is also DOGS/DCGLG4sim/examples/ReadDCEDOGS.cc that can be compiled to read, process and histogram DOGS formated files. The version of ReadDCEDOGS in release Prod-03-02 has not been checked against the current version of DOGS formated files. Due to rapid evolution of the format ReadDCEDOGS may not be useable at present. An attempt to build the version in the Prod-03-02 release at CC-IN2P3 has shown that it is incompatible with the current DCEVENT and PulseThInfo classes.
export GLG4DATA=$THRONG_DIR/losecco/DOGS/DCGLG4sim/examplesor
setenv GLG4DATA $THRONG_DIR/losecco/DOGS/DCGLG4sim/examples
g77 -o readntuple readntuple.f -L$CERN/$CERN_LEVEL/lib -lpacklib_noshift FC=f77 make RecoVS
./readntuple ../hepevt_dcgen500t.hbook ./RecoVS ../hepevt_DCgen500t.root
$CERN_BIN/pawX11 h/fil 1 hepevt_dcgen500t.hb4 32768 ...and
$CERN_BIN/pawX11 h/fil 2 hepevt_dcgen500tvs.hbook 32768 ...
#$Id: Antineutrino_hepevt.mac,v 1.5 2007/05/15 05:43:23 gahs Exp $ /run/particle/setCut 1.0 mm /glg4debug/glg4param omit_muon_processes 1.0 /glg4debug/glg4param omit_hadronic_processes 0.0 /run/initialize /generator/pos/set 10 0 0 0 # Set event window to 100 nanosecond /generator/event_window 100 # set hepevt input file /generator/vtx/set 18 "/afs/in2p3.fr/throng/dchooz/DATA/DCgen500-HEPEvt" # anti-neutrino hepevt generator rates Way to high #More realistic rate at far detector about 20000 events/year /generator/rates 38 0.0008 # only defer certain types of particles to later events /process/inactivate DeferTrackProc all /process/activate DeferTrackProc gamma /process/activate DeferTrackProc e- /process/activate DeferTrackProc e+ # uncomment next lines to turn off optical photon tracking -- big speedup! # /glg4scint/off # /process/inactivate Cerenkov /glg4scint/on /process/activate Cerenkov /event/output_file hepevt_DCgen500 /run/verbose 1 /run/beamOn 10000 /event/output_file
THE FOLLOWING HAS NOT BEEN CHECKED AS OF MAY 23, 2008 $GLG4DATA no longer exists in release Prod-03-02
# Arguments to /generator/gun command are # opticalphoton x y z p_x p_y p_z E_eV pol_x pol_y pol_z N_photons # # Here we ask for 337 nm, at origin, isotropic, rndm polarization, 100/flash /generator/gun opticalphoton 0 0 0 0 0 0 3.68e-6 0 0 0 100
/generator/gun e+ 0 0 0 0 0 0 0 /generator/gun mu- -500 -750 2887 0.1 0.2 -0.9746794 1100. /generator/gun gamma 0 0 0 1 0 0 1.022 /generator/gun neutron 0 0 2950 0 0 -1 6.0 0 1 0
/generator/gun particle-name x y z px py pz K [polx poly polz]This command is a convenient way of setting the user-controlled test gun parameters. It is really an alias for the two commands:
/generator/pos/set 9 x y z /generator/vtx/set 17 particle_name px py pz K polx poly polzFor isotropic direction vectors, leave (px,py,pz) all zero and set K. For other options, such as uniformly filling a volume or uniformly painting a surface, use
/generator/pos/set 9directly.
/generator/pos/set 9 "2400. 335. 254. fill" /generator/vtx/set 17 "Bi214 0 0 0 0."
/generator/pos/set 9 "0 0 0 fill" /generator/vtx/set 17 "B12 0 0 0 0" /generator/vtx/set 17 "Na21 0 0 0 0" /generator/vtx/set 17 "He8 0 0 0 0" /generator/vtx/set 17 "He9 0 0 0 0" /generator/vtx/set 17 "Li7 0 0 0 0"
~losecco/Chooz/DOGS/DCGLG4sim/examples/libaux.tar.Zand
~losecco/Chooz/DOGS/DCGLG4sim/examples/libtk.tar.ZCompiled versions, libaux.a and libtk.a, are also in this directory.
make ServChoozand
make DisDChoozin the DOGS/DCGLG4sim/examples directory.
~losecco/Chooz/DOGS/DCGLG4sim/examples/libaux.aand
~losecco/Chooz/DOGS/DCGLG4sim/examples/libtk.aor build from the sources in the same directory.
ServChooz $THRONG_DIR/DATA/muon-120t.rootIn general the command to start the server is (path to server code)/ServChooz (location of simple root DCGLG4sim file)
binding stream socket: Address already in use
Input file contains xxx events. ServChooz can be run in the background or it can be put in the background after being started.
DisDChooz -h
./DisDChooz -t2 -q1 -s1 -dlocalhostif you are running the display on the same machine that you ran ServChooz.
-dSERVER_NAMEwhere SERVER_NAME is the IP name of the machine on which the server is running.

-t1 Set the time format to log
-t2 Set the time format to sorted linear
-q1 Set the pulse height format to saturate at 25 pe
-q2 Set the pulse height format to rescale for each event
$GLG4DATA/pmtcoordinates_optical_id.dat
-pPORTNUMBER Set the host socket port number
Br 0 :fStartRealTime : Br 1 :fStopRealTime : Br 2 :fStartCpuTime : Br 3 :fStopCpuTime : Br 4 :fTotalCpuTime : Br 5 :fTotalRealTime : Br 6 :fCounter : Br 7 :fUniqueID : Br 8 :fBits : Br 9 :event_info : eventID/I:runID/I:UT/F:delta_UT/F:eventType/I Br 10 :vertex_info.n_particles : n_particles/I Br 11 :vertex_info.t0 : t0[n_particles]/F Br 12 :vertex_info.x0 : x0[n_particles]/F Br 13 :vertex_info.y0 : y0[n_particles]/F Br 14 :vertex_info.z0 : z0[n_particles]/F Br 15 :vertex_info.pdg_code : pdg_code[n_particles]/I Br 16 :vertex_info.px : px[n_particles]/F Br 17 :vertex_info.py : py[n_particles]/F Br 18 :vertex_info.pz : pz[n_particles]/F Br 19 :vertex_info.polx : polx[n_particles]/F Br 20 :vertex_info.poly : poly[n_particles]/F Br 21 :vertex_info.polz : polz[n_particles]/F Br 22 :vertex_info.ke : ke[n_particles]/F Br 23 :vertex_summary : vketot/D:vcentroid_x/F:vcentroid_y:vcentroid_z Br 24 :photon_hit.n_photon_hits : n_photon_hits/I Br 25 :photon_hit.hit_time : hit_time[n_photon_hits]/D Br 26 :photon_hit.hit_pmt : hit_pmt[n_photon_hits]/s Br 27 :photon_hit.hit_count : hit_count[n_photon_hits]/I Br 28 :oveto_hit.n_oveto_hits : n_oveto_hits/I Br 29 :oveto_hit.hit_time : vhit_time[n_oveto_hits]/D Br 30 :oveto_hit.hit_energy : vhit_energy[n_oveto_hits]/D Br 31 :oveto_hit.hit_pt : vhit_pt[n_oveto_hits]/s Br 32 :inner : n_pmt_hits/I:n_hit_pmts/I Br 33 :outer : n_pmt_hits/I:n_hit_pmts/I Br 34 :GLG4scint : totScintEdep/F:totScintEdepQuenched:scint_centroid_x:scint_centroid_y:scint_centroid_zAn annotated list of the event_tree TTree
1 * I*4 * eventID 2 * I*4 * runID 3 * R*4 * UT 4 * R*4 * delta_UT 5 * I*4 * eventType 6 * I*4 * n_particles[0,16] 7 * R*4 * t0(n_particles) 8 * R*4 * x0(n_particles) 9 * R*4 * y0(n_particles) 10 * R*4 * z0(n_particles) 11 * I*4 * pdg_code(n_particles) 12 * R*4 * px(n_particles) 13 * R*4 * py(n_particles) 14 * R*4 * pz(n_particles) 15 * R*4 * polx(n_particles) 16 * R*4 * poly(n_particles) 17 * R*4 * polz(n_particles) 18 * R*4 * ke(n_particles) 19 * R*4 * vcentroid_x 20 * R*4 * vcentroid_y 21 * R*4 * vcentroid_z 22 * R*4 * vketot 23 * I*4 * inner_n_pmt_hits 24 * I*4 * inner_n_hit_pmts 25 * R*4 * totScintEdep 26 * R*4 * totScintEdepQuenched 27 * R*4 * scint_centroid_x 28 * R*4 * scint_centroid_y 29 * R*4 * scint_centroid_z 30 * I*4 * n_oveto_hits[0,540] 31 * R*4 * ovhit_time(n_oveto_hits) 32 * R*4 * ovhit_energy(n_oveto_hits) 33 * I*4 * hit_pt(n_oveto_hits) 34 * I*4 * n_photon_hits[0,5400] 35 * I*4 * hit_pmt(n_photon_hits) 36 * R*4 * hit_time(n_photon_hits) 37 * I*4 * hit_count(n_photon_hits)