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

Add non linearity in calorimeter for test at L2. More...

#include <LArNonLinearity.h>

Inheritance diagram for LArNonLinearity:
Collaboration diagram for LArNonLinearity:

Public Member Functions

 LArNonLinearity (const std::string &type, const std::string &name, const IInterface *parent)
virtual ~LArNonLinearity ()
virtual StatusCode initialize () override
virtual void MakeCorrection (CaloCell *theCell, const EventContext &ctx) const override
virtual StatusCode execute (CaloCellContainer *cellCollection, const EventContext &ctx) const
 AthAlgTool (const std::string &type, const std::string &name, const IInterface *parent)
 Constructor with parameters:
ServiceHandle< StoreGateSvc > & evtStore ()
 The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.
const ServiceHandle< StoreGateSvc > & detStore () const
 The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.
virtual StatusCode sysInitialize () override
 Perform system initialization for an algorithm.
virtual StatusCode sysStart () override
 Handle START transition.
virtual std::vector< Gaudi::DataHandle * > inputHandles () const override
 Return this algorithm's input handles.
virtual std::vector< Gaudi::DataHandle * > outputHandles () const override
 Return this algorithm's output handles.
Gaudi::Details::PropertyBase & declareProperty (Gaudi::Property< T, V, H > &t)
void updateVHKA (Gaudi::Details::PropertyBase &)
MsgStream & msg () const
bool msgLvl (const MSG::Level lvl) const

Static Public Member Functions

static const InterfaceID & interfaceID ()

Protected Member Functions

void renounceArray (SG::VarHandleKeyArray &handlesArray)
 remove all handles from I/O resolution
std::enable_if_t< std::is_void_v< std::result_of_t< decltype(&T::renounce)(T)> > &&!std::is_base_of_v< SG::VarHandleKeyArray, T > &&std::is_base_of_v< Gaudi::DataHandle, T >, void > renounce (T &h)
void extraDeps_update_handler (Gaudi::Details::PropertyBase &ExtraDeps)
 Add StoreName to extra input/output deps as needed.

Static Protected Member Functions

static void setenergy (CaloCell *lar_cell, float energy)
static void addenergy (CaloCell *lar_cell, float energy)
static void scaleenergy (CaloCell *lar_cell, float scale)

Private Types

typedef ServiceHandle< StoreGateSvcStoreGateSvc_t

Private Member Functions

Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyType &)
 specialization for handling Gaudi::Property<SG::VarHandleKey>

Private Attributes

const LArEM_IDm_emID
const LArHEC_IDm_hecID
const LArFCAL_IDm_fcalID
StoreGateSvc_t m_evtStore
 Pointer to StoreGate (event store by default)
StoreGateSvc_t m_detStore
 Pointer to StoreGate (detector store by default)
std::vector< SG::VarHandleKeyArray * > m_vhka
bool m_varHandleArraysDeclared

Static Private Attributes

static const double m_etatrans = 0.8
static const double m_etrans [6]
static const double m_emax [6]
static const double m_p0 [6][2]
static const double m_p1 [6][2]
static const double m_p2 [6][2]
static const double m_p3 [6][2]

Detailed Description

Add non linearity in calorimeter for test at L2.

PACKAGE: offline/LArCalorimeter/LArCellRec

Author
G.Unal CREATED: August 2003
      (non linearity = residuals of a linear calibration
       fit, from L.Serin)

Definition at line 31 of file LArNonLinearity.h.

Member Typedef Documentation

◆ StoreGateSvc_t

typedef ServiceHandle<StoreGateSvc> AthCommonDataStore< AthCommonMsg< AlgTool > >::StoreGateSvc_t
privateinherited

Definition at line 388 of file AthCommonDataStore.h.

Constructor & Destructor Documentation

◆ LArNonLinearity()

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

Definition at line 74 of file LArNonLinearity.cxx.

76 : CaloCellCorrection(type, name, parent),m_emID(nullptr),m_hecID(nullptr),m_fcalID(nullptr)
77
78{
79
80}
const LArEM_ID * m_emID
const LArFCAL_ID * m_fcalID
const LArHEC_ID * m_hecID

◆ ~LArNonLinearity()

LArNonLinearity::~LArNonLinearity ( )
virtualdefault

Member Function Documentation

◆ addenergy()

void CaloCellCorrection::addenergy ( CaloCell * lar_cell,
float energy )
staticprotectedinherited

Definition at line 86 of file CaloCellCorrection.cxx.

87{
88 theCell->addEnergy( energy );
89}

◆ AthAlgTool()

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

Constructor with parameters:

Definition at line 31 of file AthAlgTool.cxx.

◆ declareGaudiProperty()

Gaudi::Details::PropertyBase & AthCommonDataStore< AthCommonMsg< AlgTool > >::declareGaudiProperty ( Gaudi::Property< T, V, H > & hndl,
const SG::VarHandleKeyType &  )
inlineprivateinherited

specialization for handling Gaudi::Property<SG::VarHandleKey>

Definition at line 156 of file AthCommonDataStore.h.

158 {
160 hndl.value(),
161 hndl.documentation());
162
163 }
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)

◆ declareProperty()

Gaudi::Details::PropertyBase & AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty ( Gaudi::Property< T, V, H > & t)
inlineinherited

Definition at line 145 of file AthCommonDataStore.h.

145 {
146 typedef typename SG::HandleClassifier<T>::type htype;
148 }
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>

◆ detStore()

const ServiceHandle< StoreGateSvc > & AthCommonDataStore< AthCommonMsg< AlgTool > >::detStore ( ) const
inlineinherited

The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.

Definition at line 95 of file AthCommonDataStore.h.

◆ evtStore()

ServiceHandle< StoreGateSvc > & AthCommonDataStore< AthCommonMsg< AlgTool > >::evtStore ( )
inlineinherited

The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.

Definition at line 85 of file AthCommonDataStore.h.

◆ execute()

StatusCode CaloCellCorrection::execute ( CaloCellContainer * cellCollection,
const EventContext & ctx ) const
virtualinherited

Definition at line 50 of file CaloCellCorrection.cxx.

52{
53
54 ATH_MSG_DEBUG("Executing CaloCellCorrection");
55
56 if (!cellCollection) {
57 ATH_MSG_ERROR( "Cell Correction tool receives invalid cell Collection" );
58 return StatusCode::FAILURE;
59 }
60
61 // Loop over all the CaloCell Objects and call Make Correction.
62 // Note that this is the base class of all the concrete correction
63 // classes which implement a Make Correction method.
64
65 for (CaloCell* cell : *cellCollection) {
66 MakeCorrection ( cell, ctx );
67 }
68
69 // Done, Return success
70
71 return StatusCode::SUCCESS;
72
73}
#define ATH_MSG_ERROR(x)
#define ATH_MSG_DEBUG(x)
virtual void MakeCorrection(CaloCell *cellCollection, const EventContext &ctx) const =0

◆ extraDeps_update_handler()

void AthCommonDataStore< AthCommonMsg< AlgTool > >::extraDeps_update_handler ( Gaudi::Details::PropertyBase & ExtraDeps)
protectedinherited

Add StoreName to extra input/output deps as needed.

use the logic of the VarHandleKey to parse the DataObjID keys supplied via the ExtraInputs and ExtraOuputs Properties to add the StoreName if it's not explicitly given

◆ initialize()

StatusCode LArNonLinearity::initialize ( )
overridevirtual

Definition at line 83 of file LArNonLinearity.cxx.

84{
85 ATH_MSG_INFO( name() );
86 ATH_MSG_INFO( " Initialize LArNonLinearity " );
87
88 // pointer to identifier helpers:
89 ATH_CHECK(detStore()->retrieve(m_emID,"LArEM_ID"));
90 ATH_CHECK(detStore()->retrieve(m_hecID,"HEC_ID"));
91 ATH_CHECK(detStore()->retrieve(m_fcalID,"FCAL_ID"));
92
93 return StatusCode::SUCCESS;
94}
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_INFO(x)
const ServiceHandle< StoreGateSvc > & detStore() const
retrieve(aClass, aKey=None)
Definition PyKernel.py:110

◆ inputHandles()

virtual std::vector< Gaudi::DataHandle * > AthCommonDataStore< AthCommonMsg< AlgTool > >::inputHandles ( ) const
overridevirtualinherited

Return this algorithm's input handles.

We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.

◆ interfaceID()

const InterfaceID & CaloCellCorrection::interfaceID ( )
inlinestaticinherited

Definition at line 51 of file CaloCellCorrection.h.

static const InterfaceID IID_CaloCellCorrection("CaloCellCorrection", 1, 0)

◆ MakeCorrection()

void LArNonLinearity::MakeCorrection ( CaloCell * theCell,
const EventContext & ctx ) const
overridevirtual

Implements CaloCellCorrection.

Definition at line 103 of file LArNonLinearity.cxx.

105{
106 float eta = theCell->eta();
107 Identifier id = theCell->ID();
108
109 double corr=0. ; // corr=residual to subtract to
110 // true energy
111 double energy = theCell->energy();
112
113 if(m_emID->is_lar_em(id) &&
114 m_emID->is_em_barrel(id) ) // only for barrel EM Calorimeter:
115 {
116
117 int sampling = m_emID->sampling(id);
118 if (sampling >0 && sampling < 4) // nothing for barrel PS
119 {
120
121// check A or B electrodes
122 int ielec;
123 if (fabs(eta)<m_etatrans) {ielec=0;}
124 else {ielec=1;}
125 int index =ielec + 2*(sampling-1); // from 0 to 5 (see above)
126
127 if (energy>2.*GeV)
128 ATH_MSG_DEBUG( " energy " << energy
129 << " sampling " << sampling
130 << " eta " << eta
131 << " index " << index );
132
133// check E less than E maximum validity
134
135 if (energy < m_emax[index] )
136 {
137// energy range (high gain or middle gain)
138 int irange;
139 if (energy < m_etrans[index] ) {irange=0;}
140 else {irange=1;}
141
142 if (irange==0)
143 { // ignore offset for high gain
144 corr = m_p1[index][irange] *energy
145 +m_p2[index][irange] *energy*energy
146 +m_p3[index][irange] *energy*energy*energy;
147 } else
148 {
149 corr = m_p0[index][irange]
150 +m_p1[index][irange] *energy
151 +m_p2[index][irange] *energy*energy
152 +m_p3[index][irange] *energy*energy*energy;
153 }
154// convert corr back to GEV
155 corr = corr*GeV;
156
157 if (energy>2.*GeV)
158 {
159 ATH_MSG_DEBUG( " pol coeff " << m_p0[index][irange] << " "
160 << m_p1[index][irange] << " " << m_p2[index][irange] << " "
161 << m_p3[index][irange] );
162 ATH_MSG_DEBUG( "energy,index,corr = " << energy << " " << index << " " << corr );
163 }
164
165 }
166 }
167 } // ENDIF for barrel EM
168
169
170// Correct cell energy
171
172 setenergy(theCell, energy-corr);
173
174}
Scalar eta() const
pseudorapidity method
static void setenergy(CaloCell *lar_cell, float energy)
double energy() const
get energy (data member)
Definition CaloCell.h:327
virtual double eta() const override final
get eta (through CaloDetDescrElement)
Definition CaloCell.h:382
Identifier ID() const
get ID (from cached data member) non-virtual and inline for fast access
Definition CaloCell.h:295
static const double m_emax[6]
static const double m_etrans[6]
static const double m_p3[6][2]
static const double m_etatrans
static const double m_p2[6][2]
static const double m_p0[6][2]
static const double m_p1[6][2]
str index
Definition DeMoScan.py:362

◆ msg()

MsgStream & AthCommonMsg< AlgTool >::msg ( ) const
inlineinherited

Definition at line 24 of file AthCommonMsg.h.

24 {
25 return this->msgStream();
26 }

◆ msgLvl()

bool AthCommonMsg< AlgTool >::msgLvl ( const MSG::Level lvl) const
inlineinherited

Definition at line 30 of file AthCommonMsg.h.

30 {
31 return this->msgLevel(lvl);
32 }

◆ outputHandles()

virtual std::vector< Gaudi::DataHandle * > AthCommonDataStore< AthCommonMsg< AlgTool > >::outputHandles ( ) const
overridevirtualinherited

Return this algorithm's output handles.

We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.

◆ renounce()

std::enable_if_t< std::is_void_v< std::result_of_t< decltype(&T::renounce)(T)> > &&!std::is_base_of_v< SG::VarHandleKeyArray, T > &&std::is_base_of_v< Gaudi::DataHandle, T >, void > AthCommonDataStore< AthCommonMsg< AlgTool > >::renounce ( T & h)
inlineprotectedinherited

Definition at line 380 of file AthCommonDataStore.h.

381 {
382 h.renounce();
384 }
std::enable_if_t< std::is_void_v< std::result_of_t< decltype(&T::renounce)(T)> > &&!std::is_base_of_v< SG::VarHandleKeyArray, T > &&std::is_base_of_v< Gaudi::DataHandle, T >, void > renounce(T &h)

◆ renounceArray()

void AthCommonDataStore< AthCommonMsg< AlgTool > >::renounceArray ( SG::VarHandleKeyArray & handlesArray)
inlineprotectedinherited

remove all handles from I/O resolution

Definition at line 364 of file AthCommonDataStore.h.

364 {
366 }

◆ scaleenergy()

void CaloCellCorrection::scaleenergy ( CaloCell * lar_cell,
float scale )
staticprotectedinherited

Definition at line 91 of file CaloCellCorrection.cxx.

92{
93 theCell->scaleEnergy( scale );
94}

◆ setenergy()

void CaloCellCorrection::setenergy ( CaloCell * lar_cell,
float energy )
staticprotectedinherited

Definition at line 81 of file CaloCellCorrection.cxx.

82{
83 theCell->setEnergy( energy );
84}

◆ sysInitialize()

virtual StatusCode AthCommonDataStore< AthCommonMsg< AlgTool > >::sysInitialize ( )
overridevirtualinherited

Perform system initialization for an algorithm.

We override this to declare all the elements of handle key arrays at the end of initialization. See comments on updateVHKA.

Reimplemented in asg::AsgMetadataTool, AthCheckedComponent< AthAlgTool >, AthCheckedComponent<::AthAlgTool >, and DerivationFramework::CfAthAlgTool.

◆ sysStart()

virtual StatusCode AthCommonDataStore< AthCommonMsg< AlgTool > >::sysStart ( )
overridevirtualinherited

Handle START transition.

We override this in order to make sure that conditions handle keys can cache a pointer to the conditions container.

◆ updateVHKA()

void AthCommonDataStore< AthCommonMsg< AlgTool > >::updateVHKA ( Gaudi::Details::PropertyBase & )
inlineinherited

Definition at line 308 of file AthCommonDataStore.h.

308 {
309 // debug() << "updateVHKA for property " << p.name() << " " << p.toString()
310 // << " size: " << m_vhka.size() << endmsg;
311 for (auto &a : m_vhka) {
313 for (auto k : keys) {
314 k->setOwner(this);
315 }
316 }
317 }
std::vector< SG::VarHandleKeyArray * > m_vhka

Member Data Documentation

◆ m_detStore

StoreGateSvc_t AthCommonDataStore< AthCommonMsg< AlgTool > >::m_detStore
privateinherited

Pointer to StoreGate (detector store by default)

Definition at line 393 of file AthCommonDataStore.h.

◆ m_emax

const double LArNonLinearity::m_emax
staticprivate
Initial value:
=
{60.*GeV, 60.*GeV, 260.*GeV, 500.*GeV, 170.*GeV, 250.*GeV}

Definition at line 45 of file LArNonLinearity.h.

45 :
46

◆ m_emID

const LArEM_ID* LArNonLinearity::m_emID
private

Definition at line 56 of file LArNonLinearity.h.

◆ m_etatrans

const double LArNonLinearity::m_etatrans = 0.8
staticprivate

Definition at line 47 of file LArNonLinearity.h.

◆ m_etrans

const double LArNonLinearity::m_etrans
staticprivate
Initial value:
=
{6.5*GeV, 6.0*GeV, 26.0*GeV, 50.0*GeV, 17.5*GeV, 25.0*GeV }

Definition at line 40 of file LArNonLinearity.h.

◆ m_evtStore

StoreGateSvc_t AthCommonDataStore< AthCommonMsg< AlgTool > >::m_evtStore
privateinherited

Pointer to StoreGate (event store by default)

Definition at line 390 of file AthCommonDataStore.h.

◆ m_fcalID

const LArFCAL_ID* LArNonLinearity::m_fcalID
private

Definition at line 58 of file LArNonLinearity.h.

◆ m_hecID

const LArHEC_ID* LArNonLinearity::m_hecID
private

Definition at line 57 of file LArNonLinearity.h.

◆ m_p0

const double LArNonLinearity::m_p0
staticprivate
Initial value:
=
{{0.44e-2, 0.158}, {0.691e-3, 0.121},
{0.166e-1, 0.226}, {0.347e-1, 0.753},
{0.869e-2, 0.269}, {0.422e-1, 0.3598}}

Definition at line 49 of file LArNonLinearity.h.

◆ m_p1

const double LArNonLinearity::m_p1
staticprivate
Initial value:
=
{{-0.16e-2/GeV, -0.159e-1/GeV}, {+0.379e-2/GeV, -0.100e-1/GeV},
{-0.105e-2/GeV, -0.1559e-2/GeV}, {-0.605e-2/GeV, -0.452e-2/GeV},
{+0.248e-2/GeV, -0.252e-2/GeV}, {-0.690e-2/GeV, -0.881e-2/GeV}}

Definition at line 53 of file LArNonLinearity.h.

◆ m_p2

const double LArNonLinearity::m_p2
staticprivate
Initial value:
=
{{-0.45e-3/(GeV*GeV),+0.406e-3/(GeV*GeV)},
{-0.252e-2/(GeV*GeV), +0.159e-3/(GeV*GeV)},
{-0.208e-3/(GeV*GeV),-0.263e-4/(GeV*GeV)},
{-0.66e-3/(GeV*GeV), -0.146e-4/(GeV*GeV)},
{-0.920e-3/(GeV*GeV),-0.645e-4/(GeV*GeV)},
{+0.689e-4/(GeV*GeV), +0.4773e-4/(GeV*GeV)}}

Definition at line 57 of file LArNonLinearity.h.

◆ m_p3

const double LArNonLinearity::m_p3
staticprivate
Initial value:
=
{{0.1037e-3/(GeV*GeV*GeV), -0.291e-5/(GeV*GeV*GeV)},
{+0.332e-3/(GeV*GeV*GeV), -0.309e-7/(GeV*GeV*GeV)},
{+0.100e-4/(GeV*GeV*GeV), +0.1300e-6/(GeV*GeV*GeV)},
{+0.115e-4/(GeV*GeV*GeV), +0.545e-7/(GeV*GeV*GeV)},
{0.472e-4/(GeV*GeV*GeV), 0.459e-6/(GeV*GeV*GeV)},
{0.759e-5/(GeV*GeV*GeV), -0.543e-7/(GeV*GeV*GeV)}}

Definition at line 64 of file LArNonLinearity.h.

94 : public CaloCellCorrection
95{
96
97 public:
98
99 LArNonLinearity(const std::string& type, const std::string& name,
100 const IInterface* parent);
101
102 virtual ~LArNonLinearity();
103 virtual StatusCode initialize() override;
104
105 virtual void MakeCorrection (CaloCell* theCell,
106 const EventContext& ctx) const override;
107
108 private:
109
110 static const double m_etatrans;
111 static const double m_etrans[6];
112 static const double m_emax[6];
113 static const double m_p0[6][2];
114 static const double m_p1[6][2];
115 static const double m_p2[6][2];
116 static const double m_p3[6][2];
117
118 // Identifiers
119 const LArEM_ID* m_emID;
120 const LArHEC_ID* m_hecID;
121 const LArFCAL_ID* m_fcalID;
122
123};
124
125#endif // of LARCELLREC_LARNONLINEARITY
virtual StatusCode initialize() override
LArNonLinearity(const std::string &type, const std::string &name, const IInterface *parent)
virtual ~LArNonLinearity()
virtual void MakeCorrection(CaloCell *theCell, const EventContext &ctx) const override
::StatusCode StatusCode
StatusCode definition for legacy code.

◆ m_varHandleArraysDeclared

bool AthCommonDataStore< AthCommonMsg< AlgTool > >::m_varHandleArraysDeclared
privateinherited

Definition at line 399 of file AthCommonDataStore.h.

◆ m_vhka

std::vector<SG::VarHandleKeyArray*> AthCommonDataStore< AthCommonMsg< AlgTool > >::m_vhka
privateinherited

Definition at line 398 of file AthCommonDataStore.h.


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