|
ATLAS Offline Software
|
#include <LarEMSamplingFraction.h>
|
| LarEMSamplingFraction (const std::string &name, ISvcLocator *pSvcLocator) |
|
virtual | ~LarEMSamplingFraction () |
|
virtual StatusCode | initialize () override |
|
virtual StatusCode | execute () override |
|
virtual StatusCode | finalize () override |
|
virtual StatusCode | sysInitialize () override |
| Override sysInitialize. More...
|
|
virtual const DataObjIDColl & | extraOutputDeps () const override |
| Return the list of extra output dependencies. More...
|
|
ServiceHandle< StoreGateSvc > & | evtStore () |
| The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc . More...
|
|
const ServiceHandle< StoreGateSvc > & | evtStore () const |
| The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc . More...
|
|
const ServiceHandle< StoreGateSvc > & | detStore () const |
| The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc . More...
|
|
virtual StatusCode | sysStart () override |
| Handle START transition. More...
|
|
virtual std::vector< Gaudi::DataHandle * > | inputHandles () const override |
| Return this algorithm's input handles. More...
|
|
virtual std::vector< Gaudi::DataHandle * > | outputHandles () const override |
| Return this algorithm's output handles. More...
|
|
Gaudi::Details::PropertyBase & | declareProperty (Gaudi::Property< T > &t) |
|
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, SG::VarHandleKey &hndl, const std::string &doc, const SG::VarHandleKeyType &) |
| Declare a new Gaudi property. More...
|
|
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, SG::VarHandleBase &hndl, const std::string &doc, const SG::VarHandleType &) |
| Declare a new Gaudi property. More...
|
|
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, SG::VarHandleKeyArray &hndArr, const std::string &doc, const SG::VarHandleKeyArrayType &) |
|
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, T &property, const std::string &doc, const SG::NotHandleType &) |
| Declare a new Gaudi property. More...
|
|
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, T &property, const std::string &doc="none") |
| Declare a new Gaudi property. More...
|
|
void | updateVHKA (Gaudi::Details::PropertyBase &) |
|
MsgStream & | msg () const |
|
MsgStream & | msg (const MSG::Level lvl) const |
|
bool | msgLvl (const MSG::Level lvl) const |
|
Definition at line 27 of file LarEMSamplingFraction.h.
◆ StoreGateSvc_t
◆ LarEMSamplingFraction() [1/2]
LarEMSamplingFraction::LarEMSamplingFraction |
( |
const std::string & |
name, |
|
|
ISvcLocator * |
pSvcLocator |
|
) |
| |
◆ ~LarEMSamplingFraction()
LarEMSamplingFraction::~LarEMSamplingFraction |
( |
| ) |
|
|
virtual |
◆ LarEMSamplingFraction() [2/2]
LarEMSamplingFraction::LarEMSamplingFraction |
( |
| ) |
|
|
private |
◆ declareGaudiProperty() [1/4]
specialization for handling Gaudi::Property<SG::VarHandleKeyArray>
Definition at line 170 of file AthCommonDataStore.h.
175 hndl.documentation());
◆ declareGaudiProperty() [2/4]
specialization for handling Gaudi::Property<SG::VarHandleKey>
Definition at line 156 of file AthCommonDataStore.h.
161 hndl.documentation());
◆ declareGaudiProperty() [3/4]
specialization for handling Gaudi::Property<SG::VarHandleBase>
Definition at line 184 of file AthCommonDataStore.h.
189 hndl.documentation());
◆ declareGaudiProperty() [4/4]
◆ declareProperty() [1/6]
Declare a new Gaudi property.
- Parameters
-
name | Name of the property. |
hndl | Object holding the property value. |
doc | Documentation string for the property. |
This is the version for types that derive from SG::VarHandleBase
. The property value object is put on the input and output lists as appropriate; then we forward to the base class.
Definition at line 245 of file AthCommonDataStore.h.
250 this->declare(hndl.
vhKey());
251 hndl.
vhKey().setOwner(
this);
253 return PBASE::declareProperty(
name,hndl,
doc);
◆ declareProperty() [2/6]
Declare a new Gaudi property.
- Parameters
-
name | Name of the property. |
hndl | Object holding the property value. |
doc | Documentation string for the property. |
This is the version for types that derive from SG::VarHandleKey
. The property value object is put on the input and output lists as appropriate; then we forward to the base class.
Definition at line 221 of file AthCommonDataStore.h.
229 return PBASE::declareProperty(
name,hndl,
doc);
◆ declareProperty() [3/6]
◆ declareProperty() [4/6]
Declare a new Gaudi property.
- Parameters
-
name | Name of the property. |
property | Object holding the property value. |
doc | Documentation string for the property. |
This is the generic version, for types that do not derive from SG::VarHandleKey
. It just forwards to the base class version of declareProperty
.
Definition at line 333 of file AthCommonDataStore.h.
338 return PBASE::declareProperty(
name, property,
doc);
◆ declareProperty() [5/6]
Declare a new Gaudi property.
- Parameters
-
name | Name of the property. |
property | Object holding the property value. |
doc | Documentation string for the property. |
This dispatches to either the generic declareProperty
or the one for VarHandle/Key/KeyArray.
Definition at line 352 of file AthCommonDataStore.h.
◆ declareProperty() [6/6]
◆ detStore()
◆ evtStore() [1/2]
◆ evtStore() [2/2]
◆ execute()
StatusCode LarEMSamplingFraction::execute |
( |
| ) |
|
|
overridevirtual |
!
Definition at line 114 of file LarEMSamplingFraction.cxx.
120 ATH_CHECK( tileSamplingFraction.isValid() );
123 std::vector<const CaloCalibrationHitContainer *> v_cchc;
125 if ( !
evtStore()->contains<CaloCalibrationHitContainer>(containerName))
127 ATH_MSG_ERROR(
"SG does not contain calibration hit container " << containerName);
128 return StatusCode::FAILURE;
135 ATH_MSG_ERROR(
"Cannot retrieve calibration hit container " << containerName);
140 v_cchc.push_back(cchc);
147 if (
sc.isFailure()||!truthEvent)
150 return StatusCode::FAILURE;
195 Long64_t cell_identifier=0;
196 float cell_energy_reco=0;
197 float cell_energy_active_total_corrected=0;
198 float cell_energy_active_total=0;
199 float cell_energy_inactive_total=0;
205 std::map< Long64_t , cell_info > cell_info_map;
207 for(
int s=0;
s<24;
s++)
234 double Etot = calibHit->energyTotal();
235 double Eem = calibHit->energyEM();
236 double Enonem = calibHit->energyNonEM();
237 double Einv = calibHit->energyInvisible();
238 double Eesc = calibHit->energyEscaped();
247 if((sampling>=0 && sampling<=11) || (sampling>=21 && sampling<=23)) Efactor=1/fSampl->
FSAMPL(
id);
248 if((sampling>=12 && sampling<=20)) {
252 Efactor = tileSamplingFraction->getSamplingFraction(drawerIdx,
channel);
260 ATH_MSG_VERBOSE(
"cellID "<<
id<<
" layer "<<sampling<<
" energyTotal "<<Etot<<
" Eem "<<Eem<<
" Enonem "<<Enonem<<
" Einv "<<Einv<<
" Eesc "<<Eesc<<
" Efactor="<<Efactor);
262 if(sampling>=0 && sampling<=23)
265 cell_info_map[
id.get_compact()].cell_identifier=
id.get_compact();
266 cell_info_map[
id.get_compact()].cell_sampling=sampling;
267 cell_info_map[
id.get_compact()].cell_eta=caloDDE->
eta_raw();
268 cell_info_map[
id.get_compact()].cell_phi=caloDDE->
phi_raw();
279 if(
m_docells) cell_info_map[
id.get_compact()].cell_energy_inactive_total+=Etot;
292 cell_info_map[
id.get_compact()].cell_energy_active_total_corrected+=Etot*Efactor;
293 cell_info_map[
id.get_compact()].cell_energy_active_total+=Etot;
306 sc =
evtStore()->retrieve(cellColl,
"AllCalo");
308 if (
sc.isFailure()) {
312 ATH_MSG_DEBUG(
"Found: "<<cellColl->size()<<
" calorimeter cells");
320 if((sampling>=12 && sampling<=20)) {
328 cell_info_map[
id.get_compact()].cell_identifier=
id.get_compact();
329 cell_info_map[
id.get_compact()].cell_sampling=sampling;
330 cell_info_map[
id.get_compact()].cell_eta=caloDDE->
eta_raw();
331 cell_info_map[
id.get_compact()].cell_phi=caloDDE->
phi_raw();
332 cell_info_map[
id.get_compact()].cell_energy_reco+=
cell->energy();
339 const std::vector<std::string> lArKeys = {
"LArHitEMB",
"LArHitEMEC",
"LArHitFCAL",
"LArHitHEC"};
340 for (
const std::string& containerName: lArKeys) {
345 for (
const LArHit* larHit : *larContainer) {
348 if(!hitElement)
continue;
355 ATH_MSG_DEBUG(
"Read "<<hitnumber<<
" G4Hits from "<<containerName);
365 for(
const TileHit& hit : *hitVec) {
374 for (
int tilesubhit_i = 0; tilesubhit_i<hit.size(); tilesubhit_i++) {
376 ATH_MSG_DEBUG(
"Tile subhit: "<<tilesubhit_i<<
"/"<<hit.size()<<
" E: "<<hit.energy(tilesubhit_i) );
381 ATH_MSG_DEBUG(
"Read "<<hitnumber<<
" G4Hits from TileHitVec");
384 for(
auto&
cell:cell_info_map) {
423 return StatusCode::SUCCESS;
◆ extraDeps_update_handler()
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
◆ extraOutputDeps()
const DataObjIDColl & AthAlgorithm::extraOutputDeps |
( |
| ) |
const |
|
overridevirtualinherited |
Return the list of extra output dependencies.
This list is extended to include symlinks implied by inheritance relations.
Definition at line 50 of file AthAlgorithm.cxx.
57 return Algorithm::extraOutputDeps();
◆ finalize()
StatusCode LarEMSamplingFraction::finalize |
( |
| ) |
|
|
overridevirtual |
◆ initialize()
StatusCode LarEMSamplingFraction::initialize |
( |
| ) |
|
|
overridevirtual |
Definition at line 43 of file LarEMSamplingFraction.cxx.
50 m_mytree =
new TTree(
"mytree",
"mytree");
91 if(
m_tileID==0)
throw std::runtime_error(
"ISF_HitAnalysis: Invalid Tile ID helper");
101 return StatusCode::SUCCESS;
◆ inputHandles()
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.
◆ msg() [1/2]
◆ msg() [2/2]
◆ msgLvl()
◆ outputHandles()
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()
◆ renounceArray()
◆ sysInitialize()
StatusCode AthAlgorithm::sysInitialize |
( |
| ) |
|
|
overridevirtualinherited |
◆ sysStart()
Handle START transition.
We override this in order to make sure that conditions handle keys can cache a pointer to the conditions container.
◆ updateVHKA()
◆ m_CalibrationHitContainerNames
std::vector<std::string> LarEMSamplingFraction::m_CalibrationHitContainerNames |
|
private |
◆ m_calo_id
◆ m_caloMgrKey
Initial value:{ this
, "CaloDetDescrManager"
, "CaloDetDescrManager"
, "SG Key for CaloDetDescrManager in the Condition Store" }
Definition at line 80 of file LarEMSamplingFraction.h.
◆ m_cell_energy_active_total
std::vector<float>* LarEMSamplingFraction::m_cell_energy_active_total {nullptr} |
|
private |
◆ m_cell_energy_active_total_corrected
std::vector<float>* LarEMSamplingFraction::m_cell_energy_active_total_corrected {nullptr} |
|
private |
◆ m_cell_energy_inactive_total
std::vector<float>* LarEMSamplingFraction::m_cell_energy_inactive_total {nullptr} |
|
private |
◆ m_cell_energy_reco
std::vector<float>* LarEMSamplingFraction::m_cell_energy_reco {nullptr} |
|
private |
◆ m_cell_eta
std::vector<float>* LarEMSamplingFraction::m_cell_eta {nullptr} |
|
private |
◆ m_cell_identifier
std::vector<Long64_t>* LarEMSamplingFraction::m_cell_identifier {nullptr} |
|
private |
◆ m_cell_phi
std::vector<float>* LarEMSamplingFraction::m_cell_phi {nullptr} |
|
private |
◆ m_cell_sampling
std::vector<int>* LarEMSamplingFraction::m_cell_sampling {nullptr} |
|
private |
◆ m_detStore
◆ m_docells
bool LarEMSamplingFraction::m_docells {true} |
|
private |
◆ m_energy_active_em
std::vector<float>* LarEMSamplingFraction::m_energy_active_em {nullptr} |
|
private |
◆ m_energy_active_esc
std::vector<float>* LarEMSamplingFraction::m_energy_active_esc {nullptr} |
|
private |
◆ m_energy_active_inv
std::vector<float>* LarEMSamplingFraction::m_energy_active_inv {nullptr} |
|
private |
◆ m_energy_active_nonem
std::vector<float>* LarEMSamplingFraction::m_energy_active_nonem {nullptr} |
|
private |
◆ m_energy_active_total
std::vector<float>* LarEMSamplingFraction::m_energy_active_total {nullptr} |
|
private |
◆ m_energy_active_total_corrected
std::vector<float>* LarEMSamplingFraction::m_energy_active_total_corrected {nullptr} |
|
private |
◆ m_energy_hit
std::vector<float>* LarEMSamplingFraction::m_energy_hit {nullptr} |
|
private |
◆ m_energy_inactive_em
std::vector<float>* LarEMSamplingFraction::m_energy_inactive_em {nullptr} |
|
private |
◆ m_energy_inactive_esc
std::vector<float>* LarEMSamplingFraction::m_energy_inactive_esc {nullptr} |
|
private |
◆ m_energy_inactive_inv
std::vector<float>* LarEMSamplingFraction::m_energy_inactive_inv {nullptr} |
|
private |
◆ m_energy_inactive_nonem
std::vector<float>* LarEMSamplingFraction::m_energy_inactive_nonem {nullptr} |
|
private |
◆ m_energy_inactive_total
std::vector<float>* LarEMSamplingFraction::m_energy_inactive_total {nullptr} |
|
private |
◆ m_energy_reco
std::vector<float>* LarEMSamplingFraction::m_energy_reco {nullptr} |
|
private |
◆ m_evtStore
◆ m_extendedExtraObjects
DataObjIDColl AthAlgorithm::m_extendedExtraObjects |
|
privateinherited |
◆ m_fSamplKey
◆ m_mc_e
double LarEMSamplingFraction::m_mc_e {0.} |
|
private |
◆ m_mc_eta
double LarEMSamplingFraction::m_mc_eta {0.} |
|
private |
◆ m_mc_pdg
int LarEMSamplingFraction::m_mc_pdg {0} |
|
private |
◆ m_mc_phi
double LarEMSamplingFraction::m_mc_phi {0.} |
|
private |
◆ m_mc_pt
double LarEMSamplingFraction::m_mc_pt {0.} |
|
private |
◆ m_mytree
TTree* LarEMSamplingFraction::m_mytree {nullptr} |
|
private |
◆ m_tileCabling
◆ m_tileCablingSvc
Initial value:{ this,
"TileCablingSvc", "TileCablingSvc", "Tile cabling service"}
Name of Tile cabling service.
Definition at line 102 of file LarEMSamplingFraction.h.
◆ m_tileHWID
◆ m_tileID
const TileID* LarEMSamplingFraction::m_tileID {nullptr} |
|
private |
◆ m_tileSamplingFractionKey
◆ m_varHandleArraysDeclared
◆ m_vhka
The documentation for this class was generated from the following files:
def retrieve(aClass, aKey=None)
SG::ReadCondHandleKey< CaloDetDescrManager > m_caloMgrKey
const TileHWID * m_tileHWID
std::vector< float > * m_energy_inactive_nonem
std::vector< float > * m_energy_active_total
std::vector< float > * m_cell_energy_inactive_total
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
ServiceHandle< TileCablingSvc > m_tileCablingSvc
Name of Tile cabling service.
std::vector< float > * m_cell_eta
This class groups all DetDescr information related to a CaloCell. Provides a generic interface for al...
const CaloDetDescrElement * get_element(const Identifier &cellId) const
get element by its identifier
StoreGateSvc_t m_evtStore
Pointer to StoreGate (event store by default)
std::vector< SG::VarHandleKeyArray * > m_vhka
SG::ReadCondHandleKey< TileSamplingFraction > m_tileSamplingFractionKey
Name of TileSamplingFraction in condition store.
#define ATH_MSG_VERBOSE(x)
std::vector< Long64_t > * m_cell_identifier
int channel(const HWIdentifier &id) const
extract channel field from HW identifier
float eta_raw() const
cell eta_raw
const ServiceHandle< StoreGateSvc > & detStore() const
The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.
virtual void setOwner(IDataHandleHolder *o)=0
std::vector< float > * m_energy_inactive_total
std::vector< std::string > m_CalibrationHitContainerNames
ServiceHandle< StoreGateSvc > & evtStore()
The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.
const TileID * getTileID(void) const
Identifier identify() const override final
cell identifier
virtual StatusCode sysInitialize() override
Override sysInitialize.
std::vector< float > * m_energy_active_total_corrected
This class initializes the Calo (LAr and Tile) offline identifiers.
std::vector< float > * m_energy_active_esc
virtual std::vector< Gaudi::DataHandle * > outputHandles() const override
Return this algorithm's output handles.
std::vector< float > * m_energy_active_inv
const CaloCell_ID * m_calo_id
::StatusCode StatusCode
StatusCode definition for legacy code.
std::vector< float > * m_energy_inactive_inv
virtual const float & FSAMPL(const HWIdentifier &id) const =0
std::vector< float > * m_cell_phi
std::vector< float > * m_cell_energy_active_total_corrected
std::vector< float > * m_energy_reco
std::vector< float > * m_energy_active_em
StoreGateSvc_t m_detStore
Pointer to StoreGate (detector store by default)
SG::ReadCondHandleKey< ILArfSampl > m_fSamplKey
std::vector< int > * m_cell_sampling
virtual void renounce()=0
std::conditional< std::is_base_of< SG::VarHandleKeyArray, T >::value, VarHandleKeyArrayType, type2 >::type type
Class to store calorimeter calibration hit.
int drawerIdx(const HWIdentifier &id) const
construct drawer index from HW identifier
const TileCablingService * m_tileCabling
StatusCode initialize(bool used=true)
Class to store hit energy and time in LAr cell from G4 simulation.
Container class for CaloCell.
DataObjIDColl m_extendedExtraObjects
This class provides the client interface for accessing the detector description information common to...
Data object for each calorimeter readout cell.
CaloCell_ID::CaloSample getSampling() const
cell sampling
#define ATH_MSG_WARNING(x)
std::vector< float > * m_cell_energy_active_total
std::vector< float > * m_energy_active_nonem
SG::VarHandleKey & vhKey()
Return a non-const reference to the HandleKey.
GenEvent::particle_iterator begin(HepMC::GenEvent &e)
AthAlgorithm()
Default constructor:
std::vector< float > * m_energy_inactive_esc
Identifier cell_id(const Identifier &any_id) const
constexpr int pow(int base, int exp) noexcept
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>
std::vector< float > * m_cell_energy_reco
std::vector< float > * m_energy_hit
std::vector< float > * m_energy_inactive_em
float phi_raw() const
cell phi_raw
HWIdentifier s2h_channel_id(const Identifier &id) const