 |
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_WARNING(
"SG does not contain calibration hit container " << containerName);
134 ATH_MSG_ERROR(
"Cannot retrieve calibration hit container " << containerName);
139 v_cchc.push_back(cchc);
146 if (
sc.isFailure()||!truthEvent)
149 return StatusCode::FAILURE;
194 Long64_t cell_identifier=0;
195 float cell_energy_reco=0;
196 float cell_energy_active_total_corrected=0;
197 float cell_energy_active_total=0;
198 float cell_energy_inactive_total=0;
204 std::map< Long64_t , cell_info > cell_info_map;
206 for(
int s=0;
s<24;
s++)
233 double Etot = calibHit->energyTotal();
234 double Eem = calibHit->energyEM();
235 double Enonem = calibHit->energyNonEM();
236 double Einv = calibHit->energyInvisible();
237 double Eesc = calibHit->energyEscaped();
246 if((sampling>=0 && sampling<=11) || (sampling>=21 && sampling<=23)) Efactor=1/fSampl->
FSAMPL(
id);
247 if((sampling>=12 && sampling<=20)) {
259 ATH_MSG_VERBOSE(
"cellID "<<
id<<
" layer "<<sampling<<
" energyTotal "<<Etot<<
" Eem "<<Eem<<
" Enonem "<<Enonem<<
" Einv "<<Einv<<
" Eesc "<<Eesc<<
" Efactor="<<Efactor);
261 if(sampling>=0 && sampling<=23)
264 cell_info_map[
id.get_compact()].cell_identifier=
id.get_compact();
265 cell_info_map[
id.get_compact()].cell_sampling=sampling;
266 cell_info_map[
id.get_compact()].cell_eta=caloDDE->
eta_raw();
267 cell_info_map[
id.get_compact()].cell_phi=caloDDE->
phi_raw();
278 if(
m_docells) cell_info_map[
id.get_compact()].cell_energy_inactive_total+=Etot;
291 cell_info_map[
id.get_compact()].cell_energy_active_total_corrected+=Etot*Efactor;
292 cell_info_map[
id.get_compact()].cell_energy_active_total+=Etot;
305 sc =
evtStore()->retrieve(cellColl,
"AllCalo");
307 if (
sc.isFailure()) {
311 ATH_MSG_DEBUG(
"Found: "<<cellColl->size()<<
" calorimeter cells");
319 if((sampling>=12 && sampling<=20)) {
327 cell_info_map[
id.get_compact()].cell_identifier=
id.get_compact();
328 cell_info_map[
id.get_compact()].cell_sampling=sampling;
329 cell_info_map[
id.get_compact()].cell_eta=caloDDE->
eta_raw();
330 cell_info_map[
id.get_compact()].cell_phi=caloDDE->
phi_raw();
331 cell_info_map[
id.get_compact()].cell_energy_reco+=
cell->energy();
338 const std::vector<std::string> lArKeys = {
"LArHitEMB",
"LArHitEMEC",
"LArHitFCAL",
"LArHitHEC"};
339 for (
const std::string& containerName: lArKeys) {
344 for (
const LArHit* larHit : *larContainer) {
347 if(!hitElement)
continue;
354 ATH_MSG_DEBUG(
"Read "<<hitnumber<<
" G4Hits from "<<containerName);
364 for(
const TileHit& hit : *hitVec) {
373 for (
int tilesubhit_i = 0; tilesubhit_i<hit.size(); tilesubhit_i++) {
375 ATH_MSG_DEBUG(
"Tile subhit: "<<tilesubhit_i<<
"/"<<hit.size()<<
" E: "<<hit.energy(tilesubhit_i) );
380 ATH_MSG_DEBUG(
"Read "<<hitnumber<<
" G4Hits from TileHitVec");
383 for(
auto&
cell:cell_info_map) {
422 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
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
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)
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