Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Corryvreckan
Corryvreckan
Commits
80bae02b
Commit
80bae02b
authored
Nov 16, 2017
by
Daniel Hynds
Browse files
new formatting
parent
94229c5b
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/algorithms/DUTAnalysis/DUTAnalysis.cpp
View file @
80bae02b
#include "DUTAnalysis.h"
#include "objects/Cluster.h"
#include "objects/Pixel.h"
#include "objects/MCParticle.h"
#include "objects/Pixel.h"
#include "objects/SpidrSignal.h"
#include "objects/Track.h"
...
...
@@ -42,10 +42,10 @@ void DUTAnalysis::initialise() {
hUnassociatedTracksGlobalPosition
=
new
TH2F
(
"hUnassociatedTracksGlobalPosition"
,
"hUnassociatedTracksGlobalPosition"
,
200
,
-
10
,
10
,
200
,
-
10
,
10
);
if
(
m_useMCtruth
){
residualsXMCtruth
=
new
TH1F
(
"residualsXMCtruth"
,
"residualsXMCtruth"
,
400
,
-
0.2
,
0.2
);
}
if
(
m_useMCtruth
)
{
residualsXMCtruth
=
new
TH1F
(
"residualsXMCtruth"
,
"residualsXMCtruth"
,
400
,
-
0.2
,
0.2
);
}
// Initialise member variables
m_eventNumber
=
0
;
m_nAlignmentClusters
=
0
;
...
...
@@ -128,10 +128,10 @@ StatusCode DUTAnalysis::run(Clipboard* clipboard) {
}
// Get the MC particles from the clipboard
MCParticles
*
mcParticles
=
(
MCParticles
*
)
clipboard
->
get
(
m_DUT
,
"mcparticles"
);
if
(
mcParticles
==
NULL
)
{
LOG
(
DEBUG
)
<<
"No DUT MC particles on the clipboard"
;
}
MCParticles
*
mcParticles
=
(
MCParticles
*
)
clipboard
->
get
(
m_DUT
,
"mcparticles"
);
if
(
mcParticles
==
NULL
)
{
LOG
(
DEBUG
)
<<
"No DUT MC particles on the clipboard"
;
}
// Loop over all tracks
bool
first_track
=
true
;
...
...
@@ -251,23 +251,26 @@ StatusCode DUTAnalysis::run(Clipboard* clipboard) {
hAssociatedTracksGlobalPosition
->
Fill
(
globalIntercept
.
X
(),
globalIntercept
.
Y
());
// Get associated MC particle info and plot
if
(
m_useMCtruth
){
if
(
mcParticles
==
nullptr
)
continue
;
// Find the closest MC particle
double
smallestDistance
(
DBL_MAX
);
ROOT
::
Math
::
XYZPoint
particlePosition
;
for
(
auto
&
particle
:
(
*
mcParticles
))
{
ROOT
::
Math
::
XYZPoint
entry
=
particle
->
getLocalStart
();
ROOT
::
Math
::
XYZPoint
exit
=
particle
->
getLocalEnd
();
ROOT
::
Math
::
XYZPoint
centre
(
(
entry
.
X
()
+
exit
.
X
())
/
2.
,
(
entry
.
Y
()
+
exit
.
Y
())
/
2.
,
(
entry
.
Z
()
+
exit
.
Z
())
/
2.
);
double
distance
=
sqrt
(
(
centre
.
X
()
-
cluster
->
localX
())
*
(
centre
.
X
()
-
cluster
->
localX
())
+
(
centre
.
Y
()
-
cluster
->
localY
())
*
(
centre
.
Y
()
-
cluster
->
localY
())
);
if
(
distance
<
smallestDistance
){
particlePosition
.
SetXYZ
(
centre
.
X
(),
centre
.
Y
(),
centre
.
Z
());
if
(
m_useMCtruth
)
{
if
(
mcParticles
==
nullptr
)
continue
;
// Find the closest MC particle
double
smallestDistance
(
DBL_MAX
);
ROOT
::
Math
::
XYZPoint
particlePosition
;
for
(
auto
&
particle
:
(
*
mcParticles
))
{
ROOT
::
Math
::
XYZPoint
entry
=
particle
->
getLocalStart
();
ROOT
::
Math
::
XYZPoint
exit
=
particle
->
getLocalEnd
();
ROOT
::
Math
::
XYZPoint
centre
(
(
entry
.
X
()
+
exit
.
X
())
/
2.
,
(
entry
.
Y
()
+
exit
.
Y
())
/
2.
,
(
entry
.
Z
()
+
exit
.
Z
())
/
2.
);
double
distance
=
sqrt
((
centre
.
X
()
-
cluster
->
localX
())
*
(
centre
.
X
()
-
cluster
->
localX
())
+
(
centre
.
Y
()
-
cluster
->
localY
())
*
(
centre
.
Y
()
-
cluster
->
localY
()));
if
(
distance
<
smallestDistance
)
{
particlePosition
.
SetXYZ
(
centre
.
X
(),
centre
.
Y
(),
centre
.
Z
());
}
}
}
residualsXMCtruth
->
Fill
(
cluster
->
localX
()
-
particlePosition
.
X
());
}
residualsXMCtruth
->
Fill
(
cluster
->
localX
()
-
particlePosition
.
X
());
}
// Fill power pulsing response
if
((
m_shutterOpenTime
!=
0
&&
m_shutterCloseTime
==
0
)
||
(
m_shutterOpenTime
!=
0
&&
...
...
src/algorithms/DUTAnalysis/DUTAnalysis.h
View file @
80bae02b
...
...
@@ -34,7 +34,7 @@ namespace corryvreckan {
TH2F
*
clusterToTVersusTime
;
TH2F
*
residualsTimeVsTime
;
TH1F
*
residualsXMCtruth
;
TH1F
*
residualsXMCtruth
;
TH2F
*
hAssociatedTracksGlobalPosition
;
TH2F
*
hUnassociatedTracksGlobalPosition
;
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment