Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Corryvreckan
Corryvreckan
Commits
ad11aa99
Commit
ad11aa99
authored
Nov 06, 2018
by
Simon Spannagel
Browse files
Rename ATLASpixEventLoader -> EventLoaderATLASpix, make DETECTOR_MODULE, TYPE="ATLASpix"
parent
31e4c90d
Changes
4
Hide whitespace changes
Inline
Side-by-side
src/modules/
ATLASpix
EventLoader/CMakeLists.txt
→
src/modules/EventLoader
ATLASpix
/CMakeLists.txt
View file @
ad11aa99
# Define module and return the generated name as MODULE_NAME
CORRYVRECKAN_GLOBAL_MODULE
(
MODULE_NAME
)
CORRYVRECKAN_DETECTOR_MODULE
(
MODULE_NAME
)
CORRYVRECKAN_DETECTOR_TYPE
(
${
MODULE_NAME
}
"ATLASpix"
)
# Add source files to library
CORRYVRECKAN_MODULE_SOURCES
(
${
MODULE_NAME
}
ATLASpixEventLoader.cpp
# ADD SOURCE FILES HERE...
EventLoaderATLASpix.cpp
)
# Provide standard install target
...
...
src/modules/
ATLASpix
EventLoader
/
ATLASpixEventLoader.cpp
→
src/modules/EventLoaderATLASpix
/
EventLoader
ATLASpix
.cpp
View file @
ad11aa99
#include
"
ATLASpix
EventLoader.h"
#include
"EventLoader
ATLASpix
.h"
#include
<regex>
using
namespace
corryvreckan
;
using
namespace
std
;
ATLASpix
EventLoader
::
ATLASpixEventLoader
(
Configuration
config
,
std
::
vector
<
std
::
shared_ptr
<
Detector
>
>
detector
s
)
:
Module
(
std
::
move
(
config
),
std
::
move
(
detector
s
)
)
{
EventLoaderATLASpix
::
EventLoader
ATLASpix
(
Configuration
config
,
std
::
shared_ptr
<
Detector
>
detector
)
:
Module
(
std
::
move
(
config
),
detector
),
m_detector
(
detector
)
{
m_timewalkCorrectionFactors
=
m_config
.
getArray
<
double
>
(
"timewalkCorrectionFactors"
,
std
::
vector
<
double
>
());
...
...
@@ -27,7 +27,7 @@ ATLASpixEventLoader::ATLASpixEventLoader(Configuration config, std::vector<std::
ts2Range
=
0x40
*
m_clkdivend2M
;
}
uint32_t
ATLASpix
EventLoader
::
gray_decode
(
uint32_t
gray
)
{
uint32_t
EventLoader
ATLASpix
::
gray_decode
(
uint32_t
gray
)
{
uint32_t
bin
=
gray
;
while
(
gray
>>=
1
)
{
bin
^=
gray
;
...
...
@@ -35,7 +35,7 @@ uint32_t ATLASpixEventLoader::gray_decode(uint32_t gray) {
return
bin
;
}
void
ATLASpix
EventLoader
::
initialise
()
{
void
EventLoader
ATLASpix
::
initialise
()
{
uint32_t
datain
;
...
...
@@ -111,8 +111,14 @@ void ATLASpixEventLoader::initialise() {
}
// Make histograms for debugging
auto
det
=
get_dut
();
hHitMap
=
new
TH2F
(
"hitMap"
,
"hitMap"
,
det
->
nPixelsX
(),
0
,
det
->
nPixelsX
(),
det
->
nPixelsY
(),
0
,
det
->
nPixelsY
());
hHitMap
=
new
TH2F
(
"hitMap"
,
"hitMap"
,
m_detector
->
nPixelsX
(),
0
,
m_detector
->
nPixelsX
(),
m_detector
->
nPixelsY
(),
0
,
m_detector
->
nPixelsY
());
// hPixelToT = new TH1F("pixelToT", "pixelToT", 100, 0, 100);
// std::string totTitle = "pixelToT;x ToT in " + string(m_clockCycle) + " ns units";
// hPixelToT = new TH1F("pixelToT", "pixelToT", 64, 0, ts2Range*m_clockCycle);
...
...
@@ -124,7 +130,7 @@ void ATLASpixEventLoader::initialise() {
hPixelsOverTime
=
new
TH1F
(
"pixelsOverTime"
,
"pixelsOverTime"
,
2e6
,
0
,
2e6
);
// Read calibration:
m_calibrationFactors
.
resize
(
static_cast
<
size_t
>
(
det
->
nPixelsX
()
*
det
->
nPixelsY
()),
1.0
);
m_calibrationFactors
.
resize
(
static_cast
<
size_t
>
(
m_
det
ector
->
nPixelsX
()
*
m_
det
ector
->
nPixelsY
()),
1.0
);
if
(
!
m_calibrationFile
.
empty
())
{
std
::
ifstream
calibration
(
m_calibrationFile
);
std
::
string
line
;
...
...
@@ -146,13 +152,11 @@ void ATLASpixEventLoader::initialise() {
LOG
(
INFO
)
<<
"Using clock cycle length of "
<<
m_clockCycle
<<
std
::
endl
;
// Initialise member variables
m_eventNumber
=
0
;
m_oldtoa
=
0
;
m_overflowcounter
=
0
;
}
StatusCode
ATLASpix
EventLoader
::
run
(
Clipboard
*
clipboard
)
{
StatusCode
EventLoader
ATLASpix
::
run
(
Clipboard
*
clipboard
)
{
// Check if event frame is defined:
if
(
!
clipboard
->
has_persistent
(
"eventStart"
)
||
!
clipboard
->
has_persistent
(
"eventEnd"
))
{
...
...
@@ -187,7 +191,7 @@ StatusCode ATLASpixEventLoader::run(Clipboard* clipboard) {
// Put the data on the clipboard
if
(
!
pixels
->
empty
())
{
clipboard
->
put
(
get_dut
()
->
name
(),
"pixels"
,
reinterpret_cast
<
Objects
*>
(
pixels
));
clipboard
->
put
(
m_detector
->
name
(),
"pixels"
,
reinterpret_cast
<
Objects
*>
(
pixels
));
}
else
{
return
NoData
;
}
...
...
@@ -196,7 +200,7 @@ StatusCode ATLASpixEventLoader::run(Clipboard* clipboard) {
return
Success
;
}
Pixels
*
ATLASpix
EventLoader
::
read_caribou_data
(
double
start_time
,
double
end_time
)
{
Pixels
*
EventLoader
ATLASpix
::
read_caribou_data
(
double
start_time
,
double
end_time
)
{
LOG
(
DEBUG
)
<<
"Searching for events in interval from "
<<
Units
::
display
(
start_time
,
{
"s"
,
"us"
,
"ns"
})
<<
" to "
<<
Units
::
display
(
end_time
,
{
"s"
,
"us"
,
"ns"
})
<<
", file read position "
<<
m_file
.
tellg
()
<<
", old_fpga_ts = "
<<
old_fpga_ts
<<
"."
;
...
...
@@ -204,9 +208,6 @@ Pixels* ATLASpixEventLoader::read_caribou_data(double start_time, double end_tim
// Pixel container
Pixels
*
pixels
=
new
Pixels
();
// Detector we're looking at:
auto
detector
=
get_dut
();
// Read file and load data
uint32_t
datain
;
long
long
ts_diff
;
// tmp
...
...
@@ -304,7 +305,7 @@ Pixels* ATLASpixEventLoader::read_caribou_data(double start_time, double end_tim
window_end
=
false
;
data_pixel_
++
;
// If this pixel is masked, do not save it
if
(
detector
->
masked
(
col
,
row
))
{
if
(
m_
detector
->
masked
(
col
,
row
))
{
continue
;
}
...
...
@@ -489,7 +490,7 @@ Pixels* ATLASpixEventLoader::read_caribou_data(double start_time, double end_tim
return
pixels
;
}
Pixels
*
ATLASpix
EventLoader
::
read_legacy_data
(
double
,
double
)
{
Pixels
*
EventLoader
ATLASpix
::
read_legacy_data
(
double
,
double
)
{
// Pixel container
Pixels
*
pixels
=
new
Pixels
();
...
...
@@ -502,9 +503,8 @@ Pixels* ATLASpixEventLoader::read_legacy_data(double, double) {
m_file
>>
col
>>
row
>>
ts
>>
tot
>>
dummy
>>
dummy
>>
bincounter
>>
TriggerDebugTS
;
auto
detector
=
get_dut
();
// If this pixel is masked, do not save it
if
(
detector
->
masked
(
col
,
row
))
{
if
(
m_
detector
->
masked
(
col
,
row
))
{
continue
;
}
...
...
@@ -564,9 +564,8 @@ Pixels* ATLASpixEventLoader::read_legacy_data(double, double) {
return
pixels
;
}
void
ATLASpix
EventLoader
::
finalise
()
{
void
EventLoader
ATLASpix
::
finalise
()
{
LOG
(
DEBUG
)
<<
"Analysed "
<<
m_eventNumber
<<
" events"
;
LOG
(
INFO
)
<<
"Identifier distribution:"
;
for
(
auto
id
:
m_identifiers
)
{
LOG
(
INFO
)
<<
"
\t
"
<<
id
.
first
<<
": "
<<
id
.
second
;
...
...
src/modules/
ATLASpix
EventLoader
/
ATLASpixEventLoader.h
→
src/modules/EventLoaderATLASpix
/
EventLoader
ATLASpix
.h
View file @
ad11aa99
#ifndef
ATLASpix
EventLoader_H
#define
ATLASpix
EventLoader_H 1
#ifndef EventLoader
ATLASpix
_H
#define EventLoader
ATLASpix
_H 1
#include
<TCanvas.h>
#include
<TH1F.h>
...
...
@@ -18,12 +18,12 @@
namespace
corryvreckan
{
/** @ingroup Modules
*/
class
ATLASpix
EventLoader
:
public
Module
{
class
EventLoader
ATLASpix
:
public
Module
{
public:
// Constructors and destructors
ATLASpix
EventLoader
(
Configuration
config
,
std
::
vector
<
std
::
shared_ptr
<
Detector
>
>
detector
s
);
~
ATLASpix
EventLoader
()
{}
EventLoader
ATLASpix
(
Configuration
config
,
std
::
shared_ptr
<
Detector
>
detector
);
~
EventLoader
ATLASpix
()
{}
// Functions
void
initialise
();
...
...
@@ -46,8 +46,7 @@ namespace corryvreckan {
*/
Pixels
*
read_caribou_data
(
double
start_time
,
double
end_time
);
// Member variables
int
m_eventNumber
;
std
::
shared_ptr
<
Detector
>
m_detector
;
unsigned
long
long
int
m_oldtoa
;
unsigned
long
long
int
m_overflowcounter
;
std
::
string
m_filename
;
...
...
@@ -84,4 +83,4 @@ namespace corryvreckan {
unsigned
int
data_pixel_
{},
data_header_
{};
};
}
// namespace corryvreckan
#endif //
ATLASpix
EventLoader_H
#endif // EventLoader
ATLASpix
_H
src/modules/
ATLASpix
EventLoader/README.md
→
src/modules/EventLoader
ATLASpix
/README.md
View file @
ad11aa99
File moved
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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