ATLAS Offline Software
Loading...
Searching...
No Matches
CaloCellTimeCorrTool.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
3*/
4
8
9
11 const std::string& name,
12 const IInterface* parent) :
13 base_class (type, name, parent) {}
14
16
17
19 ATH_CHECK(m_timeShiftFldr.initialize());
20 return StatusCode::SUCCESS;
21}
22
23
24
25StatusCode CaloCellTimeCorrTool::process (CaloCellContainer* theCaloCellContainer,
26 const EventContext& ctx) const {
27
29
30
31 //Possible optimization: If the following lines turn out to be slow to be executed on every event,
32 //put them into a conditions algo
33 const coral::Blob& blob = (**timeShiftHdl)["CaloCondBlob16M"].data<coral::Blob>();
34 if (blob.size()<3) {
35 ATH_MSG_DEBUG("Found empty blob, no corretion needed");
36 return StatusCode::SUCCESS;
37 }
38
39 std::unique_ptr<const CaloCondBlobFlt> corrValues(CaloCondBlobFlt::getInstance(blob));
40 ATH_MSG_DEBUG("Database folder has values for " << corrValues->getNChans() << " channels and " << corrValues->getNGains() << " gains.");
41
42 CaloCellContainer::iterator it=theCaloCellContainer->begin();
43 CaloCellContainer::iterator it_e=theCaloCellContainer->end();
44 for(;it!=it_e;++it) {
45 CaloCell* theCell=(*it);
46 const IdentifierHash& hash_id=theCell->caloDDE()->calo_hash();
47 if (hash_id<corrValues->getNChans()) {
48 const float& shift= corrValues->getData(hash_id);
49 theCell->addTime(shift);
50 }//end if hash_id<NChans
51 }//end loop over cells
52 return StatusCode::SUCCESS;
53}
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_DEBUG(x)
Container class for CaloCell.
virtual StatusCode process(CaloCellContainer *theCellContainer, const EventContext &ctx) const override
CaloCellTimeCorrTool(const std::string &type, const std::string &name, const IInterface *parent)
virtual StatusCode initialize() override
SG::ReadCondHandleKey< AthenaAttributeList > m_timeShiftFldr
Data object for each calorimeter readout cell.
Definition CaloCell.h:57
void addTime(float delta)
add time
Definition CaloCell.h:454
const CaloDetDescrElement * caloDDE() const
get pointer to CaloDetDescrElement (data member)
Definition CaloCell.h:321
static CaloCondBlobFlt * getInstance(coral::Blob &blob)
Returns a pointer to a non-const CaloCondBlobFlt.
DataModel_detail::iterator< DataVector > iterator
Definition DataVector.h:842
const_iterator end() const noexcept
Return a const_iterator pointing past the end of the collection.
const_iterator begin() const noexcept
Return a const_iterator pointing at the beginning of the collection.
This is a "hash" representation of an Identifier.