# TDC V1190 Set up file generated by Deltat : 16-Apr-2008 10:30:27
# bins are always in TDC channel units (195.3125 ps/channel)

INSTRUMENT=GPS

DESCRIPTION=No Veto -- 1port
TYPE=TDCV1190
RESOLUTION=195.3125

MDELAY=0
PDELAY=2000
#REWINDTIMEBINS=524288
REWINDTIMEBINS=-1000000000

MCOINCIDENCEW=50
PCOINCIDENCEW=50
VCOINCIDENCEW=100

MUONRATEFACTOR=0.0905048
#MUONRATEFACTOR=1000
#INFINITELYLOWMUONRATE

DATAWINDOWMIN=-0.5
DATAWINDOWMAX=10.0
PILEUPWINDOWMIN=-10.5
PILEUPWINDOWMAX=10.5


102; "M up";         M; 0.4;  800; -51 -52;
!  1; "Forw";         P; 0.1;  800; -51 -52; F;  1485; 1515; 50995;
!  2; "Backw";        P; 0.1;  800; -51 -52; B;  1485; 1515; 50995;
!  3; "Up";           P; 0.1;  800; -51 -52; U;  1485; 1515; 50995;
  4; "Down";         P; 0.1;  800; -51 -52; D;  1485; 1515; 50995;
!  5; "R1";           P; 0.1;  800; -51 -52; R1;  1485; 1515; 50995;
!  6; "R2";           P; 0.1;  800; -51 -52; R2;  1485; 1515; 50995;
!  7; "R3";           P; 0.1;  800; -51 -52; R3;  1485; 1515; 50995;
!  8; "L1";           P; 0.1;  800; -51 -52; L1;  1485; 1515; 50995;
!  9; "L2";           P; 0.1;  800; -51 -52; L2;  1485; 1515; 50995;
! 10; "L3";           P; 0.1;  800; -51 -52; L3;  1485; 1515; 50995;
 51; "Fveto";        V; 0.02;  800; 
 52; "Bveto";        V; 0.02;  800; 
!31;  Ch31;          N;

counterPhaseShifts 1  0  2 180
counterPhaseShifts 3  0  4 180

counterGrouping F 1
counterGrouping B 2
counterGrouping U 3
counterGrouping D 4
counterGrouping R 5 6 7
counterGrouping L 8 9 10

sampleID 201 202

musrTH1D hmuIniPosZ          "Muon initial position;z (mm);N" 200 -100000. 100000. muIniPosZ
musrTH1D hMuTargetPol_Theta  "Muon polarisation in the sample;#theta (deg);N"   300 60. 120. muTargetPol_Theta
musrTH1D hMuTargetPol_Phi    "Muon polarisation in the sample;#phi (deg);N"     1800 -180. 180. muTargetPol_Phi
musrTH1D hMuTargetPol_Phi360 "Muon polarisation in the sample;#phi+360 (deg);N" 1800    0. 360. muTargetPol_Phi360
musrTH1D hPos_Phi_MINUS_muDecayPol_Phi    ";#phi_{e ini} - #phi_{#mu decay spin} (deg);N" 360 -180. 180. pos_Phi_MINUS_muDecayPol_Phi
musrTH1D hPos_Phi_MINUS_muDecayPol_Phi360 ";#phi_{e ini} - #phi_{#mu decay spin} (deg);N" 360    0. 360. pos_Phi_MINUS_muDecayPol_Phi360
musrTH1D hdetP_phi_MINUS_pos_Phi    ";#phi_{det} - #phi_{e ini}  (deg);N" 360 -180. 180. detP_phi_MINUS_pos_Phi
musrTH1D hdetP_phi_MINUS_pos_Phi360 ";#phi_{det} - #phi_{e ini}  (deg);N" 360    0. 360. detP_phi_MINUS_pos_Phi360
musrTH1D hdet_time1_MINUS_muDecayTime ";TOF_{e} + TDC smearing;N" 500 0. 500. det_time1_MINUS_muDecayTime
musrTH1D hdetP_time_start_MINUS_muDecayTime ";TOF_{e};N" 500 0. 500. detP_time_start_MINUS_muDecayTime
musrTH2D hMuDecayMap "Muon decay map;z [mm]; r[mm]" 100 -80. 20. 40 0. 20. muDecayPosZ muDecayPosR
musrTH1D hMuDecayPosZall "Z of muons when they decay;z[mm];N" 4002 -2001 2001 muDecayPosZ
musrTH1D hMuDecayPosZ "Penetration of muons into the sample;z[mm];N" 100 -5.0 5. muDecayPosZ
musrTH1D hMuDecayPosX "X of decayed muons;x[mm];N" 100 -5.0 5. muDecayPosX
musrTH1D hPosMom      "Momentum of the produced positrons;P [MeV];N" 55 0. 55. pos_Momentum
musrTH1D hdet_m0edep  "Energy deposited in the trigger;E[MeV];N" 100 0. 2 det_m0edep
musrTH1D hdet_posEdep  "Energy deposited in the positron Counters;E[MeV];N" 100 0. 2 det_posEdep
#musrTH1D hdet_time0  "detected muSR spectra;time[#mus];N" 220 -11. 11. det_time0
#musrTH1D hdet_time1  "detected muSR spectra;time[#mus];N" 220 -11. 11. det_time1
#musrTH1D hdet_time10  "detected muSR spectra;time[#mus];N" 220 -11. 11. det_time10
musrTH1D hdet_time10  "detected muSR spectra;time[#mus];N" 240 -1. 11. det_time10
musrTH1D hdet_time10_bgr1  "detected muSR spectra (phase shifted);time[#mus];N" 280 -3. 11. det_time10
musrTH1D hdet_time10_bgr3  "detected muSR spectra (phase shifted);time[#mus];N" 280 -3. 11. det_time10
musrTH1D hdet_time31 "double hit time difference;time[#mus];N" 280 -3. 11. det_time31
musrTH1D hdet_time20  "detected muSR spectra (phase shifted);time[#mus];N" 240 -1. 11. det_time20
musrTH1D hgen_time10  "generated muSR spectra;time[#mus];N" 240 -11. 11. gen_time10
musrTH1D hdet_time10_MINUS_gen_time10   "detected - generated ;time_{det}-time_{gen} [ps];N" 100 -500. 500. det_time10_MINUS_gen_time10
#musrTH1D hMuDecayDetID "Detector ID where the muons decay;Detector ID; N" 4000 -2000. 2000. muDecayDetID
musrTH1D hMuDecayDetID "Detector ID where the muons decay;Detector ID; N" 2002 -1001. 1001. muDecayDetID
musrTH1D hMuDecayDetIDpileup "Detector ID where the pileup muons decay;Detector ID; N" 2002 -1001. 1001. pileup_muDecayDetID
humanDecayHistograms hMuDecayDetID hMuDecayDetIDpileup 201 Sample 202 Sample 102 M 1 F 2 B 3 U 4 D 5 R 6 R 7 R 8 L 9 L 10 L 51 FV 52 BV 401 Cryo 402 Cryo 403 Cryo 404 Cryo 411 Cryo 412 Cryo 413 Cryo 414 Cryo 415 Cryo 8201 pipe 8251 pipe 8301 pipe -1 World -1000 Escaped
musrTH1D hdet_time10_rotref "rot ref frame;time[#mus];N" 240 -1.0 11. det_time10 rotreference 66 0
musrTH1D hdet_time10_exp "hdet_time10_exp;time[#mus];N" 240 -1.0 11. det_time10 correctexpdecay
musrTH1D hdet_time20_rotref "rot ref frame;time[#mus];N" 240 -1.0 11. det_time20 rotreference 66 0
#musrTH1D hdet_time20_rotrefTwo "rot ref frame 2;time[#mus];N" 240 -1.0 11. det_time20 rotreference -1353 0
musrTH2D hMuTargetPolPhi_pInit ";#phi_{#mu spin}  (deg); p_{#mu init}  (MeV/c)" 100 0. 360. 100 25.7 28.9 muTargetPol_Phi360 muIniMomZ
musrTH2D hMuTargetPolPhi_RInit ";#phi_{#mu spin}  (deg); R_{#mu init}  (mm)" 100 0. 360. 100 0. 40. muTargetPol_Phi360 muIniPosR
musrTH2D hpos_detID_doubleHit "Double hits;positron counter ID; positron counter ID" 11 0. 11. 11 0. 11. pos_detID pos_detID_doubleHit


condition 0 alwaysTrue
condition 1 oncePerEvent
condition 2 muonDecayedInSample_gen
condition 3 muonTriggered_gen
condition 4 muonTriggered_det
condition 5 positronHit_det
condition 6 goodEvent_det
condition 7 goodEvent_gen
condition 8 goodEvent_det_AND_goodEvent_gen
condition 9 pileupEvent
condition 10 goodEvent_det_AND_muonDecayedInSample_gen
condition 11 goodEvent_F_det
condition 12 goodEvent_B_det
condition 13 goodEvent_U_det
condition 14 goodEvent_D_det
condition 15 goodEvent_R_det
condition 16 goodEvent_L_det
condition 17 goodEvent_F_det_AND_pileupEvent
condition 18 goodEvent_B_det_AND_pileupEvent
condition 19 goodEvent_U_det_AND_pileupEvent
condition 20 goodEvent_D_det_AND_pileupEvent
condition 21 goodEvent_R_det_AND_pileupEvent
condition 22 goodEvent_L_det_AND_pileupEvent
condition 23 doubleHit

fit hMuTargetPol_Phi gaus "" -180. 180. 1000. 0. 10.
fit hMuTargetPol_Phi360 gaus "" 0. 360. 1000. 0. 10.
fit hMuTargetPol_Theta gaus "" 60. 120. 1000. 0. 10.
fit hdet_time20 simpleExpoPLUSconst "" 0.1 9.9 100 1
fit hdet_time10_rotref rotFrameTime20 "" 0.2 9.8 0 0 100
fit hdet_time20_rotref rotFrameTime20 "" 0.2 9.8 0 0 100
#fit hdet_time10 simpleExpoPLUSconst "" 0.2 9.8 100 1
fit hdet_time10 funct4 "" 0.2 9.8 0 0 0.2 600 0
fit hdet_time10_exp TFieldCosPLUSbg "" 0.2 9.8 1 0 0.3 300 1
fit hdet_time10_bgr1 pol0 "" 0.2 9.8
#fit hdet_time10_bgr3 pol0 "" -1.9 -0.1
fit hdet_time10_bgr3 pol0 "WW" -0.5 -0.01
#fit hdet_time20_rotrefTwo rotFrameTime20 "" 0.1 9.9 0 0 100

#draw hMuDecayPosZ 0
#draw hMuDecayPosZall 1
#draw hMuDecayPosZ 1
#draw hMuDecayPosZ 2
#draw hMuDecayPosZ 3
#draw hMuDecayPosZ 4
#draw hMuDecayMap 0
#draw hMuDecayMap 1
#draw hdet_m0edep 0
#draw hdet_m0edep 1
#draw hdet_m0edep 2
#draw hdet_m0edep 3
#draw hdet_m0edep 4
#draw hdet_m0edep 5
#draw hdet_m0edep 6
draw hdet_time10 6
draw hgen_time10 7
draw hdet_time20 6
draw hgen_time20 7
draw hdet_time20_rotref 6
draw hdet_time20_bgr 6
#draw hdet_time20_rotrefTwo 6
draw hdet_time10_MINUS_gen_time10 8
#draw hdet_posEdep 5
#draw hMuDecayDetID 1
#draw hdet_m0edep 9
#draw hdet_time10 9
#draw hMuDecayDetIDpileup 1
#draw hMuDecayDetIDpileup 9
#draw humanDecayHistograms 1
#draw humanDecayHistograms 6
#draw humanDecayHistograms 9
#draw humanDecayPileupHistograms 1
#draw humanDecayPileupHistograms 6
#draw humanDecayPileupHistograms 9
$
