Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
vpalladi
HgcTpgSim
Commits
ff2aea7f
Commit
ff2aea7f
authored
Dec 02, 2018
by
dauncey
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Lots of new stuff
parent
58a3450b
Changes
29
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
29 changed files
with
11386 additions
and
190 deletions
+11386
-190
doc/wup.pdf
doc/wup.pdf
+0
-0
doc/wup.tex
doc/wup.tex
+237
-0
interface/Coefficients.hh
interface/Coefficients.hh
+6
-0
interface/Particle.hh
interface/Particle.hh
+61
-2
interface/Point.hh
interface/Point.hh
+20
-11
interface/Point2D.hh
interface/Point2D.hh
+22
-1
interface/Scale2D.hh
interface/Scale2D.hh
+101
-0
interface/TH1FN.hh
interface/TH1FN.hh
+5
-0
interface/TH2R.hh
interface/TH2R.hh
+65
-0
interface/ThomasAnalysisBase.hh
interface/ThomasAnalysisBase.hh
+91
-0
interface/ThomasAnalysisCali.hh
interface/ThomasAnalysisCali.hh
+804
-0
interface/ThomasAnalysisFile.hh
interface/ThomasAnalysisFile.hh
+48
-0
interface/ThomasAnalysisGeom.hh
interface/ThomasAnalysisGeom.hh
+1090
-0
interface/ThomasAnalysisIo.hh
interface/ThomasAnalysisIo.hh
+435
-0
interface/ThomasAnalysisPion.hh
interface/ThomasAnalysisPion.hh
+2083
-0
interface/ThomasAnalysisPionSave.hh
interface/ThomasAnalysisPionSave.hh
+1426
-0
src/BlochPlot.cpp
src/BlochPlot.cpp
+120
-0
src/DaqDaqBuffer.cpp
src/DaqDaqBuffer.cpp
+973
-0
src/HepMCCheck.cpp
src/HepMCCheck.cpp
+578
-176
src/Rudolph.cpp
src/Rudolph.cpp
+201
-0
src/Seeder.cpp
src/Seeder.cpp
+320
-0
src/Thomas.cpp
src/Thomas.cpp
+563
-0
src/Thomas2.cpp
src/Thomas2.cpp
+285
-0
src/Thomas3.cpp
src/Thomas3.cpp
+382
-0
src/ThomasAnalysis.cpp
src/ThomasAnalysis.cpp
+96
-0
src/TpgDaqBuffer.cpp
src/TpgDaqBuffer.cpp
+980
-0
src/interrupts.cc
src/interrupts.cc
+91
-0
src/jet_writer.cpp
src/jet_writer.cpp
+161
-0
src/tfConverter.cpp
src/tfConverter.cpp
+142
-0
No files found.
doc/wup.pdf
View file @
ff2aea7f
No preview for this file type
doc/wup.tex
View file @
ff2aea7f
...
...
@@ -952,4 +952,241 @@ M_{00}^{-1}
+(2M
_{
01
}
M
_{
12
}
M
_{
02
}
-M
_{
00
}
M
_{
12
}^
2 -M
_{
11
}
M
_{
02
}^
2)/M
_{
22
}}
\end{eqnarray}
\section
{
2D interpolation
}
Using eight nearest neighbours around a central bin, then the
coefficients of a Taylor expansion to second order (which has six
coefficients) can be found using a fit. Specifically
\begin{eqnarray}
E(x,y)
&
=
&
E(0,0)
+
\left
.
\frac
{
\partial
E
}{
\partial
x
}
\right
|
_{
00
}
x
+
\left
.
\frac
{
\partial
E
}{
\partial
y
}
\right
|
_{
00
}
y
+
\left
.
\frac
{
\partial
^
2 E
}{
\partial
x
^
2
}
\right
|
_{
00
}
\frac
{
x
^
2
}{
2
}
+
\left
.
\frac
{
\partial
^
2 E
}{
\partial
x
\partial
y
}
\right
|
_{
00
}
xy
+
\left
.
\frac
{
\partial
^
2 E
}{
\partial
y
^
2
}
\right
|
_{
00
}
\frac
{
y
^
2
}{
2
}
\\
&
=
&
E
_
0 + E
_
x x + E
_
y y + E
_{
xx
}
x
^
2 + E
_{
xy
}
xy + E
_{
yy
}
y
^
2
\end{eqnarray}
The values in the eight bins at
$
x
$
and
$
y
$
within
$
\pm
1
$
of the central
bin are
\begin{eqnarray}
e(-1, 1) = e
_
1
&
=
&
E
_
0 - E
_
x + E
_
y + E
_{
xx
}
- E
_{
xy
}
+ E
_{
yy
}
\\
e( 0, 1) = e
_
2
&
=
&
E
_
0 + E
_
y + E
_{
yy
}
\\
e( 1, 1) = e
_
3
&
=
&
E
_
0 + E
_
x + E
_
y + E
_{
xx
}
+ E
_{
xy
}
+ E
_{
yy
}
\\
e(-1, 0) = e
_
4
&
=
&
E
_
0 - E
_
x + E
_{
xx
}
\\
e( 1, 0) = e
_
5
&
=
&
E
_
0 + E
_
x + E
_{
xx
}
\\
e(-1,-1) = e
_
6
&
=
&
E
_
0 - E
_
x - E
_
y + E
_{
xx
}
+ E
_{
xy
}
+ E
_{
yy
}
\\
e( 0,-1) = e
_
7
&
=
&
E
_
0 - E
_
y + E
_{
yy
}
\\
e( 1,-1) = e
_
8
&
=
&
E
_
0 + E
_
x - E
_
y + E
_{
xx
}
- E
_{
xy
}
+ E
_{
yy
}
\end{eqnarray}
so
\begin{eqnarray}
\begin{pmatrix}
e
_
1
\\
e
_
2
\\
e
_
3
\\
e
_
4
\\
e
_
5
\\
e
_
6
\\
e
_
7
\\
e
_
8
\end{pmatrix}
=
\begin{pmatrix}
\phantom
{
-
}
1
&
-1
&
\phantom
{
-
}
1
&
\phantom
{
-
}
1
&
-1
&
\phantom
{
-
}
1
\\
\phantom
{
-
}
1
&
\phantom
{
-
}
0
&
\phantom
{
-
}
1
&
\phantom
{
-
}
0
&
\phantom
{
-
}
0
&
\phantom
{
-
}
1
\\
\phantom
{
-
}
1
&
\phantom
{
-
}
1
&
\phantom
{
-
}
1
&
\phantom
{
-
}
1
&
\phantom
{
-
}
1
&
\phantom
{
-
}
1
\\
\phantom
{
-
}
1
&
-1
&
\phantom
{
-
}
0
&
\phantom
{
-
}
1
&
\phantom
{
-
}
0
&
\phantom
{
-
}
0
\\
\phantom
{
-
}
1
&
\phantom
{
-
}
1
&
\phantom
{
-
}
0
&
\phantom
{
-
}
1
&
\phantom
{
-
}
0
&
\phantom
{
-
}
0
\\
\phantom
{
-
}
1
&
-1
&
-1
&
\phantom
{
-
}
1
&
\phantom
{
-
}
1
&
\phantom
{
-
}
1
\\
\phantom
{
-
}
1
&
\phantom
{
-
}
0
&
-1
&
\phantom
{
-
}
0
&
\phantom
{
-
}
0
&
\phantom
{
-
}
1
\\
\phantom
{
-
}
1
&
\phantom
{
-
}
1
&
-1
&
\phantom
{
-
}
1
&
-1
&
\phantom
{
-
}
1
\end{pmatrix}
\begin{pmatrix}
E
_
0
\\
E
_
x
\\
E
_
y
\\
E
_{
xx
}
\\
E
_{
xy
}
\\
E
_{
yy
}
\end{pmatrix}
\end{eqnarray}
or
$
\underline
{
e
}
=
\underline
{
\underline
{
a
}}
\underline
{
E
}$
. The problem is then
to find
$
\underline
{
E
}$
given
$
\underline
{
e
}$
. This is an overconstrained
problem so a fit is required. Forming
\begin{eqnarray}
\chi
^
2 =
\sum
_{
k=1
}^
8
\left
(e
_
k -
\sum
_{
j=1
}^
6 a
_{
kj
}
E
_
j
\right
)
^
2
\end{eqnarray}
then
\begin{eqnarray}
\frac
{
\partial
\chi
^
2
}{
\partial
E
_
i
}
=
\sum
_{
k=1
}^
8
- 2
\left
(e
_
k -
\sum
_{
j=1
}^
6 a
_{
kj
}
E
_
j
\right
) a
_{
ki
}
\end{eqnarray}
and so for the minimum
$
\chi
^
2
$
\begin{eqnarray}
\sum
_{
j=1
}^
6
\sum
_{
k=1
}^
8 a
_{
ki
}
a
_{
kj
}
E
_
j
=
\sum
_{
k=1
}^
8 e
_
k a
_{
ki
}
\qquad\mbox
{
or
}
\qquad
\underline
{
\underline
{
a
}}^
T
\underline
{
\underline
{
a
}}
\underline
{
E
}
=
\underline
{
\underline
{
a
}}^
T
\underline
{
e
}
\end{eqnarray}
With
$
\underline
{
\underline
{
M
}}
=
\underline
{
\underline
{
a
}}^
T
\underline
{
\underline
{
a
}}$
, then
\begin{eqnarray}
\underline
{
E
}
=
\underline
{
\underline
{
M
}}^{
-1
}
\underline
{
\underline
{
a
}}^
T
\underline
{
e
}
\end{eqnarray}
gives the required solution. Using
$
\underline
{
\underline
{
a
}}$
above, then
\begin{eqnarray}
\underline
{
\underline
{
M
}}
&
=
&
\begin{pmatrix}
\phantom
{
-
}
1
&
\phantom
{
-
}
1
&
\phantom
{
-
}
1
&
\phantom
{
-
}
1
&
\phantom
{
-
}
1
&
\phantom
{
-
}
1
&
\phantom
{
-
}
1
&
\phantom
{
-
}
1
\\
-1
&
\phantom
{
-
}
0
&
\phantom
{
-
}
1
&
-1
&
\phantom
{
-
}
1
&
-1
&
\phantom
{
-
}
0
&
\phantom
{
-
}
1
\\
\phantom
{
-
}
1
&
\phantom
{
-
}
1
&
\phantom
{
-
}
1
&
\phantom
{
-
}
0
&
\phantom
{
-
}
0
&
-1
&
-1
&
-1
\\
\phantom
{
-
}
1
&
\phantom
{
-
}
0
&
\phantom
{
-
}
1
&
\phantom
{
-
}
1
&
\phantom
{
-
}
1
&
\phantom
{
-
}
1
&
\phantom
{
-
}
0
&
\phantom
{
-
}
1
\\
-1
&
\phantom
{
-
}
0
&
\phantom
{
-
}
1
&
\phantom
{
-
}
0
&
\phantom
{
-
}
0
&
\phantom
{
-
}
1
&
\phantom
{
-
}
0
&
-1
\\
\phantom
{
-
}
1
&
\phantom
{
-
}
1
&
\phantom
{
-
}
1
&
\phantom
{
-
}
0
&
\phantom
{
-
}
0
&
\phantom
{
-
}
1
&
\phantom
{
-
}
1
&
\phantom
{
-
}
1
\end{pmatrix}
\begin{pmatrix}
\phantom
{
-
}
1
&
-1
&
\phantom
{
-
}
1
&
\phantom
{
-
}
1
&
-1
&
\phantom
{
-
}
1
\\
\phantom
{
-
}
1
&
\phantom
{
-
}
0
&
\phantom
{
-
}
1
&
\phantom
{
-
}
0
&
\phantom
{
-
}
0
&
\phantom
{
-
}
1
\\
\phantom
{
-
}
1
&
\phantom
{
-
}
1
&
\phantom
{
-
}
1
&
\phantom
{
-
}
1
&
\phantom
{
-
}
1
&
\phantom
{
-
}
1
\\
\phantom
{
-
}
1
&
-1
&
\phantom
{
-
}
0
&
\phantom
{
-
}
1
&
\phantom
{
-
}
0
&
\phantom
{
-
}
0
\\
\phantom
{
-
}
1
&
\phantom
{
-
}
1
&
\phantom
{
-
}
0
&
\phantom
{
-
}
1
&
\phantom
{
-
}
0
&
\phantom
{
-
}
0
\\
\phantom
{
-
}
1
&
-1
&
-1
&
\phantom
{
-
}
1
&
\phantom
{
-
}
1
&
\phantom
{
-
}
1
\\
\phantom
{
-
}
1
&
\phantom
{
-
}
0
&
-1
&
\phantom
{
-
}
0
&
\phantom
{
-
}
0
&
\phantom
{
-
}
1
\\
\phantom
{
-
}
1
&
\phantom
{
-
}
1
&
-1
&
\phantom
{
-
}
1
&
-1
&
\phantom
{
-
}
1
\end{pmatrix}
\\
&
=
&
\begin{pmatrix}
\phantom
{
-
}
8
&
\phantom
{
-
}
0
&
\phantom
{
-
}
0
&
\phantom
{
-
}
6
&
\phantom
{
-
}
0
&
\phantom
{
-
}
6
\\
\phantom
{
-
}
0
&
\phantom
{
-
}
6
&
\phantom
{
-
}
0
&
\phantom
{
-
}
0
&
\phantom
{
-
}
0
&
\phantom
{
-
}
0
\\
\phantom
{
-
}
0
&
\phantom
{
-
}
0
&
\phantom
{
-
}
6
&
\phantom
{
-
}
0
&
\phantom
{
-
}
0
&
\phantom
{
-
}
0
\\
\phantom
{
-
}
6
&
\phantom
{
-
}
0
&
\phantom
{
-
}
0
&
\phantom
{
-
}
6
&
\phantom
{
-
}
0
&
\phantom
{
-
}
4
\\
\phantom
{
-
}
0
&
\phantom
{
-
}
0
&
\phantom
{
-
}
0
&
\phantom
{
-
}
0
&
\phantom
{
-
}
4
&
\phantom
{
-
}
0
\\
\phantom
{
-
}
6
&
\phantom
{
-
}
0
&
\phantom
{
-
}
0
&
\phantom
{
-
}
4
&
\phantom
{
-
}
0
&
\phantom
{
-
}
6
\end{pmatrix}
\end{eqnarray}
for which
\begin{eqnarray}
\underline
{
\underline
{
M
}}^{
-1
}
&
=
&
\begin{pmatrix}
\phantom
{
-
}
5/4
&
\phantom
{
-
}
0
&
\phantom
{
-
}
0
&
-3/4
&
\phantom
{
-
}
0
&
-3/4
\\
\phantom
{
-
}
0
&
\phantom
{
-
}
1/6
&
\phantom
{
-
}
0
&
\phantom
{
-
}
0
&
\phantom
{
-
}
0
&
\phantom
{
-
}
0
\\
\phantom
{
-
}
0
&
\phantom
{
-
}
0
&
\phantom
{
-
}
1/6
&
\phantom
{
-
}
0
&
\phantom
{
-
}
0
&
\phantom
{
-
}
0
\\
-3/4
&
\phantom
{
-
}
0
&
\phantom
{
-
}
0
&
\phantom
{
-
}
3/4
&
\phantom
{
-
}
0
&
\phantom
{
-
}
1/4
\\
\phantom
{
-
}
0
&
\phantom
{
-
}
0
&
\phantom
{
-
}
0
&
\phantom
{
-
}
0
&
\phantom
{
-
}
1/4
&
\phantom
{
-
}
0
\\
-3/4
&
\phantom
{
-
}
0
&
\phantom
{
-
}
0
&
\phantom
{
-
}
1/4
&
\phantom
{
-
}
0
&
\phantom
{
-
}
3/4
\end{pmatrix}
\end{eqnarray}
Hence
\begin{eqnarray}
\underline
{
\underline
{
M
}}^{
-1
}
\underline
{
\underline
{
a
}}^
T
&
=
&
\begin{pmatrix}
\phantom
{
-
}
5/4
&
\phantom
{
-
}
0
&
\phantom
{
-
}
0
&
-3/4
&
\phantom
{
-
}
0
&
-3/4
\\
\phantom
{
-
}
0
&
\phantom
{
-
}
1/6
&
\phantom
{
-
}
0
&
\phantom
{
-
}
0
&
\phantom
{
-
}
0
&
\phantom
{
-
}
0
\\
\phantom
{
-
}
0
&
\phantom
{
-
}
0
&
\phantom
{
-
}
1/6
&
\phantom
{
-
}
0
&
\phantom
{
-
}
0
&
\phantom
{
-
}
0
\\
-3/4
&
\phantom
{
-
}
0
&
\phantom
{
-
}
0
&
\phantom
{
-
}
3/4
&
\phantom
{
-
}
0
&
\phantom
{
-
}
1/4
\\
\phantom
{
-
}
0
&
\phantom
{
-
}
0
&
\phantom
{
-
}
0
&
\phantom
{
-
}
0
&
\phantom
{
-
}
1/4
&
\phantom
{
-
}
0
\\
-3/4
&
\phantom
{
-
}
0
&
\phantom
{
-
}
0
&
\phantom
{
-
}
1/4
&
\phantom
{
-
}
0
&
\phantom
{
-
}
3/4
\end{pmatrix}
\begin{pmatrix}
\phantom
{
-
}
1
&
\phantom
{
-
}
1
&
\phantom
{
-
}
1
&
\phantom
{
-
}
1
&
\phantom
{
-
}
1
&
\phantom
{
-
}
1
&
\phantom
{
-
}
1
&
\phantom
{
-
}
1
\\
-1
&
\phantom
{
-
}
0
&
\phantom
{
-
}
1
&
-1
&
\phantom
{
-
}
1
&
-1
&
\phantom
{
-
}
0
&
\phantom
{
-
}
1
\\
\phantom
{
-
}
1
&
\phantom
{
-
}
1
&
\phantom
{
-
}
1
&
\phantom
{
-
}
0
&
\phantom
{
-
}
0
&
-1
&
-1
&
-1
\\
\phantom
{
-
}
1
&
\phantom
{
-
}
0
&
\phantom
{
-
}
1
&
\phantom
{
-
}
1
&
\phantom
{
-
}
1
&
\phantom
{
-
}
1
&
\phantom
{
-
}
0
&
\phantom
{
-
}
1
\\
-1
&
\phantom
{
-
}
0
&
\phantom
{
-
}
1
&
\phantom
{
-
}
0
&
\phantom
{
-
}
0
&
\phantom
{
-
}
1
&
\phantom
{
-
}
0
&
-1
\\
\phantom
{
-
}
1
&
\phantom
{
-
}
1
&
\phantom
{
-
}
1
&
\phantom
{
-
}
0
&
\phantom
{
-
}
0
&
\phantom
{
-
}
1
&
\phantom
{
-
}
1
&
\phantom
{
-
}
1
\end{pmatrix}
\nonumber\\
&
=
&
\begin{pmatrix}
-1/4
&
\phantom
{
-
}
1/2
&
-1/4
&
\phantom
{
-
}
1/2
&
\phantom
{
-
}
1/2
&
-1/4
&
\phantom
{
-
}
1/2
&
-1/4
\\
-1/6
&
\phantom
{
-
}
0
&
\phantom
{
-
}
1/6
&
-1/6
&
\phantom
{
-
}
1/6
&
-1/6
&
\phantom
{
-
}
0
&
\phantom
{
-
}
1/6
\\
\phantom
{
-
}
1/6
&
\phantom
{
-
}
1/6
&
\phantom
{
-
}
1/6
&
\phantom
{
-
}
0
&
\phantom
{
-
}
0
&
-1/6
&
-1/6
&
-1/6
\\
\phantom
{
-
}
1/4
&
-1/2
&
\phantom
{
-
}
1/4
&
\phantom
{
-
}
0
&
\phantom
{
-
}
0
&
\phantom
{
-
}
1/4
&
-1/2
&
\phantom
{
-
}
1/4
\\
-1/4
&
\phantom
{
-
}
0
&
\phantom
{
-
}
1/4
&
\phantom
{
-
}
0
&
\phantom
{
-
}
0
&
\phantom
{
-
}
1/4
&
\phantom
{
-
}
0
&
-1/4
\\
\phantom
{
-
}
1/4
&
\phantom
{
-
}
0
&
\phantom
{
-
}
1/4
&
-1/2
&
-1/2
&
\phantom
{
-
}
1/4
&
\phantom
{
-
}
0
&
\phantom
{
-
}
1/4
\end{pmatrix}
\end{eqnarray}
Hence, the interpolation to the central bin is simply done by the first line of the above, i.e.
\begin{eqnarray}
E
_
0 =
\frac
{
e
_
2+e
_
4+e
_
5+e
_
7
}{
2
}
-
\frac
{
e
_
1+e
_
3+e
_
6+e
_
8
}{
4
}
\end{eqnarray}
where the first group are the horizonal and vertical nearest neighbours and
the second group are the diagonal nearest neighbours.
\section
{
Trigger rates
}
Consider a target fraction of BXs which trigger of
$
1
/
r
$
, so
$
r
$
is the
average number of BX between triggers. The fat BX period is
$
f
$
and the time multiplex period is
$
m
$
. For current assumptions,
$
1
/
r
=
750
/
40000
=
0
.
01875
$
so
$
r
=
53
.
33
$
, while
$
f
=
107
$
and
$
m
=
18
$
.
With a fat event prescale
$
s
$
, then for finite
$
s
$
the target fraction
must be maintained. Let
$
p
=
1
/
a
$
be the probability of a non-fat BX triggering.
Within one fat BX period, there is one fat BX and
$
f
-
1
$
non-fat BXs. The fat BX
can trigger due to the usual L1Accept or due to prescaling. The total
probability of it triggering is
\begin{eqnarray}
1 - (1- p)
\left
(1-
\frac
{
1
}{
s
}
\right
)
= p +
\frac
{
1
}{
s
}
-
\frac
{
p
}{
s
}
\end{eqnarray}
Hence the fraction of BXs which trigger is
\begin{eqnarray}
p
\frac
{
(f-1)
}{
f
}
+
\left
(p +
\frac
{
1
}{
s
}
-
\frac
{
p
}{
s
}
\right
)
\frac
{
1
}{
f
}
= p +
\frac
{
1-p
}{
sf
}
\end{eqnarray}
which must be
$
1
/
r
$
. Hence
\begin{eqnarray}
\frac
{
f
}{
r
}
= p
\left
[f - \frac{1}{s}\right]
+
\frac
{
1
}{
s
}
\end{eqnarray}
and so
\begin{eqnarray}
p =
\frac
{
1
}{
a
}
=
\frac
{
f/r - 1/s
}{
f - 1/s
}
\end{eqnarray}
Clearly for
$
s
=
\infty
$
then
$
p
=
1
/
a
=
1
/
r
$
as expected. Note, this requires
$
f > r
$
for values of the prescale down to
$
s
=
1
$
; i.e. the fat BX period must
not be less than the average number of BXs between triggers for a prescale of
one. Note also that the above is independent of any time multiplexing.
Considering time multiplexing, the assuming the fat BX period is a prime, then
the repetition period is
$
mf
$
BXs long. Within this time, there are
$
m
$
fat
BXs and
$
f
$
time multiplex BXs. Of these, one BX is both fat and time
multiplexed, so there are
$
m
-
1
$
fat BXs which are not time multiplexed and
$
f
-
1
$
time multiplexed BXs which are not fat. The remainder, which is
\begin{eqnarray}
mf -(m-1)-(f-1)-1 = mf-m-f+1 = m(f-1)-(f-1) = (m-1)(f-1)
\end{eqnarray}
are normal BXs. The number of the
$
mf
$
BXs which trigger is
\begin{eqnarray}
(p + 1/s - p/s)
\frac
{
1
}{
mf
}
,
\quad
(p + 1/s - p/s)
\frac
{
m-1
}{
mf
}
,
\quad
p
\frac
{
f-1
}{
mf
}
,
\quad
p
\frac
{
(m-1)(f-1)
}{
mf
}
\end{eqnarray}
On a TPG time multiplexing board which handles all L1Accepts but only saves
non-trivial data for time multiplexed BXs, then the second and fourth
categories are treated as normal L1Accepts, with a total fraction of
\begin{eqnarray}
F
_
0
&
=
&
(p + 1/s - p/s)
\frac
{
m-1
}{
mf
}
+ p
\frac
{
(m-1)(f-1)
}{
mf
}
= p
\frac
{
(m-1)+(m-1)(f-1)
}{
mf
}
+
\frac
{
(1-p)
}{
s
}
\frac
{
(m-1)
}{
mf
}
\\
&
=
&
p
\frac
{
(m-1)f
}{
mf
}
+
\frac
{
(1-p)
}{
s
}
\frac
{
(m-1)
}{
mf
}
= p
\frac
{
m-1
}{
m
}
+
\frac
{
(1-p)
}{
s
}
\frac
{
(m-1)
}{
mf
}
\end{eqnarray}
The time multiplexed events have a fraction
\begin{eqnarray}
F
_
1 = p
\frac
{
f-1
}{
mf
}
\end{eqnarray}
and the fat time multiplexed events have a fraction
\begin{eqnarray}
F
_
2 = (p + 1/s - p/s)
\frac
{
1
}{
mf
}
\end{eqnarray}
To check, the total fraction is
\begin{eqnarray}
F
_
0+F
_
1+F
_
2
&
=
&
p
\frac
{
m-1
}{
m
}
+
\frac
{
(1-p)
}{
s
}
\frac
{
(m-1)
}{
mf
}
+p
\frac
{
f-1
}{
mf
}
+(p + 1/s - p/s)
\frac
{
1
}{
mf
}
\\
&
=
&
\frac
{
1
}{
mf
}
\left
[pf(m-1)+
\frac
{
(1-p)(m-1)
}{
s
}
+ p(f-1)
+ p +
\frac
{
1
}{
s
}
-
\frac
{
p
}{
s
}
\right
]
\\
&
=
&
\frac
{
1
}{
mf
}
\left
[pfm
+
\frac
{
1
}{
s
}
\left
(1+(1-p)(m-1) - p
\right
)
\right
]
\\
&
=
&
p +
\frac
{
m(1-p)
}{
smf
}
= p +
\frac
{
(1-p)
}{
sf
}
\end{eqnarray}
as shown above. For the assumption numbers gives previously and
$
s
=
1
$
, then
\begin{eqnarray}
p = 0.009493,
\quad
F
_
0 = 0.01771
\quad
F
_
1 = 0.0005225,
\quad
F
_
2 = 0.0005192
\end{eqnarray}
which in terms of rate in kHz are
\begin{eqnarray}
R
_
0 = 708.333,
\quad
R
_
1 = 20.898,
\quad
R
_
2 = 20.768
\end{eqnarray}
\end{document}
interface/Coefficients.hh
View file @
ff2aea7f
...
...
@@ -199,6 +199,12 @@ public:
return
(
fErg
/
fNum
)
-
sum
*
fCoe
;
}
double
energy
(
const
double
*
p
)
{
TVectorD
v
(
kNumberOfLayers
);
for
(
unsigned
i
(
0
);
i
<
kNumberOfLayers
;
i
++
)
v
(
i
)
=
p
[
i
];
return
energy
(
v
);
}
double
energy
(
const
TVectorD
&
p
)
const
{
assert
(
p
.
GetNrows
()
==
kNumberOfLayers
);
...
...
interface/Particle.hh
View file @
ff2aea7f
...
...
@@ -94,6 +94,12 @@ public:
fFourP
=
TLorentzVector
(
p4
.
x
(),
p4
.
y
(),
p4
.
z
(),
p4
.
e
()
);
if
(
fPdgId
==
22
||
abs
(
fPdgId
)
==
12
||
abs
(
fPdgId
)
==
14
||
abs
(
fPdgId
)
==
16
)
fMass
=
0.0
;
else
{
fMass
=
p4
.
m
();
//if(fMass<0.0005)
//std::cout << "PDG = " << fPdgId << ", mass = " << fMass << std::endl;
}
}
Particle
(
int
pdg
,
double
px
,
double
py
,
double
pz
)
:
pGenParticle
(
0
)
{
...
...
@@ -113,6 +119,10 @@ public:
return
fPdgId
;
}
int
particleCharge
()
const
{
return
charge
(
fPdgId
);
}
Point
position
()
const
{
return
fPosition
;
}
...
...
@@ -121,6 +131,10 @@ public:
return
fMomentum
;
}
double
energy
()
const
{
return
sqrt
(
fMomentum
.
rSquared
()
+
fMass
*
fMass
);
}
TLorentzVector
FourP
()
const
{
return
fFourP
;
}
...
...
@@ -137,6 +151,50 @@ public:
return
fTrgC3d
;
}
Particle
projectBarrel
(
double
b
)
const
{
BACKTRACE_AND_ASSERT
(
b
>
0.0
);
Particle
p
;
int
q
(
charge
(
fPdgId
));
if
(
q
==
0
)
{
double
r02
(
fPosition
.
rhoSquared
());
BACKTRACE_AND_ASSERT
(
b
*
b
>
r02
);
double
r0DotP
(
fPosition
.
x
()
*
fMomentum
.
x
()
+
fPosition
.
y
()
*
fMomentum
.
y
());
double
l
((
-
r0DotP
+
sqrt
(
r0DotP
+
fMomentum
.
rhoSquared
()
*
(
b
*
b
-
r02
)))
/
fMomentum
.
rhoSquared
());
p
.
pGenParticle
=
pGenParticle
;
p
.
fPdgId
=
fPdgId
;
p
.
fPosition
=
fPosition
+
(
fMomentum
*
l
);
p
.
fMomentum
=
fMomentum
;
p
.
fFourP
=
fFourP
;
}
else
{
double
phiLimit
(
acos
(
-
1.0
)
*
q
*
fBField
*
b
/
fMomentum
.
rho
());
Point2D
rxy
;
for
(
unsigned
i
(
0
);
i
<
100
;
i
++
)
{
double
dPhi
(
0.01
*
(
i
+
1
)
*
phiLimit
);
rxy
.
x
(
fPosition
.
x
()
+
(
fMomentum
.
x
()
*
sin
(
dPhi
)
+
fMomentum
.
y
()
*
(
1.0
-
cos
(
dPhi
)))
/
(
q
*
fBField
));
rxy
.
y
(
fPosition
.
y
()
+
(
fMomentum
.
y
()
*
sin
(
dPhi
)
-
fMomentum
.
x
()
*
(
1.0
-
cos
(
dPhi
)))
/
(
q
*
fBField
));
if
(
rxy
.
rho
()
>
b
)
{
p
.
pGenParticle
=
pGenParticle
;
p
.
fPdgId
=
fPdgId
;
p
.
fPosition
.
setXY
(
rxy
.
x
(),
rxy
.
y
());
p
.
fPosition
.
z
(
fPosition
.
z
()
+
fMomentum
.
z
()
*
dPhi
/
(
q
*
fBField
));
double
px
(
fMomentum
.
x
()
*
cos
(
dPhi
)
+
fMomentum
.
y
()
*
sin
(
dPhi
));
double
py
(
fMomentum
.
y
()
*
cos
(
dPhi
)
-
fMomentum
.
x
()
*
sin
(
dPhi
));
p
.
fMomentum
=
Point
(
px
,
py
,
fMomentum
.
z
());
p
.
fFourP
.
SetX
(
p
.
fMomentum
.
x
());
p
.
fFourP
.
SetY
(
p
.
fMomentum
.
y
());
p
.
fFourP
.
SetZ
(
p
.
fMomentum
.
z
());
return
p
;
}
}
}
return
p
;
}
Particle
project
(
double
z
)
const
{
Particle
p
;
p
.
pGenParticle
=
pGenParticle
;
...
...
@@ -162,8 +220,8 @@ public:
*/
p
.
fMomentum
=
fMomentum
;
p
.
fFourP
=
fFourP
;
}
else
{
double
dPhi
(
dz
*
q
*
fBField
/
fMomentum
.
z
());
...
...
@@ -202,7 +260,8 @@ private:
int
fPdgId
;
Point
fPosition
;
Point
fMomentum
;
double
fMass
;
TLorentzVector
fFourP
;
TrgC3d
*
fTrgC3d
;
...
...
interface/Point.hh
View file @
ff2aea7f
...
...
@@ -4,7 +4,7 @@
#include <iostream>
#include <cstdint>
#include "
Point
2D.hh"
#include "
Scale
2D.hh"
class
Point
:
public
Point2D
{
public:
...
...
@@ -27,8 +27,12 @@ public:
return
fZ
;
}
double
rSquared
()
const
{
return
fX
*
fX
+
fY
*
fY
+
fZ
*
fZ
;
}
double
r
()
const
{
return
sqrt
(
fX
*
fX
+
fY
*
fY
+
fZ
*
fZ
);
return
sqrt
(
rSquared
()
);
}
double
cosTheta
()
const
{
...
...
@@ -47,8 +51,9 @@ public:
return
asinh
(
z
()
/
rho
());
}
Point2D
scale
()
const
{
return
Point2D
(
fX
/
fZ
,
fY
/
fZ
);
Point2D
scale
(
bool
absZ
=
false
)
const
{
if
(
absZ
)
return
Scale2D
(
fX
/
fabs
(
fZ
),
fY
/
fabs
(
fZ
));
return
Scale2D
(
fX
/
fZ
,
fY
/
fZ
);
}
void
flipEndcap
()
{
...
...
@@ -56,7 +61,11 @@ public:
fZ
=-
fZ
;
}
double
deltaR
(
const
Point
&
p
)
{
void
z
(
double
d
)
{
fZ
=
d
;
}
double
deltaR
(
const
Point
&
p
)
const
{
double
dEta
(
eta
()
-
p
.
eta
());
double
dPhi
(
phi
()
-
p
.
phi
());
...
...
@@ -67,7 +76,7 @@ public:
return
sqrt
(
dEta
*
dEta
+
dPhi
*
dPhi
);
}
Point
operator
+
(
const
Point2D
&
xy
)
{
Point
operator
+
(
const
Point2D
&
xy
)
const
{
return
Point
(
fX
+
xy
.
x
(),
fY
+
xy
.
y
(),
fZ
);
}
...
...
@@ -76,7 +85,7 @@ public:
fY
+=
xy
.
y
();
}
Point
operator
+
(
const
Point
&
p
)
{
Point
operator
+
(
const
Point
&
p
)
const
{
return
Point
(
fX
+
p
.
x
(),
fY
+
p
.
y
(),
fZ
+
p
.
fZ
);
}
...
...
@@ -86,7 +95,7 @@ public:
fZ
+=
p
.
z
();
}
Point
operator
-
(
const
Point2D
&
xy
)
{
Point
operator
-
(
const
Point2D
&
xy
)
const
{
return
Point
(
fX
-
xy
.
x
(),
fY
-
xy
.
y
(),
fZ
);
}
...
...
@@ -95,7 +104,7 @@ public:
fY
-=
xy
.
y
();
}
Point
operator
-
(
const
Point
&
p
)
{
Point
operator
-
(
const
Point
&
p
)
const
{
return
Point
(
fX
-
p
.
x
(),
fY
-
p
.
y
(),
fZ
-
p
.
fZ
);
}
...
...
@@ -105,7 +114,7 @@ public:
fZ
-=
p
.
z
();
}
Point
operator
*
(
const
double
&
d
)
{
Point
operator
*
(
const
double
&
d
)
const
{
return
Point
(
fX
*
d
,
fY
*
d
,
fZ
*
d
);
}
...
...
@@ -115,7 +124,7 @@ public:
fZ
*=
d
;
}
Point
operator
/
(
const
double
&
d
)
{
Point
operator
/
(
const
double
&
d
)
const
{
return
Point
(
fX
/
d
,
fY
/
d
,
fZ
/
d
);
}
...
...
interface/Point2D.hh
View file @
ff2aea7f
...
...
@@ -5,6 +5,8 @@
#include <cstdint>
#include <cmath>
#include "Backtrace.hh"
class
Point2D
{
public:
Point2D
()
...
...
@@ -17,6 +19,11 @@ public:
~
Point2D
()
{
}
void
zero
()
{
fX
=
0.0
;
fY
=
0.0
;
}
void
x
(
double
d
)
{
fX
=
d
;
...
...
@@ -36,6 +43,12 @@ public:
fY
=
r
*
sin
(
f
);
}
void
setRS
(
double
r
,
double
s
)
{
BACKTRACE_AND_ASSERT
(
r
>
0.0
);
fX
=
r
*
cos
(
s
/
r
);
fY
=
r
*
sin
(
s
/
r
);
}
double
x
()
const
{
return
fX
;
}
...
...
@@ -44,8 +57,12 @@ public:
return
fY
;
}
double
rhoSquared
()
const
{
return
fX
*
fX
+
fY
*
fY
;
}
double
rho
()
const
{
return
sqrt
(
fX
*
fX
+
fY
*
fY
);
return
sqrt
(
rhoSquared
()
);
}
double
phi
(
bool
positiveRange
=
false
)
const
{
...
...
@@ -54,6 +71,10 @@ public:
return
f
;
}
double
s
()
const
{
return
rhoPhi
();
}
double
rhoPhi
()
const
{
return
rho
()
*
phi
();
}
...
...
interface/Scale2D.hh
0 → 100644
View file @
ff2aea7f
#ifndef Scale2D_HH
#define Scale2D_HH
#include <iostream>
#include <cstdint>
#include "Point2D.hh"
class
Scale2D
:
public
Point2D
{
public:
Scale2D
()
:
Point2D
()
{
}
Scale2D
(
double
x
,
double
y
)
:
Point2D
(
x
,
y
)
{
}
Scale2D
(
const
Point2D
&
xy
)
:
Point2D
(
xy
)
{
}
~
Scale2D
()
{
}
double
r
()
const
{
return
sqrt
(
rhoSquared
()
+
1.0
);
}
double
cosTheta
()
const
{
return
1.0
/
r
();
}
double
sinTheta
()
const
{
return
rho
()
/
r
();
}
double
tanTheta
()
const
{
return
rho
();
}
double
eta
()
const
{
return
asinh
(
1.0
/
rho
());
}
double
deltaR
(
const
Scale2D
&
p
)
{
double
dEta
(
eta
()
-
p
.
eta
());
double
dPhi
(
phi
()
-
p
.
phi
());
double
pi
(
acos
(
-
1.0
));
if
(
dPhi
<-
pi
)
dPhi
+=
2.0
*
pi
;
else
if
(
dPhi
>
pi
)
dPhi
-=
2.0
*
pi
;
return
sqrt
(
dEta
*
dEta
+
dPhi
*
dPhi
);
}
Scale2D
operator
+
(
const
Scale2D
&
xy
)
const
{
return
Scale2D
(
fX
+
xy
.
x
(),
fY
+
xy
.
y
());
}
void
operator
+=
(
const
Scale2D
&
xy
)
{
fX
+=
xy
.
x
();
fY
+=
xy
.
y
();
}
Scale2D
operator
-
(
const
Scale2D
&
xy
)
const
{
return
Scale2D
(
fX
-
xy
.
x
(),
fY
-
xy
.
y
());
}
void
operator
-=
(
const
Scale2D
&
xy
)
{
fX
-=
xy
.
x
();
fY
-=
xy
.
y
();
}
Scale2D
operator
*
(
const
double
&
d
)
const
{
return
Scale2D
(
fX
*
d
,
fY
*
d
);
}
void
operator
*=
(
const
double
&
d
)
{
fX
*=
d
;
fY
*=
d
;
}