53 m_h_rdoID = new TH1F("h_rdoID", "rdoID", 100, 0, 10e17);
54 m_h_rdoID->StatOverflows();
55 ATH_CHECK(histSvc()->regHist(m_histPath + m_h_rdoID->GetName(), m_h_rdoID));
58 return StatusCode::SUCCESS;
75 const EventContext& ctx{Gaudi::Hive::currentContext()};
87 bool doTruthMatching =
true;
88 const HepMC::GenEvent* hardScatterEvent(
nullptr);
90 if (mcEventCollection->
size()==0){
91 ATH_MSG_WARNING(
"Failed to retrieve a nonzero sized truth event collection, disabling truthMatching");
92 doTruthMatching =
false;
94 if(doTruthMatching) hardScatterEvent = mcEventCollection->
at(0);
100 const Identifier rdoIDColl((*rdoCont_itr)->identify());
109 const Identifier rdoID((*rdo_itr)->identify());
128 float rdo_toa = (*rdo_itr)->getTOA();
135 InDetSimDataCollection::const_iterator iter = (*simDataMap).find((*rdo_itr)->identify());
136 std::vector<SdoInfo> sdo_info;
137 if ( iter != (*simDataMap).end() ) {
139 const std::vector< InDetSimData::Deposit >& deposits = sdo.
getdeposits();
140 for( std::vector< InDetSimData::Deposit >::const_iterator nextdeposit = deposits.begin() ; nextdeposit!=deposits.end(); ++nextdeposit) {
143 sdoi.
time = nextdeposit->second;
150 sdo_info.push_back(sdoi);
157 sdo_info.push_back(sdoi);
161 std::sort(sdo_info.begin(), sdo_info.end());
162 if (sdo_info.size() > 0) {
177 return StatusCode::SUCCESS;
181 bool decision =
false;
184 particlePtr->momentum().perp() >= min_pt_cut and
185 particlePtr->momentum().eta() < 4. and
186 particlePtr->parent_event() == hardScatterGenEvent)
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_WARNING(x)
bool isCharged(const T &p)
ATLAS-specific HepMC functions.
Handle class for reading from StoreGate.
const ServiceHandle< StoreGateSvc > & detStore() const
const ServiceHandle< ITHistSvc > & histSvc() const
The standard THistSvc (for writing histograms and TTrees and more to a root file) Returns (kind of) a...
DataModel_detail::const_iterator< DataVector > const_iterator
const T * at(size_type n) const
Access an element, as an rvalue.
const_iterator end() const noexcept
Return a const_iterator pointing past the end of the collection.
const_iterator begin() const noexcept
Return a const_iterator pointing at the beginning of the collection.
size_type size() const noexcept
Returns the number of elements in the collection.
std::vector< float > m_rdo_module_x
bool isHSGoodParticle(HepMC::ConstGenParticlePtr particlePtr, const HepMC::GenEvent *hardScatterEvent, float min_pt_cut=1000.)
std::vector< unsigned long long > m_rdo_module_ID
std::vector< float > m_rdo_hit_sdo_toa
virtual StatusCode initialize() override final
std::vector< float > m_rdo_hit_z
Gaudi::Property< std::string > m_ntupleName
const HGTD_ID * m_HGTD_ID
std::vector< float > m_rdo_hit_x
Gaudi::Property< std::string > m_HGTDID_Name
SG::ReadHandleKey< HGTD_RDO_Container > m_inputKey
SG::ReadHandleKey< InDetSimDataCollection > m_inputTruthKey
std::vector< int > m_rdo_hit_sdo_truth_category
std::vector< float > m_rdo_hit_toa
Gaudi::Property< std::string > m_HGTD_Name
std::vector< float > m_rdo_hit_y
std::vector< float > m_rdo_module_y
std::vector< int > m_rdo_module_layer
SG::ReadHandleKey< McEventCollection > m_inputMcEventCollectionKey
Gaudi::Property< std::string > m_ntuplePath
std::vector< float > m_rdo_module_z
virtual StatusCode execute() override final
const HGTD_DetectorManager * m_HGTD_Manager
a link optimized in size for a GenParticle in a McEventCollection
bool isValid() const
Validity check.
HepMC::ConstGenParticlePtr cptr() const
Dereference.
const_iterator end() const
return const_iterator for end of container
const_iterator begin() const
return const_iterator for first entry
value_type get_compact() const
Get the compact id.
Class to hold geometrical description of an HGTD detector element.
Class to represent a position in the natural frame of a silicon sensor, for Pixel and SCT For Pixel: ...
HepGeom::Point3D< double > globalPosition(const HepGeom::Point3D< double > &localPos) const
transform a reconstruction local position into a global position (inline):
Amg::Vector2D rawLocalPositionOfCell(const SiCellId &cellId) const
Returns position (center) of cell.
const std::vector< Deposit > & getdeposits() const
This defines the McEventCollection, which is really just an ObjectVector of McEvent objectsFile: Gene...
Eigen::Matrix< double, 3, 1 > Vector3D
const GenParticle * ConstGenParticlePtr
bool isGenStable(const T &p)
Determine if the particle is stable at the generator (not det-sim) level,.
const T * get(const ReadCondHandleKey< T > &key, const EventContext &ctx)
Convenience function to retrieve an object given a ReadCondHandleKey.
void sort(typename DataModel_detail::iterator< DVL > beg, typename DataModel_detail::iterator< DVL > end)
Specialization of sort for DataVector/List.