# 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=100

MDELAY=0
PDELAY=2000
#REWINDTIMEBINS=10000000

MCOINCIDENCEW=50
PCOINCIDENCEW=50
VCOINCIDENCEW=100

# 30000 mu/s
MUONRATEFACTOR=0.0965819
#INFINITELYLOWMUONRATE

DATAWINDOWMIN=-2.
DATAWINDOWMAX=10.0
PILEUPWINDOWMIN=-10.0
PILEUPWINDOWMAX=10.0

102; "M up";         M; 0.4;  2005; ;
  1; "B1";           P; 0.4;  2005; ; B1; 1485; 1515; 50995;
  2; "B2";           P; 0.4;  2005; ; B2; 1485; 1515; 50995;
 11; "F1";           P; 0.4;  2005; ; F11; 1485; 1515; 50995;
 12; "F2";           P; 0.4;  2005; ; F12; 1485; 1515; 50995;
 13; "F3";           P; 0.4;  2005; ; F13; 1485; 1515; 50995;
! 21; "Coinc B1"      K; 0.4;  2005;
! 22; "Coinc B2"      K; 0.4;  2005;
!401; "Act Veto"      V; 0.1;  2005;
! 3; "F right";      K; 0.4;  1263;
! 4; "B left";       P; 0.2;  1311;  5 -10 -11 -12 -13;  Back;   1485; 1515; 50995;
! 5; "B right";      K; 0.2;  1262;
! 6;  Up;            P; 0.2;  1306;  -10 -11 -12 -13;    Up;     1490; 1520; 51000;
! 7;  Down;          P; 0.2;  1264;  -10 -11 -12 -13;    Down;   1525; 1555; 51035;
! 8; "R int";        P; 0.2;  1309;  -10 -11 -12 -13;    R_int;  1480; 1510; 50990;
! 9; "R ext";        P; 0.3;  1267;  -10 -11 -12 -13;    R_ext;  1520; 1550; 51020; 8; Rite
!10; "Bveto up";     V; 0.3;  2085;
!11; "Bveto down";   V; 0.3;  2089;
!12; "Bveto left";   V; 0.3;  2080;
!13; "Bveto right";  V; 0.3;  2079;
!14; "F center";     P; 0.2;  2073;  -10 -11 -12 -13;    F_cntr;  720;  750; 50230; 2; Forw
!15;  Clock;         C;
!16;  Rejected;      R;
!17;  Ch17;          N;
!18;  Ch18;          N;
!19;  Ch19;          N;
!20;  Ch20;          N;
!21;  Ch21;          N;
!22;  Ch22;          N;
!23;  Ch23;          N;
!24;  Ch24;          N;
!25;  Ch25;          N;
!26;  Ch26;          N;
!27;  Ch27;          N;
!28;  Ch28;          N;
!29;  Ch29;          N;
!30;  Ch30;          N;
!31;  Ch31;          N;

#DEBUGEVENT   704 10
#DEBUGEVENT  1427 10
#DEBUGEVENT  3222 10
#DEBUGEVENT  5223 10
#DEBUGEVENT  8351 10
#DEBUGEVENT  8581 10
#DEBUGEVENT  9041 10
#DEBUGEVENT  9645 10



counterPhaseShifts 1  0  2 0  11 180  12 180  13 180
counterGrouping B 1 2
counterGrouping F 11 12 13

musrTH2D hMuDecayMap "Muon decay map;z [mm]; r[mm]" 100 -80. 20. 40 0. 20. muDecayPosZ muDecayPosR
musrTH2D hMuDecayMap_a "Muon decay map;z (mm); x (mm)" 400 -300. 100. 400 -200. 200. muDecayPosZ muDecayPosX
musrTH2D hMuDecayMappileup "Pileup muon decay map;z (mm); r (mm)" 400 -300. 100. 200 0. 200. pileup_muDecayPosZ pileup_muDecayPosR
musrTH2D hMuDecayMappileup_a "Pileup muon decay map;z (mm); x (mm)" 400 -300. 100. 400 -200. 200. pileup_muDecayPosZ pileup_muDecayPosX
musrTH1D hMuDecayPosZ "Penetration of muons into the sample;z (mm);N" 100 -5.0 5. muDecayPosZ
musrTH1D hMuDecayPosZpileup "Decay of the muons contributing to pileup bgr.;z[mm];N" 400 -300 100 pileup_muDecayPosZ
musrTH1D hMuDecayPosX "X of decayed muons;x[mm];N" 100 -5.0 5. muDecayPosX
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 hgen_time10  "generated muSR spectra;time[#mus];N" 220 -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 hdet_time10      "detected muSR spectra (phase shifted);time[#mus];N" 700 -2.0 12.0 det_time10
musrTH1D hdet_time10_Bgr  "detected muSR spectra (phase shifted);time[#mus];N" 700 -2.0 12.0 det_time10
musrTH1D hdet_time20      "detected muSR spectra (phase shifted);time[#mus];N" 700 -2.0 12.0 det_time20
musrTH1D hdet_time20_Bgr  "detected muSR spectra (phase shifted);time[#mus];N" 700 -2.0 12.0 det_time20
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 211 SampleCell 300 Holder 301 Holder 302 Holder 303 Holder 304 Holder 305 Holder 306 Holder 307 Holder 308 Holder 309 Holder 310 Holder 313 Holder 314 Holder 315 Holder 316 Holder 251 Col_Cu 255 Col_1 257 Col_1 261 Col_2 263 Col_2 265 Al_Plate 102 M0 103 M0Holder 1 BC 2 BC 11 FC 12 FC 13 FC -1 World 291 Magnet 292 Magnet 293 Al_Uprof 230 Elsewhere 231 Elsewhere 232 Elsewhere 233 Elsewhere  256 Elsewhere 262 Elsewhere 267 Elsewhere -1000 Escaped

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_F_det
condition 11 goodEvent_B_det
condition 12 goodEvent_F_det_AND_pileupEvent
condition 13 goodEvent_B_det_AND_pileupEvent

fit hdet_time20_Bgr pol0 WW  -1.9 -0.1 0 
fit hdet_time20 funct4 "" 0.2 9.8 0 0 0.3 100 0
fit hdet_time10 funct4 "" 0.05 9.95 0 0 0.3 100 0
fit hdet_time10_Bgr pol0 WW -1.95 -0.05 0 

#draw hMuDecayPosZ 0
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 hdet_time20 10
#draw hdet_time20 11
#draw hdet_time20_Bgr 10
#draw hdet_time20_Bgr 11
draw hgen_time10 7
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 6
draw hMuDecayDetIDpileup 9
draw humanDecayHistograms 1
draw humanDecayHistograms 6
draw humanDecayHistograms 9
draw humanDecayPileupHistograms 1
draw humanDecayPileupHistograms 6
draw humanDecayPileupHistograms 9
draw hdet_time20 4
draw hdet_time20 6
$
