|
ATLAS Offline Software
|
Go to the documentation of this file.
11 , ISvcLocator* pSvcLocator )
13 m_caldbtool(
"TRT_CalDbTool",this),
33 return StatusCode::SUCCESS;
45 if(writeHandle.isValid()) {
46 ATH_MSG_DEBUG(
"CondHandle " << writeHandle.fullKey() <<
" is already valid."
47 <<
". In theory this should not be called, but may happen"
48 <<
" if multiple concurrent events are being processed out of order.");
50 return StatusCode::SUCCESS;
56 std::unique_ptr<TRTCond::AverageT0> writeCdo{std::make_unique<TRTCond::AverageT0>()};
60 int countAverageT0 = 0;
62 double averageT0 = 0.;
68 for (
int i = 0;
i <= nStrawsInLayer;
i++) {
81 if (countAverageT0 != 0){
82 averageT0 /=
double(countAverageT0);
87 if (countAverageT0 != 0) {
88 rtShift /=
double(countAverageT0);
93 double evtPhaseT0 = averageT0-20.+rtShift;
95 ATH_MSG_INFO(
" Subtracting: " << evtPhaseT0 <<
" ns (average T0: " << averageT0 <<
" ns, average t(r=0): " << rtShift <<
" ns )");
97 writeCdo->update(evtPhaseT0);
104 if(T0Container==
nullptr) {
106 return StatusCode::FAILURE;
110 if(!T0ReadHandle.range(rangeW)) {
111 ATH_MSG_ERROR(
"Failed to retrieve validity range for " << T0ReadHandle.key());
112 return StatusCode::FAILURE;
117 if(writeHandle.record(rangeW,std::move(writeCdo)).isFailure()) {
118 ATH_MSG_ERROR(
"Could not record AverageT0 " << writeHandle.key()
119 <<
" with EventRange " << rangeW
120 <<
" into Conditions Store");
121 return StatusCode::FAILURE;
123 ATH_MSG_INFO(
" Recorded AverageT0 " << writeHandle.key()
124 <<
" with EventRange " << rangeW
125 <<
" into Conditions Store");
128 return StatusCode::SUCCESS;
134 return StatusCode::SUCCESS;
def retrieve(aClass, aKey=None)
virtual StatusCode initialize() override
int straw_max(const Identifier &id) const
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
abstract base class for rt-relations
This is an Identifier helper class for the TRT subdetector. This class is a factory for creating comp...
const_id_iterator straw_layer_end(void) const
const ServiceHandle< StoreGateSvc > & detStore() const
The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.
ToolHandle< ITRT_CalDbTool > m_caldbtool
virtual float drifttime(float radius) const =0
drifttime for given radius
::StatusCode StatusCode
StatusCode definition for legacy code.
SG::ReadCondHandleKey< StrawT0Container > m_T0ReadKey
SG::WriteCondHandleKey< TRTCond::AverageT0 > m_T0WriteKey
int barrel_ec(const Identifier &id) const
Values of different levels (failure returns 0)
virtual ~TRTPhaseCondAlg() override
virtual StatusCode finalize() override
StatusCode initialize(bool used=true)
virtual StatusCode execute() override
TRTPhaseCondAlg(const std::string &name, ISvcLocator *pSvcLocator)
const_id_iterator straw_layer_begin(void) const
Iterators over full set of straw_layer ids. Straw_layer ids are sorted.
Identifier straw_id(int barrel_ec, int phi_module, int layer_or_wheel, int straw_layer, int straw) const
Three ways of getting id for a single straw: