ATLAS Offline Software
Loading...
Searching...
No Matches
CaloCellEnergyRescaler Class Reference

CaloCellMakerTool to re-scale cell energies. More...

#include <CaloCellEnergyRescaler.h>

Inheritance diagram for CaloCellEnergyRescaler:
Collaboration diagram for CaloCellEnergyRescaler:

Public Member Functions

 CaloCellEnergyRescaler (const std::string &type, const std::string &name, const IInterface *parent)
 ~CaloCellEnergyRescaler ()
virtual StatusCode initialize () override
virtual StatusCode process (CaloCellContainer *theCellContainer, const EventContext &ctx) const override

Private Attributes

SG::ReadCondHandleKey< AthenaAttributeListm_eneShiftFldr {this,"Folder","/CALO/Ofl/CellEnergyCorr","Key (=foldername) of AttrListCollection"}

Detailed Description

CaloCellMakerTool to re-scale cell energies.

Definition at line 21 of file CaloCellEnergyRescaler.h.

Constructor & Destructor Documentation

◆ CaloCellEnergyRescaler()

CaloCellEnergyRescaler::CaloCellEnergyRescaler ( const std::string & type,
const std::string & name,
const IInterface * parent )

Definition at line 10 of file CaloCellEnergyRescaler.cxx.

12 :
13 base_class (type, name, parent) {}

◆ ~CaloCellEnergyRescaler()

CaloCellEnergyRescaler::~CaloCellEnergyRescaler ( )
default

Member Function Documentation

◆ initialize()

StatusCode CaloCellEnergyRescaler::initialize ( )
overridevirtual

Definition at line 18 of file CaloCellEnergyRescaler.cxx.

18 {
19 ATH_CHECK(m_eneShiftFldr.initialize());
20 return StatusCode::SUCCESS;
21}
#define ATH_CHECK
Evaluate an expression and check for errors.
SG::ReadCondHandleKey< AthenaAttributeList > m_eneShiftFldr

◆ process()

StatusCode CaloCellEnergyRescaler::process ( CaloCellContainer * theCellContainer,
const EventContext & ctx ) const
overridevirtual

Definition at line 25 of file CaloCellEnergyRescaler.cxx.

26 {
27
28 SG::ReadCondHandle<AthenaAttributeList> eneShiftHdl(m_eneShiftFldr,ctx);
29
30 //Possible optimization: If the following lines turn out to be slow to be executed on every event,
31 //put them into a conditions algo
32 const coral::Blob& blob = (**eneShiftHdl)["CaloCondBlob16M"].data<coral::Blob>();
33 if (blob.size()<3) {
34 ATH_MSG_DEBUG("Found empty blob, no corretion needed");
35 return StatusCode::SUCCESS;
36 }
37
38 std::unique_ptr<const CaloCondBlobFlt> corrValues(CaloCondBlobFlt::getInstance(blob));
39 ATH_MSG_DEBUG("Database folder has values for " << corrValues->getNChans() << " channels and " << corrValues->getNGains() << " gains.");
40
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& scale= corrValues->getData(hash_id);
49 theCell->scaleEnergy(scale);
50 }//end if hash_id<NChans
51 }//end loop over cells
52 return StatusCode::SUCCESS;
53}
#define ATH_MSG_DEBUG(x)
const CaloDetDescrElement * caloDDE() const
get pointer to CaloDetDescrElement (data member)
Definition CaloCell.h:321
virtual void scaleEnergy(float scale)
scale energy
Definition CaloCell.h:478
static CaloCondBlobFlt * getInstance(coral::Blob &blob)
Returns a pointer to a non-const CaloCondBlobFlt.
DataModel_detail::iterator< DataVector > iterator
Definition DataVector.h:842

Member Data Documentation

◆ m_eneShiftFldr

SG::ReadCondHandleKey<AthenaAttributeList> CaloCellEnergyRescaler::m_eneShiftFldr {this,"Folder","/CALO/Ofl/CellEnergyCorr","Key (=foldername) of AttrListCollection"}
private

Definition at line 36 of file CaloCellEnergyRescaler.h.

36{this,"Folder","/CALO/Ofl/CellEnergyCorr","Key (=foldername) of AttrListCollection"};

The documentation for this class was generated from the following files: