ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
TestBeam
TBRec
src
TBTailCatcherRec.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2026 CERN for the benefit of the ATLAS collaboration
3
*/
4
5
#include "
TBTailCatcherRec.h
"
6
7
#define WTC_ADC_MAX 1024
8
9
10
TBTailCatcherRec::TBTailCatcherRec
(
const
std::string& name,
11
ISvcLocator* pSvcLocator) :
12
AthAlgorithm
(name,pSvcLocator)
13
{
14
// job options
15
16
declareProperty
(
"SGkey"
,
m_SGkey
=
"TailCatcherRaw"
);
17
declareProperty
(
"TailCatcherCalib"
,
m_tailcatch_calib
);
18
declareProperty
(
"TailCatcherPed"
,
m_tailcatch_ped
);
19
20
}
21
22
TBTailCatcherRec::~TBTailCatcherRec
()
23
{ }
24
25
StatusCode
26
TBTailCatcherRec::initialize
()
27
{
28
return
StatusCode::SUCCESS;
29
}
30
31
StatusCode
32
TBTailCatcherRec::execute
(
const
EventContext& ctx)
33
{
34
ATH_MSG_DEBUG
(
"In execute()"
);
35
36
TBTailCatcherRaw
* tailcatchraw;
37
StatusCode
sc
=
evtStore
()->retrieve(tailcatchraw,
m_SGkey
);
38
if
(
sc
.isFailure()){
39
ATH_MSG_DEBUG
(
"TBObjectReco: Retrieval of "
<<
m_SGkey
<<
" failed"
);
40
setFilterPassed
(
false
, ctx);
41
return
StatusCode::SUCCESS;
42
}
else
{
43
44
if
(
m_tailcatch_calib
.size()!=tailcatchraw->
size
()){
45
ATH_MSG_ERROR
(
"Calib factor number : "
<<
m_tailcatch_calib
.size()
46
<<
" != "
<<tailcatchraw->
size
()<<
" = number of scints in TailCatcherRaw"
);
47
setFilterPassed
(
false
, ctx);
48
return
StatusCode::SUCCESS;
49
}
50
51
std::vector< TBScintillator* > theScints;
52
53
int
ind=0;
54
for
(
const
TBScintillatorRaw
* scintraw : *tailcatchraw) {
55
std::string name = scintraw->getDetectorName();
56
57
TBScintillator
* scint =
new
TBScintillator
();
58
scint->
setDetectorName
(name);
59
// No time signal in TalCatcher, only ADC
60
unsigned
int
adc = scintraw->getADCSignal();
61
if
(scintraw->isADCOverflow()) adc =
WTC_ADC_MAX
;
62
scint->
setSignal
(
m_tailcatch_calib
[ind]*(adc -
m_tailcatch_ped
[ind]));
63
64
scint->
setSignalOverflow
(scintraw->isADCOverflow());
65
66
theScints.push_back(scint);
67
ind++;
68
}
69
TBTailCatcher
* tailcatch =
new
TBTailCatcher
(tailcatchraw->getDetectorName(),tailcatchraw->isOverflow(),theScints);
70
sc
=
evtStore
()->record(tailcatch,
"TailCatcher"
);
71
if
(
sc
.isFailure( ) ) {
72
ATH_MSG_FATAL
(
"Cannot record TailCatcher "
);
73
}
74
}
75
if
(
sc
.isFailure( ) ) {
76
setFilterPassed
(
false
, ctx);
77
}
else
{
78
setFilterPassed
(
true
, ctx);
79
}
80
return
StatusCode::SUCCESS;
81
}
82
83
84
StatusCode
85
TBTailCatcherRec::finalize
()
86
{
87
return
StatusCode::SUCCESS;
88
}
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition
AthMsgStreamMacros.h:33
ATH_MSG_FATAL
#define ATH_MSG_FATAL(x)
Definition
AthMsgStreamMacros.h:34
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition
AthMsgStreamMacros.h:29
sc
static Double_t sc
Definition
LArPhysWaveHECTool.cxx:37
WTC_ADC_MAX
#define WTC_ADC_MAX
Definition
TBTailCatcherRec.cxx:7
TBTailCatcherRec.h
AthAlgorithm::AthAlgorithm
AthAlgorithm(const std::string &name, ISvcLocator *pSvcLocator)
Constructor.
Definition
AthAlgorithm.cxx:10
AthCommonAlgorithm< Gaudi::Algorithm >::setFilterPassed
virtual void setFilterPassed(bool state, const EventContext &ctx) const
Definition
AthCommonAlgorithm.h:99
AthCommonAlgorithm< Gaudi::Algorithm >::declareProperty
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)
Definition
AthCommonDataStore.h:145
AthCommonAlgorithm< Gaudi::Algorithm >::evtStore
ServiceHandle< StoreGateSvc > & evtStore()
Definition
AthCommonDataStore.h:85
DataVector::size
size_type size() const noexcept
Returns the number of elements in the collection.
TBBeamDetector::setDetectorName
virtual void setDetectorName(std::string_view tbBeamDetectorName)
Definition
TBBeamDetector.h:49
TBScintillatorRaw
Definition
TBScintillatorRaw.h:26
TBScintillator
Definition
TBScintillator.h:25
TBScintillator::setSignal
virtual void setSignal(float theSignal)
Definition
TBScintillator.h:65
TBScintillator::setSignalOverflow
virtual void setSignalOverflow(bool signal_overflow)
Definition
TBScintillator.h:69
TBTailCatcherRaw
Definition
TBTailCatcherRaw.h:25
TBTailCatcherRec::execute
virtual StatusCode execute(const EventContext &ctx) override
Execute method.
Definition
TBTailCatcherRec.cxx:32
TBTailCatcherRec::m_tailcatch_calib
std::vector< float > m_tailcatch_calib
Definition
TBTailCatcherRec.h:45
TBTailCatcherRec::m_SGkey
std::string m_SGkey
Definition
TBTailCatcherRec.h:39
TBTailCatcherRec::initialize
virtual StatusCode initialize() override
Definition
TBTailCatcherRec.cxx:26
TBTailCatcherRec::finalize
virtual StatusCode finalize() override
Definition
TBTailCatcherRec.cxx:85
TBTailCatcherRec::~TBTailCatcherRec
virtual ~TBTailCatcherRec()
Definition
TBTailCatcherRec.cxx:22
TBTailCatcherRec::TBTailCatcherRec
TBTailCatcherRec(const std::string &name, ISvcLocator *pSvcLocator)
Definition
TBTailCatcherRec.cxx:10
TBTailCatcherRec::m_tailcatch_ped
std::vector< float > m_tailcatch_ped
Definition
TBTailCatcherRec.h:46
TBTailCatcher
Definition
TBTailCatcher.h:25
Generated on
for ATLAS Offline Software by
1.17.0