ATLAS Offline Software
Public Member Functions | Protected Member Functions | Private Types | Private Member Functions | Private Attributes | List of all members
PixelPrepDataToxAOD Class Reference

#include <PixelPrepDataToxAOD.h>

Inheritance diagram for PixelPrepDataToxAOD:
Collaboration diagram for PixelPrepDataToxAOD:

Public Member Functions

 PixelPrepDataToxAOD (const std::string &name, ISvcLocator *pSvcLocator)
 
virtual StatusCode initialize ()
 
virtual StatusCode execute ()
 
virtual StatusCode finalize ()
 
virtual StatusCode sysInitialize () override
 Override sysInitialize. More...
 
virtual const DataObjIDColl & extraOutputDeps () const override
 Return the list of extra output dependencies. More...
 
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 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
 

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

typedef ServiceHandle< StoreGateSvcStoreGateSvc_t
 

Private Member Functions

std::vector< std::vector< int > > addSDOInformation (xAOD::TrackMeasurementValidation *xprd, const InDet::PixelCluster *prd, const InDetSimDataCollection &sdoCollection) const
 
void addSiHitInformation (xAOD::TrackMeasurementValidation *xprd, const InDet::PixelCluster *prd, const std::vector< SiHit > &matchingHits) const
 
std::vector< SiHitfindAllHitsCompatibleWithCluster (const InDet::PixelCluster *prd, const std::vector< const SiHit * > *sihits, std::vector< std::vector< int > > &trkBCs) const
 
void addNNTruthInfo (xAOD::TrackMeasurementValidation *xprd, const InDet::PixelCluster *prd, const std::vector< SiHit > &matchingHits) const
 
void addNNInformation (xAOD::TrackMeasurementValidation *xprd, const InDet::PixelCluster *pixelCluster, const unsigned int SizeX, const unsigned int SizeY) const
 
void addRdoInformation (xAOD::TrackMeasurementValidation *xprd, const InDet::PixelCluster *pixelCluster, const PixelChargeCalibCondData *calibData) const
 
InDetDD::SiCellId getCellIdWeightedPosition (const InDet::PixelCluster *pixelCluster, int *rrowMin=0, int *rrowMax=0, int *rcolMin=0, int *rcolMax=0) 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...
 

Private Attributes

const PixelIDm_PixelHelper
 
bool m_useTruthInfo
 
bool m_writeSDOs
 
bool m_writeSiHits
 
bool m_writeNNinformation
 
bool m_writeRDOinformation
 
bool m_writeExtendedPRDinformation
 
bool m_useSiHitsGeometryMatching
 
ServiceHandle< InDetDD::IPixelReadoutManagerm_pixelReadout {this, "PixelReadoutManager", "PixelReadoutManager", "Pixel readout manager" }
 
SG::ReadCondHandleKey< PixelChargeCalibCondDatam_chargeDataKey {this, "PixelChargeCalibCondData", "PixelChargeCalibCondData", "Pixel charge calibration data"}
 
SG::ReadCondHandleKey< PixelDCSStateDatam_condDCSStateKey {this, "PixelDCSStateCondData", "PixelDCSStateCondData", "Pixel FSM state key"}
 
SG::ReadCondHandleKey< PixelDCSStatusDatam_condDCSStatusKey {this, "PixelDCSStatusCondData", "PixelDCSStatusCondData", "Pixel FSM status key"}
 
SG::ReadCondHandleKey< PixelDCSTempDatam_readKeyTemp {this, "ReadKeyTemp", "PixelDCSTempCondData", "Key of input sensor temperature conditions folder"}
 
SG::ReadCondHandleKey< PixelDCSHVDatam_readKeyHV {this, "ReadKeyHV", "PixelDCSHVCondData", "Key of input bias voltage conditions folder"}
 
ToolHandle< IInDetConditionsToolm_pixelSummary {this, "PixelConditionsSummaryTool", "PixelConditionsSummaryTool", "Tool for PixelConditionsSummaryTool"}
 
ToolHandle< ISiLorentzAngleToolm_lorentzAngleTool {this, "LorentzAngleTool", "SiLorentzAngleTool", "Tool to retreive Lorentz angle"}
 
SG::ReadHandleKey< Trk::ClusterSplitProbabilityContainerm_clusterSplitProbContainer {this, "ClusterSplitProbabilityName", "",""}
 
std::atomic< unsigned int > m_haveTruthLink {}
 
std::atomic< unsigned int > m_missingTruthParticle {}
 
std::atomic< unsigned int > m_missingParentParticle {}
 
bool m_firstEventWarnings
 
bool m_need_sihits
 
SG::ReadHandleKey< InDet::PixelClusterContainerm_clustercontainer_key
 
SG::ReadHandleKey< SiHitCollectionm_sihitContainer_key
 
SG::ReadHandleKey< InDetSimDataCollectionm_SDOcontainer_key
 
SG::ReadHandleKey< PRD_MultiTruthCollectionm_multiTruth_key
 
SG::ReadHandleKey< xAODTruthParticleLinkVectorm_truthParticleLinks {this,"InputTruthParticleLinks","","The key for the truth particle link collection."}
 
SG::WriteHandleKey< xAOD::TrackMeasurementValidationContainerm_write_xaod_key
 
SG::WriteHandleKey< std::vector< unsigned int > > m_write_offsets
 
DataObjIDColl m_extendedExtraObjects
 
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
 

Detailed Description

Definition at line 64 of file PixelPrepDataToxAOD.h.

Member Typedef Documentation

◆ StoreGateSvc_t

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

Definition at line 388 of file AthCommonDataStore.h.

Constructor & Destructor Documentation

◆ PixelPrepDataToxAOD()

PixelPrepDataToxAOD::PixelPrepDataToxAOD ( const std::string &  name,
ISvcLocator *  pSvcLocator 
)

Definition at line 51 of file PixelPrepDataToxAOD.cxx.

51  :
52  AthAlgorithm(name,pSvcLocator),
53  m_PixelHelper(nullptr),
56  m_need_sihits{false}
57 {
58  // --- Steering and configuration flags
59 
60  declareProperty("UseTruthInfo", m_useTruthInfo=false);
61  declareProperty("UseSiHitsGeometryMatching", m_useSiHitsGeometryMatching=true);
62  declareProperty("WriteSDOs", m_writeSDOs = false);
63  declareProperty("WriteSiHits", m_writeSiHits = false);
64  declareProperty("WriteNNinformation", m_writeNNinformation = true);
65  declareProperty("WriteRDOinformation", m_writeRDOinformation = true);
66  declareProperty("WriteExtendedPRDinformation", m_writeExtendedPRDinformation = false);
67 
68  // --- Configuration keys
69  declareProperty("SiClusterContainer", m_clustercontainer_key = "PixelClusters");
70  declareProperty("MC_SDOs", m_SDOcontainer_key = "PixelSDO_Map");
71  declareProperty("MC_Hits", m_sihitContainer_key = "PixelHits");
72  declareProperty("PRD_MultiTruth", m_multiTruth_key = "PRD_MultiTruthPixel");
73  //Keep this the same as input for now, for consistency with downstream assumptions
74  declareProperty("OutputClusterContainer", m_write_xaod_key = "PixelClusters");
75 
76  // --- Services and Tools
77  declare(m_write_xaod_key);
78  declare(m_write_offsets);
79 
80 }

Member Function Documentation

◆ addNNInformation()

void PixelPrepDataToxAOD::addNNInformation ( xAOD::TrackMeasurementValidation xprd,
const InDet::PixelCluster pixelCluster,
const unsigned int  SizeX,
const unsigned int  SizeY 
) const
private

Definition at line 772 of file PixelPrepDataToxAOD.cxx.

775 {
776  ATH_MSG_VERBOSE( " Starting creating input from cluster " );
777 
778  const InDetDD::SiDetectorElement* de = pixelCluster->detectorElement();
779  if (de==nullptr) {
780  ATH_MSG_ERROR("Could not get detector element");
781  return;
782  }
783 
784 
785  const InDetDD::PixelModuleDesign* design(dynamic_cast<const InDetDD::PixelModuleDesign*>(&de->design()));
786  if (not design) {
787  ATH_MSG_WARNING("PixelModuleDesign was not retrieved in function 'addNNInformation'");
788  return;
789  }
790  const std::vector<Identifier>& rdos = pixelCluster->rdoList();
791 
792  const std::vector<float>& chList = pixelCluster->chargeList();
793  const std::vector<int>& totList = pixelCluster->totList();
794 
795  ATH_MSG_VERBOSE( "Number of RDOs: " << rdos.size() );
796  ATH_MSG_VERBOSE( "Number of charges: " << chList.size() );
797  ATH_MSG_VERBOSE( "Number of TOT: " << totList.size() );
798 
799 
800  //Calculate the centre of the cluster
801  int phiPixelIndexMin, phiPixelIndexMax, etaPixelIndexMin, etaPixelIndexMax;
802  InDetDD::SiCellId cellIdWeightedPosition= getCellIdWeightedPosition( pixelCluster, &phiPixelIndexMin, &phiPixelIndexMax, &etaPixelIndexMin, &etaPixelIndexMax);
803 
804  if (!cellIdWeightedPosition.isValid())
805  {
806  ATH_MSG_WARNING( "Weighted position is on invalid CellID." );
807  }
808 
809  int etaPixelIndexWeightedPosition=cellIdWeightedPosition.etaIndex();
810  int phiPixelIndexWeightedPosition=cellIdWeightedPosition.phiIndex();
811 
812 
813  ATH_MSG_DEBUG(" weighted pos phiPixelIndex: " << phiPixelIndexWeightedPosition << " etaPixelIndex: " << etaPixelIndexWeightedPosition );
814 
815  // SiLocalPosition PixelModuleDesign::positionFromColumnRow(const int column, const int row) const;
816  //
817  // Given row and column index of diode, returns position of diode center
818  // ALTERNATIVE/PREFERED way is to use localPositionOfCell(const SiCellId & cellId) or
819  // rawLocalPositionOfCell method in SiDetectorElement.
820  // DEPRECATED (but used in numerous places)
821  //
822  // Comment by Hide (referring the original comment in the code) : 2015-02-04
823  // I automatically replaced column to etaPixelIndex and row to phiPixelIndex here. It was bofore:
824  // InDetDD::SiLocalPosition siLocalPosition( design->positionFromColumnRow(columnWeightedPosition,rowWeightedPosition) );
825  //
826  // Then I assume the argument of column/row in this function is in offline manner, not the real hardware column/row.
827  //
828  InDetDD::SiLocalPosition w = design->positionFromColumnRow(etaPixelIndexWeightedPosition,phiPixelIndexWeightedPosition);
829 
830 
831  double localEtaPixelIndexWeightedPosition = w.xEta();
832  double localPhiPixelIndexWeightedPosition = w.xPhi();
833 
834  int centralIndexX=(sizeX-1)/2;
835  int centralIndexY=(sizeY-1)/2;
836 
837 
838 
839  // Check to see if the cluster is too big for the NN
840 
841  if (abs(phiPixelIndexWeightedPosition-phiPixelIndexMin)>centralIndexX ||
842  abs(phiPixelIndexWeightedPosition-phiPixelIndexMax)>centralIndexX)
843  {
844  ATH_MSG_DEBUG(" Cluster too large phiPixelIndexMin " << phiPixelIndexMin << " phiPixelIndexMax " << phiPixelIndexMax << " centralX " << centralIndexX);
845  //return;
846  }
847 
848  if (abs(etaPixelIndexWeightedPosition-etaPixelIndexMin)>centralIndexY ||
849  abs(etaPixelIndexWeightedPosition-etaPixelIndexMax)>centralIndexY)
850  {
851  ATH_MSG_DEBUG(" Cluster too large etaPixelIndexMin" << etaPixelIndexMin << " etaPixelIndexMax " << etaPixelIndexMax << " centralY " << centralIndexY);
852  //return;
853  }
854 
855  std::vector< std::vector<float> > matrixOfToT (sizeX, std::vector<float>(sizeY,0) );
856  std::vector< std::vector<float> > matrixOfCharge(sizeX, std::vector<float>(sizeY,0));
857  std::vector<float> vectorOfPitchesY(sizeY,0.4);
858 
859 
860  //Itererate over all elements hits in the cluster and fill the charge and tot matrices
861  std::vector<Identifier>::const_iterator rdosBegin = rdos.begin();
862  std::vector<Identifier>::const_iterator rdosEnd = rdos.end();
863  auto charge = chList.begin();
864  auto tot = totList.begin();
865 
866  ATH_MSG_VERBOSE(" Putting together the n. " << rdos.size() << " rdos into a matrix.");
867 
868  for (; rdosBegin!= rdosEnd; ++rdosBegin)
869  {
870 
871  Identifier rId = *rdosBegin;
872  int absphiPixelIndex = m_PixelHelper->phi_index(rId)-phiPixelIndexWeightedPosition + centralIndexX;
873  int absetaPixelIndex = m_PixelHelper->eta_index(rId)-etaPixelIndexWeightedPosition + centralIndexY;
874  if (charge != chList.end()){
875  ATH_MSG_VERBOSE( " Phi Index: " << m_PixelHelper->phi_index(rId) << " absphiPixelIndex: " << absphiPixelIndex << " eta Idx: " << m_PixelHelper->eta_index(rId) << " absetaPixelIndex: " << absetaPixelIndex << " charge " << *charge );
876  }
877  if (absphiPixelIndex <0 || absphiPixelIndex >= (int)sizeX)
878  {
879  ATH_MSG_DEBUG(" problem with index: " << absphiPixelIndex << " min: " << 0 << " max: " << sizeX);
880  continue;
881  }
882 
883  if (absetaPixelIndex <0 || absetaPixelIndex >= (int)sizeY)
884  {
885  ATH_MSG_DEBUG(" problem with index: " << absetaPixelIndex << " min: " << 0 << " max: " << sizeY);
886  continue;
887  }
888 
889  InDetDD::SiCellId cellId = de->cellIdFromIdentifier(*rdosBegin);
890  InDetDD::SiDiodesParameters diodeParameters = design->parameters(cellId);
891  float pitchY = diodeParameters.width().xEta();
892 
893  if ( (not totList.empty()) && tot != totList.end()) {
894  matrixOfToT[absphiPixelIndex][absetaPixelIndex] =*tot;
895  ++tot;
896  } else matrixOfToT[absphiPixelIndex][absetaPixelIndex] = -1;
897 
898  if ( (not chList.empty()) && charge != chList.end()){
899  matrixOfCharge[absphiPixelIndex][absetaPixelIndex]=*charge;
900  ++charge;
901  } else matrixOfCharge[absphiPixelIndex][absetaPixelIndex] = -1;
902 
903  if (pitchY > 0.1)
904  {
905  vectorOfPitchesY[absetaPixelIndex]=pitchY;
906  }
907  }//end iteration on rdos
908 
909 
910  ATH_MSG_VERBOSE( " End RDO LOOP " );
911 
912  // Using the centre of the module and beam spot calculate
913  // the incidence angles of the tracks
914  const Amg::Vector2D& prdLocPos = pixelCluster->localPosition();
916 
917  Amg::Vector3D globalPos = de->globalPosition(centroid);
918  Amg::Vector3D trackDir = globalPos; // - beamSpotPosition;
919  trackDir.normalize();
920 
921  Amg::Vector3D module_normal = de->normal();
922  Amg::Vector3D module_phiax = de->phiAxis();
923  Amg::Vector3D module_etaax = de->etaAxis();
924 
925  // Calculate the phi incidence angle
926  float trkphicomp = trackDir.dot(module_phiax);
927  float trketacomp = trackDir.dot(module_etaax);
928  float trknormcomp = trackDir.dot(module_normal);
929  double bowphi = atan2(trkphicomp,trknormcomp);
930  double boweta = atan2(trketacomp,trknormcomp);
931  double tanl = m_lorentzAngleTool->getTanLorentzAngle(de->identifyHash());
932  if(bowphi > TMath::Pi()/2) bowphi -= TMath::Pi();
933  if(bowphi < -TMath::Pi()/2) bowphi += TMath::Pi();
934  int readoutside = design->readoutSide();
935  double angle = atan(tan(bowphi)-readoutside*tanl);
936 
937 
938  // Calculate the theta incidence angle
939  ATH_MSG_VERBOSE( " Angle theta bef corr: " << boweta );
940  if (boweta>TMath::Pi()/2.) boweta-=TMath::Pi();
941  if (boweta<-TMath::Pi()/2.) boweta+=TMath::Pi();
942 
943 
944  ATH_MSG_VERBOSE(" Angle phi: " << angle << " theta: " << boweta );
945  ATH_MSG_VERBOSE(" PhiPixelIndexWeightedPosition: " << phiPixelIndexWeightedPosition << " EtaPixelIndexWeightedPosition: " << etaPixelIndexWeightedPosition );
946 
947  // store the matrixOfToT in a vector
948  std::vector<float> vectorOfCharge(sizeX*sizeY,0);
949  std::vector<float> vectorOfToT(sizeX*sizeY,0);
950  int counter(0);
951  for (unsigned int u=0;u<sizeX;u++)
952  {
953  for (unsigned int s=0;s<sizeY;s++)
954  {
955  vectorOfToT[counter] = matrixOfToT[u][s];
956  vectorOfCharge[counter] = matrixOfCharge[u][s];
957  ++counter;
958  }
959  }
960 
961  ATH_MSG_VERBOSE( "matrixOfToT converted in a std::vector<float> " );
962 
963  ATH_MSG_VERBOSE( "... and saved " );
964  // Add information to xAOD
965  AUXDATA(xprd, int, NN_sizeX) = sizeX;
966  AUXDATA(xprd, int, NN_sizeY) = sizeY;
967 
968  AUXDATA(xprd, float, NN_phiBS) = angle;
969  AUXDATA(xprd, float, NN_thetaBS) = boweta;
970 
971  AUXDATA(xprd, std::vector<float>, NN_matrixOfToT) = vectorOfToT;
972  AUXDATA(xprd, std::vector<float>, NN_matrixOfCharge) = vectorOfCharge;
973  AUXDATA(xprd, std::vector<float>, NN_vectorOfPitchesY) = vectorOfPitchesY;
974 
975 
976  AUXDATA(xprd, int, NN_etaPixelIndexWeightedPosition) = etaPixelIndexWeightedPosition;
977  AUXDATA(xprd, int, NN_phiPixelIndexWeightedPosition) = phiPixelIndexWeightedPosition;
978 
979  AUXDATA(xprd, float, NN_localEtaPixelIndexWeightedPosition) = localEtaPixelIndexWeightedPosition;
980  AUXDATA(xprd, float, NN_localPhiPixelIndexWeightedPosition) = localPhiPixelIndexWeightedPosition;
981 
982  ATH_MSG_VERBOSE( "NN training Written" );
983 }

◆ addNNTruthInfo()

void PixelPrepDataToxAOD::addNNTruthInfo ( xAOD::TrackMeasurementValidation xprd,
const InDet::PixelCluster prd,
const std::vector< SiHit > &  matchingHits 
) const
private

Definition at line 985 of file PixelPrepDataToxAOD.cxx.

988 {
989 
990 
991  unsigned int numberOfSiHits = matchingHits.size();
992 
993  std::vector<float> positionsX(numberOfSiHits,0);
994  std::vector<float> positionsY(numberOfSiHits,0);
995 
996  std::vector<float> positions_indexX(numberOfSiHits,0);
997  std::vector<float> positions_indexY(numberOfSiHits,0);
998 
999  std::vector<float> theta(numberOfSiHits,0);
1000  std::vector<float> phi(numberOfSiHits,0);
1001 
1002  std::vector<int> barcode(numberOfSiHits,0);
1003  std::vector<int> pdgid(numberOfSiHits,0);
1004  std::vector<float> chargeDep(numberOfSiHits,0);
1005  std::vector<float> truep(numberOfSiHits,0);
1006 
1007  std::vector<float> pathlengthX(numberOfSiHits,0);
1008  std::vector<float> pathlengthY(numberOfSiHits,0);
1009  std::vector<float> pathlengthZ(numberOfSiHits,0);
1010 
1011  std::vector<int> motherBarcode(numberOfSiHits,0);
1012  std::vector<int> motherPdgid(numberOfSiHits,0);
1013 
1014 
1015 
1016  // Check if we have detector element -- needed to find the local position of the SiHits
1017  const InDetDD::SiDetectorElement* de = pixelCluster->detectorElement();
1018  if(!de)
1019  return;
1020 
1021  InDetDD::SiCellId cellIdWeightedPosition = getCellIdWeightedPosition( pixelCluster );
1022 
1023  const InDetDD::PixelModuleDesign* design(dynamic_cast<const InDetDD::PixelModuleDesign*>(&de->design()));
1024  if (not design) {
1025  ATH_MSG_WARNING("PixelModuleDesign was not retrieved in function 'addNNTruthInfo'");
1026  return;
1027  }
1028  // lorentz shift correction
1029  double shift = m_lorentzAngleTool->getLorentzShift(de->identifyHash());
1030  unsigned hitNumber(0);
1031  for( const auto& siHit : matchingHits ){
1032 
1033  HepGeom::Point3D<double> averagePosition = (siHit.localStartPosition() + siHit.localEndPosition()) * 0.5;
1034 
1035  ATH_MSG_VERBOSE("Truth Part X: " << averagePosition.y() << " shift " << shift << " Y: " << averagePosition.z() );
1036 
1037  // position lorentz shift corrected
1038  float YposC = averagePosition.y()-shift;
1039 
1040  if (std::abs(YposC)>design->width()/2 &&
1041  std::abs(averagePosition.y())<design->width()/2)
1042  {
1043  if (YposC>design->width()/2)
1044  {
1045  YposC=design->width()/2-1e-6;
1046  } else if (YposC<-design->width()/2)
1047  {
1048  YposC=-design->width()/2+1e-6;
1049  }
1050  }
1051 
1052  positionsX[hitNumber] = YposC;
1053  positionsY[hitNumber] = averagePosition.z();
1054 
1055  HepGeom::Point3D<double> deltaPosition = siHit.localEndPosition() - siHit.localStartPosition();
1056 
1057  pathlengthX[hitNumber] = deltaPosition.y();
1058  pathlengthY[hitNumber] = deltaPosition.z();
1059  pathlengthZ[hitNumber] = deltaPosition.x();
1060 
1061 
1062  // Here we convert the hit position to the right frame
1063  Amg::Vector2D siLocalTruthPosition = de->hitLocalToLocal(averagePosition.z(), YposC);
1064  InDetDD::SiCellId cellIdOfTruthPosition = design->cellIdOfPosition(siLocalTruthPosition);
1065 
1066 
1067 // InDetDD::SiLocalPosition siLocalTruthPosition(averagePosition.z(),YposC ) ;
1068 // InDetDD::SiCellId cellIdOfTruthPosition =design->cellIdOfPosition(siLocalTruthPosition);
1069 
1070  int truthEtaIndex = cellIdOfTruthPosition.etaIndex();
1071  int truthPhiIndex = cellIdOfTruthPosition.phiIndex();
1072 
1073  InDetDD::SiDiodesParameters diodeParameters = design->parameters(cellIdOfTruthPosition);
1074  double pitchY = diodeParameters.width().xEta();
1075  double pitchX = diodeParameters.width().xPhi();
1076 
1077  // pixel center
1078  // SiLocalPosition PixelModuleDesign::positionFromColumnRow(const int column, const int row) const;
1079  //
1080  // Given row and column index of diode, returns position of diode center
1081  // ALTERNATIVE/PREFERED way is to use localPositionOfCell(const SiCellId & cellId) or
1082  // rawLocalPositionOfCell method in SiDetectorElement.
1083  // DEPRECATED (but used in numerous places)
1084  //
1085  // Comment by Hide (referring the original comment in the code) : 2015-02-04
1086  // I automatically replaced column to etaPixelIndex and row to phiPixelIndex here. It was bofore:
1087  // InDetDD::SiLocalPosition siLocalPosition( design->positionFromColumnRow(truthColumn,truthRow) );
1088  //
1089  // Then I assume the argument of column/row in this function is in offline manner, not the real hardware column/row.
1090  //
1091  InDetDD::SiLocalPosition siLocalPositionCenter(design->positionFromColumnRow(truthEtaIndex,truthPhiIndex));
1092  double pixelCenterY = siLocalPositionCenter.xEta();
1093  double pixelCenterX = siLocalPositionCenter.xPhi();
1094 
1095 
1096  // truth index
1097 // double truthIndexY = truthEtaIndex + (averagePosition.z() - pixelCenterY)/pitchY;
1098 // double truthIndexX = truthPhiIndex + (YposC - pixelCenterX)/pitchX;
1099  double truthIndexY = truthEtaIndex + (siLocalTruthPosition[Trk::distEta] - pixelCenterY)/pitchY;
1100  double truthIndexX = truthPhiIndex + (siLocalTruthPosition[Trk::distPhi] - pixelCenterX)/pitchX;
1101 
1102 
1103  positions_indexX[hitNumber] = truthIndexX - cellIdWeightedPosition.phiIndex();
1104  positions_indexY[hitNumber] = truthIndexY - cellIdWeightedPosition.etaIndex();
1105 
1106  HepGeom::Point3D<double> diffPositions = (siHit.localEndPosition() - siHit.localStartPosition());
1107  double bowphi = std::atan2( diffPositions.y(), diffPositions.x() );
1108 
1109 
1110  //Truth Track incident angle theta
1111  theta[hitNumber] = std::atan2(diffPositions.z() ,diffPositions.x());
1112  //Truth track incident angle phi -- correct for lorentz angle
1113  float tanlorentz = m_lorentzAngleTool->getTanLorentzAngle(de->identifyHash());
1114 
1115  int readoutside = design->readoutSide();
1116  phi[hitNumber] = std::atan(std::tan(bowphi)-readoutside*tanlorentz);
1117  const HepMcParticleLink& HMPL = siHit.particleLink();
1118  if (HMPL.isValid()){
1119  barcode[hitNumber] = HepMC::barcode(HMPL);
1120  const auto particle = HMPL.cptr();
1121  pdgid[hitNumber] = particle->pdg_id();
1122  HepMC::FourVector mom=particle->momentum();
1123  truep[hitNumber] = std::sqrt(mom.x()*mom.x()+mom.y()*mom.y()+mom.z()*mom.z());
1124  const auto vertex = particle->production_vertex();
1125 //AV Please note that taking the first particle as a mother is ambiguous.
1126 #ifdef HEPMC3
1127  if ( vertex && !vertex->particles_in().empty()){
1128  const auto& mother_of_particle=vertex->particles_in().front();
1129  motherBarcode[hitNumber] = HepMC::barcode(mother_of_particle);
1130  motherPdgid[hitNumber] = mother_of_particle->pdg_id();
1131  }
1132 #else
1133  if ( vertex ){
1134  if( vertex->particles_in_const_begin() != vertex->particles_in_const_end() ){
1135  motherBarcode[hitNumber] = HepMC::barcode(*vertex->particles_in_const_begin());
1136  motherPdgid[hitNumber] = (*vertex->particles_in_const_begin())->pdg_id();
1137  }
1138  }
1139 #endif
1140  }
1141  chargeDep[hitNumber] = siHit.energyLoss() ;
1142 
1143  ++hitNumber;
1144  }
1145 
1146 
1147  AUXDATA(xprd, std::vector<float>, NN_positionsX) = positionsX;
1148  AUXDATA(xprd, std::vector<float>, NN_positionsY) = positionsY;
1149 
1150  AUXDATA(xprd, std::vector<float>, NN_positions_indexX) = positions_indexX;
1151  AUXDATA(xprd, std::vector<float>, NN_positions_indexY) = positions_indexY;
1152 
1153  AUXDATA(xprd, std::vector<float>, NN_theta) = theta;
1154  AUXDATA(xprd, std::vector<float>, NN_phi) = phi;
1155 
1156  AUXDATA(xprd, std::vector<int>, NN_barcode) = barcode;
1157  AUXDATA(xprd, std::vector<int>, NN_pdgid) = pdgid;
1158  AUXDATA(xprd, std::vector<float>, NN_energyDep) = chargeDep;
1159  AUXDATA(xprd, std::vector<float>, NN_trueP) = truep;
1160 
1161  AUXDATA(xprd, std::vector<int>, NN_motherBarcode) = motherBarcode;
1162  AUXDATA(xprd, std::vector<int>, NN_motherPdgid) = motherPdgid;
1163 
1164 
1165  AUXDATA(xprd, std::vector<float>, NN_pathlengthX) = pathlengthX;
1166  AUXDATA(xprd, std::vector<float>, NN_pathlengthY) = pathlengthY;
1167  AUXDATA(xprd, std::vector<float>, NN_pathlengthZ) = pathlengthZ;
1168 
1169 
1170 }

◆ addRdoInformation()

void PixelPrepDataToxAOD::addRdoInformation ( xAOD::TrackMeasurementValidation xprd,
const InDet::PixelCluster pixelCluster,
const PixelChargeCalibCondData calibData 
) const
private

Definition at line 708 of file PixelPrepDataToxAOD.cxx.

711 {
712  ATH_MSG_VERBOSE( " Starting creating input from cluster " );
713 
714 
715  const std::vector<Identifier>& rdos = pixelCluster->rdoList();
716 
717  const std::vector<float> &chList = pixelCluster->chargeList();
718  const std::vector<int> &totList = pixelCluster->totList();
719 
720  // std::vector<int> rowList;
721  // std::vector<int> colList;
722  std::vector<int> etaIndexList;
723  std::vector<int> phiIndexList;
724  std::vector<float> CTerm;
725  std::vector<float> ATerm;
726  std::vector<float> ETerm;
727 
728  ATH_MSG_VERBOSE( "Number of RDOs: " << rdos.size() );
729 
730  //Itererate over all elements hits in the cluster and fill the charge and tot matricies
731  std::vector<Identifier>::const_iterator rdosBegin = rdos.begin();
732  std::vector<Identifier>::const_iterator rdosEnd = rdos.end();
733 
734  ATH_MSG_VERBOSE(" Putting together the n. " << rdos.size() << " rdos into a matrix.");
735 
736  phiIndexList.reserve( rdos.size());
737  etaIndexList.reserve( rdos.size());
738  CTerm.reserve( rdos.size());
739  ATerm.reserve( rdos.size());
740  ETerm.reserve( rdos.size());
741  for (; rdosBegin!= rdosEnd; ++rdosBegin)
742  {
743  Identifier rId = *rdosBegin;
744  phiIndexList.push_back( m_PixelHelper->phi_index(rId) );
745  etaIndexList.push_back( m_PixelHelper->eta_index(rId) );
746 
747  // charge calibration parameters
748  Identifier moduleID = m_PixelHelper->wafer_id(rId);
749  IdentifierHash moduleHash = m_PixelHelper->wafer_hash(moduleID); // wafer hash
750  unsigned int FE = m_pixelReadout->getFE(rId, moduleID);
751  InDetDD::PixelDiodeType type = m_pixelReadout->getDiodeType(rId);
752  const auto & parameters = calibData->getLegacyFitParameters(type, moduleHash, FE);
753  CTerm.emplace_back(parameters.C);
754  ATerm.emplace_back(parameters.A);
755  ETerm.emplace_back(parameters.E);
756 
757  }//end iteration on rdos
758 
759 
760  AUXDATA(xprd, std::vector<int>,rdo_phi_pixel_index) = phiIndexList;
761  AUXDATA(xprd, std::vector<int>,rdo_eta_pixel_index) = etaIndexList;
762  AUXDATA(xprd, std::vector<float>,rdo_charge) = chList;
763  AUXDATA(xprd, std::vector<int>,rdo_tot) = totList;
764 
765  AUXDATA(xprd, std::vector<float>,rdo_Cterm) = CTerm;
766  AUXDATA(xprd, std::vector<float>,rdo_Aterm) = ATerm;
767  AUXDATA(xprd, std::vector<float>,rdo_Eterm) = ETerm;
768 
769 }

◆ addSDOInformation()

std::vector< std::vector< int > > PixelPrepDataToxAOD::addSDOInformation ( xAOD::TrackMeasurementValidation xprd,
const InDet::PixelCluster prd,
const InDetSimDataCollection sdoCollection 
) const
private

Definition at line 470 of file PixelPrepDataToxAOD.cxx.

473 {
474  std::vector<int> sdo_word;
475  std::vector< std::vector< int > > sdo_depositsBarcode;
476  std::vector< std::vector< float > > sdo_depositsEnergy;
477  // find hit
478  for( const auto &hitIdentifier : prd->rdoList() ){
479  auto pos = sdoCollection.find(hitIdentifier);
480  if( pos == sdoCollection.end() ) continue;
481  sdo_word.push_back( pos->second.word() ) ;
482  std::vector<int> sdoDepBC(pos->second.getdeposits().size(), -1);
483  std::vector<float> sdoDepEnergy(pos->second.getdeposits().size());
484  unsigned int nDepos{0};
485  for (auto& deposit: pos->second.getdeposits()) {
486  if (deposit.first) sdoDepBC[nDepos] = HepMC::barcode(deposit.first);
487  ATH_MSG_DEBUG(" SDO Energy Deposit " << deposit.second ) ;
488  sdoDepEnergy[nDepos] = deposit.second;
489  nDepos++;
490  }
491  sdo_depositsBarcode.push_back( sdoDepBC );
492  sdo_depositsEnergy.push_back( sdoDepEnergy );
493  }
494  AUXDATA(xprd,std::vector<int>,sdo_words) = sdo_word;
495  AUXDATA(xprd,std::vector< std::vector<int> >,sdo_depositsBarcode) = sdo_depositsBarcode;
496  AUXDATA(xprd,std::vector< std::vector<float> >,sdo_depositsEnergy) = sdo_depositsEnergy;
497 
498  return sdo_depositsBarcode;
499 }

◆ addSiHitInformation()

void PixelPrepDataToxAOD::addSiHitInformation ( xAOD::TrackMeasurementValidation xprd,
const InDet::PixelCluster prd,
const std::vector< SiHit > &  matchingHits 
) const
private

Definition at line 503 of file PixelPrepDataToxAOD.cxx.

506 {
507 
508  int numHits = matchingHits.size();
509 
510  std::vector<float> sihit_energyDeposit(numHits,0);
511  std::vector<float> sihit_meanTime(numHits,0);
512  std::vector<int> sihit_barcode(numHits,0);
513  std::vector<int> sihit_pdgid(numHits,0);
514 
515  std::vector<float> sihit_startPosX(numHits,0);
516  std::vector<float> sihit_startPosY(numHits,0);
517  std::vector<float> sihit_startPosZ(numHits,0);
518 
519  std::vector<float> sihit_endPosX(numHits,0);
520  std::vector<float> sihit_endPosY(numHits,0);
521  std::vector<float> sihit_endPosZ(numHits,0);
522 
523  int hitNumber(0);
524  const InDetDD::SiDetectorElement* de = prd->detectorElement();
525  if(de){
526  for ( const auto& sihit : matchingHits ) {
527  sihit_energyDeposit[hitNumber] = sihit.energyLoss() ;
528  sihit_meanTime[hitNumber] = sihit.meanTime() ;
529  const HepMcParticleLink& HMPL = sihit.particleLink();
530  sihit_barcode[hitNumber] = HepMC::barcode(HMPL) ;
531  if(HMPL.isValid()){
532  sihit_pdgid[hitNumber] = HMPL->pdg_id();
533  }
534 
535  // Convert Simulation frame into reco frame
536  const HepGeom::Point3D<double>& startPos=sihit.localStartPosition();
537 
538  Amg::Vector2D pos= de->hitLocalToLocal( startPos.z(), startPos.y() );
539  sihit_startPosX[hitNumber] = pos[0];
540  sihit_startPosY[hitNumber] = pos[1];
541  sihit_startPosZ[hitNumber] = startPos.x();
542 
543 
544  const HepGeom::Point3D<double>& endPos=sihit.localEndPosition();
545  pos= de->hitLocalToLocal( endPos.z(), endPos.y() );
546  sihit_endPosX[hitNumber] = pos[0];
547  sihit_endPosY[hitNumber] = pos[1];
548  sihit_endPosZ[hitNumber] = endPos.x();
549  ++hitNumber;
550  }
551  }
552 
553  AUXDATA(xprd,std::vector<float>,sihit_energyDeposit) = sihit_energyDeposit;
554  AUXDATA(xprd,std::vector<float>,sihit_meanTime) = sihit_meanTime;
555  AUXDATA(xprd,std::vector<int>,sihit_barcode) = sihit_barcode;
556  AUXDATA(xprd,std::vector<int>,sihit_pdgid) = sihit_pdgid;
557 
558  AUXDATA(xprd,std::vector<float>,sihit_startPosX) = sihit_startPosX;
559  AUXDATA(xprd,std::vector<float>,sihit_startPosY) = sihit_startPosY;
560  AUXDATA(xprd,std::vector<float>,sihit_startPosZ) = sihit_startPosZ;
561 
562  AUXDATA(xprd,std::vector<float>,sihit_endPosX) = sihit_endPosX;
563  AUXDATA(xprd,std::vector<float>,sihit_endPosY) = sihit_endPosY;
564  AUXDATA(xprd,std::vector<float>,sihit_endPosZ) = sihit_endPosZ;
565 
566 
567 }

◆ declareGaudiProperty() [1/4]

Gaudi::Details::PropertyBase& AthCommonDataStore< AthCommonMsg< Algorithm > >::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< Algorithm > >::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< Algorithm > >::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< Algorithm > >::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< Algorithm > >::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< Algorithm > >::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< Algorithm > >::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< Algorithm > >::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< Algorithm > >::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< Algorithm > >::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< Algorithm > >::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; }

◆ evtStore() [1/2]

ServiceHandle<StoreGateSvc>& AthCommonDataStore< AthCommonMsg< Algorithm > >::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< Algorithm > >::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; }

◆ execute()

StatusCode PixelPrepDataToxAOD::execute ( )
virtual

Definition at line 130 of file PixelPrepDataToxAOD.cxx.

131 {
132  const EventContext& ctx = Gaudi::Hive::currentContext();
133  //Mandatory. Require if the algorithm is scheduled.
135 
136  if ( !PixelClusterContainer.isValid() )
137  {
138  ATH_MSG_ERROR("Failed to retrieve PixelClusterContainer with key" << PixelClusterContainer.key() );
139  return StatusCode::FAILURE;
140  }
141 
142  const PRD_MultiTruthCollection* prdmtColl(nullptr);
143  const xAODTruthParticleLinkVector *truth_particle_links{nullptr};
144  if (m_useTruthInfo) {
146  if (prdmtCollHandle.isValid()) {
147  prdmtColl = &*prdmtCollHandle;
148  }
149  if (!m_truthParticleLinks.empty()) {
151  if (truthParticleLinksHandle.isValid()) {
152  truth_particle_links = truthParticleLinksHandle.cptr();
153  }
154  }
155  }
156 
157  const InDetSimDataCollection* sdoCollection(nullptr);
158  if (m_writeSDOs) {
160  if (sdoCollectionHandle.isValid()) {
161  sdoCollection = &*sdoCollectionHandle;
162  } else if (m_firstEventWarnings) {
163  ATH_MSG_WARNING("SDO information requested, but SDO collection not available!");
164  }
165  }
166 
168  if (!m_clusterSplitProbContainer.key().empty()) {
170  if (!splitProbContainer.isValid()) {
171  ATH_MSG_FATAL("Failed to get cluster splitting probability container " << m_clusterSplitProbContainer);
172  }
173  }
174 
175  std::vector<std::vector<const SiHit*>> siHits(m_PixelHelper->wafer_hash_max());
176  if (m_need_sihits) {
177  SG::ReadHandle<SiHitCollection> siHitCollectionHandle(m_sihitContainer_key, ctx);
178  if (siHitCollectionHandle.isValid()) {
179  for (const SiHit& siHit: *siHitCollectionHandle) {
180  // Check if it is a Pixel hit
181  if (!siHit.isPixel()) continue;
182 
183  Identifier wafer_id(m_PixelHelper->wafer_id(siHit.getBarrelEndcap(),
184  siHit.getLayerDisk(),
185  siHit.getPhiModule(),
186  siHit.getEtaModule()));
187  IdentifierHash wafer_hash(m_PixelHelper->wafer_hash(wafer_id));
188  if (wafer_hash>=m_PixelHelper->wafer_hash_max()) continue;
189  siHits[wafer_hash].push_back(&siHit);
190  }
191  } else if (m_firstEventWarnings) {
192  ATH_MSG_WARNING("SiHit information requested, but SiHit collection not available!");
193  }
194  }
195 
196  const PixelChargeCalibCondData *calibData=nullptr;
197  if (m_writeRDOinformation) {
199  if (!calibData_handle.isValid()) {
200  ATH_MSG_FATAL("Failed to get PixelChargeCalibCondData with key " << m_chargeDataKey);
201  }
202  calibData=calibData_handle.cptr();
203  }
204 
205  // Create the xAOD container and its auxiliary store:
207  ATH_CHECK(xaod.record(std::make_unique<xAOD::TrackMeasurementValidationContainer>(),
208  std::make_unique<xAOD::TrackMeasurementValidationAuxContainer>()));
209 
211  ATH_CHECK(offsets.record(std::make_unique<std::vector<unsigned int>>(m_PixelHelper->wafer_hash_max(), 0)));
212 
213  unsigned int have_truth_link=0u;
214  unsigned int missing_truth_particle=0u;
215  unsigned int missing_parent_particle=0u;
216  // Loop over the container
217  unsigned int counter(0);
218 
222 
223  std::unordered_map< unsigned int , std::vector<unsigned int> > cluster_map;
224  for( const auto clusterCollection : * PixelClusterContainer ){
225 
226  //Fill Offset container
227  (*offsets)[clusterCollection->identifyHash()] = counter;
228 
229  // skip empty collections
230  if( clusterCollection->empty() ) continue;
231 
232  // loop over collection and convert to xAOD
233  for( const InDet::PixelCluster* prd : *clusterCollection ){
234  ++counter;
235 
236  Identifier clusterId = prd->identify();
237  if ( !clusterId.is_valid() ) {
238  ATH_MSG_WARNING("Pixel cluster identifier is not valid");
239  }
240 
241  // create and add xAOD object
243  unsigned int cluster_idx = xaod->size();
244  xaod->push_back(xprd);
245 
246  //Set Identifier
247  xprd->setIdentifier( clusterId.get_compact() );
248 
249  //Set Global Position
250  Amg::Vector3D gpos = prd->globalPosition();
251  xprd->setGlobalPosition(gpos.x(),gpos.y(),gpos.z());
252 
253  //Set Local Position
254  const Amg::Vector2D& locpos = prd->localPosition();
255 
256  // Set local error matrix
257  xprd->setLocalPosition( locpos.x(), locpos.y() );
258 
259  const Amg::MatrixX& localCov = prd->localCovariance();
260  //std::cout << localCov << std::endl;
261  if(localCov.size() == 1){
262  //std::cout << "Size == 1" << std::endl;
263  xprd->setLocalPositionError( localCov(0,0), 0., 0. );
264  } else if(localCov.size() == 4){
265  //std::cout << "Size == 2" << std::endl;
266  xprd->setLocalPositionError( localCov(0,0), localCov(1,1), localCov(0,1) );
267  } else {
268  //std::cout << "Size == "<< localCov.size() << std::endl;
269  xprd->setLocalPositionError(0.,0.,0.);
270  }
271 
272  // Set vector of hit identifiers
273  std::vector< uint64_t > rdoIdentifierList;
274  rdoIdentifierList.reserve(prd->rdoList().size());
275  int rowmin=9999; int rowmax=-9999;
276  int colmin=9999; int colmax=-9999;
277  for( const auto &hitIdentifier : prd->rdoList() ){
278  rdoIdentifierList.push_back( hitIdentifier.get_compact() );
279  //May want to addinformation about the individual hits here
280  int row = m_PixelHelper->phi_index(hitIdentifier);
281  int col = m_PixelHelper->eta_index(hitIdentifier);
282  if(rowmin > row) rowmin = row;
283  if(rowmax < row) rowmax = row;
284  if(colmin > col) colmin = col;
285  if(colmax < col) colmax = col;
286  }
287  xprd->setRdoIdentifierList(rdoIdentifierList);
288 
289  //Add pixel cluster properties
290  AUXDATA(xprd,int,bec) = m_PixelHelper->barrel_ec(clusterId) ;
291  char the_layer = m_PixelHelper->layer_disk(clusterId) ;
292  char the_eta = m_PixelHelper->eta_module(clusterId) ;
293  short the_phi = m_PixelHelper->phi_module(clusterId) ;
294  AUXDATA(xprd,int,layer) = the_layer ;
295  AUXDATA(xprd,int,phi_module) = the_phi ;
296  AUXDATA(xprd,int,eta_module) = the_eta ;
297  AUXDATA(xprd,int,eta_pixel_index) = m_PixelHelper->eta_index(clusterId);
298  AUXDATA(xprd,int,phi_pixel_index) = m_PixelHelper->phi_index(clusterId);
299 
300  cluster_map[ makeKey(the_phi, the_eta, the_layer)].push_back(cluster_idx);
301 
302  const InDet::SiWidth cw = prd->width();
303  AUXDATA(xprd,int,sizePhi) = (int)cw.colRow()[0];
304  AUXDATA(xprd,int,sizeZ) = (int)cw.colRow()[1];
305  AUXDATA(xprd,int,nRDO) = (int)prd->rdoList().size();
306 
307  AUXDATA(xprd,float,charge) = prd->totalCharge();
308  AUXDATA(xprd,int,ToT) = prd->totalToT();
309  AUXDATA(xprd,int,LVL1A) = prd->LVL1A();
310 
311  AUXDATA(xprd,char,isFake) = (char)prd->isFake();
312  AUXDATA(xprd,char,gangedPixel) = (char)prd->gangedPixel();
314  splitProb = splitProbContainer.isValid() ? splitProbContainer->splitProbability(prd) : Trk::ClusterSplitProbabilityContainer::getNoSplitProbability();
315  AUXDATA(xprd,char,isSplit) = static_cast<char>(splitProb.isSplit());
316  AUXDATA(xprd,float,splitProbability1) = splitProb.splitProbability1();
317  AUXDATA(xprd,float,splitProbability2) = splitProb.splitProbability2();
318 
319  // Need to add something to Add the NN splitting information
320  if(m_writeNNinformation) addNNInformation( xprd, prd, 7, 7);
321 
322  // Add information for each contributing hit
324  IdentifierHash moduleHash = clusterCollection->identifyHash();
325  AUXDATA(xprd,int,hasBSError) = (int)m_pixelSummary->hasBSError(moduleHash, ctx);
326  AUXDATA(xprd,int,DCSState) = dcsState->getModuleStatus(moduleHash);
327 
328  float deplVoltage = 0.0;
329  AUXDATA(xprd,float,BiasVoltage) = dcsHV->getBiasVoltage(moduleHash);
330  AUXDATA(xprd,float,Temperature) = dcsTemp->getTemperature(moduleHash);
331  AUXDATA(xprd,float,DepletionVoltage) = deplVoltage;
332 
333  AUXDATA(xprd,float,LorentzShift) = (float)m_lorentzAngleTool->getLorentzShift(moduleHash);
334 
335  assert (calibData);
336  addRdoInformation(xprd, prd, calibData);
337  }
338 
339 
340  // Add the Detector element ID -- not sure if needed as we have the informations above
341  const InDetDD::SiDetectorElement* de = prd->detectorElement();
342  uint64_t detElementId(0);
343  if(de){
344  Identifier detId = de->identify();
345  if ( detId.is_valid() ) {
346  detElementId = detId.get_compact();
347  }
348  }
349  AUXDATA(xprd,uint64_t,detectorElementID) = detElementId;
350 
352  AUXDATA(xprd,int,waferID) = m_PixelHelper->wafer_hash(de->identify());
353 
354  const InDetDD::PixelModuleDesign* design = dynamic_cast<const InDetDD::PixelModuleDesign*>(&de->design());
355  InDetDD::SiLocalPosition pos1 = design->positionFromColumnRow(colmin,rowmin);
356  InDetDD::SiLocalPosition pos2 = design->positionFromColumnRow(colmax,rowmin);
357  InDetDD::SiLocalPosition pos3 = design->positionFromColumnRow(colmin,rowmax);
358  InDetDD::SiLocalPosition pos4 = design->positionFromColumnRow(colmax,rowmax);
359  InDetDD::SiLocalPosition centroid = 0.25*(pos1+pos2+pos3+pos4);
360 
361  AUXDATA(xprd,float,centroid_xphi) = centroid.xPhi();
362  AUXDATA(xprd,float,centroid_xeta) = centroid.xEta();
363 
364  AUXDATA(xprd,float,omegax) = prd->omegax();
365  AUXDATA(xprd,float,omegay) = prd->omegay();
366  }
367 
368  // Use the MultiTruth Collection to get a list of all true particle contributing to the cluster
369  if (prdmtColl) {
370  auto range{prdmtColl->equal_range(clusterId)};
371  if (truth_particle_links) {
372  std::vector<unsigned int> tp_indices;
373  for (auto& i{range.first}; i!=range.second; ++i) {
374  ElementLink<xAOD::TruthParticleContainer> a_truth_particle_link = truth_particle_links->find(i->second);
375  if (a_truth_particle_link) {
376  const xAOD::TruthParticle *truth_particle = *a_truth_particle_link;
377  if (truth_particle) {
378  ++have_truth_link;
379  tp_indices.push_back(static_cast<int>(truth_particle->index()));
380  }
381  else {
382  ++missing_parent_particle;
383  }
384  }
385  else {
386  tp_indices.push_back(std::numeric_limits<unsigned int>::max());
387  ++missing_truth_particle;
388  }
389  }
390  // @TODO provide possibility to move tp_indices to its final destination
391  AUXDATA(xprd,std::vector<unsigned int>, truth_index) = tp_indices;
392  }
393  std::vector<int> barcodes; // FIXME barcode-based - requires xAOD::TrackMeasurementValidation to be migrated away from barcodes
394  for (auto i = range.first; i != range.second; ++i) {
395  barcodes.push_back( HepMC::barcode(i->second) );
396  }
397  // @TODO move vector
398  AUXDATA(xprd,std::vector<int>, truth_barcode) = barcodes;
399  }
400 
401  std::vector< std::vector< int > > sdo_tracks;
402  // Use the SDO Collection to get a list of all true particle contributing to the cluster per readout element
403  // Also get the energy deposited by each true particle per readout element
404  if (sdoCollection) {
405  sdo_tracks = addSDOInformation(xprd, prd, *sdoCollection);
406  }
407 
408  // Now Get the most detailed truth from the SiHits
409  // Note that this could get really slow if there are a lot of hits and clusters
410  if (m_need_sihits) {
411  const std::vector<SiHit> matched_hits = findAllHitsCompatibleWithCluster(prd, &siHits[prd->detectorElement()->identifyHash()], sdo_tracks);
412  if (m_writeSiHits) {
413  addSiHitInformation(xprd, prd, matched_hits);
414  }
415 
416  if (m_writeNNinformation) {
417  addNNTruthInfo(xprd, prd, matched_hits);
418  }
419  }
420  }
421  }
422 
423  for ( auto clusItr = xaod->begin(); clusItr != xaod->end(); ++clusItr ) {
424  AUXDATA(*clusItr,char,broken) = false;
425  }
426  m_haveTruthLink += have_truth_link;
427  m_missingTruthParticle += missing_truth_particle;
428  m_missingParentParticle += missing_parent_particle;
429 
430  static const SG::AuxElement::Accessor<int> acc_layer ("layer");
431  static const SG::AuxElement::Accessor<int> acc_phi_module ("phi_module");
432  static const SG::AuxElement::Accessor<int> acc_eta_module ("eta_module");
433  static const SG::AuxElement::Accessor<std::vector<int> > acc_sihit_barcode ("sihit_barcode");
434  for ( auto clusItr = xaod->begin(); clusItr != xaod->end(); ++clusItr)
435  {
436  auto pixelCluster = *clusItr;
437  int layer = acc_layer(*pixelCluster);
438  std::vector<int> barcodes = acc_sihit_barcode(*pixelCluster);
439 
440  const std::vector< unsigned int> &cluster_idx_list = cluster_map.at( makeKey(acc_phi_module(*pixelCluster), acc_eta_module(*pixelCluster), acc_layer(*pixelCluster) ));
441  for (unsigned int cluster_idx : cluster_idx_list) {
442  auto pixelCluster2 = xaod->at(cluster_idx);
443  if ( acc_layer(*pixelCluster2) != layer )
444  continue;
445  if ( acc_eta_module(*pixelCluster) != acc_eta_module(*pixelCluster2) )
446  continue;
447  if ( acc_phi_module(*pixelCluster) != acc_phi_module(*pixelCluster2) )
448  continue;
449 
450  std::vector<int> barcodes2 = acc_sihit_barcode(*pixelCluster2);
451 
452  for ( auto bc : barcodes ) {
453  if (std::find(barcodes2.begin(), barcodes2.end(), bc ) == barcodes2.end()) continue;
454  static const SG::AuxElement::Accessor<char> acc_broken ("broken");
455  acc_broken(*pixelCluster) = true;
456  acc_broken(*pixelCluster2) = true;
457  break;
458  }
459  }
460  }
461 
462  ATH_MSG_DEBUG( " recorded PixelPrepData objects: size " << xaod->size() );
463 
464  m_firstEventWarnings = false;
465 
466  return StatusCode::SUCCESS;
467 }

◆ extraDeps_update_handler()

void AthCommonDataStore< AthCommonMsg< Algorithm > >::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

◆ extraOutputDeps()

const DataObjIDColl & AthAlgorithm::extraOutputDeps ( ) const
overridevirtualinherited

Return the list of extra output dependencies.

This list is extended to include symlinks implied by inheritance relations.

Definition at line 50 of file AthAlgorithm.cxx.

51 {
52  // If we didn't find any symlinks to add, just return the collection
53  // from the base class. Otherwise, return the extended collection.
54  if (!m_extendedExtraObjects.empty()) {
56  }
57  return Algorithm::extraOutputDeps();
58 }

◆ finalize()

StatusCode PixelPrepDataToxAOD::finalize ( )
virtual

Definition at line 1279 of file PixelPrepDataToxAOD.cxx.

1280 {
1282  ATH_MSG_INFO("Missing truth particles " << m_missingTruthParticle << " missing parent: " << m_missingParentParticle
1283  << " have " << m_haveTruthLink);
1284  }
1285  return StatusCode::SUCCESS;
1286 }

◆ findAllHitsCompatibleWithCluster()

std::vector< SiHit > PixelPrepDataToxAOD::findAllHitsCompatibleWithCluster ( const InDet::PixelCluster prd,
const std::vector< const SiHit * > *  sihits,
std::vector< std::vector< int > > &  trkBCs 
) const
private

Definition at line 574 of file PixelPrepDataToxAOD.cxx.

577 {
578  ATH_MSG_VERBOSE( "Got " << sihits->size() << " SiHits to look through" );
579  std::vector<SiHit> matchingHits;
580 
581  // Check if we have detector element -- needed to find the local position of the SiHits
582  const InDetDD::SiDetectorElement* de = prd->detectorElement();
583  if(!de)
584  return matchingHits;
585 
586  std::vector<const SiHit* > multiMatchingHits;
587 
588  for ( const SiHit* siHit : *sihits) {
589  // Now we have all hits in the module that match lets check to see if they match the cluster
590  // Must be within +/- 1 hits of any hit in the cluster to be included
591 
593  {
594  HepGeom::Point3D<double> averagePosition = siHit->localStartPosition() + siHit->localEndPosition();
595  averagePosition *= 0.5;
596  Amg::Vector2D pos = de->hitLocalToLocal( averagePosition.z(), averagePosition.y() );
598 
599  for( const auto &hitIdentifier : prd->rdoList() ){
600  ATH_MSG_DEBUG("Truth Phi " << diode.phiIndex() << " Cluster Phi " << m_PixelHelper->phi_index( hitIdentifier ) );
601  ATH_MSG_DEBUG("Truth Eta " << diode.etaIndex() << " Cluster Eta " << m_PixelHelper->eta_index( hitIdentifier ) );
602  if( abs( int(diode.etaIndex()) - m_PixelHelper->eta_index( hitIdentifier ) ) <=1
603  && abs( int(diode.phiIndex()) - m_PixelHelper->phi_index( hitIdentifier ) ) <=1 )
604  {
605  multiMatchingHits.push_back(siHit);
606  break;
607  }
608  }
609  }
610  else
611  {
612  auto bc = HepMC::barcode(siHit->particleLink());
613  for ( const auto& barcodeSDOColl : trkBCs ) {
614  if (std::find(barcodeSDOColl.begin(),barcodeSDOColl.end(),bc) == barcodeSDOColl.end() ) continue;
615  multiMatchingHits.push_back(siHit);
616  break;
617  }
618  }
619  }
620  //Now we will now make 1 SiHit for each true particle if the SiHits "touch" other
621  std::vector<const SiHit* >::iterator siHitIter = multiMatchingHits.begin();
622  std::vector<const SiHit* >::iterator siHitIter2 = multiMatchingHits.begin();
623  ATH_MSG_DEBUG( "Found " << multiMatchingHits.size() << " SiHit " );
624  for ( ; siHitIter != multiMatchingHits.end(); ++siHitIter) {
625  const SiHit* lowestXPos = *siHitIter;
626  const SiHit* highestXPos = *siHitIter;
627 
628 
629  // We will merge these hits
630  std::vector<const SiHit* > ajoiningHits;
631  ajoiningHits.push_back( *siHitIter );
632 
633  siHitIter2 = siHitIter+1;
634  auto bc = HepMC::barcode((*siHitIter)->particleLink());
635  while ( siHitIter2 != multiMatchingHits.end() ) {
636  // Need to come from the same truth particle
637 
638  if( bc != HepMC::barcode((*siHitIter2)->particleLink()) ){
639  ++siHitIter2;
640  continue;
641  }
642 
643  // Check to see if the SiHits are compatible with each other.
644  if (std::abs((highestXPos->localEndPosition().x()-(*siHitIter2)->localStartPosition().x()))<0.00005 &&
645  std::abs((highestXPos->localEndPosition().y()-(*siHitIter2)->localStartPosition().y()))<0.00005 &&
646  std::abs((highestXPos->localEndPosition().z()-(*siHitIter2)->localStartPosition().z()))<0.00005 )
647  {
648  highestXPos = *siHitIter2;
649  ajoiningHits.push_back( *siHitIter2 );
650  // Dont use hit more than once
651  // @TODO could invalidate siHitIter
652  siHitIter2 = multiMatchingHits.erase( siHitIter2 );
653  }else if (std::abs((lowestXPos->localStartPosition().x()-(*siHitIter2)->localEndPosition().x()))<0.00005 &&
654  std::abs((lowestXPos->localStartPosition().y()-(*siHitIter2)->localEndPosition().y()))<0.00005 &&
655  std::abs((lowestXPos->localStartPosition().z()-(*siHitIter2)->localEndPosition().z()))<0.00005)
656  {
657  lowestXPos = *siHitIter2;
658  ajoiningHits.push_back( *siHitIter2 );
659  // Dont use hit more than once
660  // @TODO could invalidate siHitIter
661  siHitIter2 = multiMatchingHits.erase( siHitIter2 );
662  } else {
663  ++siHitIter2;
664  }
665  }
666 
667  if( ajoiningHits.size() == 0){
668  ATH_MSG_WARNING("This should really never happen");
669  continue;
670  }else if(ajoiningHits.size() == 1){
671  // Copy Si Hit ready to return
672  matchingHits.push_back( *ajoiningHits[0] );
673  continue;
674  } else {
675  // Build new SiHit and merge information together.
676  ATH_MSG_DEBUG("Merging " << ajoiningHits.size() << " SiHits together." );
677 
678 
679  float energyDep(0);
680  float time(0);
681  for( const auto& siHit : ajoiningHits){
682  energyDep += siHit->energyLoss();
683  time += siHit->meanTime();
684  }
685  time /= (float)ajoiningHits.size();
686 
687  matchingHits.emplace_back(lowestXPos->localStartPosition(),
688  highestXPos->localEndPosition(),
689  energyDep,
690  time,
691  HepMC::barcode((*siHitIter)->particleLink()),
692  0, // 0 for pixel 1 for Pixel
693  (*siHitIter)->getBarrelEndcap(),
694  (*siHitIter)->getLayerDisk(),
695  (*siHitIter)->getEtaModule(),
696  (*siHitIter)->getPhiModule(),
697  (*siHitIter)->getSide() );
698  ATH_MSG_DEBUG("Finished Merging " << ajoiningHits.size() << " SiHits together." );
699 
700  }
701  }
702 
703 
704  return matchingHits;
705 
706 }

◆ getCellIdWeightedPosition()

InDetDD::SiCellId PixelPrepDataToxAOD::getCellIdWeightedPosition ( const InDet::PixelCluster pixelCluster,
int *  rrowMin = 0,
int *  rrowMax = 0,
int *  rcolMin = 0,
int *  rcolMax = 0 
) const
private

Definition at line 1175 of file PixelPrepDataToxAOD.cxx.

1180 {
1181 
1182  const InDetDD::SiDetectorElement* de = pixelCluster->detectorElement();
1183  if (de==nullptr) {
1184  ATH_MSG_ERROR("Could not get detector element");
1185  return {};
1186  }
1187 
1188  const InDetDD::PixelModuleDesign* design(dynamic_cast<const InDetDD::PixelModuleDesign*>(&de->design()));
1189  if (not design) {
1190  ATH_MSG_WARNING("PixelModuleDesign was not retrieved in function 'getCellIdWeightedPosition'");
1191  return {};
1192  }
1193  const std::vector<Identifier>& rdos = pixelCluster->rdoList();
1194 
1195  ATH_MSG_VERBOSE( "Number of RDOs: " << rdos.size() );
1196  const std::vector<float>& chList = pixelCluster->chargeList();
1197 
1198  ATH_MSG_VERBOSE( "Number of charges: " << chList.size() );
1199  std::vector<Identifier>::const_iterator rdosBegin = rdos.begin();
1200  std::vector<Identifier>::const_iterator rdosEnd = rdos.end();
1201 
1202  auto charge = chList.begin();
1203 
1204  InDetDD::SiLocalPosition sumOfWeightedPositions(0,0,0);
1205  double sumOfCharge=0;
1206 
1207  int phiPixelIndexMin = 99999;
1208  int phiPixelIndexMax = -99999;
1209  int etaPixelIndexMin = 99999;
1210  int etaPixelIndexMax = -99999;
1211 
1212  for (; rdosBegin!= rdosEnd; ++rdosBegin, ++charge)
1213  {
1214 
1215  Identifier rId = *rdosBegin;
1216  int phiPixelIndex = m_PixelHelper->phi_index(rId);
1217  int etaPixelIndex = m_PixelHelper->eta_index(rId);
1218 
1219  ATH_MSG_VERBOSE(" Adding pixel phiPixelIndex: " << phiPixelIndex << " etaPixelIndex: " << etaPixelIndex << " charge: " << *charge );
1220 
1221  // SiLocalPosition PixelModuleDesign::positionFromColumnRow(const int column, const int row) const;
1222  //
1223  // Given row and column index of diode, returns position of diode center
1224  // ALTERNATIVE/PREFERED way is to use localPositionOfCell(const SiCellId & cellId) or
1225  // rawLocalPositionOfCell method in SiDetectorElement.
1226  // DEPRECATED (but used in numerous places)
1227  //
1228  // Comment by Hide (referring the original comment in the code): 2015-02-04
1229  // I automatically replaced column to etaPixelIndex and row to phiPixelIndex here. It was bofore:
1230  // InDetDD::SiLocalPosition siLocalPosition( design->positionFromColumnRow(column,row) );
1231  //
1232  // Then I assume the argument of column/row in this function is in offline manner, not the real hardware column/row.
1233  //
1234  InDetDD::SiLocalPosition siLocalPosition( design->positionFromColumnRow(etaPixelIndex,phiPixelIndex) );
1235  ATH_MSG_VERBOSE ( "Local Position: Row = " << siLocalPosition.xRow() << ", Col = " << siLocalPosition.xColumn() );
1236 
1237  sumOfWeightedPositions += (*charge)*siLocalPosition;
1238  sumOfCharge += (*charge);
1239 
1240  if (phiPixelIndex < phiPixelIndexMin)
1241  phiPixelIndexMin = phiPixelIndex;
1242 
1243  if (phiPixelIndex > phiPixelIndexMax)
1244  phiPixelIndexMax = phiPixelIndex;
1245 
1246  if (etaPixelIndex < etaPixelIndexMin)
1247  etaPixelIndexMin = etaPixelIndex;
1248 
1249  if (etaPixelIndex > etaPixelIndexMax)
1250  etaPixelIndexMax = etaPixelIndex;
1251 
1252  }
1253  sumOfWeightedPositions /= sumOfCharge;
1254 
1255  ATH_MSG_VERBOSE ( "Wighted position: Row = " << sumOfWeightedPositions.xRow() << ", Col = " << sumOfWeightedPositions.xColumn() );
1256 
1257  if(rphiPixelIndexMin) *rphiPixelIndexMin = phiPixelIndexMin;
1258  if(rphiPixelIndexMax) *rphiPixelIndexMax = phiPixelIndexMax;
1259  if(retaPixelIndexMin) *retaPixelIndexMin = etaPixelIndexMin;
1260  if(retaPixelIndexMax) *retaPixelIndexMax = etaPixelIndexMax;
1261 
1262  //what you want to know is simple:
1263  //just the phiPixelIndex and etaPixelIndex of this average position!
1264 
1265  InDetDD::SiCellId cellIdWeightedPosition=design->cellIdOfPosition(sumOfWeightedPositions);
1266 
1267 
1268  return cellIdWeightedPosition;
1269 
1270 }

◆ initialize()

StatusCode PixelPrepDataToxAOD::initialize ( )
virtual

Definition at line 87 of file PixelPrepDataToxAOD.cxx.

◆ inputHandles()

virtual std::vector<Gaudi::DataHandle*> AthCommonDataStore< AthCommonMsg< Algorithm > >::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.

◆ msg() [1/2]

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

Definition at line 24 of file AthCommonMsg.h.

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

◆ msg() [2/2]

MsgStream& AthCommonMsg< Algorithm >::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< Algorithm >::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< Algorithm > >::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< Algorithm > >::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< Algorithm > >::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()

StatusCode AthAlgorithm::sysInitialize ( )
overridevirtualinherited

Override sysInitialize.

Override sysInitialize from the base class.

Loop through all output handles, and if they're WriteCondHandles, automatically register them and this Algorithm with the CondSvc

Scan through all outputHandles, and if they're WriteCondHandles, register them with the CondSvc

Reimplemented from AthCommonDataStore< AthCommonMsg< Algorithm > >.

Reimplemented in AthAnalysisAlgorithm, AthFilterAlgorithm, PyAthena::Alg, and AthHistogramAlgorithm.

Definition at line 66 of file AthAlgorithm.cxx.

66  {
68 
69  if (sc.isFailure()) {
70  return sc;
71  }
72  ServiceHandle<ICondSvc> cs("CondSvc",name());
73  for (auto h : outputHandles()) {
74  if (h->isCondition() && h->mode() == Gaudi::DataHandle::Writer) {
75  // do this inside the loop so we don't create the CondSvc until needed
76  if ( cs.retrieve().isFailure() ) {
77  ATH_MSG_WARNING("no CondSvc found: won't autoreg WriteCondHandles");
78  return StatusCode::SUCCESS;
79  }
80  if (cs->regHandle(this,*h).isFailure()) {
81  sc = StatusCode::FAILURE;
82  ATH_MSG_ERROR("unable to register WriteCondHandle " << h->fullKey()
83  << " with CondSvc");
84  }
85  }
86  }
87  return sc;
88 }

◆ sysStart()

virtual StatusCode AthCommonDataStore< AthCommonMsg< Algorithm > >::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< Algorithm > >::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_chargeDataKey

SG::ReadCondHandleKey<PixelChargeCalibCondData> PixelPrepDataToxAOD::m_chargeDataKey {this, "PixelChargeCalibCondData", "PixelChargeCalibCondData", "Pixel charge calibration data"}
private

Definition at line 125 of file PixelPrepDataToxAOD.h.

◆ m_clustercontainer_key

SG::ReadHandleKey<InDet::PixelClusterContainer> PixelPrepDataToxAOD::m_clustercontainer_key
private

Definition at line 156 of file PixelPrepDataToxAOD.h.

◆ m_clusterSplitProbContainer

SG::ReadHandleKey<Trk::ClusterSplitProbabilityContainer> PixelPrepDataToxAOD::m_clusterSplitProbContainer {this, "ClusterSplitProbabilityName", "",""}
private

Definition at line 146 of file PixelPrepDataToxAOD.h.

◆ m_condDCSStateKey

SG::ReadCondHandleKey<PixelDCSStateData> PixelPrepDataToxAOD::m_condDCSStateKey {this, "PixelDCSStateCondData", "PixelDCSStateCondData", "Pixel FSM state key"}
private

Definition at line 128 of file PixelPrepDataToxAOD.h.

◆ m_condDCSStatusKey

SG::ReadCondHandleKey<PixelDCSStatusData> PixelPrepDataToxAOD::m_condDCSStatusKey {this, "PixelDCSStatusCondData", "PixelDCSStatusCondData", "Pixel FSM status key"}
private

Definition at line 131 of file PixelPrepDataToxAOD.h.

◆ m_detStore

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

Pointer to StoreGate (detector store by default)

Definition at line 393 of file AthCommonDataStore.h.

◆ m_evtStore

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

Pointer to StoreGate (event store by default)

Definition at line 390 of file AthCommonDataStore.h.

◆ m_extendedExtraObjects

DataObjIDColl AthAlgorithm::m_extendedExtraObjects
privateinherited

Definition at line 79 of file AthAlgorithm.h.

◆ m_firstEventWarnings

bool PixelPrepDataToxAOD::m_firstEventWarnings
private

Definition at line 153 of file PixelPrepDataToxAOD.h.

◆ m_haveTruthLink

std::atomic<unsigned int> PixelPrepDataToxAOD::m_haveTruthLink {}
mutableprivate

Definition at line 150 of file PixelPrepDataToxAOD.h.

◆ m_lorentzAngleTool

ToolHandle<ISiLorentzAngleTool> PixelPrepDataToxAOD::m_lorentzAngleTool {this, "LorentzAngleTool", "SiLorentzAngleTool", "Tool to retreive Lorentz angle"}
private

Definition at line 143 of file PixelPrepDataToxAOD.h.

◆ m_missingParentParticle

std::atomic<unsigned int> PixelPrepDataToxAOD::m_missingParentParticle {}
mutableprivate

Definition at line 152 of file PixelPrepDataToxAOD.h.

◆ m_missingTruthParticle

std::atomic<unsigned int> PixelPrepDataToxAOD::m_missingTruthParticle {}
mutableprivate

Definition at line 151 of file PixelPrepDataToxAOD.h.

◆ m_multiTruth_key

SG::ReadHandleKey<PRD_MultiTruthCollection> PixelPrepDataToxAOD::m_multiTruth_key
private

Definition at line 159 of file PixelPrepDataToxAOD.h.

◆ m_need_sihits

bool PixelPrepDataToxAOD::m_need_sihits
private

Definition at line 154 of file PixelPrepDataToxAOD.h.

◆ m_PixelHelper

const PixelID* PixelPrepDataToxAOD::m_PixelHelper
private

Definition at line 112 of file PixelPrepDataToxAOD.h.

◆ m_pixelReadout

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

Definition at line 122 of file PixelPrepDataToxAOD.h.

◆ m_pixelSummary

ToolHandle<IInDetConditionsTool> PixelPrepDataToxAOD::m_pixelSummary {this, "PixelConditionsSummaryTool", "PixelConditionsSummaryTool", "Tool for PixelConditionsSummaryTool"}
private

Definition at line 140 of file PixelPrepDataToxAOD.h.

◆ m_readKeyHV

SG::ReadCondHandleKey<PixelDCSHVData> PixelPrepDataToxAOD::m_readKeyHV {this, "ReadKeyHV", "PixelDCSHVCondData", "Key of input bias voltage conditions folder"}
private

Definition at line 137 of file PixelPrepDataToxAOD.h.

◆ m_readKeyTemp

SG::ReadCondHandleKey<PixelDCSTempData> PixelPrepDataToxAOD::m_readKeyTemp {this, "ReadKeyTemp", "PixelDCSTempCondData", "Key of input sensor temperature conditions folder"}
private

Definition at line 134 of file PixelPrepDataToxAOD.h.

◆ m_SDOcontainer_key

SG::ReadHandleKey<InDetSimDataCollection> PixelPrepDataToxAOD::m_SDOcontainer_key
private

Definition at line 158 of file PixelPrepDataToxAOD.h.

◆ m_sihitContainer_key

SG::ReadHandleKey<SiHitCollection> PixelPrepDataToxAOD::m_sihitContainer_key
private

Definition at line 157 of file PixelPrepDataToxAOD.h.

◆ m_truthParticleLinks

SG::ReadHandleKey<xAODTruthParticleLinkVector> PixelPrepDataToxAOD::m_truthParticleLinks {this,"InputTruthParticleLinks","","The key for the truth particle link collection."}
private

Definition at line 160 of file PixelPrepDataToxAOD.h.

◆ m_useSiHitsGeometryMatching

bool PixelPrepDataToxAOD::m_useSiHitsGeometryMatching
private

Definition at line 120 of file PixelPrepDataToxAOD.h.

◆ m_useTruthInfo

bool PixelPrepDataToxAOD::m_useTruthInfo
private

Definition at line 114 of file PixelPrepDataToxAOD.h.

◆ m_varHandleArraysDeclared

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

Definition at line 399 of file AthCommonDataStore.h.

◆ m_vhka

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

Definition at line 398 of file AthCommonDataStore.h.

◆ m_write_offsets

SG::WriteHandleKey<std::vector<unsigned int> > PixelPrepDataToxAOD::m_write_offsets
private

Definition at line 164 of file PixelPrepDataToxAOD.h.

◆ m_write_xaod_key

SG::WriteHandleKey<xAOD::TrackMeasurementValidationContainer> PixelPrepDataToxAOD::m_write_xaod_key
private

Definition at line 163 of file PixelPrepDataToxAOD.h.

◆ m_writeExtendedPRDinformation

bool PixelPrepDataToxAOD::m_writeExtendedPRDinformation
private

Definition at line 119 of file PixelPrepDataToxAOD.h.

◆ m_writeNNinformation

bool PixelPrepDataToxAOD::m_writeNNinformation
private

Definition at line 117 of file PixelPrepDataToxAOD.h.

◆ m_writeRDOinformation

bool PixelPrepDataToxAOD::m_writeRDOinformation
private

Definition at line 118 of file PixelPrepDataToxAOD.h.

◆ m_writeSDOs

bool PixelPrepDataToxAOD::m_writeSDOs
private

Definition at line 115 of file PixelPrepDataToxAOD.h.

◆ m_writeSiHits

bool PixelPrepDataToxAOD::m_writeSiHits
private

Definition at line 116 of file PixelPrepDataToxAOD.h.


The documentation for this class was generated from the following files:
python.PyKernel.retrieve
def retrieve(aClass, aKey=None)
Definition: PyKernel.py:110
xAOD::iterator
JetConstituentVector::iterator iterator
Definition: JetConstituentVector.cxx:68
AUXDATA
#define AUXDATA(OBJ, TYP, NAME)
Definition: PixelPrepDataToxAOD.cxx:37
PixelChargeCalibCondData::getLegacyFitParameters
PixelChargeCalib::LegacyFitParameters getLegacyFitParameters(InDetDD::PixelDiodeType type, unsigned int moduleHash, unsigned int FE) const
Definition: PixelChargeCalibCondData.cxx:120
query_example.row
row
Definition: query_example.py:24
ATH_MSG_FATAL
#define ATH_MSG_FATAL(x)
Definition: AthMsgStreamMacros.h:34
Trk::ParticleSwitcher::particle
constexpr ParticleHypothesis particle[PARTICLEHYPOTHESES]
the array of masses
Definition: ParticleHypothesis.h:76
PixelID::phi_index
int phi_index(const Identifier &id) const
Definition: PixelID.h:658
InDetDD::SolidStateDetectorElementBase::cellIdOfPosition
SiCellId cellIdOfPosition(const Amg::Vector2D &localPos) const
As in previous method but returns SiCellId.
Definition: SolidStateDetectorElementBase.cxx:224
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
python.PerfMonSerializer.p
def p
Definition: PerfMonSerializer.py:743
SiHit::localEndPosition
HepGeom::Point3D< double > localEndPosition() const
Definition: SiHit.cxx:153
max
#define max(a, b)
Definition: cfImp.cxx:41
phi
Scalar phi() const
phi method
Definition: AmgMatrixBasePlugin.h:64
PixelPrepDataToxAOD::m_SDOcontainer_key
SG::ReadHandleKey< InDetSimDataCollection > m_SDOcontainer_key
Definition: PixelPrepDataToxAOD.h:158
SG::ReadCondHandle
Definition: ReadCondHandle.h:44
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition: AthMsgStreamMacros.h:31
find
std::string find(const std::string &s)
return a remapped string
Definition: hcg.cxx:135
InDetDD::PixelModuleDesign
Definition: PixelModuleDesign.h:48
Trk::ClusterSplitProbabilityContainer::ProbabilityInfo::isSplit
bool isSplit() const
Definition: ClusterSplitProbabilityContainer.h:27
CaloCellPos2Ntuple.int
int
Definition: CaloCellPos2Ntuple.py:24
PixelPrepDataToxAOD::addSiHitInformation
void addSiHitInformation(xAOD::TrackMeasurementValidation *xprd, const InDet::PixelCluster *prd, const std::vector< SiHit > &matchingHits) const
Definition: PixelPrepDataToxAOD.cxx:503
SG::Accessor
Helper class to provide type-safe access to aux data.
Definition: Control/AthContainers/AthContainers/Accessor.h:66
PixelPrepDataToxAOD::m_firstEventWarnings
bool m_firstEventWarnings
Definition: PixelPrepDataToxAOD.h:153
InDetSecVtxTruthMatchUtils::isFake
bool isFake(int matchInfo)
Definition: InDetSecVtxTruthMatchTool.h:60
ParticleGun_SamplingFraction.bec
int bec
Definition: ParticleGun_SamplingFraction.py:89
PixelPrepDataToxAOD::addSDOInformation
std::vector< std::vector< int > > addSDOInformation(xAOD::TrackMeasurementValidation *xprd, const InDet::PixelCluster *prd, const InDetSimDataCollection &sdoCollection) const
Definition: PixelPrepDataToxAOD.cxx:470
make_unique
std::unique_ptr< T > make_unique(Args &&... args)
Definition: SkimmingToolEXOT5.cxx:23
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
SG::ReadHandle
Definition: StoreGate/StoreGate/ReadHandle.h:70
PixelPrepDataToxAOD::m_clustercontainer_key
SG::ReadHandleKey< InDet::PixelClusterContainer > m_clustercontainer_key
Definition: PixelPrepDataToxAOD.h:156
AthCommonDataStore< AthCommonMsg< Algorithm > >::declareProperty
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
Definition: AthCommonDataStore.h:145
xAOD::TrackMeasurementValidation
TrackMeasurementValidation_v1 TrackMeasurementValidation
Reference the current persistent version:
Definition: TrackMeasurementValidation.h:13
Trk::ClusterSplitProbabilityContainer::ProbabilityInfo
Definition: ClusterSplitProbabilityContainer.h:22
PRD_MultiTruthCollection
A PRD is mapped onto all contributing particles.
Definition: PRD_MultiTruthCollection.h:24
PixelPrepDataToxAOD::m_missingTruthParticle
std::atomic< unsigned int > m_missingTruthParticle
Definition: PixelPrepDataToxAOD.h:151
theta
Scalar theta() const
theta method
Definition: AmgMatrixBasePlugin.h:71
PixelPrepDataToxAOD::m_writeSDOs
bool m_writeSDOs
Definition: PixelPrepDataToxAOD.h:115
xAOD::char
char
Definition: TrigDecision_v1.cxx:38
InDetDD::SolidStateDetectorElementBase::etaAxis
const Amg::Vector3D & etaAxis() const
Definition: SolidStateDetectorElementBase.cxx:88
PixelPrepDataToxAOD::m_need_sihits
bool m_need_sihits
Definition: PixelPrepDataToxAOD.h:154
PixelPrepDataToxAOD::m_PixelHelper
const PixelID * m_PixelHelper
Definition: PixelPrepDataToxAOD.h:112
InDetDD::SiCellId::isValid
bool isValid() const
Test if its in a valid state.
Definition: SiCellId.h:136
InDetDD::PixelDiodeType
PixelDiodeType
Definition: PixelReadoutDefinitions.h:20
PixelPrepDataToxAOD::m_condDCSStatusKey
SG::ReadCondHandleKey< PixelDCSStatusData > m_condDCSStatusKey
Definition: PixelPrepDataToxAOD.h:132
PixelPrepDataToxAOD::findAllHitsCompatibleWithCluster
std::vector< SiHit > findAllHitsCompatibleWithCluster(const InDet::PixelCluster *prd, const std::vector< const SiHit * > *sihits, std::vector< std::vector< int > > &trkBCs) const
Definition: PixelPrepDataToxAOD.cxx:574
AthCommonDataStore< AthCommonMsg< Algorithm > >::m_evtStore
StoreGateSvc_t m_evtStore
Pointer to StoreGate (event store by default)
Definition: AthCommonDataStore.h:390
AthCommonDataStore< AthCommonMsg< Algorithm > >::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)
InDetSimDataCollection
Definition: InDetSimDataCollection.h:25
PixelPrepDataToxAOD::m_pixelSummary
ToolHandle< IInDetConditionsTool > m_pixelSummary
Definition: PixelPrepDataToxAOD.h:141
InDetDD::SiCellId::phiIndex
int phiIndex() const
Get phi index. Equivalent to strip().
Definition: SiCellId.h:122
xAOD::TrackMeasurementValidation_v1::setRdoIdentifierList
void setRdoIdentifierList(const std::vector< uint64_t > &rdoIdentifierList)
Sets the list of RDO identifiers.
InDetSecVtxTruthMatchUtils::isSplit
bool isSplit(int matchInfo)
Definition: InDetSecVtxTruthMatchTool.h:56
read_hist_ntuple.t
t
Definition: read_hist_ntuple.py:5
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
SG::VarHandleKey::empty
bool empty() const
Test if the key is blank.
Definition: AthToolSupport/AsgDataHandles/Root/VarHandleKey.cxx:150
Identifier::is_valid
bool is_valid() const
Check if id is in a valid state.
PixelPrepDataToxAOD::getCellIdWeightedPosition
InDetDD::SiCellId getCellIdWeightedPosition(const InDet::PixelCluster *pixelCluster, int *rrowMin=0, int *rrowMax=0, int *rcolMin=0, int *rcolMax=0) const
Definition: PixelPrepDataToxAOD.cxx:1175
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
AthenaPoolTestRead.sc
sc
Definition: AthenaPoolTestRead.py:27
AthCommonDataStore< AthCommonMsg< Algorithm > >::detStore
const ServiceHandle< StoreGateSvc > & detStore() const
The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.
Definition: AthCommonDataStore.h:95
SG::VarHandleKeyArray::setOwner
virtual void setOwner(IDataHandleHolder *o)=0
SiHit
Definition: SiHit.h:19
PixelPrepDataToxAOD::m_chargeDataKey
SG::ReadCondHandleKey< PixelChargeCalibCondData > m_chargeDataKey
Definition: PixelPrepDataToxAOD.h:126
InDetDD::SiLocalPosition
Definition: SiLocalPosition.h:31
InDetDD::PixelModuleDesign::positionFromColumnRow
SiLocalPosition positionFromColumnRow(const int column, const int row) const
Given row and column index of a diode, return position of diode center ALTERNATIVE/PREFERED way is to...
Definition: PixelModuleDesign.cxx:219
InDetDD::SiLocalPosition::xPhi
double xPhi() const
position along phi direction:
Definition: SiLocalPosition.h:123
PixelPrepDataToxAOD::m_writeExtendedPRDinformation
bool m_writeExtendedPRDinformation
Definition: PixelPrepDataToxAOD.h:119
xAOD::TrackMeasurementValidation_v1
Class describing a TrackMeasurementValidation.
Definition: TrackMeasurementValidation_v1.h:27
PixelPrepDataToxAOD::m_clusterSplitProbContainer
SG::ReadHandleKey< Trk::ClusterSplitProbabilityContainer > m_clusterSplitProbContainer
Definition: PixelPrepDataToxAOD.h:147
PixelPrepDataToxAOD::addNNTruthInfo
void addNNTruthInfo(xAOD::TrackMeasurementValidation *xprd, const InDet::PixelCluster *prd, const std::vector< SiHit > &matchingHits) const
Definition: PixelPrepDataToxAOD.cxx:985
InDetDD::SiDetectorElement::cellIdFromIdentifier
virtual SiCellId cellIdFromIdentifier(const Identifier &identifier) const override final
SiCellId from Identifier.
Definition: SiDetectorElement.cxx:120
InDetDD::SiCellId::etaIndex
int etaIndex() const
Get eta index.
Definition: SiCellId.h:114
PixelPrepDataToxAOD::addRdoInformation
void addRdoInformation(xAOD::TrackMeasurementValidation *xprd, const InDet::PixelCluster *pixelCluster, const PixelChargeCalibCondData *calibData) const
Definition: PixelPrepDataToxAOD.cxx:708
PixelID::wafer_hash
IdentifierHash wafer_hash(Identifier wafer_id) const
wafer hash from id
Definition: PixelID.h:387
ParticleGun_EoverP_Config.mom
mom
Definition: ParticleGun_EoverP_Config.py:63
AthCommonDataStore
Definition: AthCommonDataStore.h:52
PixelPrepDataToxAOD::m_sihitContainer_key
SG::ReadHandleKey< SiHitCollection > m_sihitContainer_key
Definition: PixelPrepDataToxAOD.h:157
AthAlgorithm::sysInitialize
virtual StatusCode sysInitialize() override
Override sysInitialize.
Definition: AthAlgorithm.cxx:66
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
Trk::distEta
@ distEta
readout for silicon
Definition: ParamDefs.h:57
AthCommonDataStore< AthCommonMsg< Algorithm > >::outputHandles
virtual std::vector< Gaudi::DataHandle * > outputHandles() const override
Return this algorithm's output handles.
xAOD::TrackMeasurementValidation_v1::setLocalPosition
void setLocalPosition(float localX, float localY)
Sets the local position.
python.Dumpers.barcodes
def barcodes(beg, end, sz)
Definition: Dumpers.py:2800
lumiFormat.i
int i
Definition: lumiFormat.py:92
InDetDD::SiLocalPosition::xEta
double xEta() const
position along eta direction:
Definition: SiLocalPosition.h:118
Identifier
Definition: DetectorDescription/Identifier/Identifier/Identifier.h:32
PixelPrepDataToxAOD::m_writeRDOinformation
bool m_writeRDOinformation
Definition: PixelPrepDataToxAOD.h:118
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
PixelPrepDataToxAOD::m_write_xaod_key
SG::WriteHandleKey< xAOD::TrackMeasurementValidationContainer > m_write_xaod_key
Definition: PixelPrepDataToxAOD.h:163
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
angle
double angle(const GeoTrf::Vector2D &a, const GeoTrf::Vector2D &b)
Definition: TRTDetectorFactory_Full.cxx:73
PixelPrepDataToxAOD::m_useTruthInfo
bool m_useTruthInfo
Definition: PixelPrepDataToxAOD.h:114
HepMC::barcode
int barcode(const T *p)
Definition: Barcode.h:16
TRT::Hit::layer
@ layer
Definition: HitInfo.h:79
xAOD::TruthParticle_v1
Class describing a truth particle in the MC record.
Definition: TruthParticle_v1.h:41
PixelChargeCalibCondData
Definition: PixelChargeCalibCondData.h:24
plotBeamSpotVxVal.range
range
Definition: plotBeamSpotVxVal.py:195
PixelID::eta_index
int eta_index(const Identifier &id) const
Definition: PixelID.h:664
PixelPrepDataToxAOD::m_lorentzAngleTool
ToolHandle< ISiLorentzAngleTool > m_lorentzAngleTool
Definition: PixelPrepDataToxAOD.h:144
xAOD::uint64_t
uint64_t
Definition: EventInfo_v1.cxx:123
PixelPrepDataToxAOD::m_condDCSStateKey
SG::ReadCondHandleKey< PixelDCSStateData > m_condDCSStateKey
Definition: PixelPrepDataToxAOD.h:129
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
drawFromPickle.tan
tan
Definition: drawFromPickle.py:36
AthCommonDataStore< AthCommonMsg< Algorithm > >::m_detStore
StoreGateSvc_t m_detStore
Pointer to StoreGate (detector store by default)
Definition: AthCommonDataStore.h:393
SG::VarHandleKey::initialize
StatusCode initialize(bool used=true)
If this object is used as a property, then this should be called during the initialize phase.
Definition: AthToolSupport/AsgDataHandles/Root/VarHandleKey.cxx:103
xAOD::TrackMeasurementValidation_v1::setIdentifier
void setIdentifier(uint64_t identifier)
Sets the identifier.
SG::AuxElement::index
size_t index() const
Return the index of this element within its container.
PixelPrepDataToxAOD::m_truthParticleLinks
SG::ReadHandleKey< xAODTruthParticleLinkVector > m_truthParticleLinks
Definition: PixelPrepDataToxAOD.h:161
InDetDD::SolidStateDetectorElementBase::normal
virtual const Amg::Vector3D & normal() const override final
Get reconstruction local normal axes in global frame.
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
SG::ReadHandle::isValid
virtual bool isValid() override final
Can the handle be successfully dereferenced?
Trk::distPhi
@ distPhi
Definition: ParamDefs.h:56
InDetDD::SolidStateDetectorElementBase::hitLocalToLocal
Amg::Vector2D hitLocalToLocal(double xEta, double xPhi) const
Simulation/Hit local frame to reconstruction local frame.
Definition: SolidStateDetectorElementBase.cxx:95
SG::VarHandleKeyArray::renounce
virtual void renounce()=0
SG::HandleClassifier::type
std::conditional< std::is_base_of< SG::VarHandleKeyArray, T >::value, VarHandleKeyArrayType, type2 >::type type
Definition: HandleClassifier.h:54
PixelID::layer_disk
int layer_disk(const Identifier &id) const
Definition: PixelID.h:626
PixelID::eta_module
int eta_module(const Identifier &id) const
Definition: PixelID.h:651
xAOD::TrackMeasurementValidation_v1::setGlobalPosition
void setGlobalPosition(float globalX, float globalY, float globalZ)
Sets the global position.
Definition: TrackMeasurementValidation_v1.cxx:50
merge_scale_histograms.doc
string doc
Definition: merge_scale_histograms.py:9
PixelPrepDataToxAOD::m_readKeyHV
SG::ReadCondHandleKey< PixelDCSHVData > m_readKeyHV
Definition: PixelPrepDataToxAOD.h:138
xAOD::PixelClusterContainer
PixelClusterContainer_v1 PixelClusterContainer
Define the version of the pixel cluster container.
Definition: Event/xAOD/xAODInDetMeasurement/xAODInDetMeasurement/PixelClusterContainer.h:14
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:195
xAOD::TrackMeasurementValidation_v1::setLocalPositionError
void setLocalPositionError(float localXError, float localYError, float localXYCorrelation)
Sets the local position error.
Definition: TrackMeasurementValidation_v1.cxx:37
charge
double charge(const T &p)
Definition: AtlasPID.h:494
InDetDD::SiDetectorElement
Definition: SiDetectorElement.h:109
SG::CondHandleKey::initialize
StatusCode initialize(bool used=true)
PixelID::wafer_hash_max
size_type wafer_hash_max(void) const
Definition: PixelID.cxx:912
PixelPrepDataToxAOD::m_multiTruth_key
SG::ReadHandleKey< PRD_MultiTruthCollection > m_multiTruth_key
Definition: PixelPrepDataToxAOD.h:159
Amg::Vector3D
Eigen::Matrix< double, 3, 1 > Vector3D
Definition: GeoPrimitives.h:47
xAOD::EgammaHelpers::numberOfSiHits
std::size_t numberOfSiHits(const xAOD::TrackParticle *tp)
return the number of Si hits in the track particle
Definition: ElectronxAODHelpers.cxx:66
query_example.col
col
Definition: query_example.py:7
PixelPrepDataToxAOD::m_writeNNinformation
bool m_writeNNinformation
Definition: PixelPrepDataToxAOD.h:117
python.LumiBlobConversion.pos
pos
Definition: LumiBlobConversion.py:18
PixelPrepDataToxAOD::m_write_offsets
SG::WriteHandleKey< std::vector< unsigned int > > m_write_offsets
Definition: PixelPrepDataToxAOD.h:164
InDetDD::SiCellId
Definition: SiCellId.h:29
InDet::PixelCluster
Definition: InnerDetector/InDetRecEvent/InDetPrepRawData/InDetPrepRawData/PixelCluster.h:49
Trk::pixelCluster
@ pixelCluster
Definition: MeasurementType.h:22
SG::WriteHandle
Definition: StoreGate/StoreGate/WriteHandle.h:76
AthAlgorithm::m_extendedExtraObjects
DataObjIDColl m_extendedExtraObjects
Definition: AthAlgorithm.h:79
Trk::vertex
@ vertex
Definition: MeasurementType.h:21
DiTauMassTools::MaxHistStrategyV2::e
e
Definition: PhysicsAnalysis/TauID/DiTauMassTools/DiTauMassTools/HelperFunctions.h:26
a
TList * a
Definition: liststreamerinfos.cxx:10
h
Identifier::get_compact
value_type get_compact(void) const
Get the compact id.
Base_Fragment.width
width
Definition: Sherpa_i/share/common/Base_Fragment.py:59
CaloSwCorrections.time
def time(flags, cells_name, *args, **kw)
Definition: CaloSwCorrections.py:242
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition: AthMsgStreamMacros.h:32
PixelPrepDataToxAOD::m_useSiHitsGeometryMatching
bool m_useSiHitsGeometryMatching
Definition: PixelPrepDataToxAOD.h:120
InDetDD::SolidStateDetectorElementBase::globalPosition
HepGeom::Point3D< double > globalPosition(const HepGeom::Point3D< double > &localPos) const
transform a reconstruction local position into a global position (inline):
InDetDD::SolidStateDetectorElementBase::phiAxis
const Amg::Vector3D & phiAxis() const
Definition: SolidStateDetectorElementBase.cxx:74
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
xAODTruthParticleLinkVector
Definition: xAODTruthParticleLink.h:26
InDet::SiWidth
Definition: SiWidth.h:25
SG::VarHandleBase::vhKey
SG::VarHandleKey & vhKey()
Return a non-const reference to the HandleKey.
Definition: StoreGate/src/VarHandleBase.cxx:616
InDet::SiWidth::colRow
const Amg::Vector2D & colRow() const
Definition: SiWidth.h:115
physics_parameters.parameters
parameters
Definition: physics_parameters.py:144
declareProperty
#define declareProperty(n, p, h)
Definition: BaseFakeBkgTool.cxx:15
AthAlgorithm::AthAlgorithm
AthAlgorithm()
Default constructor:
python.Bindings.keys
keys
Definition: Control/AthenaPython/python/Bindings.py:790
Trk::ClusterSplitProbabilityContainer::ProbabilityInfo::splitProbability1
float splitProbability1() const
Definition: ClusterSplitProbabilityContainer.h:24
Trk::ClusterSplitProbabilityContainer::splitProbability
const ProbabilityInfo & splitProbability(const PrepRawData *cluster) const
Definition: ClusterSplitProbabilityContainer.h:35
LHEF::Writer
Pythia8::Writer Writer
Definition: Prophecy4fMerger.cxx:12
PixelPrepDataToxAOD::m_readKeyTemp
SG::ReadCondHandleKey< PixelDCSTempData > m_readKeyTemp
Definition: PixelPrepDataToxAOD.h:135
PixelPrepDataToxAOD::addNNInformation
void addNNInformation(xAOD::TrackMeasurementValidation *xprd, const InDet::PixelCluster *pixelCluster, const unsigned int SizeX, const unsigned int SizeY) const
Definition: PixelPrepDataToxAOD.cxx:772
IdentifierHash
Definition: IdentifierHash.h:38
python.IoTestsLib.w
def w
Definition: IoTestsLib.py:200
PixelPrepDataToxAOD::m_pixelReadout
ServiceHandle< InDetDD::IPixelReadoutManager > m_pixelReadout
Definition: PixelPrepDataToxAOD.h:123
InDetDD::SiDetectorElement::design
virtual const SiDetectorDesign & design() const override final
access to the local description (inline):
PixelID::phi_module
int phi_module(const Identifier &id) const
Definition: PixelID.h:644
test_pyathena.counter
counter
Definition: test_pyathena.py:15
InDetDD::SiDiodesParameters::width
SiLocalPosition width() const
width of the diodes:
Definition: SiDiodesParameters.h:96
Trk::ClusterSplitProbabilityContainer::getNoSplitProbability
static const ProbabilityInfo & getNoSplitProbability()
Definition: ClusterSplitProbabilityContainer.h:33
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
readCCLHist.float
float
Definition: readCCLHist.py:83
InDetDD::SolidStateDetectorElementBase::identify
virtual Identifier identify() const override final
identifier of this detector element (inline)
Trk::ClusterSplitProbabilityContainer::ProbabilityInfo::splitProbability2
float splitProbability2() const
Definition: ClusterSplitProbabilityContainer.h:25
NSWL1::centroid
Vertex centroid(const Polygon &p)
Definition: GeoUtils.cxx:59
SiHit::localStartPosition
HepGeom::Point3D< double > localStartPosition() const
Definition: SiHit.cxx:146
PixelPrepDataToxAOD::m_missingParentParticle
std::atomic< unsigned int > m_missingParentParticle
Definition: PixelPrepDataToxAOD.h:152
PixelPrepDataToxAOD::m_writeSiHits
bool m_writeSiHits
Definition: PixelPrepDataToxAOD.h:116
fitman.k
k
Definition: fitman.py:528
ServiceHandle< ICondSvc >
InDetDD::SiDiodesParameters
Definition: SiDiodesParameters.h:25
PixelPrepDataToxAOD::m_haveTruthLink
std::atomic< unsigned int > m_haveTruthLink
Definition: PixelPrepDataToxAOD.h:150