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
5b093f50
Commit
5b093f50
authored
Nov 16, 2017
by
Simon Spannagel
Browse files
Merge branch 'master' into 'master'
formatting and misc See merge request
!9
parents
5bec5161
f05ba499
Pipeline
#240158
passed with stages
in 4 minutes and 58 seconds
Changes
34
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
src/algorithms/ATLASpixEventLoader/ATLASpixEventLoader.h
View file @
5b093f50
...
...
@@ -44,5 +44,5 @@ namespace corryvreckan {
TH1F
*
hPixelToT
;
TH1F
*
hPixelsPerFrame
;
};
}
}
// namespace corryvreckan
#endif // ATLASpixEventLoader_H
src/algorithms/Alignment/Alignment.h
View file @
5b093f50
...
...
@@ -41,5 +41,5 @@ namespace corryvreckan {
std
::
map
<
std
::
string
,
TGraph
*>
align_correction_rotY
;
std
::
map
<
std
::
string
,
TGraph
*>
align_correction_rotZ
;
};
}
}
// namespace corryvreckan
#endif // ALIGNMENT_H
src/algorithms/BasicTracking/BasicTracking.h
View file @
5b093f50
...
...
@@ -50,5 +50,5 @@ namespace corryvreckan {
int
minHitsOnTrack
;
bool
excludeDUT
;
};
}
}
// namespace corryvreckan
#endif // BASICTRACKING_H
src/algorithms/CLICpixEventLoader/CLICpixEventLoader.h
View file @
5b093f50
...
...
@@ -37,5 +37,5 @@ namespace corryvreckan {
TH1F
*
hShutterLength
;
TH1F
*
hPixelsPerFrame
;
};
}
}
// namespace corryvreckan
#endif // CLICpixEventLoader_H
src/algorithms/Clicpix2Correlator/Clicpix2Correlator.h
View file @
5b093f50
...
...
@@ -35,5 +35,5 @@ namespace corryvreckan {
std
::
map
<
std
::
string
,
TH1F
*>
hTrackDiffX
;
std
::
map
<
std
::
string
,
TH1F
*>
hTrackDiffY
;
};
}
}
// namespace corryvreckan
#endif // Clicpix2Correlator_H
src/algorithms/Clicpix2EventLoader/Clicpix2EventLoader.h
View file @
5b093f50
...
...
@@ -43,5 +43,5 @@ namespace corryvreckan {
TH1F
*
hPixelToT
;
TH1F
*
hPixelsPerFrame
;
};
}
}
// namespace corryvreckan
#endif // Clicpix2EventLoader_H
src/algorithms/ClicpixAnalysis/ClicpixAnalysis.h
View file @
5b093f50
...
...
@@ -126,5 +126,5 @@ namespace corryvreckan {
double
m_lostHits
;
bool
timepix3Telescope
;
};
}
}
// namespace corryvreckan
#endif // ClicpixAnalysis_H
src/algorithms/DUTAnalysis/DUTAnalysis.cpp
View file @
5b093f50
#include "DUTAnalysis.h"
#include "objects/Cluster.h"
#include "objects/MCParticle.h"
#include "objects/Pixel.h"
#include "objects/SpidrSignal.h"
#include "objects/Track.h"
...
...
@@ -10,6 +11,7 @@ DUTAnalysis::DUTAnalysis(Configuration config, std::vector<Detector*> detectors)
:
Algorithm
(
std
::
move
(
config
),
std
::
move
(
detectors
))
{
m_digitalPowerPulsing
=
m_config
.
get
<
bool
>
(
"digitalPowerPulsing"
,
false
);
m_DUT
=
m_config
.
get
<
std
::
string
>
(
"DUT"
);
m_useMCtruth
=
m_config
.
get
<
bool
>
(
"useMCtruth"
,
false
);
}
void
DUTAnalysis
::
initialise
()
{
...
...
@@ -40,6 +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
);
}
// Initialise member variables
m_eventNumber
=
0
;
m_nAlignmentClusters
=
0
;
...
...
@@ -121,6 +127,12 @@ StatusCode DUTAnalysis::run(Clipboard* clipboard) {
LOG
(
DEBUG
)
<<
"No DUT clusters on the 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"
;
}
// Loop over all tracks
bool
first_track
=
true
;
for
(
auto
&
track
:
(
*
tracks
))
{
...
...
@@ -238,6 +250,27 @@ StatusCode DUTAnalysis::run(Clipboard* clipboard) {
m_nAlignmentClusters
++
;
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
());
}
}
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 @
5b093f50
...
...
@@ -34,6 +34,8 @@ namespace corryvreckan {
TH2F
*
clusterToTVersusTime
;
TH2F
*
residualsTimeVsTime
;
TH1F
*
residualsXMCtruth
;
TH2F
*
hAssociatedTracksGlobalPosition
;
TH2F
*
hUnassociatedTracksGlobalPosition
;
...
...
@@ -44,11 +46,12 @@ namespace corryvreckan {
std
::
string
m_DUT
;
int
m_eventNumber
;
int
m_nAlignmentClusters
;
bool
m_useMCtruth
;
long
long
int
m_powerOnTime
;
long
long
int
m_powerOffTime
;
long
long
int
m_shutterOpenTime
;
long
long
int
m_shutterCloseTime
;
bool
m_digitalPowerPulsing
;
};
}
}
// namespace corryvreckan
#endif // DUTAnalysis_H
src/algorithms/DataDump/DataDump.h
View file @
5b093f50
...
...
@@ -31,5 +31,5 @@ namespace corryvreckan {
int
m_eventNumber
;
std
::
string
m_detector
;
};
}
}
// namespace corryvreckan
#endif // DataDump_H
src/algorithms/EtaCorrection/CMakeLists.txt
0 → 100644
View file @
5b093f50
# Define module and return the generated name as ALGORITHM_NAME
CORRYVRECKAN_ALGORITHM
(
ALGORITHM_NAME
)
# Add source files to library
CORRYVRECKAN_ALGORITHM_SOURCES
(
${
ALGORITHM_NAME
}
EtaCorrection.cpp
# ADD SOURCE FILES HERE...
)
# Provide standard install target
CORRYVRECKAN_ALGORITHM_INSTALL
(
${
ALGORITHM_NAME
}
)
src/algorithms/EtaCorrection/EtaCorrection.cpp
0 → 100644
View file @
5b093f50
#include "EtaCorrection.h"
using
namespace
corryvreckan
;
using
namespace
std
;
EtaCorrection
::
EtaCorrection
(
Configuration
config
,
std
::
vector
<
Detector
*>
detectors
)
:
Algorithm
(
std
::
move
(
config
),
std
::
move
(
detectors
))
{}
void
EtaCorrection
::
initialise
()
{
// Initialise histograms per device
for
(
auto
&
detector
:
get_detectors
())
{
// Check if they are a Timepix3
if
(
detector
->
type
()
!=
"Timepix3"
)
continue
;
// Simple histogram per device
string
name
=
"plotForDevice_"
+
detector
->
name
();
plotPerDevice
[
detector
->
name
()]
=
new
TH2F
(
name
.
c_str
(),
name
.
c_str
(),
256
,
0
,
256
,
256
,
0
,
256
);
}
// Initialise single histograms
string
name
=
"singlePlot"
;
singlePlot
=
new
TH1F
(
name
.
c_str
(),
name
.
c_str
(),
1000
,
0
,
1000
);
// Initialise member variables
m_eventNumber
=
0
;
}
StatusCode
EtaCorrection
::
run
(
Clipboard
*
clipboard
)
{
// Loop over all Timepix3 and make plots
for
(
auto
&
detector
:
get_detectors
())
{
// Check if they are a Timepix3
if
(
detector
->
type
()
!=
"Timepix3"
)
continue
;
// Get the pixels
Pixels
*
pixels
=
(
Pixels
*
)
clipboard
->
get
(
detector
->
name
(),
"pixels"
);
if
(
pixels
==
NULL
)
{
LOG
(
DEBUG
)
<<
"Detector "
<<
detector
->
name
()
<<
" does not have any pixels on the clipboard"
;
continue
;
}
// Get the clusters
Clusters
*
clusters
=
(
Clusters
*
)
clipboard
->
get
(
detector
->
name
(),
"clusters"
);
if
(
clusters
==
NULL
)
{
LOG
(
DEBUG
)
<<
"Detector "
<<
detector
->
name
()
<<
" does not have any clusters on the clipboard"
;
continue
;
}
// Loop over all pixels and make hitmaps
for
(
auto
&
pixel
:
(
*
pixels
))
{
// Fill the plots for this device
plotPerDevice
[
detector
->
name
()]
->
Fill
(
pixel
->
m_column
,
pixel
->
m_row
);
}
}
// Fill single histogram
singlePlot
->
Fill
(
m_eventNumber
);
// Increment event counter
m_eventNumber
++
;
// Return value telling analysis to keep running
return
Success
;
}
void
EtaCorrection
::
finalise
()
{
LOG
(
DEBUG
)
<<
"Analysed "
<<
m_eventNumber
<<
" events"
;
}
src/algorithms/EtaCorrection/EtaCorrection.h
0 → 100644
View file @
5b093f50
#ifndef EtaCorrection_H
#define EtaCorrection_H 1
#include <iostream>
#include "TCanvas.h"
#include "TH1F.h"
#include "TH2F.h"
#include "core/algorithm/Algorithm.h"
#include "objects/Cluster.h"
#include "objects/Pixel.h"
#include "objects/Track.h"
namespace
corryvreckan
{
class
EtaCorrection
:
public
Algorithm
{
public:
// Constructors and destructors
EtaCorrection
(
Configuration
config
,
std
::
vector
<
Detector
*>
detectors
);
~
EtaCorrection
()
{}
// Functions
void
initialise
();
StatusCode
run
(
Clipboard
*
clipboard
);
void
finalise
();
// Histograms for several devices
std
::
map
<
std
::
string
,
TH2F
*>
plotPerDevice
;
// Single histograms
TH1F
*
singlePlot
;
// Member variables
int
m_eventNumber
;
};
}
// namespace corryvreckan
#endif // EtaCorrection_H
src/algorithms/FileReader/FileReader.h
View file @
5b093f50
...
...
@@ -47,5 +47,5 @@ namespace corryvreckan {
std
::
map
<
std
::
string
,
long
long
int
>
m_currentPosition
;
double
m_timeWindow
;
};
}
}
// namespace corryvreckan
#endif // FileReader_H
src/algorithms/FileWriter/FileWriter.h
View file @
5b093f50
...
...
@@ -41,5 +41,5 @@ namespace corryvreckan {
// List of objects to write out
std
::
vector
<
std
::
string
>
m_objectList
;
};
}
}
// namespace corryvreckan
#endif // FileWriter_H
src/algorithms/GUI/GUI.h
View file @
5b093f50
...
...
@@ -44,5 +44,5 @@ namespace corryvreckan {
int
eventNumber
;
int
updateNumber
;
};
}
}
// namespace corryvreckan
#endif // GUI_H
src/algorithms/GenericAlgorithm/GenericAlgorithm.h
View file @
5b093f50
...
...
@@ -32,5 +32,5 @@ namespace corryvreckan {
// Member variables
int
m_eventNumber
;
};
}
}
// namespace corryvreckan
#endif // GenericAlgorithm_H
src/algorithms/OnlineMonitor/OnlineMonitor.h
View file @
5b093f50
...
...
@@ -47,5 +47,5 @@ namespace corryvreckan {
int
eventNumber
;
int
updateNumber
;
};
}
}
// namespace corryvreckan
#endif // OnlineMonitor_H
src/algorithms/Prealignment/Prealignment.h
View file @
5b093f50
...
...
@@ -34,5 +34,5 @@ namespace corryvreckan {
double
max_correlation_rms
;
double
damping_factor
;
};
}
}
// namespace corryvreckan
#endif // PREALIGNMENT_H
src/algorithms/SpatialClustering/SpatialClustering.h
View file @
5b093f50
...
...
@@ -26,5 +26,5 @@ namespace corryvreckan {
// Member variables
int
m_eventNumber
;
};
}
}
// namespace corryvreckan
#endif // SpatialClustering_H
Prev
1
2
Next
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