|
ATLAS Offline Software
|
Go to the documentation of this file.
13 #include "GaudiKernel/ServiceHandle.h"
14 #include "GaudiKernel/ITHistSvc.h"
15 #include "Gaudi/Property.h"
28 , ISvcLocator* pSvcLocator)
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;
109 return StatusCode::SUCCESS;
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)) {
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;
def retrieve(aClass, aKey=None)
SG::ReadCondHandleKey< CaloDetDescrManager > m_caloMgrKey
const TileHWID * m_tileHWID
float getSamplingFraction(unsigned int drawerIdx, unsigned int channel) const
Return Tile Calorimeter sampling fraction.
std::vector< float > * m_energy_inactive_nonem
std::vector< float > * m_energy_active_total
std::vector< float > * m_cell_energy_inactive_total
virtual StatusCode finalize() override
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
SG::ReadCondHandleKey< TileSamplingFraction > m_tileSamplingFractionKey
Name of TileSamplingFraction in condition store.
virtual StatusCode execute() override
virtual ~LarEMSamplingFraction()
#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.
std::vector< float > * m_energy_inactive_total
std::vector< std::string > m_CalibrationHitContainerNames
LarEMSamplingFraction()
Default constructor:
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
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 StatusCode initialize() override
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
SG::ReadCondHandleKey< ILArfSampl > m_fSamplKey
std::vector< int > * m_cell_sampling
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.
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
GenEvent::particle_iterator begin(HepMC::GenEvent &e)
std::vector< float > * m_energy_inactive_esc
Identifier cell_id(const Identifier &any_id) const
constexpr int pow(int base, int exp) noexcept
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