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
bd7bfbca
Commit
bd7bfbca
authored
Nov 07, 2018
by
Simon Spannagel
Browse files
Rename DataOutput -> TreeWiterDUT
parent
609f06cf
Pipeline
#575197
passed with stages
in 4 minutes and 22 seconds
Changes
4
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
src/modules/
DataOutput
/CMakeLists.txt
→
src/modules/
TreeWriterDUT
/CMakeLists.txt
View file @
bd7bfbca
# Define module and return the generated name as MODULE_NAME
CORRYVRECKAN_
GLOBAL
_MODULE
(
MODULE_NAME
)
CORRYVRECKAN_
DUT
_MODULE
(
MODULE_NAME
)
# Add source files to library
CORRYVRECKAN_MODULE_SOURCES
(
${
MODULE_NAME
}
DataOutput.cpp
# ADD SOURCE FILES HERE...
TreeWriterDUT.cpp
)
# Provide standard install target
...
...
src/modules/
DataOutput
/README.md
→
src/modules/
TreeWriterDUT
/README.md
View file @
bd7bfbca
File moved
src/modules/
DataOutput/DataOutput
.cpp
→
src/modules/
TreeWriterDUT/TreeWriterDUT
.cpp
View file @
bd7bfbca
#include "
DataOutput
.h"
#include "
TreeWriterDUT
.h"
#include <vector>
using
namespace
corryvreckan
;
using
namespace
std
;
DataOutput
::
DataOutput
(
Configuration
config
,
std
::
vector
<
std
::
shared_ptr
<
Detector
>
>
detector
s
)
:
Module
(
std
::
move
(
config
),
std
::
move
(
detector
s
)
)
{
TreeWriterDUT
::
TreeWriterDUT
(
Configuration
config
,
std
::
shared_ptr
<
Detector
>
detector
)
:
Module
(
std
::
move
(
config
),
detector
),
m_detector
(
detector
)
{
m_fileName
=
m_config
.
get
<
std
::
string
>
(
"fileName"
,
"outputTuples.root"
);
m_treeName
=
m_config
.
get
<
std
::
string
>
(
"treeName"
,
"tree"
);
...
...
@@ -29,8 +29,8 @@ DataOutput::DataOutput(Configuration config, std::vector<std::shared_ptr<Detecto
*/
void
DataOutput
::
initialise
()
{
LOG
(
DEBUG
)
<<
"Initialised
DataOutput
"
;
void
TreeWriterDUT
::
initialise
()
{
LOG
(
DEBUG
)
<<
"Initialised
TreeWriterDUT
"
;
// Create output file and directories
m_outputFile
=
new
TFile
(
m_fileName
.
c_str
(),
"RECREATE"
);
...
...
@@ -55,16 +55,12 @@ void DataOutput::initialise() {
m_outputTree
->
Branch
(
"intercepts"
,
&
v_intercepts
);
}
StatusCode
DataOutput
::
run
(
Clipboard
*
clipboard
)
{
StatusCode
TreeWriterDUT
::
run
(
Clipboard
*
clipboard
)
{
// Counter for cluster event ID
eventID
++
;
// Get the DUT
auto
DUT
=
get_dut
();
// Clear data vectors before storing the cluster information for this event
v_intercepts
.
clear
();
// Clear data vectors before storing the cluster information for
// this event
v_clusterSizeX
.
clear
();
v_clusterSizeY
.
clear
();
v_clusterEventID
.
clear
();
...
...
@@ -98,10 +94,10 @@ StatusCode DataOutput::run(Clipboard* clipboard) {
LOG
(
DEBUG
)
<<
"Found track with associated cluster"
;
// Get track intercept with DUT in global coordinates
trackIntercept
=
DUT
->
getIntercept
(
track
);
trackIntercept
=
m_detector
->
getIntercept
(
track
);
// Calculate the intercept in local coordinates
trackInterceptLocal
=
DUT
->
globalToLocal
(
trackIntercept
);
trackInterceptLocal
=
m_detector
->
globalToLocal
(
trackIntercept
);
v_intercepts
.
push_back
(
trackInterceptLocal
);
Cluster
*
cluster
=
associatedClusters
.
front
();
...
...
@@ -161,15 +157,13 @@ StatusCode DataOutput::run(Clipboard* clipboard) {
return
Success
;
}
void
DataOutput
::
finalise
()
{
void
TreeWriterDUT
::
finalise
()
{
LOG
(
DEBUG
)
<<
"Finalise"
;
// DUT angles for output
auto
DUT
=
get_dut
();
auto
directory
=
m_outputFile
->
mkdir
(
"Directory"
);
directory
->
cd
();
LOG
(
STATUS
)
<<
filledEvents
<<
" events written to file "
<<
m_fileName
;
auto
orientation
=
DUT
->
rotation
();
auto
orientation
=
m_detector
->
rotation
();
directory
->
WriteObject
(
&
orientation
,
"DUTorientation"
);
// Writing out outputfile
...
...
src/modules/
DataOutput/DataOutput
.h
→
src/modules/
TreeWriterDUT/TreeWriterDUT
.h
View file @
bd7bfbca
#ifndef
DATAOUTP
UT_H
#define
DATAOUTP
UT_H 1
#ifndef
TreeWriterD
UT_H
#define
TreeWriterD
UT_H 1
#include <Math/Point3D.h>
#include <Math/Vector3D.h>
...
...
@@ -13,19 +13,21 @@
namespace
corryvreckan
{
/** @ingroup Modules
*/
class
DataOutput
:
public
Module
{
class
TreeWriterDUT
:
public
Module
{
public:
// Constructors and destructors
DataOutput
(
Configuration
config
,
std
::
vector
<
std
::
shared_ptr
<
Detector
>
>
detector
s
);
~
DataOutput
()
{}
TreeWriterDUT
(
Configuration
config
,
std
::
shared_ptr
<
Detector
>
detector
);
~
TreeWriterDUT
()
{}
// Functions
void
initialise
();
StatusCode
run
(
Clipboard
*
clipboard
);
void
finalise
();
// Member variables
private:
std
::
shared_ptr
<
Detector
>
m_detector
;
int
numPixels
;
int
eventID
;
int
filledEvents
;
...
...
@@ -54,4 +56,4 @@ namespace corryvreckan {
std
::
string
m_treeName
;
};
}
// namespace corryvreckan
#endif //
DATAOUTP
UT_H
#endif //
TreeWriterD
UT_H
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