Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Corryvreckan
Corryvreckan
Commits
89cb0f61
Commit
89cb0f61
authored
Jul 03, 2018
by
Simon Spannagel
Browse files
Merge branch 'master' into documentation
parents
3d6e9b6e
957827d5
Changes
5
Hide whitespace changes
Inline
Side-by-side
src/core/detector/Detector.cpp
View file @
89cb0f61
...
...
@@ -31,6 +31,10 @@ Detector::Detector(const Configuration& config) {
auto
npixels
=
config
.
get
<
ROOT
::
Math
::
DisplacementVector2D
<
Cartesian2D
<
int
>>>
(
"number_of_pixels"
);
// Size of the pixels
m_pitch
=
config
.
get
<
ROOT
::
Math
::
XYVector
>
(
"pixel_pitch"
);
// Intrinsic position resolution, defaults to 4um:
m_resolution
=
config
.
get
<
ROOT
::
Math
::
XYVector
>
(
"resolution"
,
ROOT
::
Math
::
XYVector
(
0.004
,
0.004
));
m_detectorName
=
config
.
getName
();
if
(
Units
::
convert
(
m_pitch
.
X
(),
"mm"
)
>=
1
or
Units
::
convert
(
m_pitch
.
Y
(),
"mm"
)
>=
1
or
...
...
@@ -165,6 +169,9 @@ Configuration Detector::getConfiguration() {
// Size of the pixels
config
.
set
(
"pixel_pitch"
,
m_pitch
,
{
"um"
});
// Intrinsic resolution:
config
.
set
(
"resolution"
,
m_resolution
,
{
"um"
});
if
(
m_timingOffset
!=
0.
)
{
config
.
set
(
"time_offset"
,
m_timingOffset
,
{
"ns"
,
"us"
,
"ms"
,
"s"
});
}
...
...
src/core/detector/Detector.hpp
View file @
89cb0f61
...
...
@@ -43,6 +43,7 @@ namespace corryvreckan {
ROOT
::
Math
::
XYVector
size
()
{
return
ROOT
::
Math
::
XYVector
(
m_pitch
.
X
()
*
m_nPixelsX
,
m_pitch
.
Y
()
*
m_nPixelsY
);
}
ROOT
::
Math
::
XYVector
pitch
()
{
return
m_pitch
;
}
ROOT
::
Math
::
XYVector
resolution
()
{
return
m_resolution
;
}
int
nPixelsX
()
{
return
m_nPixelsX
;
}
int
nPixelsY
()
{
return
m_nPixelsY
;
}
...
...
@@ -112,6 +113,7 @@ namespace corryvreckan {
std
::
string
m_detectorType
;
std
::
string
m_detectorName
;
ROOT
::
Math
::
XYVector
m_pitch
;
ROOT
::
Math
::
XYVector
m_resolution
;
int
m_nPixelsX
;
int
m_nPixelsY
;
double
m_timingOffset
;
...
...
src/modules/SpatialClustering/SpatialClustering.cpp
View file @
89cb0f61
...
...
@@ -199,8 +199,10 @@ void SpatialClustering::calculateClusterCentre(Detector* detector, Cluster* clus
cluster
->
setRow
(
row
);
cluster
->
setColumn
(
column
);
cluster
->
setTot
(
tot
);
cluster
->
setErrorX
(
0.004
);
cluster
->
setErrorY
(
0.004
);
// Set uncertainty on position from intrinstic detector resolution:
cluster
->
setError
(
detector
->
resolution
());
cluster
->
setDetectorID
(
detectorID
);
cluster
->
setClusterCentre
(
positionGlobal
.
X
(),
positionGlobal
.
Y
(),
positionGlobal
.
Z
());
cluster
->
setClusterCentreLocal
(
positionLocal
.
X
(),
positionLocal
.
Y
(),
positionLocal
.
Z
());
...
...
src/modules/Timepix3Clustering/Timepix3Clustering.cpp
View file @
89cb0f61
...
...
@@ -214,8 +214,10 @@ void Timepix3Clustering::calculateClusterCentre(Cluster* cluster) {
cluster
->
setRow
(
row
);
cluster
->
setColumn
(
column
);
cluster
->
setTot
(
tot
);
cluster
->
setErrorX
(
0.004
);
cluster
->
setErrorY
(
0.004
);
// Set uncertainty on position from intrinstic detector resolution:
cluster
->
setError
(
detector
->
resolution
());
cluster
->
setTimestamp
(
timestamp
);
cluster
->
setDetectorID
(
detectorID
);
cluster
->
setClusterCentre
(
positionGlobal
.
X
(),
positionGlobal
.
Y
(),
positionGlobal
.
Z
());
...
...
src/objects/Cluster.h
View file @
89cb0f61
#ifndef CLUSTER_H
#define CLUSTER_H 1
#include <Math/Point3D.h>
#include <Math/Vector2D.h>
#include <iostream>
#include "Math/Point3D.h"
#include "Pixel.h"
/*
...
...
@@ -29,8 +30,7 @@ namespace corryvreckan {
Cluster
(
Cluster
*
cluster
)
{
m_global
=
cluster
->
global
();
m_local
=
cluster
->
local
();
m_error_x
=
cluster
->
errorX
();
m_error_y
=
cluster
->
errorY
();
m_error
=
ROOT
::
Math
::
XYVector
(
cluster
->
errorX
(),
cluster
->
errorY
());
m_detectorID
=
cluster
->
detectorID
();
m_timestamp
=
cluster
->
timestamp
();
m_columnWidth
=
cluster
->
columnWidth
();
...
...
@@ -56,9 +56,9 @@ namespace corryvreckan {
double
row
()
{
return
m_row
;
}
double
column
()
{
return
m_column
;
}
double
tot
()
{
return
m_tot
;
}
double
error
()
{
return
sqrt
(
m_error
_x
*
m_error
_x
+
m_error
_y
*
m_error
_y
);
}
double
errorX
()
{
return
m_error
_x
;
}
double
errorY
()
{
return
m_error
_y
;
}
double
error
()
{
return
sqrt
(
m_error
.
X
()
*
m_error
.
X
()
+
m_error
.
Y
()
*
m_error
.
Y
()
);
}
double
errorX
()
{
return
m_error
.
X
()
;
}
double
errorY
()
{
return
m_error
.
Y
()
;
}
bool
isSplit
()
{
return
m_split
;
}
void
setSplit
(
bool
split
)
{
m_split
=
split
;
}
...
...
@@ -107,8 +107,9 @@ namespace corryvreckan {
m_local
.
SetY
(
y
);
m_local
.
SetZ
(
z
);
}
void
setErrorX
(
double
error
)
{
m_error_x
=
error
;
}
void
setErrorY
(
double
error
)
{
m_error_y
=
error
;
}
void
setErrorX
(
double
error
)
{
m_error
.
SetX
(
error
);
}
void
setErrorY
(
double
error
)
{
m_error
.
SetY
(
error
);
}
void
setError
(
ROOT
::
Math
::
XYVector
error
)
{
m_error
=
error
;
}
private:
// Member variables
...
...
@@ -116,8 +117,7 @@ namespace corryvreckan {
double
m_row
;
double
m_column
;
double
m_tot
;
double
m_error_x
;
double
m_error_y
;
ROOT
::
Math
::
XYVector
m_error
;
double
m_columnWidth
;
double
m_rowWidth
;
bool
m_split
;
...
...
@@ -129,7 +129,7 @@ namespace corryvreckan {
std
::
map
<
int
,
bool
>
m_columnHits
;
// ROOT I/O class definition - update version number when you change this class!
ClassDef
(
Cluster
,
6
)
ClassDef
(
Cluster
,
7
)
};
// Vector type declaration
...
...
Write
Preview
Markdown
is supported
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