![Logo](../../ATLAS-Logo-Square-Blue-RGB.png) |
ATLAS Offline Software
|
Go to the documentation of this file.
22 #include "GaudiKernel/ServiceHandle.h"
23 #include "GaudiKernel/Incident.h"
31 #include "CLHEP/Random/RandFlat.h"
38 const std::string&
n,
const IInterface*
p):
41 declareInterface<TruthClusterizationFactory>(
this);
56 return StatusCode::FAILURE;
64 return StatusCode::SUCCESS;
71 const EventContext& ctx = Gaudi::Hive::currentContext();
78 std::vector<double> probabilities(3,0.);
79 const auto &rdos = pCluster.
rdoList();
80 unsigned int nPartContributing = 0;
86 for (
auto rdoIter : rdos){
87 auto simDataIter = pixSdoColl->find(rdoIter);
88 if (simDataIter != pixSdoColl->end()){
90 auto simData = (simDataIter->second);
91 for(
const auto& deposit :
simData.getdeposits() ){
96 int bc = deposit.first.barcode();
104 nPartContributing =
barcodes.size();
106 ATH_MSG_VERBOSE(
"Smearing TruthClusterizationFactory probability output for TIDE studies");
109 if (nPartContributing<=1) {
111 probabilities[0] = 1.0;
114 else if (nPartContributing==2) {
118 else probabilities[0] = 1.0;
121 else if (nPartContributing>2) {
125 else probabilities[0] = 1.0;
128 return probabilities;
134 ATH_MSG_ERROR(
"TruthClusterizationFactory::estimatePositions called for ITk ambiguity setup, should never happen! Digital clustering should be run for positions & errors.");
ServiceHandle< IAthRNGSvc > m_rndmSvc
This is an Identifier helper class for the Pixel subdetector. This class is a factory for creating co...
void setSeed(const std::string &algName, const EventContext &ctx)
Set the random seed using a string (e.g.
Eigen::Matrix< double, 2, 1 > Vector2D
DUMMY Primary Vertex Finder.
const std::vector< Identifier > & rdoList() const
return the List of rdo identifiers (pointers)
ATHRNG::RNGWrapper * m_rndmEngine
#define ATH_MSG_VERBOSE(x)
SG::ReadHandleKey< InDetSimDataCollection > m_simDataCollectionName
IncidentSvc to catch begining of event and end of event.
def barcodes(beg, end, sz)
::StatusCode StatusCode
StatusCode definition for legacy code.
#define CHECK(...)
Evaluate an expression and check for errors.
StatusCode initialize(bool used=true)
If this object is used as a property, then this should be called during the initialize phase.
virtual bool isValid() override final
Can the handle be successfully dereferenced?
TruthClusterizationFactory(const std::string &name, const std::string &n, const IInterface *p)
A wrapper class for event-slot-local random engines.
virtual StatusCode initialize()
Gaudi::Property< bool > m_discardPUHits
CLHEP::HepRandomEngine * getEngine(const EventContext &ctx) const
Retrieve the random engine corresponding to the provided EventContext.
Gaudi::Property< float > m_truthClusterSplittingEff
#define ATH_MSG_WARNING(x)
std::vector< double > estimateNumberOfParticles(const InDet::PixelCluster &pCluster) const
Gaudi::Property< std::string > m_rndmEngineName
#define ATLAS_THREAD_SAFE
Define macros for attributes used to control the static checker.
EventContext::ContextEvt_t evtSeeded() const
Return the event count at which the current slot was last seeded.
std::vector< Amg::Vector2D > estimatePositions(const InDet::PixelCluster &) const