ATLAS Offline Software
Public Member Functions | Static Public Member Functions | Protected Member Functions | Private Types | Private Member Functions | Static Private Member Functions | Private Attributes | Static Private Attributes | List of all members
InDet::NnClusterizationFactory Class Reference

#include <NnClusterizationFactory.h>

Inheritance diagram for InDet::NnClusterizationFactory:
Collaboration diagram for InDet::NnClusterizationFactory:

Public Member Functions

 NnClusterizationFactory (const std::string &name, const std::string &n, const IInterface *p)
 
 ~NnClusterizationFactory ()=default
 
virtual StatusCode initialize () override
 
virtual StatusCode finalize () override
 
std::vector< double > estimateNumberOfParticles (const InDet::PixelCluster &pCluster, Amg::Vector3D &beamSpotPosition) const
 
std::vector< double > estimateNumberOfParticles (const InDet::PixelCluster &pCluster, const Trk::Surface &pixelSurface, const Trk::TrackParameters &trackParsAtSurface) const
 
std::vector< Amg::Vector2DestimatePositions (const InDet::PixelCluster &pCluster, Amg::Vector3D &beamSpotPosition, std::vector< Amg::MatrixX > &errors, int numberSubClusters) const
 
std::vector< Amg::Vector2DestimatePositions (const InDet::PixelCluster &pCluster, const Trk::Surface &pixelSurface, const Trk::TrackParameters &trackParsAtSurface, std::vector< Amg::MatrixX > &errors, int numberSubClusters) const
 
ServiceHandle< StoreGateSvc > & evtStore ()
 The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc. More...
 
const ServiceHandle< StoreGateSvc > & evtStore () const
 The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc. More...
 
const ServiceHandle< StoreGateSvc > & detStore () const
 The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc. More...
 
virtual StatusCode sysInitialize () override
 Perform system initialization for an algorithm. More...
 
virtual StatusCode sysStart () override
 Handle START transition. More...
 
virtual std::vector< Gaudi::DataHandle * > inputHandles () const override
 Return this algorithm's input handles. More...
 
virtual std::vector< Gaudi::DataHandle * > outputHandles () const override
 Return this algorithm's output handles. More...
 
Gaudi::Details::PropertyBase & declareProperty (Gaudi::Property< T > &t)
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, SG::VarHandleKey &hndl, const std::string &doc, const SG::VarHandleKeyType &)
 Declare a new Gaudi property. More...
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, SG::VarHandleBase &hndl, const std::string &doc, const SG::VarHandleType &)
 Declare a new Gaudi property. More...
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, SG::VarHandleKeyArray &hndArr, const std::string &doc, const SG::VarHandleKeyArrayType &)
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, T &property, const std::string &doc, const SG::NotHandleType &)
 Declare a new Gaudi property. More...
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, T &property, const std::string &doc="none")
 Declare a new Gaudi property. More...
 
void updateVHKA (Gaudi::Details::PropertyBase &)
 
MsgStream & msg () const
 
MsgStream & msg (const MSG::Level lvl) const
 
bool msgLvl (const MSG::Level lvl) const
 

Static Public Member Functions

static const InterfaceID & interfaceID ()
 AlgTool interface methods. More...
 

Protected Member Functions

void renounceArray (SG::VarHandleKeyArray &handlesArray)
 remove all handles from I/O resolution More...
 
std::enable_if_t< std::is_void_v< std::result_of_t< decltype(&T::renounce)(T)> > &&!std::is_base_of_v< SG::VarHandleKeyArray, T > &&std::is_base_of_v< Gaudi::DataHandle, T >, void > renounce (T &h)
 
void extraDeps_update_handler (Gaudi::Details::PropertyBase &ExtraDeps)
 Add StoreName to extra input/output deps as needed. More...
 

Private Types

enum  ENetworkType {
  kNumberParticlesNN, kPositionNN, kErrorXNN, kErrorYNN,
  kNNetworkTypes
}
 
typedef std::vector< Eigen::VectorXd > InputVector
 
using ReturnType = std::vector< Double_t >
 
using InputType = std::vector< Double_t >
 
typedef ServiceHandle< StoreGateSvcStoreGateSvc_t
 

Private Member Functions

std::vector< double > estimateNumberOfParticlesTTN (const TTrainedNetworkCollection &nn_collection, const std::vector< double > &inputData) const
 
std::vector< double > estimateNumberOfParticlesLWTNN (NnClusterizationFactory::InputVector &input) const
 
std::vector< Amg::Vector2DestimatePositionsTTN (const TTrainedNetworkCollection &nn_collection, const std::vector< double > &inputData, const NNinput &input, const InDet::PixelCluster &pCluster, int numberSubClusters, std::vector< Amg::MatrixX > &errors) const
 
std::vector< Amg::Vector2DestimatePositionsLWTNN (NnClusterizationFactory::InputVector &input, NNinput &rawInput, const InDet::PixelCluster &pCluster, int numberSubClusters, std::vector< Amg::MatrixX > &errors) const
 
double correctedRMSY (double posPixels, std::vector< float > &pitches) const
 
NNinput createInput (const InDet::PixelCluster &pCluster, Amg::Vector3D &beamSpotPosition, double &tanl) const
 
void addTrackInfoToInput (NNinput &input, const Trk::Surface &pixelSurface, const Trk::TrackParameters &trackParsAtSurface, const double tanl) const
 
std::vector< double > assembleInputRunI (NNinput &input) const
 
std::vector< double > assembleInputRunII (NNinput &input) const
 
InputVector eigenInput (NNinput &input) const
 
std::vector< Amg::Vector2DgetPositionsFromOutput (std::vector< double > &output, const NNinput &input, const InDet::PixelCluster &pCluster) const
 
void getErrorMatrixFromOutput (std::vector< double > &outputX, std::vector< double > &outputY, std::vector< Amg::MatrixX > &errorMatrix, int nParticles) const
 
size_t calculateVectorDimension (const bool useTrackInfo) const
 
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T > &hndl, const SG::VarHandleKeyType &)
 specialization for handling Gaudi::Property<SG::VarHandleKey> More...
 
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T > &hndl, const SG::VarHandleKeyArrayType &)
 specialization for handling Gaudi::Property<SG::VarHandleKeyArray> More...
 
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T > &hndl, const SG::VarHandleType &)
 specialization for handling Gaudi::Property<SG::VarHandleBase> More...
 
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T > &t, const SG::NotHandleType &)
 specialization for handling everything that's not a Gaudi::Property<SG::VarHandleKey> or a <SG::VarHandleKeyArray> More...
 

Static Private Member Functions

static double correctedRMSX (double posPixels)
 

Private Attributes

Gaudi::Property< std::vector< std::string > > m_nnOrder
 
unsigned int m_nParticleNNId {}
 
std::vector< std::vector< unsigned int > > m_NNId {}
 
std::vector< double >(InDet::NnClusterizationFactory::* m_assembleInput )(NNinput &input) const
 
ReturnType(::TTrainedNetwork::* m_calculateOutput )(const InputType &input) const
 
ToolHandle< ISiLorentzAngleToolm_pixelLorentzAngleTool {this, "PixelLorentzAngleTool", "SiLorentzAngleTool/PixelLorentzAngleTool", "Tool to retreive Lorentz angle of Pixel"}
 
ServiceHandle< InDetDD::IPixelReadoutManagerm_pixelReadout {this, "PixelReadoutManager", "PixelReadoutManager", "Pixel readout manager" }
 
SG::ReadCondHandleKey< PixelChargeCalibCondDatam_chargeDataKey {this, "PixelChargeCalibCondData", "PixelChargeCalibCondData", "Output key"}
 
SG::ReadCondHandleKey< TTrainedNetworkCollectionm_readKeyWithoutTrack {this, "NnCollectionReadKey", "PixelClusterNN", "The conditions store key for the pixel cluster NNs"}
 
SG::ReadCondHandleKey< TTrainedNetworkCollectionm_readKeyWithTrack
 
SG::ReadCondHandleKey< LWTNNCollectionm_readKeyJSON
 
Gaudi::Property< std::size_t > m_outputNodesPos1
 
Gaudi::Property< std::vector< std::size_t > > m_outputNodesPos2
 
Gaudi::Property< std::vector< std::size_t > > m_outputNodesPos3
 
Gaudi::Property< unsigned int > m_maxSubClusters {this, "MaxSubClusters", 3, "Maximum number of sub cluster supported by the networks." }
 
Gaudi::Property< double > m_correctLorShiftBarrelWithoutTracks {this, "correctLorShiftBarrelWithoutTracks",0.,"Lorentz shift correction factor when evaluating NN without track input."}
 
Gaudi::Property< double > m_correctLorShiftBarrelWithTracks {this, "correctLorShiftBarrelWithTracks",0.,"Lorentz shift correction factor when evaluating NN with track input."}
 
Gaudi::Property< bool > m_useToT {this, "useToT",true,"Use Tot rather than charge." }
 
Gaudi::Property< bool > m_addIBL {this, "addIBL", false, "Also apply to clusters in IBL." }
 
Gaudi::Property< bool > m_doRunI {this, "doRunI", false, "Use runI style network (outputs are not normalised; add pitches; use charge if not m_useToT)"}
 
Gaudi::Property< bool > m_useTTrainedNetworks {this, "useTTrainedNetworks", false, "Use earlier (release-21-like) neural networks stored in ROOT files and accessed via TTrainedNetowrk."}
 
Gaudi::Property< bool > m_useRecenteringNNWithouTracks {this, "useRecenteringNNWithoutTracks",false,"Recenter x position when evaluating NN without track input."}
 
Gaudi::Property< bool > m_useRecenteringNNWithTracks {this, "useRecenteringNNWithTracks",false,"Recenter x position when evaluating NN with track input."}
 
Gaudi::Property< unsigned int > m_sizeX {this, "sizeX",7,"Size of pixel matrix along X"}
 
Gaudi::Property< unsigned int > m_sizeY {this, "sizeY",7,"Size of pixel matrix along Y"}
 
StoreGateSvc_t m_evtStore
 Pointer to StoreGate (event store by default) More...
 
StoreGateSvc_t m_detStore
 Pointer to StoreGate (detector store by default) More...
 
std::vector< SG::VarHandleKeyArray * > m_vhka
 
bool m_varHandleArraysDeclared
 

Static Private Attributes

static constexpr std::array< std::string_view, kNNetworkTypess_nnTypeNames
 
static constexpr std::array< unsigned int, kNNetworkTypesm_nParticleGroup {0U,1U,1U,1U}
 
static const std::array< std::regex, kNNetworkTypesm_nnNames
 

Detailed Description

Definition at line 90 of file NnClusterizationFactory.h.

Member Typedef Documentation

◆ InputType

using InDet::NnClusterizationFactory::InputType = std::vector<Double_t>
private

Definition at line 232 of file NnClusterizationFactory.h.

◆ InputVector

typedef std::vector<Eigen::VectorXd> InDet::NnClusterizationFactory::InputVector
private

Definition at line 127 of file NnClusterizationFactory.h.

◆ ReturnType

using InDet::NnClusterizationFactory::ReturnType = std::vector<Double_t>
private

Definition at line 231 of file NnClusterizationFactory.h.

◆ StoreGateSvc_t

typedef ServiceHandle<StoreGateSvc> AthCommonDataStore< AthCommonMsg< AlgTool > >::StoreGateSvc_t
privateinherited

Definition at line 388 of file AthCommonDataStore.h.

Member Enumeration Documentation

◆ ENetworkType

Enumerator
kNumberParticlesNN 
kPositionNN 
kErrorXNN 
kErrorYNN 
kNNetworkTypes 

Definition at line 207 of file NnClusterizationFactory.h.

208  kPositionNN,
209  kErrorXNN,
210  kErrorYNN,

Constructor & Destructor Documentation

◆ NnClusterizationFactory()

InDet::NnClusterizationFactory::NnClusterizationFactory ( const std::string &  name,
const std::string &  n,
const IInterface *  p 
)

Definition at line 61 of file NnClusterizationFactory.cxx.

63  : AthAlgTool(name, n, p){
64  declareInterface<NnClusterizationFactory>(this);
65  }

◆ ~NnClusterizationFactory()

InDet::NnClusterizationFactory::~NnClusterizationFactory ( )
default

Member Function Documentation

◆ addTrackInfoToInput()

void InDet::NnClusterizationFactory::addTrackInfoToInput ( NNinput input,
const Trk::Surface pixelSurface,
const Trk::TrackParameters trackParsAtSurface,
const double  tanl 
) const
private

Definition at line 741 of file NnClusterizationFactory.cxx.

744  {
745  input.useTrackInfo=true;
746  Amg::Vector3D particleDir = trackParsAtSurface.momentum().unit();
747  Amg::Vector3D localIntersection = pixelSurface.transform().inverse().linear() * particleDir;
748  localIntersection *= 0.250/cos(localIntersection.theta());
749  float trackDeltaX = (float)localIntersection.x();
750  float trackDeltaY = (float)localIntersection.y();
751  input.theta=std::atan2(trackDeltaY,0.250);
752  input.phi=std::atan2(trackDeltaX,0.250);
753  ATH_MSG_VERBOSE("Angle phi bef Lorentz corr: " << input.phi );
754  input.phi=std::atan(std::tan(input.phi)-tanl);
755  ATH_MSG_VERBOSE(" From track: angle phi: " << input.phi << " theta: " << input.theta );
756  }

◆ assembleInputRunI()

std::vector< double > InDet::NnClusterizationFactory::assembleInputRunI ( NNinput input) const
private

Definition at line 177 of file NnClusterizationFactory.cxx.

177  {
178  const auto vectorSize{calculateVectorDimension(input.useTrackInfo)};
179  const auto invalidValue{std::numeric_limits<double>::quiet_NaN()};
180  std::vector<double> inputData(vectorSize, invalidValue);
181  size_t vectorIndex{0};
182  for (unsigned int u=0;u<m_sizeX;u++){
183  for (unsigned int s=0;s<m_sizeY;s++){
184  if (m_useToT){
185  inputData[vectorIndex++] = norm_rawToT(input.matrixOfToT[u][s]);
186  } else {
187  inputData[vectorIndex++] = norm_ToT(input.matrixOfToT[u][s]);
188  }
189  }
190  }
191  for (unsigned int s=0;s<m_sizeY;s++){
192  const double rawPitch(input.vectorOfPitchesY[s]);
193  const double normPitch(norm_pitch(rawPitch,m_addIBL));
194  if (std::isnan(normPitch)){
195  ATH_MSG_ERROR("NaN returned from norm_pitch, rawPitch = "<<rawPitch<<" addIBL = "<<m_addIBL);
196  }
197  inputData[vectorIndex++] = normPitch;
198  }
199  inputData[vectorIndex++] = norm_layerNumber(input.ClusterPixLayer);
200  inputData[vectorIndex++] = norm_layerType(input.ClusterPixBarrelEC);
201  if (input.useTrackInfo){
202  inputData[vectorIndex++] = norm_phi(input.phi);
203  inputData[vectorIndex] = norm_theta(input.theta);
204  } else {
205  inputData[vectorIndex++] = norm_phiBS(input.phi);
206  inputData[vectorIndex++] = norm_thetaBS(input.theta);
207  inputData[vectorIndex] = norm_etaModule(input.etaModule);
208  }
209  return inputData;
210  }

◆ assembleInputRunII()

std::vector< double > InDet::NnClusterizationFactory::assembleInputRunII ( NNinput input) const
private

Definition at line 155 of file NnClusterizationFactory.cxx.

155  {
156  const auto vectorSize{calculateVectorDimension(input.useTrackInfo)};
157  const auto invalidValue{std::numeric_limits<double>::quiet_NaN()};
158  std::vector<double> inputData(vectorSize, invalidValue);
159  size_t vectorIndex{0};
160  for (unsigned int u=0;u<m_sizeX;u++){
161  for (unsigned int s=0;s<m_sizeY;s++){
162  inputData[vectorIndex++] = input.matrixOfToT[u][s];
163  }
164  }
165  for (unsigned int s=0;s<m_sizeY;s++){
166  inputData[vectorIndex++] = input.vectorOfPitchesY[s];
167  }
168  inputData[vectorIndex++] = input.ClusterPixLayer;
169  inputData[vectorIndex++] = input.ClusterPixBarrelEC;
170  inputData[vectorIndex++] = input.phi;
171  inputData[vectorIndex++] = input.theta;
172  if (not input.useTrackInfo) inputData[vectorIndex] = input.etaModule;
173  return inputData;
174  }

◆ calculateVectorDimension()

size_t InDet::NnClusterizationFactory::calculateVectorDimension ( const bool  useTrackInfo) const
private

Definition at line 959 of file NnClusterizationFactory.cxx.

959  {
960  return (m_sizeX * m_sizeY) + m_sizeY + (useTrackInfo ? 4 : 5);
961  }

◆ correctedRMSX()

double InDet::NnClusterizationFactory::correctedRMSX ( double  posPixels)
staticprivate

Definition at line 556 of file NnClusterizationFactory.cxx.

556  {
557  // This gives location in pixels
558  constexpr double pitch = 0.05;
559  const double corrected = posPixels * pitch;
560  return corrected;
561  }

◆ correctedRMSY()

double InDet::NnClusterizationFactory::correctedRMSY ( double  posPixels,
std::vector< float > &  pitches 
) const
private

Definition at line 564 of file NnClusterizationFactory.cxx.

565  {
566  double p = posPixels + (m_sizeY - 1) * 0.5;
567  double p_Y = -100;
568  double p_center = -100;
569  double p_actual = 0;
570  for (unsigned int i = 0; i < m_sizeY; i++) {
571  if (p >= i and p <= (i + 1)) p_Y = p_actual + (p - i + 0.5) * pitches.at(i);
572  if (i == (m_sizeY - 1) / 2) p_center = p_actual + 0.5 * pitches.at(i);
573  p_actual += pitches.at(i);
574  }
575  return std::abs(p_Y - p_center);
576  }

◆ createInput()

NNinput InDet::NnClusterizationFactory::createInput ( const InDet::PixelCluster pCluster,
Amg::Vector3D beamSpotPosition,
double &  tanl 
) const
private

Definition at line 760 of file NnClusterizationFactory.cxx.

762  {
763  NNinput input;
764  ATH_MSG_VERBOSE(" Starting creating input from cluster " );
765  const InDetDD::SiDetectorElement* element=pCluster.detectorElement();
766  if (not element) {
767  ATH_MSG_ERROR("Could not get detector element");
768  return input;
769  }
770  const AtlasDetectorID* aid = element->getIdHelper();
771  if (not aid){
772  ATH_MSG_ERROR("Could not get ATLASDetectorID");
773  return input;
774  }
775 
776  if (aid->helper() != AtlasDetectorID::HelperType::Pixel){
777  ATH_MSG_ERROR("Could not get PixelID pointer");
778  return input;
779  }
780  const PixelID* pixelIDp=static_cast<const PixelID*>(aid);
781  const PixelID& pixelID = *pixelIDp;
782  const InDetDD::PixelModuleDesign* design
783  (dynamic_cast<const InDetDD::PixelModuleDesign*>(&element->design()));
784  if (not design){
785  ATH_MSG_ERROR("Dynamic cast failed at line "<<__LINE__<<" of NnClusterizationFactory.cxx.");
786  return input;
787  }
789  const PixelChargeCalibCondData *calibData = *calibDataHandle;
790  const std::vector<Identifier>& rdos = pCluster.rdoList();
791  const size_t rdoSize = rdos.size();
792  ATH_MSG_VERBOSE(" Number of RDOs: " << rdoSize );
793  const std::vector<float>& chList = pCluster.chargeList();
794  const std::vector<int>& totList = pCluster.totList();
795  std::vector<float> chListRecreated{};
796  chListRecreated.reserve(rdoSize);
797  ATH_MSG_VERBOSE(" Number of charges: " << chList.size() );
798  std::vector<int>::const_iterator tot = totList.begin();
799  std::vector<Identifier>::const_iterator rdosBegin = rdos.begin();
800  std::vector<Identifier>::const_iterator rdosEnd = rdos.end();
801  std::vector<int> totListRecreated{};
802  totListRecreated.reserve(rdoSize);
803  std::vector<int>::const_iterator totRecreated = totListRecreated.begin();
804  // Recreate both charge list and ToT list to correct for the IBL ToT overflow (and later for small hits):
805  ATH_MSG_VERBOSE("Charge list is not filled ... re-creating it.");
806  for ( ; rdosBegin!= rdosEnd and tot != totList.end(); ++tot, ++rdosBegin, ++totRecreated ){
807  // recreate the charge: should be a method of the calibSvc
808  int tot0 = *tot;
809  Identifier pixid = *rdosBegin;
810  Identifier moduleID = pixelID.wafer_id(pixid);
811  IdentifierHash moduleHash = pixelID.wafer_hash(moduleID); // wafer hash
812  unsigned int FE = m_pixelReadout->getFE(pixid, moduleID);
813  InDetDD::PixelDiodeType type = m_pixelReadout->getDiodeType(pixid);
814  float charge = calibData->getCharge(type, moduleHash, FE, tot0);
815  chListRecreated.push_back(charge);
816  totListRecreated.push_back(tot0);
817  }
818  // reset the rdo iterator
819  rdosBegin = rdos.begin();
820  rdosEnd = rdos.end();
821  // and the tot iterator
822  tot = totList.begin();
823  totRecreated = totListRecreated.begin();
824  // Always use recreated charge and ToT lists:
825  std::vector<float>::const_iterator charge = chListRecreated.begin();
826  std::vector<float>::const_iterator chargeEnd = chListRecreated.end();
827  tot = totListRecreated.begin();
828  std::vector<int>::const_iterator totEnd = totListRecreated.end();
829  InDetDD::SiLocalPosition sumOfWeightedPositions(0,0,0);
830  double sumOfTot=0;
831  int rowMin = 999;
832  int rowMax = 0;
833  int colMin = 999;
834  int colMax = 0;
835  for (; (rdosBegin!= rdosEnd) and (charge != chargeEnd) and (tot != totEnd); ++rdosBegin, ++charge, ++tot){
836  Identifier rId = *rdosBegin;
837  int row = pixelID.phi_index(rId);
838  int col = pixelID.eta_index(rId);
839  InDetDD::SiLocalPosition siLocalPosition (design->positionFromColumnRow(col,row));
840  if (not m_useToT){
841  sumOfWeightedPositions += (*charge)*siLocalPosition;
842  sumOfTot += (*charge);
843  } else {
844  sumOfWeightedPositions += ((double)(*tot))*siLocalPosition;
845  sumOfTot += (double)(*tot);
846  }
847  rowMin = std::min(row, rowMin);
848  rowMax = std::max(row, rowMax);
849  colMin = std::min(col, colMin);
850  colMax = std::max(col, colMax);
851 
852  }
853  sumOfWeightedPositions /= sumOfTot;
854  //what you want to know is simple:
855  //just the row and column of this average position!
856  InDetDD::SiCellId cellIdWeightedPosition=design->cellIdOfPosition(sumOfWeightedPositions);
857 
858  if (!cellIdWeightedPosition.isValid()){
859  ATH_MSG_WARNING(" Weighted position is on invalid CellID." );
860  }
861  int columnWeightedPosition=cellIdWeightedPosition.etaIndex();
862  int rowWeightedPosition=cellIdWeightedPosition.phiIndex();
863  ATH_MSG_VERBOSE(" weighted pos row: " << rowWeightedPosition << " col: " << columnWeightedPosition );
864  int centralIndexX=(m_sizeX-1)/2;
865  int centralIndexY=(m_sizeY-1)/2;
866  if (std::abs(rowWeightedPosition-rowMin)>centralIndexX or
867  std::abs(rowWeightedPosition-rowMax)>centralIndexX){
868  ATH_MSG_VERBOSE(" Cluster too large rowMin" << rowMin << " rowMax " << rowMax << " centralX " << centralIndexX);
869  return input;
870  }
871  if (std::abs(columnWeightedPosition-colMin)>centralIndexY or
872  std::abs(columnWeightedPosition-colMax)>centralIndexY){
873  ATH_MSG_VERBOSE(" Cluster too large colMin" << colMin << " colMax " << colMax << " centralY " << centralIndexY);
874  return input;
875  }
876  input.matrixOfToT.reserve(m_sizeX);
877  for (unsigned int a=0;a<m_sizeX;a++){
878  input.matrixOfToT.emplace_back(m_sizeY, 0.0);
879  }
880  input.vectorOfPitchesY.assign(m_sizeY, 0.4);
881  rdosBegin = rdos.begin();
882  charge = chListRecreated.begin();
883  chargeEnd = chListRecreated.end();
884  tot = totListRecreated.begin();
885  ATH_MSG_VERBOSE(" Putting together the n. " << rdos.size() << " rdos into a matrix." );
886  Identifier pixidentif=pCluster.identify();
887  input.etaModule=(int)pixelID.eta_module(pixidentif);
888  input.ClusterPixLayer=(int)pixelID.layer_disk(pixidentif);
889  input.ClusterPixBarrelEC=(int)pixelID.barrel_ec(pixidentif);
890  for (;( charge != chargeEnd) and (rdosBegin!= rdosEnd); ++rdosBegin, ++charge, ++tot){
891  Identifier rId = *rdosBegin;
892  unsigned int absrow = pixelID.phi_index(rId)-rowWeightedPosition+centralIndexX;
893  unsigned int abscol = pixelID.eta_index(rId)-columnWeightedPosition+centralIndexY;
894  if (absrow > m_sizeX){
895  ATH_MSG_WARNING(" problem with index: " << absrow << " min: " << 0 << " max: " << m_sizeX);
896  return input;
897  }
898  if (abscol > m_sizeY){
899  ATH_MSG_WARNING(" problem with index: " << abscol << " min: " << 0 << " max: " << m_sizeY);
900  return input;
901  }
902  InDetDD::SiCellId cellId = element->cellIdFromIdentifier(*rdosBegin);
903  InDetDD::SiDiodesParameters diodeParameters = design->parameters(cellId);
904  double pitchY = diodeParameters.width().xEta();
905  if (not m_useToT) {
906  input.matrixOfToT[absrow][abscol]=*charge;
907  } else {
908  input.matrixOfToT[absrow][abscol]=(double)(*tot);
909  // in case to RunI setup to make IBL studies
910  if(m_doRunI){
911  if (m_addIBL and (input.ClusterPixLayer==0) and (input.ClusterPixBarrelEC==0)){
912  input.matrixOfToT[absrow][abscol]*=3;
913  }
914  }else{
915  // for RunII IBL is always present
916  if ( (input.ClusterPixLayer==0) and (input.ClusterPixBarrelEC==0)){
917  input.matrixOfToT[absrow][abscol]*=3;
918  }
919  }
920 
921  }
922  if (std::abs(pitchY-0.4)>1e-5){
923  input.vectorOfPitchesY[abscol]=pitchY;
924  }
925  }//end iteration on rdos
926  ATH_MSG_VERBOSE(" eta module: " << input.etaModule );
927  ATH_MSG_VERBOSE(" Layer number: " << input.ClusterPixLayer << " Barrel / endcap: " << input.ClusterPixBarrelEC );
928  input.useTrackInfo=false;
929  const Amg::Vector2D& prdLocPos = pCluster.localPosition();
931  Amg::Vector3D globalPos = element->globalPosition(centroid);
932  Amg::Vector3D my_track = globalPos-beamSpotPosition;
933  const Amg::Vector3D &my_normal = element->normal();
934  const Amg::Vector3D &my_phiax = element->phiAxis();
935  const Amg::Vector3D &my_etaax = element->etaAxis();
936  float trkphicomp = my_track.dot(my_phiax);
937  float trketacomp = my_track.dot(my_etaax);
938  float trknormcomp = my_track.dot(my_normal);
939  double bowphi = std::atan2(trkphicomp,trknormcomp);
940  double boweta = std::atan2(trketacomp,trknormcomp);
941  tanl = m_pixelLorentzAngleTool->getTanLorentzAngle(element->identifyHash());
942  if(bowphi > M_PI_2) bowphi -= M_PI;
943  if(bowphi < -M_PI_2) bowphi += M_PI;
944  int readoutside = design->readoutSide();
945  double angle = std::atan(std::tan(bowphi)-readoutside*tanl);
946  input.phi=angle;
947  ATH_MSG_VERBOSE(" Angle theta bef corr: " << boweta );
948  if (boweta>M_PI_2) boweta-=M_PI;
949  if (boweta<-M_PI_2) boweta+=M_PI;
950  input.theta=boweta;
951  ATH_MSG_VERBOSE(" Angle phi: " << angle << " theta: " << boweta );
952  input.rowWeightedPosition=rowWeightedPosition;
953  input.columnWeightedPosition=columnWeightedPosition;
954  ATH_MSG_VERBOSE(" RowWeightedPosition: " << rowWeightedPosition << " ColWeightedPosition: " << columnWeightedPosition );
955  return input;
956  }//end create NNinput function

◆ declareGaudiProperty() [1/4]

Gaudi::Details::PropertyBase& AthCommonDataStore< AthCommonMsg< AlgTool > >::declareGaudiProperty ( Gaudi::Property< T > &  hndl,
const SG::VarHandleKeyArrayType  
)
inlineprivateinherited

specialization for handling Gaudi::Property<SG::VarHandleKeyArray>

Definition at line 170 of file AthCommonDataStore.h.

172  {
173  return *AthCommonDataStore<PBASE>::declareProperty(hndl.name(),
174  hndl.value(),
175  hndl.documentation());
176 
177  }

◆ declareGaudiProperty() [2/4]

Gaudi::Details::PropertyBase& AthCommonDataStore< AthCommonMsg< AlgTool > >::declareGaudiProperty ( Gaudi::Property< T > &  hndl,
const SG::VarHandleKeyType  
)
inlineprivateinherited

specialization for handling Gaudi::Property<SG::VarHandleKey>

Definition at line 156 of file AthCommonDataStore.h.

158  {
159  return *AthCommonDataStore<PBASE>::declareProperty(hndl.name(),
160  hndl.value(),
161  hndl.documentation());
162 
163  }

◆ declareGaudiProperty() [3/4]

Gaudi::Details::PropertyBase& AthCommonDataStore< AthCommonMsg< AlgTool > >::declareGaudiProperty ( Gaudi::Property< T > &  hndl,
const SG::VarHandleType  
)
inlineprivateinherited

specialization for handling Gaudi::Property<SG::VarHandleBase>

Definition at line 184 of file AthCommonDataStore.h.

186  {
187  return *AthCommonDataStore<PBASE>::declareProperty(hndl.name(),
188  hndl.value(),
189  hndl.documentation());
190  }

◆ declareGaudiProperty() [4/4]

Gaudi::Details::PropertyBase& AthCommonDataStore< AthCommonMsg< AlgTool > >::declareGaudiProperty ( Gaudi::Property< T > &  t,
const SG::NotHandleType  
)
inlineprivateinherited

specialization for handling everything that's not a Gaudi::Property<SG::VarHandleKey> or a <SG::VarHandleKeyArray>

Definition at line 199 of file AthCommonDataStore.h.

200  {
201  return PBASE::declareProperty(t);
202  }

◆ declareProperty() [1/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty ( const std::string &  name,
SG::VarHandleBase hndl,
const std::string &  doc,
const SG::VarHandleType  
)
inlineinherited

Declare a new Gaudi property.

Parameters
nameName of the property.
hndlObject holding the property value.
docDocumentation string for the property.

This is the version for types that derive from SG::VarHandleBase. The property value object is put on the input and output lists as appropriate; then we forward to the base class.

Definition at line 245 of file AthCommonDataStore.h.

249  {
250  this->declare(hndl.vhKey());
251  hndl.vhKey().setOwner(this);
252 
253  return PBASE::declareProperty(name,hndl,doc);
254  }

◆ declareProperty() [2/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty ( const std::string &  name,
SG::VarHandleKey hndl,
const std::string &  doc,
const SG::VarHandleKeyType  
)
inlineinherited

Declare a new Gaudi property.

Parameters
nameName of the property.
hndlObject holding the property value.
docDocumentation string for the property.

This is the version for types that derive from SG::VarHandleKey. The property value object is put on the input and output lists as appropriate; then we forward to the base class.

Definition at line 221 of file AthCommonDataStore.h.

225  {
226  this->declare(hndl);
227  hndl.setOwner(this);
228 
229  return PBASE::declareProperty(name,hndl,doc);
230  }

◆ declareProperty() [3/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty ( const std::string &  name,
SG::VarHandleKeyArray hndArr,
const std::string &  doc,
const SG::VarHandleKeyArrayType  
)
inlineinherited

Definition at line 259 of file AthCommonDataStore.h.

263  {
264 
265  // std::ostringstream ost;
266  // ost << Algorithm::name() << " VHKA declareProp: " << name
267  // << " size: " << hndArr.keys().size()
268  // << " mode: " << hndArr.mode()
269  // << " vhka size: " << m_vhka.size()
270  // << "\n";
271  // debug() << ost.str() << endmsg;
272 
273  hndArr.setOwner(this);
274  m_vhka.push_back(&hndArr);
275 
276  Gaudi::Details::PropertyBase* p = PBASE::declareProperty(name, hndArr, doc);
277  if (p != 0) {
278  p->declareUpdateHandler(&AthCommonDataStore<PBASE>::updateVHKA, this);
279  } else {
280  ATH_MSG_ERROR("unable to call declareProperty on VarHandleKeyArray "
281  << name);
282  }
283 
284  return p;
285 
286  }

◆ declareProperty() [4/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty ( const std::string &  name,
T &  property,
const std::string &  doc,
const SG::NotHandleType  
)
inlineinherited

Declare a new Gaudi property.

Parameters
nameName of the property.
propertyObject holding the property value.
docDocumentation string for the property.

This is the generic version, for types that do not derive from SG::VarHandleKey. It just forwards to the base class version of declareProperty.

Definition at line 333 of file AthCommonDataStore.h.

337  {
338  return PBASE::declareProperty(name, property, doc);
339  }

◆ declareProperty() [5/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty ( const std::string &  name,
T &  property,
const std::string &  doc = "none" 
)
inlineinherited

Declare a new Gaudi property.

Parameters
nameName of the property.
propertyObject holding the property value.
docDocumentation string for the property.

This dispatches to either the generic declareProperty or the one for VarHandle/Key/KeyArray.

Definition at line 352 of file AthCommonDataStore.h.

355  {
356  typedef typename SG::HandleClassifier<T>::type htype;
357  return declareProperty (name, property, doc, htype());
358  }

◆ declareProperty() [6/6]

Gaudi::Details::PropertyBase& AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty ( Gaudi::Property< T > &  t)
inlineinherited

Definition at line 145 of file AthCommonDataStore.h.

145  {
146  typedef typename SG::HandleClassifier<T>::type htype;
148  }

◆ detStore()

const ServiceHandle<StoreGateSvc>& AthCommonDataStore< AthCommonMsg< AlgTool > >::detStore ( ) const
inlineinherited

The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.

Definition at line 95 of file AthCommonDataStore.h.

95 { return m_detStore; }

◆ eigenInput()

NnClusterizationFactory::InputVector InDet::NnClusterizationFactory::eigenInput ( NNinput input) const
private

Definition at line 213 of file NnClusterizationFactory.cxx.

213  {
214  // we know the size to be
215  // - m_sizeX x m_sizeY pixel ToT values
216  // - m_sizeY pitch sizes in y
217  // - 2 values: detector location
218  // - 2 values: track incidence angles
219  // - optional: eta module
220  const auto vecSize{calculateVectorDimension(input.useTrackInfo)};
221  Eigen::VectorXd valuesVector( vecSize );
222  // Fill it!
223  // Variable names here need to match the ones in the configuration...
224  // ...IN THE SAME ORDER!!!
225  // location in eigen matrix object where next element goes
226  int location(0);
227  for (const auto & xvec: input.matrixOfToT){
228  for (const auto & xyElement : xvec){
229  valuesVector[location++] = xyElement;
230  }
231  }
232  for (const auto & pitch : input.vectorOfPitchesY) {
233  valuesVector[location++] = pitch;
234  }
235  valuesVector[location] = input.ClusterPixLayer;
236  location++;
237  valuesVector[location] = input.ClusterPixBarrelEC;
238  location++;
239  valuesVector[location] = input.phi;
240  location++;
241  valuesVector[location] = input.theta;
242  location++;
243  if (!input.useTrackInfo) {
244  valuesVector[location] = input.etaModule;
245  location++;
246  }
247  // We have only one node for now, so we just store things there.
248  // Format for use with lwtnn
249  std::vector<Eigen::VectorXd> vectorOfEigen;
250  vectorOfEigen.push_back(valuesVector);
251  return vectorOfEigen;
252  }

◆ estimateNumberOfParticles() [1/2]

std::vector< double > InDet::NnClusterizationFactory::estimateNumberOfParticles ( const InDet::PixelCluster pCluster,
Amg::Vector3D beamSpotPosition 
) const

Definition at line 255 of file NnClusterizationFactory.cxx.

256  {
257  double tanl=0;
258  NNinput input( createInput(pCluster,beamSpotPosition,tanl) );
259  if (!input) return {};
260  // If using old TTrainedNetworks, fetch correct ones for the
261  // without-track situation and call them now.
262  if (m_useTTrainedNetworks) {
263  const std::vector<double> & inputData=(this->*m_assembleInput)(input);
265  if (!nn_collection.isValid()) {
266  ATH_MSG_FATAL( "Failed to get trained network collection with key " << m_readKeyWithoutTrack.key() );
267  return {};
268  }
269  return estimateNumberOfParticlesTTN(**nn_collection, inputData);
270  }
271  // Otherwise, prepare lwtnn input map and use new networks.
273  return estimateNumberOfParticlesLWTNN(nnInputVector);
274  }

◆ estimateNumberOfParticles() [2/2]

std::vector< double > InDet::NnClusterizationFactory::estimateNumberOfParticles ( const InDet::PixelCluster pCluster,
const Trk::Surface pixelSurface,
const Trk::TrackParameters trackParsAtSurface 
) const

Definition at line 277 of file NnClusterizationFactory.cxx.

279  {
280  Amg::Vector3D dummyBS(0,0,0);
281  double tanl=0;
282  NNinput input( createInput(pCluster,dummyBS,tanl) );
283 
284  if (!input) return {};
285  addTrackInfoToInput(input,pixelSurface,trackParsAtSurface,tanl);
286  std::vector<double> inputData=(this->*m_assembleInput)(input);
287  // If using old TTrainedNetworks, fetch correct ones for the
288  // with-track situation and call them now.
289  if (m_useTTrainedNetworks) {
291  if (!nn_collection.isValid()) {
292  ATH_MSG_FATAL( "Failed to get trained network collection with key " << m_readKeyWithoutTrack.key() );
293  return {};
294  }
295  return estimateNumberOfParticlesTTN(**nn_collection, inputData);
296  }
297  // Otherwise, prepare lwtnn input map and use new networks.
299  return estimateNumberOfParticlesLWTNN(nnInputVector);
300  }

◆ estimateNumberOfParticlesLWTNN()

std::vector< double > InDet::NnClusterizationFactory::estimateNumberOfParticlesLWTNN ( NnClusterizationFactory::InputVector input) const
private

Definition at line 326 of file NnClusterizationFactory.cxx.

326  {
327  std::vector<double> result(3,0.0);//ok as invalid result?
329  if (!lwtnn_collection.isValid()) {
330  ATH_MSG_FATAL( "Failed to get LWTNN network collection with key " << m_readKeyJSON.key() );
331  return result;
332  }
333  if (lwtnn_collection->empty()){
334  ATH_MSG_FATAL( "LWTNN network collection with key " << m_readKeyJSON.key()<<" is empty." );
335  return result;
336  }
337  ATH_MSG_DEBUG("Using lwtnn number network");
338  // Order of output matches order in JSON config in "outputs"
339  // Only 1 node here, simple compute function
340  Eigen::VectorXd discriminant = lwtnn_collection->at(0)->compute(input);
341  const double & num0 = discriminant[0];
342  const double & num1 = discriminant[1];
343  const double & num2 = discriminant[2];
344  // Get normalized predictions
345  const auto inverseSum = 1./(num0+num1+num2);
346  result[0] = num0 * inverseSum;
347  result[1] = num1 * inverseSum;
348  result[2] = num2 * inverseSum;
349  ATH_MSG_VERBOSE(" LWTNN Prob of n. particles (1): " << result[0] <<
350  " (2): " << result[1] <<
351  " (3): " << result[2]);
352  return result;
353  }

◆ estimateNumberOfParticlesTTN()

std::vector< double > InDet::NnClusterizationFactory::estimateNumberOfParticlesTTN ( const TTrainedNetworkCollection nn_collection,
const std::vector< double > &  inputData 
) const
private

Definition at line 303 of file NnClusterizationFactory.cxx.

304  {
305  ATH_MSG_DEBUG("Using TTN number network");
306  std::vector<double> resultNN_TTN{};
307  if (not (m_nParticleNNId < nn_collection.size())){ //note: m_nParticleNNId is unsigned
308  ATH_MSG_FATAL("NnClusterizationFactory::estimateNumberOfParticlesTTN: Index "<<m_nParticleNNId<< "is out of range.");
309  return resultNN_TTN;
310  }
311  auto *const pNetwork = nn_collection[m_nParticleNNId].get();
312  if (not pNetwork){
313  ATH_MSG_FATAL("NnClusterizationFactory::estimateNumberOfParticlesTTN: nullptr returned for TrainedNetwork");
314  return resultNN_TTN;
315  }
316  // dereference unique_ptr<TTrainedNetwork> then call calculateOutput :
317  resultNN_TTN = (*pNetwork.*m_calculateOutput)(inputData);
318  ATH_MSG_VERBOSE(" TTN Prob of n. particles (1): " << resultNN_TTN[0] <<
319  " (2): " << resultNN_TTN[1] <<
320  " (3): " << resultNN_TTN[2]);
321  return resultNN_TTN;
322  }

◆ estimatePositions() [1/2]

std::vector< Amg::Vector2D > InDet::NnClusterizationFactory::estimatePositions ( const InDet::PixelCluster pCluster,
Amg::Vector3D beamSpotPosition,
std::vector< Amg::MatrixX > &  errors,
int  numberSubClusters 
) const

Definition at line 357 of file NnClusterizationFactory.cxx.

360  {
361  ATH_MSG_VERBOSE(" Starting to estimate positions...");
362  double tanl=0;
363  NNinput input( createInput(pCluster,beamSpotPosition,tanl) );
364  if (!input){
365  return {};
366  }
367  // If using old TTrainedNetworks, fetch correct ones for the
368  // without-track situation and call them now.
369  if (m_useTTrainedNetworks) {
370  const std::vector<double> & inputData=(this->*m_assembleInput)(input);
372  if (!nn_collection.isValid()) {
373  ATH_MSG_FATAL( "Failed to get trained network collection with key " << m_readKeyWithoutTrack.key() );
374  return {};
375  }
376  // *(ReadCondHandle<>) returns a pointer rather than a reference ...
377  return estimatePositionsTTN(**nn_collection, inputData,input,pCluster,numberSubClusters,errors);
378  }
379  // Otherwise, prepare lwtnn input map and use new networks.
381  return estimatePositionsLWTNN(nnInputVector,input,pCluster,numberSubClusters,errors);
382  }

◆ estimatePositions() [2/2]

std::vector< Amg::Vector2D > InDet::NnClusterizationFactory::estimatePositions ( const InDet::PixelCluster pCluster,
const Trk::Surface pixelSurface,
const Trk::TrackParameters trackParsAtSurface,
std::vector< Amg::MatrixX > &  errors,
int  numberSubClusters 
) const

Definition at line 386 of file NnClusterizationFactory.cxx.

390  {
391  ATH_MSG_VERBOSE(" Starting to estimate positions...");
392  Amg::Vector3D dummyBS(0,0,0);
393  double tanl=0;
394  NNinput input( createInput(pCluster, dummyBS, tanl) );
395  if (!input) return {};
396  addTrackInfoToInput(input,pixelSurface,trackParsAtSurface,tanl);
397  // If using old TTrainedNetworks, fetch correct ones for the
398  // without-track situation and call them now.
399  if (m_useTTrainedNetworks) {
400  std::vector<double> inputData=(this->*m_assembleInput)(input);
402  if (!nn_collection.isValid()) {
403  ATH_MSG_FATAL( "Failed to get trained network collection with key " << m_readKeyWithTrack.key() );
404  return {};
405  }
406  return estimatePositionsTTN(**nn_collection, inputData,input,pCluster,numberSubClusters,errors);
407  }
408  // Otherwise, prepare lwtnn input map and use new networks.
410  return estimatePositionsLWTNN(nnInputVector,input,pCluster,numberSubClusters,errors);
411  }

◆ estimatePositionsLWTNN()

std::vector< Amg::Vector2D > InDet::NnClusterizationFactory::estimatePositionsLWTNN ( NnClusterizationFactory::InputVector input,
NNinput rawInput,
const InDet::PixelCluster pCluster,
int  numberSubClusters,
std::vector< Amg::MatrixX > &  errors 
) const
private

Definition at line 475 of file NnClusterizationFactory.cxx.

479  {
481  if (not lwtnn_collection.isValid()) {
482  ATH_MSG_FATAL( "Failed to get LWTNN network collection with key " << m_readKeyJSON.key() );
483  return {};
484  }
485  if (lwtnn_collection->empty()){
486  ATH_MSG_FATAL( "estimatePositionsLWTNN: LWTNN network collection with key " << m_readKeyJSON.key()<<" is empty." );
487  return {};
488  }
489  // Need to evaluate the correct network once per cluster we're interested in.
490  // Save the output
491  std::vector<double> positionValues{};
492  std::vector<Amg::MatrixX> errorMatrices;
493  errorMatrices.reserve(numberSubClusters);
494  positionValues.reserve(numberSubClusters * 2);
495  std::size_t outputNode(0);
496  for (int cluster = 1; cluster < numberSubClusters+1; cluster++) {
497  // Check that the network is defined.
498  // If not, we are outside an IOV and should fail
499  const auto pNetwork = lwtnn_collection->find(numberSubClusters);
500  const bool validGraph = (pNetwork != lwtnn_collection->end()) and (pNetwork->second != nullptr);
501  if (not validGraph) {
502  std::string infoMsg ="Acceptable numbers of subclusters for the lwtnn collection:\n ";
503  for (const auto & pair: **lwtnn_collection){
504  infoMsg += std::to_string(pair.first) + "\n ";
505  }
506  infoMsg += "\nNumber of subclusters requested : "+ std::to_string(numberSubClusters);
507  ATH_MSG_DEBUG(infoMsg);
508  ATH_MSG_FATAL( "estimatePositionsLWTNN: No lwtnn network found for the number of clusters.\n"
509  <<" If you are outside the valid range for an lwtnn-based configuration, please run with useNNTTrainedNetworks instead.\n Key = "
510  << m_readKeyJSON.key() );
511  return {};
512  }
513  if(numberSubClusters==1) {
514  outputNode = m_outputNodesPos1;
515  } else if(numberSubClusters==2) {
516  outputNode = m_outputNodesPos2[cluster-1];
517  } else if(numberSubClusters==3) {
518  outputNode = m_outputNodesPos3[cluster-1];
519  } else {
520  ATH_MSG_FATAL( "Cannot evaluate LWTNN networks with " << numberSubClusters << " numberSubClusters" );
521  return {};
522  }
523 
524  // Order of output matches order in JSON config in "outputs"
525  // "alpha", "mean_x", "mean_y", "prec_x", "prec_y"
526  // Assume here that 1 particle network is in position 1, 2 at 2, and 3 at 3.
527  Eigen::VectorXd position = lwtnn_collection->at(numberSubClusters)->compute(input, {}, outputNode);
528  ATH_MSG_DEBUG("Testing for numberSubClusters " << numberSubClusters << " and cluster " << cluster);
529  for (int i=0; i<position.rows(); i++) {
530  ATH_MSG_DEBUG(" position " << position[i]);
531  }
532  positionValues.push_back(position[1]); //mean_x
533  positionValues.push_back(position[2]); //mean_y
534  // Fill errors.
535  // Values returned by NN are inverse of variance, and we want variances.
536  const float rawRmsX = std::sqrt(1.0/position[3]); //prec_x
537  const float rawRmsY = std::sqrt(1.0/position[4]); //prec_y
538  // Now convert to real space units
539  const double rmsX = correctedRMSX(rawRmsX);
540  const double rmsY = correctedRMSY(rawRmsY, rawInput.vectorOfPitchesY);
541  ATH_MSG_DEBUG(" Estimated RMS errors (1) x: " << rmsX << ", y: " << rmsY);
542  // Fill matrix
543  Amg::MatrixX erm(2,2);
544  erm.setZero();
545  erm(0,0)=rmsX*rmsX;
546  erm(1,1)=rmsY*rmsY;
547  errorMatrices.push_back(erm);
548  }
549  std::vector<Amg::Vector2D> myPositions = getPositionsFromOutput(positionValues,rawInput,pCluster);
550  ATH_MSG_DEBUG(" Estimated myPositions (1) x: " << myPositions[0][Trk::locX] << " y: " << myPositions[0][Trk::locY]);
551  errors=std::move(errorMatrices);
552  return myPositions;
553  }

◆ estimatePositionsTTN()

std::vector< Amg::Vector2D > InDet::NnClusterizationFactory::estimatePositionsTTN ( const TTrainedNetworkCollection nn_collection,
const std::vector< double > &  inputData,
const NNinput input,
const InDet::PixelCluster pCluster,
int  numberSubClusters,
std::vector< Amg::MatrixX > &  errors 
) const
private

Definition at line 414 of file NnClusterizationFactory.cxx.

419  {
420  bool applyRecentering=(!input.useTrackInfo and m_useRecenteringNNWithouTracks) or (input.useTrackInfo and m_useRecenteringNNWithTracks);
421  std::vector<Amg::Vector2D> allPositions{};
422  const auto endNnIdx = nn_collection.size();
423  if (numberSubClusters>0 and static_cast<unsigned int>(numberSubClusters) < m_maxSubClusters) {
424  const auto subClusterIndex = numberSubClusters-1;
425  // get position network id for the given cluster multiplicity then
426  // dereference unique_ptr<TTrainedNetwork> then call calculateOutput :
427  const auto networkIndex = m_NNId[kPositionNN-1].at(subClusterIndex);
428  //TTrainedNetworkCollection inherits from std::vector
429  if (not(networkIndex < endNnIdx)){
430  ATH_MSG_FATAL("estimatePositionsTTN: Requested collection index, "<< networkIndex << " is out of range.");
431  return allPositions;
432  }
433  auto *const pNetwork = nn_collection[networkIndex].get();
434  std::vector<double> position1P = (*pNetwork.*m_calculateOutput)(inputData);
435  std::vector<Amg::Vector2D> myPosition1=getPositionsFromOutput(position1P,input,pCluster);
436  assert( position1P.size() % 2 == 0);
437  for (unsigned int i=0; i<position1P.size()/2 ; ++i) {
438  ATH_MSG_DEBUG(" Original RAW Estimated positions (" << i << ") x: " << back_posX(position1P[0+i*2],applyRecentering) << " y: " << back_posY(position1P[1+i*2]));
439  ATH_MSG_DEBUG(" Original estimated myPositions (" << i << ") x: " << myPosition1[i][Trk::locX] << " y: " << myPosition1[i][Trk::locY]);
440  }
441  std::vector<double> inputDataNew=inputData;
442  inputDataNew.reserve( inputDataNew.size() + numberSubClusters*2);
443  assert( static_cast<unsigned int>(numberSubClusters*2) <= position1P.size() );
444  for (unsigned int i=0; i<static_cast<unsigned int>(numberSubClusters*2); ++i) {
445  inputDataNew.push_back(position1P[i]);
446  }
447  // get error network id for the given cluster multiplicity then
448  // dereference unique_ptr<TTrainedNetwork> then call calculateOutput :
449  const auto xNetworkIndex = m_NNId[kErrorXNN-1].at(subClusterIndex);
450  const auto yNetworkIndex = m_NNId[kErrorYNN-1].at(subClusterIndex);
451  if ((not (xNetworkIndex < endNnIdx)) or (not (yNetworkIndex < endNnIdx))){
452  ATH_MSG_FATAL("estimatePositionsTTN: A requested collection index, "<< xNetworkIndex << " or "<< yNetworkIndex << "is out of range.");
453  return allPositions;
454  }
455  auto *pxNetwork = nn_collection.at(xNetworkIndex).get();
456  auto *pyNetwork = nn_collection.at(yNetworkIndex).get();
457  //call the selected member function of the TTrainedNetwork
458  std::vector<double> errors1PX = (*pxNetwork.*m_calculateOutput)(inputDataNew);
459  std::vector<double> errors1PY = (*pyNetwork.*m_calculateOutput)(inputDataNew);
460  //
461  std::vector<Amg::MatrixX> errorMatrices1;
462  getErrorMatrixFromOutput(errors1PX,errors1PY,errorMatrices1,numberSubClusters);
463  allPositions.reserve( allPositions.size() + myPosition1.size());
464  errors.reserve( errors.size() + myPosition1.size());
465  for (unsigned int i=0;i<myPosition1.size();i++){
466  allPositions.push_back(myPosition1[i]);
467  errors.push_back(errorMatrices1[i]);
468  }
469  }
470  return allPositions;
471  }

◆ evtStore() [1/2]

ServiceHandle<StoreGateSvc>& AthCommonDataStore< AthCommonMsg< AlgTool > >::evtStore ( )
inlineinherited

The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.

Definition at line 85 of file AthCommonDataStore.h.

85 { return m_evtStore; }

◆ evtStore() [2/2]

const ServiceHandle<StoreGateSvc>& AthCommonDataStore< AthCommonMsg< AlgTool > >::evtStore ( ) const
inlineinherited

The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.

Definition at line 90 of file AthCommonDataStore.h.

90 { return m_evtStore; }

◆ extraDeps_update_handler()

void AthCommonDataStore< AthCommonMsg< AlgTool > >::extraDeps_update_handler ( Gaudi::Details::PropertyBase &  ExtraDeps)
protectedinherited

Add StoreName to extra input/output deps as needed.

use the logic of the VarHandleKey to parse the DataObjID keys supplied via the ExtraInputs and ExtraOuputs Properties to add the StoreName if it's not explicitly given

◆ finalize()

virtual StatusCode InDet::NnClusterizationFactory::finalize ( )
inlineoverridevirtual

Definition at line 102 of file NnClusterizationFactory.h.

102 { return StatusCode::SUCCESS; };

◆ getErrorMatrixFromOutput()

void InDet::NnClusterizationFactory::getErrorMatrixFromOutput ( std::vector< double > &  outputX,
std::vector< double > &  outputY,
std::vector< Amg::MatrixX > &  errorMatrix,
int  nParticles 
) const
private

Definition at line 579 of file NnClusterizationFactory.cxx.

582  {
583  int sizeOutputX=outputX.size()/nParticles;
584  int sizeOutputY=outputY.size()/nParticles;
585  double minimumX=-errorHalfIntervalX(nParticles);
586  double maximumX=errorHalfIntervalX(nParticles);
587  double minimumY=-errorHalfIntervalY(nParticles);
588  double maximumY=errorHalfIntervalY(nParticles);
589  //X=0...sizeOutput-1
590  //Y=minimum+(maximum-minimum)/sizeOutput*(X+1./2.)
591  errorMatrix.reserve( errorMatrix.size() + nParticles);
592  for (int i=0;i<nParticles;i++){
593  double sumValuesX=0;
594  for (int u=0;u<sizeOutputX;u++){
595  sumValuesX+=outputX[i*sizeOutputX+u];
596  }
597  double sumValuesY=0;
598  for (int u=0;u<sizeOutputY;u++){
599  sumValuesY+=outputY[i*sizeOutputY+u];
600  }
601  ATH_MSG_VERBOSE(" minimumX: " << minimumX << " maximumX: " << maximumX << " sizeOutputX " << sizeOutputX);
602  ATH_MSG_VERBOSE(" minimumY: " << minimumY << " maximumY: " << maximumY << " sizeOutputY " << sizeOutputY);
603  double RMSx=0;
604  for (int u=0;u<sizeOutputX;u++){
605  RMSx+=outputX[i*sizeOutputX+u]/sumValuesX*std::pow(minimumX+(maximumX-minimumX)/(double)(sizeOutputX-2)*(u-1./2.),2);
606  }
607  RMSx=std::sqrt(RMSx);//computed error!
608  ATH_MSG_VERBOSE(" first Iter RMSx: " << RMSx);
609  double intervalErrorX=3*RMSx;
610  //now recompute between -3*RMSx and +3*RMSx
611  int minBinX=(int)(1+(-intervalErrorX-minimumX)/(maximumX-minimumX)*(double)(sizeOutputX-2));
612  int maxBinX=(int)(1+(intervalErrorX-minimumX)/(maximumX-minimumX)*(double)(sizeOutputX-2));
613  if (maxBinX>sizeOutputX-1) maxBinX=sizeOutputX-1;
614  if (minBinX<0) minBinX=0;
615  ATH_MSG_VERBOSE(" minBinX: " << minBinX << " maxBinX: " << maxBinX );
616  RMSx=0;
617  for (int u=minBinX;u<maxBinX+1;u++){
618  RMSx+=outputX[i*sizeOutputX+u]/sumValuesX*std::pow(minimumX+(maximumX-minimumX)/(double)(sizeOutputX-2)*(u-1./2.),2);
619  }
620  RMSx=std::sqrt(RMSx);//computed error!
621  double RMSy=0;
622  for (int u=0;u<sizeOutputY;u++){
623  RMSy+=outputY[i*sizeOutputY+u]/sumValuesY*std::pow(minimumY+(maximumY-minimumY)/(double)(sizeOutputY-2)*(u-1./2.),2);
624  }
625  RMSy=std::sqrt(RMSy);//computed error!
626  ATH_MSG_VERBOSE("first Iter RMSy: " << RMSy );
627  double intervalErrorY=3*RMSy;
628  //now recompute between -3*RMSy and +3*RMSy
629  int minBinY=(int)(1+(-intervalErrorY-minimumY)/(maximumY-minimumY)*(double)(sizeOutputY-2));
630  int maxBinY=(int)(1+(intervalErrorY-minimumY)/(maximumY-minimumY)*(double)(sizeOutputY-2));
631  if (maxBinY>sizeOutputY-1) maxBinY=sizeOutputY-1;
632  if (minBinY<0) minBinY=0;
633  ATH_MSG_VERBOSE("minBinY: " << minBinY << " maxBinY: " << maxBinY );
634  RMSy=0;
635  for (int u=minBinY;u<maxBinY+1;u++){
636  RMSy+=outputY[i*sizeOutputY+u]/sumValuesY*std::pow(minimumY+(maximumY-minimumY)/(double)(sizeOutputY-2)*(u-1./2.),2);
637  }
638  RMSy=std::sqrt(RMSy);//computed error!
639  ATH_MSG_VERBOSE("Computed error, sigma(X) " << RMSx << " sigma(Y) " << RMSy );
640  Amg::MatrixX erm(2,2);
641  erm.setZero();
642  erm(0,0)=RMSx*RMSx;
643  erm(1,1)=RMSy*RMSy;
644  errorMatrix.push_back(erm);
645  }//end nParticles
646  }//getErrorMatrixFromOutput

◆ getPositionsFromOutput()

std::vector< Amg::Vector2D > InDet::NnClusterizationFactory::getPositionsFromOutput ( std::vector< double > &  output,
const NNinput input,
const InDet::PixelCluster pCluster 
) const
private

Definition at line 650 of file NnClusterizationFactory.cxx.

652  {
653  ATH_MSG_VERBOSE(" Translating output back into a position " );
654  const InDetDD::SiDetectorElement* element=pCluster.detectorElement();//DEFINE
655  const InDetDD::PixelModuleDesign* design
656  (dynamic_cast<const InDetDD::PixelModuleDesign*>(&element->design()));
657  if (not design){
658  ATH_MSG_ERROR("Dynamic cast failed at line "<<__LINE__<<" of NnClusterizationFactory.cxx.");
659  return {};
660  }
661  int numParticles=output.size()/2;
662  int columnWeightedPosition=input.columnWeightedPosition;
663  int rowWeightedPosition=input.rowWeightedPosition;
664  ATH_MSG_VERBOSE(" REF POS columnWeightedPos: " << columnWeightedPosition << " rowWeightedPos: " << rowWeightedPosition );
665  bool applyRecentering=false;
666  if (m_useRecenteringNNWithouTracks and (not input.useTrackInfo)){
667  applyRecentering=true;
668  }
669  if (m_useRecenteringNNWithTracks and input.useTrackInfo){
670  applyRecentering=true;
671  }
672  std::vector<Amg::Vector2D> positions;
673  for (int u=0;u<numParticles;u++){
674  double posXid{};
675  double posYid{};
676  if(m_doRunI){
677  posXid=back_posX(output[2*u],applyRecentering)+rowWeightedPosition;
678  posYid=back_posY(output[2*u+1])+columnWeightedPosition;
679  }else{
680  posXid=output[2*u]+rowWeightedPosition;
681  posYid=output[2*u+1]+columnWeightedPosition;
682  }
683  ATH_MSG_VERBOSE(" N. particle: " << u << " idx posX " << posXid << " posY " << posYid );
684  //ATLASRECTS-7155 : Pixel Charge Calibration needs investigating
685  const auto & [posXid_int, coercedX]=coerceToIntRange(posXid+0.5);
686  const auto & [posYid_int, coercedY]=coerceToIntRange(posYid+0.5);
687  if (coercedX or coercedY){
688  ATH_MSG_WARNING("X or Y position value has been limited in range; original values are (" << posXid<<", "<<posYid<<")");
689  //we cannot skip these values, it seems client code relies on the size of input vector and output vector being the same
690  }
691  ATH_MSG_VERBOSE(" N. particle: " << u << " TO INTEGER idx posX " << posXid_int << " posY " << posYid_int );
692  InDetDD::SiLocalPosition siLocalPositionDiscrete(design->positionFromColumnRow(posYid_int,posXid_int));
693  InDetDD::SiCellId cellIdOfPositionDiscrete=design->cellIdOfPosition(siLocalPositionDiscrete);
694  if ( not cellIdOfPositionDiscrete.isValid()){
695  ATH_MSG_WARNING(" Cell is outside validity region with index Y: " << posYid_int << " and index X: " << posXid_int << ". Not foreseen... " );
696  }
697  InDetDD::SiDiodesParameters diodeParameters = design->parameters(cellIdOfPositionDiscrete);
698  double pitchY = diodeParameters.width().xEta();
699  double pitchX = diodeParameters.width().xPhi();
700  ATH_MSG_VERBOSE(" Translated weighted position : " << siLocalPositionDiscrete.xPhi()
701  << " Translated weighted position : " << siLocalPositionDiscrete.xEta() );
702  //FOR TEST
703  InDetDD::SiLocalPosition siLocalPositionDiscreteOneRowMoreOneColumnMore(design->positionFromColumnRow(posYid_int+1,posXid_int+1));
704  ATH_MSG_VERBOSE(" Translated weighted position +1col +1row phi: " << siLocalPositionDiscreteOneRowMoreOneColumnMore.xPhi()
705  << " Translated weighted position +1col +1row eta: " << siLocalPositionDiscreteOneRowMoreOneColumnMore.xEta() );
706  ATH_MSG_VERBOSE("PitchY: " << pitchY << " pitchX " << pitchX );
707  InDetDD::SiLocalPosition siLocalPositionAdd(pitchY*(posYid-(double)posYid_int),
708  pitchX*(posXid-(double)posXid_int));
709  double lorentzShift=m_pixelLorentzAngleTool->getLorentzShift(element->identifyHash());
710  if (input.ClusterPixBarrelEC == 0){
711  if (not input.useTrackInfo){
713  } else {
714  lorentzShift+=m_correctLorShiftBarrelWithTracks;
715  }
716  }
717 
719  siLocalPosition(siLocalPositionDiscrete.xEta()+pitchY*(posYid-(double)posYid_int),
720  siLocalPositionDiscrete.xPhi()+pitchX*(posXid-(double)posXid_int)+lorentzShift);
721  ATH_MSG_VERBOSE(" Translated final position phi: " << siLocalPosition.xPhi() << " eta: " << siLocalPosition.xEta() );
722  const auto halfWidth{design->width()*0.5};
723  if (siLocalPositionDiscrete.xPhi() > halfWidth){
724  siLocalPosition=InDetDD::SiLocalPosition(siLocalPositionDiscrete.xEta()+pitchY*(posYid-(double)posYid_int),
725  halfWidth-1e-6);
726  ATH_MSG_WARNING(" Corrected out of boundary cluster from x(phi): " << siLocalPositionDiscrete.xPhi()+pitchX*(posXid-(double)posXid_int)
727  << " to: " << halfWidth-1e-6);
728  } else if (siLocalPositionDiscrete.xPhi() < -halfWidth) {
729  siLocalPosition=InDetDD::SiLocalPosition(siLocalPositionDiscrete.xEta()+pitchY*(posYid-(double)posYid_int),
730  -halfWidth+1e-6);
731  ATH_MSG_WARNING(" Corrected out of boundary cluster from x(phi): " << siLocalPositionDiscrete.xPhi()+pitchX*(posXid-(double)posXid_int)
732  << " to: " << -halfWidth+1e-6);
733  }
734  positions.emplace_back(siLocalPosition);
735  }//iterate over all particles
736  return positions;
737  }

◆ initialize()

StatusCode InDet::NnClusterizationFactory::initialize ( )
overridevirtual

Definition at line 67 of file NnClusterizationFactory.cxx.

67  {
68  ATH_CHECK(m_pixelReadout.retrieve());
72  if (m_doRunI) {
74  } else {
76  }
77  // =0 means invalid in the following, but later on the values will be decremented by one and they indicate the index in the NN collection
79  m_NNId.clear();
80  m_NNId.resize( kNNetworkTypes -1 ) ;
81  // map networks to element in network collection
82  unsigned int nn_id=0;
83  std::smatch match_result;
84  for(const std::string &nn_name : m_nnOrder) {
85  ++nn_id;
86  for (unsigned int network_i=0; network_i<kNNetworkTypes; ++network_i) {
87  if (std::regex_match( nn_name, match_result, m_nnNames[network_i])) {
88  if (network_i == kNumberParticlesNN) {
89  m_nParticleNNId = nn_id;
90  } else {
91  if (m_nParticleGroup[network_i]>0) {
92  if (m_nParticleGroup[network_i]>=match_result.size()) {
93  ATH_MSG_ERROR("Regex and match group of particle multiplicity do not coincide (groups=" << match_result.size()
94  << " n particle group=" << m_nParticleGroup[network_i]
95  << "; type=" << network_i << ")");
96  }
97  int n_particles=std::stoi( match_result[m_nParticleGroup[network_i]].str());
98  if (n_particles<=0 or static_cast<unsigned int>(n_particles)>m_maxSubClusters) {
99  ATH_MSG_ERROR( "Failed to extract number of clusters the NN is meant for. Got " << match_result[m_nParticleGroup[network_i]].str()
100  << " But this is not in the valid range 1..." << m_maxSubClusters);
101  return StatusCode::FAILURE;
102  }
103  if (static_cast<unsigned int>(n_particles)>=m_NNId[network_i-1].size()) {
104  m_NNId[network_i-1].resize( n_particles );
105  }
106  m_NNId[network_i-1][n_particles-1] = nn_id;
107  } else {
108  if (m_NNId[network_i-1].empty()) {
109  m_NNId[network_i-1].resize(1);
110  }
111  m_NNId[network_i-1][0] = nn_id;
112  }
113  }
114  }
115  }
116  }
117  // check whether the NN IDs are all valid
118  // if valid decrease IDs by 1, because the ID is used as index in the NN collection.
119  if ((m_nParticleNNId==0) or (m_nParticleNNId>=m_nnOrder.size())) {
120  ATH_MSG_ERROR( "No NN specified to estimate the number of particles.");
121  return StatusCode::FAILURE;
122  }
123  --m_nParticleNNId;
124  ATH_MSG_VERBOSE("Expect NN " << s_nnTypeNames[0] << " at index " << m_nParticleNNId );
125  unsigned int type_i=0;
126  for (std::vector<unsigned int> &nn_id : m_NNId) {
127  ++type_i;
128  if (nn_id.empty()) {
129  ATH_MSG_ERROR( "No " << s_nnTypeNames[type_i] << " specified.");
130  return StatusCode::FAILURE;
131  }
132  if (m_nParticleGroup[type_i-1]>0 and nn_id.size() != m_maxSubClusters) {
133  ATH_MSG_ERROR( "Number of networks of type " << s_nnTypeNames[type_i] << " does match the maximum number of supported sub clusters " << m_maxSubClusters);
134  return StatusCode::FAILURE;
135  }
136  unsigned int n_particles=0;
137  for (unsigned int &a_nn_id : nn_id ) {
138  ++n_particles;
139  if ((a_nn_id==0) or (a_nn_id>m_nnOrder.size())) {
140  ATH_MSG_ERROR( "No " << s_nnTypeNames[type_i] << " specified for " << n_particles);
141  return StatusCode::FAILURE;
142  }
143  --a_nn_id;
144  ATH_MSG_VERBOSE("Expect NN " << s_nnTypeNames[type_i] << " for " << n_particles << " particle(s) at index " << a_nn_id );
145  }
146  }
150  return StatusCode::SUCCESS;
151  }

◆ inputHandles()

virtual std::vector<Gaudi::DataHandle*> AthCommonDataStore< AthCommonMsg< AlgTool > >::inputHandles ( ) const
overridevirtualinherited

Return this algorithm's input handles.

We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.

◆ interfaceID()

static const InterfaceID& InDet::NnClusterizationFactory::interfaceID ( )
inlinestatic

AlgTool interface methods.

Definition at line 95 of file NnClusterizationFactory.h.

95 { return IID_NnClusterizationFactory; };

◆ msg() [1/2]

MsgStream& AthCommonMsg< AlgTool >::msg ( ) const
inlineinherited

Definition at line 24 of file AthCommonMsg.h.

24  {
25  return this->msgStream();
26  }

◆ msg() [2/2]

MsgStream& AthCommonMsg< AlgTool >::msg ( const MSG::Level  lvl) const
inlineinherited

Definition at line 27 of file AthCommonMsg.h.

27  {
28  return this->msgStream(lvl);
29  }

◆ msgLvl()

bool AthCommonMsg< AlgTool >::msgLvl ( const MSG::Level  lvl) const
inlineinherited

Definition at line 30 of file AthCommonMsg.h.

30  {
31  return this->msgLevel(lvl);
32  }

◆ outputHandles()

virtual std::vector<Gaudi::DataHandle*> AthCommonDataStore< AthCommonMsg< AlgTool > >::outputHandles ( ) const
overridevirtualinherited

Return this algorithm's output handles.

We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.

◆ renounce()

std::enable_if_t<std::is_void_v<std::result_of_t<decltype(&T::renounce)(T)> > && !std::is_base_of_v<SG::VarHandleKeyArray, T> && std::is_base_of_v<Gaudi::DataHandle, T>, void> AthCommonDataStore< AthCommonMsg< AlgTool > >::renounce ( T &  h)
inlineprotectedinherited

Definition at line 380 of file AthCommonDataStore.h.

381  {
382  h.renounce();
383  PBASE::renounce (h);
384  }

◆ renounceArray()

void AthCommonDataStore< AthCommonMsg< AlgTool > >::renounceArray ( SG::VarHandleKeyArray handlesArray)
inlineprotectedinherited

remove all handles from I/O resolution

Definition at line 364 of file AthCommonDataStore.h.

364  {
365  handlesArray.renounce();
366  }

◆ sysInitialize()

virtual StatusCode AthCommonDataStore< AthCommonMsg< AlgTool > >::sysInitialize ( )
overridevirtualinherited

Perform system initialization for an algorithm.

We override this to declare all the elements of handle key arrays at the end of initialization. See comments on updateVHKA.

Reimplemented in DerivationFramework::CfAthAlgTool, AthCheckedComponent< AthAlgTool >, AthCheckedComponent<::AthAlgTool >, and asg::AsgMetadataTool.

◆ sysStart()

virtual StatusCode AthCommonDataStore< AthCommonMsg< AlgTool > >::sysStart ( )
overridevirtualinherited

Handle START transition.

We override this in order to make sure that conditions handle keys can cache a pointer to the conditions container.

◆ updateVHKA()

void AthCommonDataStore< AthCommonMsg< AlgTool > >::updateVHKA ( Gaudi::Details::PropertyBase &  )
inlineinherited

Definition at line 308 of file AthCommonDataStore.h.

308  {
309  // debug() << "updateVHKA for property " << p.name() << " " << p.toString()
310  // << " size: " << m_vhka.size() << endmsg;
311  for (auto &a : m_vhka) {
312  std::vector<SG::VarHandleKey*> keys = a->keys();
313  for (auto k : keys) {
314  k->setOwner(this);
315  }
316  }
317  }

Member Data Documentation

◆ m_addIBL

Gaudi::Property<bool> InDet::NnClusterizationFactory::m_addIBL {this, "addIBL", false, "Also apply to clusters in IBL." }
private

Definition at line 286 of file NnClusterizationFactory.h.

◆ m_assembleInput

std::vector<double>(InDet::NnClusterizationFactory:: * InDet::NnClusterizationFactory::m_assembleInput) (NNinput &input) const
inlineprivate

◆ m_calculateOutput

ReturnType(::TTrainedNetwork:: * InDet::NnClusterizationFactory::m_calculateOutput) (const InputType &input) const
inlineprivate

◆ m_chargeDataKey

SG::ReadCondHandleKey<PixelChargeCalibCondData> InDet::NnClusterizationFactory::m_chargeDataKey {this, "PixelChargeCalibCondData", "PixelChargeCalibCondData", "Output key"}
private

Definition at line 244 of file NnClusterizationFactory.h.

◆ m_correctLorShiftBarrelWithoutTracks

Gaudi::Property<double> InDet::NnClusterizationFactory::m_correctLorShiftBarrelWithoutTracks {this, "correctLorShiftBarrelWithoutTracks",0.,"Lorentz shift correction factor when evaluating NN without track input."}
private

Definition at line 277 of file NnClusterizationFactory.h.

◆ m_correctLorShiftBarrelWithTracks

Gaudi::Property<double> InDet::NnClusterizationFactory::m_correctLorShiftBarrelWithTracks {this, "correctLorShiftBarrelWithTracks",0.,"Lorentz shift correction factor when evaluating NN with track input."}
private

Definition at line 280 of file NnClusterizationFactory.h.

◆ m_detStore

StoreGateSvc_t AthCommonDataStore< AthCommonMsg< AlgTool > >::m_detStore
privateinherited

Pointer to StoreGate (detector store by default)

Definition at line 393 of file AthCommonDataStore.h.

◆ m_doRunI

Gaudi::Property<bool> InDet::NnClusterizationFactory::m_doRunI {this, "doRunI", false, "Use runI style network (outputs are not normalised; add pitches; use charge if not m_useToT)"}
private

Definition at line 289 of file NnClusterizationFactory.h.

◆ m_evtStore

StoreGateSvc_t AthCommonDataStore< AthCommonMsg< AlgTool > >::m_evtStore
privateinherited

Pointer to StoreGate (event store by default)

Definition at line 390 of file AthCommonDataStore.h.

◆ m_maxSubClusters

Gaudi::Property<unsigned int> InDet::NnClusterizationFactory::m_maxSubClusters {this, "MaxSubClusters", 3, "Maximum number of sub cluster supported by the networks." }
private

Definition at line 274 of file NnClusterizationFactory.h.

◆ m_NNId

std::vector< std::vector<unsigned int> > InDet::NnClusterizationFactory::m_NNId {}
private

Definition at line 221 of file NnClusterizationFactory.h.

◆ m_nnNames

const std::array< std::regex, NnClusterizationFactory::kNNetworkTypes > InDet::NnClusterizationFactory::m_nnNames
staticprivate
Initial value:
{
std::regex("^NumberParticles(|/|_.*)$"),
std::regex("^ImpactPoints([0-9])P(|/|_.*)$"),
std::regex("^ImpactPointErrorsX([0-9])(|/|_.*)$"),
std::regex("^ImpactPointErrorsY([0-9])(|/|_.*)$"),
}

Definition at line 218 of file NnClusterizationFactory.h.

◆ m_nnOrder

Gaudi::Property< std::vector<std::string> > InDet::NnClusterizationFactory::m_nnOrder
private
Initial value:
{this, "NetworkOrder", {
"NumberParticles",
"ImpactPoints1P",
"ImpactPoints2P",
"ImpactPoints3P",
"ImpactPointErrorsX1",
"ImpactPointErrorsX2",
"ImpactPointErrorsX3",
"ImpactPointErrorsY1",
"ImpactPointErrorsY2",
"ImpactPointErrorsY3"},
"The order in which the networks will appear in the TTrainedNetworkCollection"}

Definition at line 193 of file NnClusterizationFactory.h.

◆ m_nParticleGroup

constexpr std::array<unsigned int, kNNetworkTypes> InDet::NnClusterizationFactory::m_nParticleGroup {0U,1U,1U,1U}
staticconstexprprivate

Definition at line 217 of file NnClusterizationFactory.h.

◆ m_nParticleNNId

unsigned int InDet::NnClusterizationFactory::m_nParticleNNId {}
private

Definition at line 220 of file NnClusterizationFactory.h.

◆ m_outputNodesPos1

Gaudi::Property< std::size_t > InDet::NnClusterizationFactory::m_outputNodesPos1
private
Initial value:
{this, "OutputNodePos1", 7,
"Output node for the 1 position networks (LWTNN)"}

Definition at line 262 of file NnClusterizationFactory.h.

◆ m_outputNodesPos2

Gaudi::Property< std::vector<std::size_t> > InDet::NnClusterizationFactory::m_outputNodesPos2
private
Initial value:
{this, "OutputNodePos2", { 10, 11 },
"List of output nodes for the 2 position network (LWTNN)"}

Definition at line 266 of file NnClusterizationFactory.h.

◆ m_outputNodesPos3

Gaudi::Property< std::vector<std::size_t> > InDet::NnClusterizationFactory::m_outputNodesPos3
private
Initial value:
{this, "OutputNodePos3", { 13, 14, 15 },
"List of output nodes for the 3 position networks (LWTNN)"}

Definition at line 270 of file NnClusterizationFactory.h.

◆ m_pixelLorentzAngleTool

ToolHandle<ISiLorentzAngleTool> InDet::NnClusterizationFactory::m_pixelLorentzAngleTool {this, "PixelLorentzAngleTool", "SiLorentzAngleTool/PixelLorentzAngleTool", "Tool to retreive Lorentz angle of Pixel"}
private

Definition at line 238 of file NnClusterizationFactory.h.

◆ m_pixelReadout

ServiceHandle<InDetDD::IPixelReadoutManager> InDet::NnClusterizationFactory::m_pixelReadout {this, "PixelReadoutManager", "PixelReadoutManager", "Pixel readout manager" }
private

Definition at line 241 of file NnClusterizationFactory.h.

◆ m_readKeyJSON

SG::ReadCondHandleKey<LWTNNCollection> InDet::NnClusterizationFactory::m_readKeyJSON
private
Initial value:
{this, "NnCollectionJSONReadKey", "PixelClusterNNJSON",
"The conditions key for the pixel cluster NNs configured via JSON file and accessed with lwtnn"}

Definition at line 254 of file NnClusterizationFactory.h.

◆ m_readKeyWithoutTrack

SG::ReadCondHandleKey<TTrainedNetworkCollection> InDet::NnClusterizationFactory::m_readKeyWithoutTrack {this, "NnCollectionReadKey", "PixelClusterNN", "The conditions store key for the pixel cluster NNs"}
private

Definition at line 247 of file NnClusterizationFactory.h.

◆ m_readKeyWithTrack

SG::ReadCondHandleKey<TTrainedNetworkCollection> InDet::NnClusterizationFactory::m_readKeyWithTrack
private
Initial value:
{this, "NnCollectionWithTrackReadKey", "PixelClusterNNWithTrack",
"The conditions store key for the pixel cluster NNs which needs tracks as input"}

Definition at line 250 of file NnClusterizationFactory.h.

◆ m_sizeX

Gaudi::Property<unsigned int> InDet::NnClusterizationFactory::m_sizeX {this, "sizeX",7,"Size of pixel matrix along X"}
private

Definition at line 301 of file NnClusterizationFactory.h.

◆ m_sizeY

Gaudi::Property<unsigned int> InDet::NnClusterizationFactory::m_sizeY {this, "sizeY",7,"Size of pixel matrix along Y"}
private

Definition at line 304 of file NnClusterizationFactory.h.

◆ m_useRecenteringNNWithouTracks

Gaudi::Property<bool> InDet::NnClusterizationFactory::m_useRecenteringNNWithouTracks {this, "useRecenteringNNWithoutTracks",false,"Recenter x position when evaluating NN without track input."}
private

Definition at line 295 of file NnClusterizationFactory.h.

◆ m_useRecenteringNNWithTracks

Gaudi::Property<bool> InDet::NnClusterizationFactory::m_useRecenteringNNWithTracks {this, "useRecenteringNNWithTracks",false,"Recenter x position when evaluating NN with track input."}
private

Definition at line 298 of file NnClusterizationFactory.h.

◆ m_useToT

Gaudi::Property<bool> InDet::NnClusterizationFactory::m_useToT {this, "useToT",true,"Use Tot rather than charge." }
private

Definition at line 283 of file NnClusterizationFactory.h.

◆ m_useTTrainedNetworks

Gaudi::Property<bool> InDet::NnClusterizationFactory::m_useTTrainedNetworks {this, "useTTrainedNetworks", false, "Use earlier (release-21-like) neural networks stored in ROOT files and accessed via TTrainedNetowrk."}
private

Definition at line 292 of file NnClusterizationFactory.h.

◆ m_varHandleArraysDeclared

bool AthCommonDataStore< AthCommonMsg< AlgTool > >::m_varHandleArraysDeclared
privateinherited

Definition at line 399 of file AthCommonDataStore.h.

◆ m_vhka

std::vector<SG::VarHandleKeyArray*> AthCommonDataStore< AthCommonMsg< AlgTool > >::m_vhka
privateinherited

Definition at line 398 of file AthCommonDataStore.h.

◆ s_nnTypeNames

constexpr std::array<std::string_view, kNNetworkTypes> InDet::NnClusterizationFactory::s_nnTypeNames
staticconstexprprivate
Initial value:
{
"NumberParticlesNN",
"PositionNN",
"ErrorXNN",
"ErrorYNN" }

Definition at line 212 of file NnClusterizationFactory.h.


The documentation for this class was generated from the following files:
query_example.row
row
Definition: query_example.py:24
InDet::NnClusterizationFactory::m_sizeX
Gaudi::Property< unsigned int > m_sizeX
Definition: NnClusterizationFactory.h:302
norm_etaModule
double norm_etaModule(const double input)
Definition: NnNormalization.cxx:101
ATH_MSG_FATAL
#define ATH_MSG_FATAL(x)
Definition: AthMsgStreamMacros.h:34
TTrainedNetwork::calculateOutputValues
std::vector< Double_t > calculateOutputValues(std::vector< Double_t > &input) const
Definition: InnerDetector/InDetCalibAlgs/PixelCalibAlgs/NNClusteringCalibration_RunI/TTrainedNetwork.cxx:99
PixelID::phi_index
int phi_index(const Identifier &id) const
Definition: PixelID.h:658
python.SystemOfUnits.s
int s
Definition: SystemOfUnits.py:131
Amg::MatrixX
Eigen::Matrix< double, Eigen::Dynamic, Eigen::Dynamic > MatrixX
Dynamic Matrix - dynamic allocation.
Definition: EventPrimitives.h:29
get_generator_info.result
result
Definition: get_generator_info.py:21
InDet::NnClusterizationFactory::m_addIBL
Gaudi::Property< bool > m_addIBL
Definition: NnClusterizationFactory.h:287
python.PerfMonSerializer.p
def p
Definition: PerfMonSerializer.py:743
InDet::NnClusterizationFactory::m_nParticleGroup
static constexpr std::array< unsigned int, kNNetworkTypes > m_nParticleGroup
Definition: NnClusterizationFactory.h:217
max
#define max(a, b)
Definition: cfImp.cxx:41
InDet::NnClusterizationFactory::m_chargeDataKey
SG::ReadCondHandleKey< PixelChargeCalibCondData > m_chargeDataKey
Definition: NnClusterizationFactory.h:245
SG::ReadCondHandle
Definition: ReadCondHandle.h:44
Trk::locX
@ locX
Definition: ParamDefs.h:43
InDet::NnClusterizationFactory::m_outputNodesPos1
Gaudi::Property< std::size_t > m_outputNodesPos1
Definition: NnClusterizationFactory.h:263
norm_rawToT
double norm_rawToT(const double input)
Definition: NnNormalization.cxx:16
InDetDD::PixelModuleDesign
Definition: PixelModuleDesign.h:48
Trk::locY
@ locY
local cartesian
Definition: ParamDefs.h:44
CaloCellPos2Ntuple.int
int
Definition: CaloCellPos2Ntuple.py:24
AtlasDetectorID::HelperType::Pixel
@ Pixel
InDet::NnClusterizationFactory::m_NNId
std::vector< std::vector< unsigned int > > m_NNId
Definition: NnClusterizationFactory.h:221
PixelID::barrel_ec
int barrel_ec(const Identifier &id) const
Values of different levels (failure returns 0)
Definition: PixelID.h:619
Amg::Vector2D
Eigen::Matrix< double, 2, 1 > Vector2D
Definition: GeoPrimitives.h:48
AthCommonDataStore::declareProperty
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
Definition: AthCommonDataStore.h:145
norm_pitch
double norm_pitch(const double input, bool addIBL=false)
Definition: NnNormalization.cxx:32
conifer::pow
constexpr int pow(int x)
Definition: conifer.h:20
InDetDD::SiCellId::isValid
bool isValid() const
Test if its in a valid state.
Definition: SiCellId.h:136
InDetDD::PixelDiodeType
PixelDiodeType
Definition: PixelReadoutDefinitions.h:20
InDet::NnClusterizationFactory::estimatePositionsTTN
std::vector< Amg::Vector2D > estimatePositionsTTN(const TTrainedNetworkCollection &nn_collection, const std::vector< double > &inputData, const NNinput &input, const InDet::PixelCluster &pCluster, int numberSubClusters, std::vector< Amg::MatrixX > &errors) const
Definition: NnClusterizationFactory.cxx:414
M_PI
#define M_PI
Definition: ActiveFraction.h:11
AthCommonDataStore< AthCommonMsg< AlgTool > >::m_evtStore
StoreGateSvc_t m_evtStore
Pointer to StoreGate (event store by default)
Definition: AthCommonDataStore.h:390
AthCommonDataStore< AthCommonMsg< AlgTool > >::m_vhka
std::vector< SG::VarHandleKeyArray * > m_vhka
Definition: AthCommonDataStore.h:398
Trk::PrepRawData::rdoList
const std::vector< Identifier > & rdoList() const
return the List of rdo identifiers (pointers)
norm_phi
double norm_phi(const double input)
Definition: NnNormalization.cxx:71
InDet::NnClusterizationFactory::m_maxSubClusters
Gaudi::Property< unsigned int > m_maxSubClusters
Definition: NnClusterizationFactory.h:275
InDetDD::SiCellId::phiIndex
int phiIndex() const
Get phi index. Equivalent to strip().
Definition: SiCellId.h:122
read_hist_ntuple.t
t
Definition: read_hist_ntuple.py:5
drawFromPickle.cos
cos
Definition: drawFromPickle.py:36
InDet::NnClusterizationFactory::eigenInput
InputVector eigenInput(NNinput &input) const
Definition: NnClusterizationFactory.cxx:213
ATH_MSG_VERBOSE
#define ATH_MSG_VERBOSE(x)
Definition: AthMsgStreamMacros.h:28
SG::VarHandleKey::key
const std::string & key() const
Return the StoreGate ID for the referenced object.
Definition: AthToolSupport/AsgDataHandles/Root/VarHandleKey.cxx:141
InDet::NnClusterizationFactory::m_nnNames
static const std::array< std::regex, kNNetworkTypes > m_nnNames
Definition: NnClusterizationFactory.h:218
norm_theta
double norm_theta(const double input)
Definition: NnNormalization.cxx:79
InDet::NnClusterizationFactory::addTrackInfoToInput
void addTrackInfoToInput(NNinput &input, const Trk::Surface &pixelSurface, const Trk::TrackParameters &trackParsAtSurface, const double tanl) const
Definition: NnClusterizationFactory.cxx:741
empty
bool empty(TH1 *h)
Definition: computils.cxx:294
InDet::NnClusterizationFactory::estimatePositionsLWTNN
std::vector< Amg::Vector2D > estimatePositionsLWTNN(NnClusterizationFactory::InputVector &input, NNinput &rawInput, const InDet::PixelCluster &pCluster, int numberSubClusters, std::vector< Amg::MatrixX > &errors) const
Definition: NnClusterizationFactory.cxx:475
InDet::PixelCluster::totList
const std::vector< int > & totList() const
Definition: InnerDetector/InDetRecEvent/InDetPrepRawData/InDetPrepRawData/PixelCluster.h:201
Trk::u
@ u
Enums for curvilinear frames.
Definition: ParamDefs.h:83
InDetDD::SolidStateDetectorElementBase::identifyHash
virtual IdentifierHash identifyHash() const override final
identifier hash (inline)
PixelID::wafer_id
Identifier wafer_id(int barrel_ec, int layer_disk, int phi_module, int eta_module) const
For a single crystal.
Definition: PixelID.h:364
drawFromPickle.atan
atan
Definition: drawFromPickle.py:36
InDet::NnClusterizationFactory::m_assembleInput
std::vector< double >(InDet::NnClusterizationFactory::* m_assembleInput)(NNinput &input) const
Definition: NnClusterizationFactory.h:225
SG::VarHandleKeyArray::setOwner
virtual void setOwner(IDataHandleHolder *o)=0
PrepareReferenceFile.regex
regex
Definition: PrepareReferenceFile.py:43
InDetDD::SiLocalPosition
Definition: SiLocalPosition.h:31
InDet::NnClusterizationFactory::assembleInputRunI
std::vector< double > assembleInputRunI(NNinput &input) const
Definition: NnClusterizationFactory.cxx:177
InDetDD::SiLocalPosition::xPhi
double xPhi() const
position along phi direction:
Definition: SiLocalPosition.h:123
InDet::NnClusterizationFactory::m_useTTrainedNetworks
Gaudi::Property< bool > m_useTTrainedNetworks
Definition: NnClusterizationFactory.h:293
python.setupRTTAlg.size
int size
Definition: setupRTTAlg.py:39
InDet::NnClusterizationFactory::m_readKeyJSON
SG::ReadCondHandleKey< LWTNNCollection > m_readKeyJSON
Definition: NnClusterizationFactory.h:255
InDet::NnClusterizationFactory::correctedRMSX
static double correctedRMSX(double posPixels)
Definition: NnClusterizationFactory.cxx:556
InDet::NnClusterizationFactory::getPositionsFromOutput
std::vector< Amg::Vector2D > getPositionsFromOutput(std::vector< double > &output, const NNinput &input, const InDet::PixelCluster &pCluster) const
Definition: NnClusterizationFactory.cxx:650
InDetDD::SiCellId::etaIndex
int etaIndex() const
Get eta index.
Definition: SiCellId.h:114
PixelID::wafer_hash
IdentifierHash wafer_hash(Identifier wafer_id) const
wafer hash from id
Definition: PixelID.h:387
norm_layerNumber
double norm_layerNumber(const double input)
Definition: NnNormalization.cxx:57
AthCommonDataStore
Definition: AthCommonDataStore.h:52
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
lumiFormat.i
int i
Definition: lumiFormat.py:92
InDet::NnClusterizationFactory::getErrorMatrixFromOutput
void getErrorMatrixFromOutput(std::vector< double > &outputX, std::vector< double > &outputY, std::vector< Amg::MatrixX > &errorMatrix, int nParticles) const
Definition: NnClusterizationFactory.cxx:579
InDetDD::SiLocalPosition::xEta
double xEta() const
position along eta direction:
Definition: SiLocalPosition.h:118
Identifier
Definition: DetectorDescription/Identifier/Identifier/Identifier.h:32
beamspotman.n
n
Definition: beamspotman.py:731
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
python.sizes.location
string location
Definition: sizes.py:11
angle
double angle(const GeoTrf::Vector2D &a, const GeoTrf::Vector2D &b)
Definition: TRTDetectorFactory_Full.cxx:73
InDet::NnClusterizationFactory::m_pixelReadout
ServiceHandle< InDetDD::IPixelReadoutManager > m_pixelReadout
Definition: NnClusterizationFactory.h:242
PixelChargeCalibCondData
Definition: PixelChargeCalibCondData.h:24
back_posY
double back_posY(const double input)
Definition: NnNormalization.cxx:122
InDet::NnClusterizationFactory::m_readKeyWithTrack
SG::ReadCondHandleKey< TTrainedNetworkCollection > m_readKeyWithTrack
Definition: NnClusterizationFactory.h:251
PlotPulseshapeFromCool.input
input
Definition: PlotPulseshapeFromCool.py:106
TTrainedNetwork::calculateNormalized
DVec calculateNormalized(const DVec &input) const
Definition: Tracking/TrkUtilityPackages/TrkNeuralNetworkUtils/src/TTrainedNetwork.cxx:267
norm_ToT
double norm_ToT(const double input)
Definition: NnNormalization.cxx:24
PixelID::eta_index
int eta_index(const Identifier &id) const
Definition: PixelID.h:664
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
InDet::NnClusterizationFactory::kPositionNN
@ kPositionNN
Definition: NnClusterizationFactory.h:208
drawFromPickle.tan
tan
Definition: drawFromPickle.py:36
AthCommonDataStore< AthCommonMsg< AlgTool > >::m_detStore
StoreGateSvc_t m_detStore
Pointer to StoreGate (detector store by default)
Definition: AthCommonDataStore.h:393
InDet::NnClusterizationFactory::s_nnTypeNames
static constexpr std::array< std::string_view, kNNetworkTypes > s_nnTypeNames
Definition: NnClusterizationFactory.h:212
norm_layerType
double norm_layerType(const double input)
Definition: NnNormalization.cxx:64
xAOD::double
double
Definition: CompositeParticle_v1.cxx:159
InDet::NnClusterizationFactory::estimateNumberOfParticlesTTN
std::vector< double > estimateNumberOfParticlesTTN(const TTrainedNetworkCollection &nn_collection, const std::vector< double > &inputData) const
Definition: NnClusterizationFactory.cxx:303
InDet::SiCluster::detectorElement
virtual const InDetDD::SiDetectorElement * detectorElement() const override final
return the detector element corresponding to this PRD The pointer will be zero if the det el is not d...
LB_AnalMapSplitter.tot
tot
Definition: LB_AnalMapSplitter.py:46
AthAlgTool::AthAlgTool
AthAlgTool()
Default constructor:
min
#define min(a, b)
Definition: cfImp.cxx:40
SG::VarHandleKeyArray::renounce
virtual void renounce()=0
norm_phiBS
double norm_phiBS(const double input)
Definition: NnNormalization.cxx:86
SG::HandleClassifier::type
std::conditional< std::is_base_of< SG::VarHandleKeyArray, T >::value, VarHandleKeyArrayType, type2 >::type type
Definition: HandleClassifier.h:54
mergePhysValFiles.errors
list errors
Definition: DataQuality/DataQualityUtils/scripts/mergePhysValFiles.py:43
merge.output
output
Definition: merge.py:17
Trk::PrepRawData::identify
Identifier identify() const
return the identifier
InDet::NnClusterizationFactory::m_readKeyWithoutTrack
SG::ReadCondHandleKey< TTrainedNetworkCollection > m_readKeyWithoutTrack
Definition: NnClusterizationFactory.h:248
PixelID::layer_disk
int layer_disk(const Identifier &id) const
Definition: PixelID.h:626
InDet::NnClusterizationFactory::m_useRecenteringNNWithTracks
Gaudi::Property< bool > m_useRecenteringNNWithTracks
Definition: NnClusterizationFactory.h:299
PixelID::eta_module
int eta_module(const Identifier &id) const
Definition: PixelID.h:651
errorHalfIntervalY
double errorHalfIntervalY(const int nParticles)
Definition: NnNormalization.cxx:144
merge_scale_histograms.doc
string doc
Definition: merge_scale_histograms.py:9
TauJetParameters::discriminant
@ discriminant
Definition: TauJetParameters.h:166
InDet::NnClusterizationFactory::m_nParticleNNId
unsigned int m_nParticleNNId
Definition: NnClusterizationFactory.h:220
InDet::NnClusterizationFactory::m_useToT
Gaudi::Property< bool > m_useToT
Definition: NnClusterizationFactory.h:284
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:192
ActsTrk::to_string
std::string to_string(const DetectorType &type)
Definition: GeometryDefs.h:34
Trk::PrepRawData::localPosition
const Amg::Vector2D & localPosition() const
return the local position reference
InDet::NnClusterizationFactory::correctedRMSY
double correctedRMSY(double posPixels, std::vector< float > &pitches) const
Definition: NnClusterizationFactory.cxx:564
charge
double charge(const T &p)
Definition: AtlasPID.h:494
InDetDD::SiDetectorElement
Definition: SiDetectorElement.h:109
InDet::NnClusterizationFactory::m_correctLorShiftBarrelWithoutTracks
Gaudi::Property< double > m_correctLorShiftBarrelWithoutTracks
Definition: NnClusterizationFactory.h:278
SG::CondHandleKey::initialize
StatusCode initialize(bool used=true)
InDet::NnClusterizationFactory::estimateNumberOfParticlesLWTNN
std::vector< double > estimateNumberOfParticlesLWTNN(NnClusterizationFactory::InputVector &input) const
Definition: NnClusterizationFactory.cxx:326
Amg::Vector3D
Eigen::Matrix< double, 3, 1 > Vector3D
Definition: GeoPrimitives.h:47
query_example.col
col
Definition: query_example.py:7
InDet::NnClusterizationFactory::m_pixelLorentzAngleTool
ToolHandle< ISiLorentzAngleTool > m_pixelLorentzAngleTool
Definition: NnClusterizationFactory.h:239
InDet::NnClusterizationFactory::kNumberParticlesNN
@ kNumberParticlesNN
Definition: NnClusterizationFactory.h:207
back_posX
double back_posX(const double input, const bool recenter=false)
Definition: NnNormalization.cxx:113
InDetDD::SiCellId
Definition: SiCellId.h:29
errorHalfIntervalX
double errorHalfIntervalX(const int nParticles)
Definition: NnNormalization.cxx:140
Trk::ParametersBase::momentum
const Amg::Vector3D & momentum() const
Access method for the momentum.
DiTauMassTools::MaxHistStrategyV2::e
e
Definition: PhysicsAnalysis/TauID/DiTauMassTools/DiTauMassTools/HelperFunctions.h:26
a
TList * a
Definition: liststreamerinfos.cxx:10
InDet::NnClusterizationFactory::m_outputNodesPos3
Gaudi::Property< std::vector< std::size_t > > m_outputNodesPos3
Definition: NnClusterizationFactory.h:271
h
InDet::NnClusterizationFactory::m_correctLorShiftBarrelWithTracks
Gaudi::Property< double > m_correctLorShiftBarrelWithTracks
Definition: NnClusterizationFactory.h:281
InDet::NnClusterizationFactory::m_sizeY
Gaudi::Property< unsigned int > m_sizeY
Definition: NnClusterizationFactory.h:305
python.CaloScaleNoiseConfig.str
str
Definition: CaloScaleNoiseConfig.py:78
InDet::NnClusterizationFactory::m_calculateOutput
ReturnType(::TTrainedNetwork::* m_calculateOutput)(const InputType &input) const
Definition: NnClusterizationFactory.h:236
InDet::NnClusterizationFactory::assembleInputRunII
std::vector< double > assembleInputRunII(NNinput &input) const
Definition: NnClusterizationFactory.cxx:155
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition: AthMsgStreamMacros.h:32
InDet::NnClusterizationFactory::m_useRecenteringNNWithouTracks
Gaudi::Property< bool > m_useRecenteringNNWithouTracks
Definition: NnClusterizationFactory.h:296
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
InDet::NnClusterizationFactory::kNNetworkTypes
@ kNNetworkTypes
Definition: NnClusterizationFactory.h:211
InDet::NnClusterizationFactory::m_nnOrder
Gaudi::Property< std::vector< std::string > > m_nnOrder
Definition: NnClusterizationFactory.h:194
SG::VarHandleBase::vhKey
SG::VarHandleKey & vhKey()
Return a non-const reference to the HandleKey.
Definition: StoreGate/src/VarHandleBase.cxx:616
InDet::NnClusterizationFactory::calculateVectorDimension
size_t calculateVectorDimension(const bool useTrackInfo) const
Definition: NnClusterizationFactory.cxx:959
declareProperty
#define declareProperty(n, p, h)
Definition: BaseFakeBkgTool.cxx:15
InDet::NnClusterizationFactory::m_outputNodesPos2
Gaudi::Property< std::vector< std::size_t > > m_outputNodesPos2
Definition: NnClusterizationFactory.h:267
PixelChargeCalibCondData::getCharge
float getCharge(InDetDD::PixelDiodeType type, unsigned int moduleHash, unsigned int FE, float ToT) const
Definition: PixelChargeCalibCondData.cxx:190
python.Bindings.keys
keys
Definition: Control/AthenaPython/python/Bindings.py:790
InDet::NnClusterizationFactory::m_doRunI
Gaudi::Property< bool > m_doRunI
Definition: NnClusterizationFactory.h:290
IdentifierHash
Definition: IdentifierHash.h:38
InDetDD::SiDetectorElement::design
virtual const SiDetectorDesign & design() const override final
access to the local description (inline):
InDet::NnClusterizationFactory::kErrorYNN
@ kErrorYNN
Definition: NnClusterizationFactory.h:210
InDet::NnClusterizationFactory::InputVector
std::vector< Eigen::VectorXd > InputVector
Definition: NnClusterizationFactory.h:127
PixelID
Definition: PixelID.h:67
Trk::Surface::transform
const Amg::Transform3D & transform() const
Returns HepGeom::Transform3D by reference.
InDetDD::SiDiodesParameters::width
SiLocalPosition width() const
width of the diodes:
Definition: SiDiodesParameters.h:96
InDet::NnClusterizationFactory::createInput
NNinput createInput(const InDet::PixelCluster &pCluster, Amg::Vector3D &beamSpotPosition, double &tanl) const
Definition: NnClusterizationFactory.cxx:760
AthCommonDataStore::declareGaudiProperty
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>
Definition: AthCommonDataStore.h:156
run2time.chList
chList
Definition: run2time.py:26
norm_thetaBS
double norm_thetaBS(const double input)
Definition: NnNormalization.cxx:94
readCCLHist.float
float
Definition: readCCLHist.py:83
AtlasDetectorID
This class provides an interface to generate or decode an identifier for the upper levels of the dete...
Definition: AtlasDetectorID.h:57
InDet::NnClusterizationFactory::kErrorXNN
@ kErrorXNN
Definition: NnClusterizationFactory.h:209
NSWL1::centroid
Vertex centroid(const Polygon &p)
Definition: GeoUtils.cxx:59
fitman.k
k
Definition: fitman.py:528
InDet::PixelCluster::chargeList
const std::vector< float > & chargeList() const
Definition: InnerDetector/InDetRecEvent/InDetPrepRawData/InDetPrepRawData/PixelCluster.h:209
InDetDD::SiDiodesParameters
Definition: SiDiodesParameters.h:25