|
ATLAS Offline Software
|
Go to the documentation of this file.
19 #include "CaloGeoHelpers/CaloSampling.h"
21 #include "CaloDetDescr/CaloDetDescrElement.h"
28 #include "G4Version.hh"
32 using CLHEP::Hep3Vector;
41 , m_inputCollectionKey(
"EventSteps")
42 , m_outputCollectionKey(
"MergedEventSteps")
49 "max distance squared after which the hits will be truncated");
51 "energy border, that truncation won't cross");
53 "maximal radius squared until two hits will be combined");
55 "maximal radius in LAr squared until two hits will be combined");
57 "maximal radius in HEC squared until two hits will be combined");
59 "maximal radius in FCAL squared until two hits will be combined");
61 "maximal radius in Tile squared until two hits will be combined");
71 "energy fraction that will be inside containment borders");
73 "List of files to read library structures from");
75 "the allowed amount of energy that can be deposited outside calorimeter region ");
86 return StatusCode::SUCCESS;
93 ATH_CHECK(outputHandle.record(std::make_unique<ISF_FCS_Parametrization::FCS_StepInfoCollection>()));
98 for (
const auto *
const step: *inputHandle ) {
99 auto&& stepCopy = std::make_unique<ISF_FCS_Parametrization::FCS_StepInfo>(*
step);
100 outputHandle->push_back( stepCopy.release() );
110 return StatusCode::SUCCESS;
115 ATH_MSG_DEBUG(
"Initial clusterize size: "<<stepinfo->
size()<<
" - will merge steps in the same cell which are less than dR and dT to each other");
116 double total_energy1(0.);
117 for (
const auto step: *stepinfo) {
118 total_energy1+=
step->energy();
120 ATH_MSG_DEBUG(
"Check: total energy before clusterize "<<total_energy1);
127 std::map<Identifier, ISF_FCS_Parametrization::FCS_StepInfoCollection*> FCS_SIC_cells;
128 for (
const auto step: *stepinfo) {
129 if (FCS_SIC_cells.find(
step->identify()) != FCS_SIC_cells.end()) {
130 auto&& stepCopy = std::make_unique<ISF_FCS_Parametrization::FCS_StepInfo>(*
step);
131 FCS_SIC_cells[
step->identify()]->push_back( stepCopy.release() );
134 auto && new_fcs_sic = std::make_unique<ISF_FCS_Parametrization::FCS_StepInfoCollection>();
135 auto&& stepCopy = std::make_unique<ISF_FCS_Parametrization::FCS_StepInfo>(*
step);
136 new_fcs_sic->push_back( stepCopy.release() );
137 FCS_SIC_cells.insert(std::pair<Identifier, ISF_FCS_Parametrization::FCS_StepInfoCollection*>(
step->identify(),new_fcs_sic.release()));
141 ATH_MSG_DEBUG(
"Merging separately in each cell: Ncells: "<<FCS_SIC_cells.size());
144 std::stable_sort(FCS_SIC_cells[
it->first]->begin(), FCS_SIC_cells[
it->first]->end(),
SortByE());
150 else if ((
it->second)->size()==1) {
178 while (
it1 != (
it->second)->end() ) {
180 while (it2 != (
it->second)->end()) {
181 if (((*it1)->diff2(**it2) < dsame) && std::fabs((*it1)->time() - (*it2)->time()) < tsame ) {
183 it2 = (
it->second)->erase(it2);
195 for (
const auto step: *(
it->second)) {
196 auto&& stepCopy = std::make_unique<ISF_FCS_Parametrization::FCS_StepInfo>(*
step);
197 stepinfo->push_back( stepCopy.release() );
203 double total_energy2(0.);
204 for (
const auto step: *stepinfo) {
205 total_energy2+=
step->energy();
209 unsigned int nInvalid(0);
212 while(stepIter != stepinfo->end()) {
213 if ((*stepIter)->valid()) {
218 stepIter = stepinfo->erase(stepIter);
220 ATH_MSG_DEBUG(
"Removed "<<nInvalid<<
" StepInfo objects. New collection size: "<<stepinfo->size());
221 return StatusCode::SUCCESS;
229 while (stepIter != stepinfo->
end()) {
230 if ((
m_truncate>=2)&&((*stepIter)->time()>1000)) {
231 stepIter = stepinfo->
erase(stepIter);
238 return StatusCode::SUCCESS;
JetConstituentVector::iterator iterator
virtual StatusCode initialize() override final
FastCaloSimParamAlg(const std::string &name, ISvcLocator *pSvcLocator)
StringArrayProperty m_lib_struct_files
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
SG::ReadHandleKey< ISF_FCS_Parametrization::FCS_StepInfoCollection > m_inputCollectionKey
const CaloDetDescrElement * get_element(const Identifier &cellId) const
get element by its identifier
DoubleProperty m_minEnergy
property, see LArG4GenShowerLib::LArG4GenShowerLib
DoubleProperty m_energyFraction
property, see LArG4GenShowerLib::LArG4GenShowerLib
DoubleProperty m_maxRadiusLAr
property, see LArG4GenShowerLib::LArG4GenShowerLib
DoubleProperty m_maxRadiusFCAL
property, see LArG4GenShowerLib::LArG4GenShowerLib
#define ATH_MSG_VERBOSE(x)
SG::WriteHandleKey< ISF_FCS_Parametrization::FCS_StepInfoCollection > m_outputCollectionKey
SG::ReadCondHandleKey< CaloDetDescrManager > m_caloMgrKey
Definition of CaloDetDescrManager.
bool operator()(const ISF_FCS_Parametrization::FCS_StepInfo &step1, const ISF_FCS_Parametrization::FCS_StepInfo &step2)
DoubleProperty m_containmentEnergy
property, see LArG4GenShowerLib::LArG4GenShowerLib
DoubleProperty m_maxRadiusHEC
property, see LArG4GenShowerLib::LArG4GenShowerLib
DoubleProperty m_maxTimeHEC
StatusCode clusterize(ISF_FCS_Parametrization::FCS_StepInfoCollection *stepinfo) const
(Non-const) Iterator class for DataVector/DataList.
DoubleProperty m_maxTimeLAr
std::vector< HWIdentifier >::iterator it1
::StatusCode StatusCode
StatusCode definition for legacy code.
DoubleProperty m_maxTimeTile
StatusCode truncate(ISF_FCS_Parametrization::FCS_StepInfoCollection *stepinfo) const
StatusCode initialize(bool used=true)
If this object is used as a property, then this should be called during the initialize phase.
DoubleProperty m_maxDistance
StatusCode initialize(bool used=true)
const_iterator end() const noexcept
Return a const_iterator pointing past the end of the collection.
DoubleProperty m_truncate
This class provides the client interface for accessing the detector description information common to...
CaloCell_ID::CaloSample getSampling() const
cell sampling
#define ATH_MSG_WARNING(x)
float energy(int ind=0) const
Return energy of ind-th sub-hit
Class for collection of StepInfo class (G4 hits) copied and modified version to ISF.
DoubleProperty m_maxTimeFCAL
iterator erase(iterator position)
Remove element at a given position.
BooleanProperty m_clusterize
DoubleProperty m_maxRadiusTile
property, see LArG4GenShowerLib::LArG4GenShowerLib
size_type size() const noexcept
Returns the number of elements in the collection.
DoubleProperty m_maxRadius
property, see LArG4GenShowerLib::LArG4GenShowerLib
virtual StatusCode execute() override final
const_iterator begin() const noexcept
Return a const_iterator pointing at the beginning of the collection.