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

#include <TRT_SegmentsToTrack.h>

Inheritance diagram for InDet::TRT_SegmentsToTrack:
Collaboration diagram for InDet::TRT_SegmentsToTrack:

Public Member Functions

 TRT_SegmentsToTrack (const std::string &name, ISvcLocator *pSvcLocator)
 
 ~TRT_SegmentsToTrack ()
 
StatusCode initialize ()
 
StatusCode execute ()
 
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

int getNumberReal (const InDet::TRT_DriftCircle *, const EventContext &ctx) const
 Get the number of truth particles associated with this hit. More...
 
double getRealFractionTRT (const Trk::Track *track, const EventContext &ctx) const
 Get the fraction of truth TRT hits on this Track. More...
 
double getNoiseProbability (const Trk::Track *track) const
 Get the fraction of noise TRT hits on this Track. More...
 
int nTRTHits (const Trk::Track *track) const
 Count number of TRT Hits on track. More...
 
int nHTHits (const Trk::Track *track) const
 Count number of TRT HT Hits on track. More...
 
void combineSegments (const EventContext &ctx) 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

SG::ReadHandleKey< Trk::SegmentCollectionm_inputSegmentCollectionName {this,"InputSegmentsCollection","TrackSegments","RHK to retrieve input track collection"}
 Name of the TrackSegment Collection to read in. More...
 
SG::WriteHandleKey< TrackCollectionm_outputTrackCollectionName {this,"OutputTrackCollection","SegmentTracks","WHK to store output tracks"}
 Name of the TrackCollection to write out. More...
 
ToolHandle< Trk::ITrackFitterm_trackFitter {this,"TrackFitter","Trk::KalmanFitter/TrkKalmanFitter",""}
 The TrackFitter. More...
 
ToolHandle< Trk::IExtrapolatorm_extrapolator {this,"ExtrapolationTool","Trk::Extrapolator/InDetExtrapolator",""}
 The Extrapolator. More...
 
ToolHandle< Trk::IExtendedTrackSummaryToolm_trkSummaryTool {this, "SummaryTool","",""}
 
ToolHandle< Trk::IPRDtoTrackMapToolm_assoTool {this, "AssociationTool", "","" }
 
SG::WriteHandleKey< Trk::PRDtoTrackMapm_assoMapName {this,"AssociationMapName","",""}
 key for the PRDtoTrackMap to filled by the ambiguity score processor. More...
 
SG::ReadHandleKey< Trk::PRDtoTrackMapm_inputAssoMapName {this,"InputAssociationMapName","",""}
 key to be set to optionally store PRD to track association map More...
 
double m_noiseCut
 All tracks with a TRT Noise fraction larger than this variable will be thrown away. More...
 
int m_minTRTHits
 All tracks with less Hits (after the track fit) will be thrown away. More...
 
const AtlasDetectorIDm_idHelper
 
const TRT_IDm_trtid
 
SG::ReadHandleKey< PRD_MultiTruthCollectionm_multiTruthCollectionTRTName {this,"PRDTruthCollectionTRT","","RHK to retrieve TRT turth info"}
 Name of the TRT MultiTruthCollection. More...
 
int m_nTracksReal
 Counter for real reconstructed Tracks. More...
 
int m_nTracksFake
 Counter for fake reconstructed Track. More...
 
double m_noiseratio
 average percentage of noise in real tracks More...
 
std::atomic< int > m_events
 Event counter. More...
 
std::map< int, int > m_MapReal
 Map of hits and real tracks. More...
 
std::map< int, int > m_MapFake
 Map of hits and fake tracks. More...
 
bool m_materialEffects
 Flag to switch on Material Effects in the Fitter. More...
 
bool m_outlierRemoval
 Flag to switch on the outlier removal in the track fitter. More...
 
bool m_combineSegments
 Try to combine segments from Barrel and Endcap. More...
 
SG::ReadHandleKey< Trk::SegmentCollectionm_barrelSegments {this,"BarrelSegments","TRTBarrelSegments","RHK to retrieve barrel track segments"}
 Name of Barrel segment collection. More...
 
SG::ReadHandleKey< Trk::SegmentCollectionm_endcapSegments {this,"EndcapSegments","TRTEndcapSegments","RHK to retrieve endcap track segments"}
 Name of Endcap segment collection. More...
 
SG::WriteHandleKey< TrackCollectionm_BECCollectionName {this,"BarrelEndcapTracks","TRT_Barrel_EC","WHK to write tracks"}
 Name of the combined (TRT Barrel+EC) TrackCollection to write out. More...
 
std::atomic< int > m_n_combined_fit
 
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 53 of file TRT_SegmentsToTrack.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

◆ TRT_SegmentsToTrack()

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

Definition at line 55 of file TRT_SegmentsToTrack.cxx.

55  :
56  AthAlgorithm(name, pSvcLocator),
57  m_idHelper(nullptr),
58  m_trtid(nullptr),
59  m_nTracksReal(0),
60  m_nTracksFake(0),
61  m_noiseratio(0.),
62  m_events(0),
64 {
65  declareProperty("NoiseCut", m_noiseCut = -1.);
66  declareProperty("MinNHit", m_minTRTHits = 1);
67  declareProperty("MaterialEffects", m_materialEffects = false);
68  declareProperty("OutlierRemoval", m_outlierRemoval = false);
69  declareProperty("CombineSegments", m_combineSegments = false);
70 }

◆ ~TRT_SegmentsToTrack()

InDet::TRT_SegmentsToTrack::~TRT_SegmentsToTrack ( )

Definition at line 72 of file TRT_SegmentsToTrack.cxx.

73 {
74 }

Member Function Documentation

◆ combineSegments()

void InDet::TRT_SegmentsToTrack::combineSegments ( const EventContext &  ctx) const
private

Definition at line 573 of file TRT_SegmentsToTrack.cxx.

574 {
575  //Idea:
576  // - get from endcap segment z-phi dependence
577  // - get from barrel segment r-phi dependence and z dependence from endcap segment fit
578 
579  int n_combined_fit=0;
582 
583  StatusCode sc;
584 
585  SG::WriteHandle<TrackCollection> outputCombiCollection(m_BECCollectionName,ctx);
586  sc = outputCombiCollection.record(std::make_unique<TrackCollection>());
587  if (sc.isFailure()) return;
588 
589  if (!BarrelSegments.isValid()){
590  ATH_MSG_FATAL("Could not open barrel segments collection : " << m_barrelSegments.key());
591  return;
592  }
593 
594  if (!EndcapSegments.isValid()) {
595  ATH_MSG_FATAL("Could not open endcap segments collection : " << m_endcapSegments.key());
596  return;
597  }
598 
599  ATH_MSG_VERBOSE("Got both barrel and endcap segment collections of size "<<BarrelSegments->size()<<" "<<EndcapSegments->size());
600 
601  Trk::SegmentCollection::const_iterator iseg = BarrelSegments->begin();
602  Trk::SegmentCollection::const_iterator isegE = BarrelSegments->end();
603 
604  int scount=0;
605  for(;iseg!=isegE;++iseg,scount++){
606  ATH_MSG_VERBOSE("Barrel Segment "<<scount<<" : phi="<<(*iseg)->localParameters()[Trk::phi]);
607  }
608 
609  iseg = EndcapSegments->begin();
610  isegE = EndcapSegments->end();
611 
612  scount=0;
613  for(;iseg!=isegE;++iseg,scount++){
614  ATH_MSG_VERBOSE("Endcap Segment "<<scount<<" : phi="<<(*iseg)->localParameters()[Trk::phi]);
615  }
616 
617  if(BarrelSegments->size()==1 && EndcapSegments->size()==1){
618  ATH_MSG_VERBOSE("Here we go: one barrel segment and one endcap segment!");
619 
620  Trk::SegmentCollection::const_iterator isegBarrel = BarrelSegments->begin();
621  Trk::SegmentCollection::const_iterator isegBarrelE = BarrelSegments->end();
622 
623  Trk::SegmentCollection::const_iterator isegEndcap = EndcapSegments->begin();
624  Trk::SegmentCollection::const_iterator isegEndcapE = EndcapSegments->end();
625 
626  //loop over all Barrel Segments
627  for(;isegBarrel!=isegBarrelE;++isegBarrel){
628  for(;isegEndcap!=isegEndcapE;++isegEndcap){
629 
630  std::vector< Trk::PseudoMeasurementOnTrack*> tobedeleted;
631 
632  ATH_MSG_VERBOSE("Barrel Segment : phi="<<(*isegBarrel)->localParameters()[Trk::phi]<<" with "<<(*isegBarrel)->numberOfMeasurementBases()<<" hits");
633  ATH_MSG_VERBOSE("Endcap Segment : phi="<<(*isegEndcap)->localParameters()[Trk::phi]<<" with "<<(*isegEndcap)->numberOfMeasurementBases()<<" hits");
634 
635  int count=0;
636  Trk::MeasurementSet myset,myset2,echits=(*isegEndcap)->containedMeasurements();
637 
638  bool barreldown=((*isegBarrel)->measurement((*isegBarrel)->numberOfMeasurementBases()/2)->globalPosition().y()<0);
639  double theta=0;
640  if((*isegEndcap)->localParameters().contains(Trk::theta)){
641  theta = (*isegEndcap)->localParameters()[Trk::theta];
642  }
643 
644  //correct theta to point towards the barrel
645  if(( (*isegEndcap)->globalPosition().y()>0 && (*isegEndcap)->globalPosition().z()>0) ||
646  ((*isegEndcap)->globalPosition().y()<0 && (*isegEndcap)->globalPosition().z()<0)
647  ){
648  //endcap A top pointing to barrel A bottom or Barrel C top pointing to Endcap C bottom
649  //--> Theta between 90 and 180 degrees
650  if(theta<M_PI/2.) {
651  theta=M_PI-theta;
652  std::reverse(echits.begin(),echits.end());
653  }
654  }else{
655  //Theta between 0 and 90 degrees
656  if(theta>M_PI/2.) {
657  theta=M_PI-theta;
658  std::reverse(echits.begin(),echits.end());
659  }
660  }
661 
662  //decide if barrel or endcap hits come first depending on global position of segments
663 
664  if(!barreldown && (*isegEndcap)->globalPosition().y()>0){
665  ATH_MSG_VERBOSE("Both barrel and endcap segments in top sectors, won't fit");
666  continue;
667  }
668 
669  if(barreldown && (*isegEndcap)->globalPosition().y()<0){
670  ATH_MSG_VERBOSE("Both barrel and endcap segments in lower sectors, won't fit");
671  continue;
672  }
673  int firstechit=0,lastechit=0;
674  if((*isegEndcap)->globalPosition().y()>0){
675  //first endcap then barrel
676  for(int i=0;i<(int)echits.size();++i){
677  const Trk::MeasurementBase *meas=echits[i];
678  const Amg::VectorX LocalParameters = meas->localParameters();
679  const Amg::MatrixX LocalErrorMatrix = meas->localCovariance();
680  double z=meas->globalPosition().z();
681  double phi=meas->globalPosition().phi();
682  double r=meas->globalPosition().perp();
683 
684  const InDet::TRT_DriftCircleOnTrack* trtcirc = dynamic_cast<const InDet::TRT_DriftCircleOnTrack*>(meas);
685  if(trtcirc){
686  myset.push_back(meas);
687  ATH_MSG_VERBOSE("Endcap : (phi,r,z) = ( "<<phi<<" , "<<r<<" , "<<z<<" ) ");
688  count++;
689  }
690  }
691  firstechit=0;
692  lastechit=count-1;
693 
694  for(unsigned int i=0;i<(*isegBarrel)->numberOfMeasurementBases();++i){
695  const Amg::VectorX LocalParameters = (*isegBarrel)->measurement(i)->localParameters();
696  const Amg::MatrixX LocalErrorMatrix = (*isegBarrel)->measurement(i)->localCovariance();
697  double z=(*isegBarrel)->measurement(i)->globalPosition().z();
698  double phi=(*isegBarrel)->measurement(i)->globalPosition().phi();
699  double r=(*isegBarrel)->measurement(i)->globalPosition().perp();
700 
701  const Trk::MeasurementBase *mesb=(*isegBarrel)->measurement(i);
702  const InDet::TRT_DriftCircleOnTrack* trtcirc = dynamic_cast<const InDet::TRT_DriftCircleOnTrack*>(mesb);
703  if(trtcirc){
704  myset.push_back((*isegBarrel)->measurement(i));
705  ATH_MSG_VERBOSE("Barrel : (phi,r,z) = ( "<<phi<<" , "<<r<<" , "<<z<<" ) ");
706  count++;
707  }
708 
709  }
710  }else{
711  //first barrel then endcap
712  for(unsigned int i=0;i<(*isegBarrel)->numberOfMeasurementBases();++i){
713  const Amg::VectorX LocalParameters = (*isegBarrel)->measurement(i)->localParameters();
714  const Amg::MatrixX LocalErrorMatrix = (*isegBarrel)->measurement(i)->localCovariance();
715  double z=(*isegBarrel)->measurement(i)->globalPosition().z();
716  double phi=(*isegBarrel)->measurement(i)->globalPosition().phi();
717  double r=(*isegBarrel)->measurement(i)->globalPosition().perp();
718 
719  const Trk::MeasurementBase *mesb=(*isegBarrel)->measurement(i);
720  const InDet::TRT_DriftCircleOnTrack* trtcirc = dynamic_cast<const InDet::TRT_DriftCircleOnTrack*>(mesb);
721  if(trtcirc){
722  myset.push_back((*isegBarrel)->measurement(i));
723  ATH_MSG_VERBOSE("Barrel : (phi,r,z) = ( "<<phi<<" , "<<r<<" , "<<z<<" ) ");
724  count++;
725  }
726 
727  }
728  firstechit=count;
729 
730  for(int i=0;i<(int)echits.size();++i){
731  const Trk::MeasurementBase *meas=echits[i];
732  const Amg::VectorX LocalParameters = meas->localParameters();
733  const Amg::MatrixX LocalErrorMatrix = meas->localCovariance();
734  double z=meas->globalPosition().z();
735  double phi=meas->globalPosition().phi();
736  double r=meas->globalPosition().perp();
737 
738  const InDet::TRT_DriftCircleOnTrack* trtcirc = dynamic_cast<const InDet::TRT_DriftCircleOnTrack*>(meas);
739  if(trtcirc){
740  myset.push_back(meas);
741  ATH_MSG_VERBOSE("Endcap : (phi,r,z) = ( "<<phi<<" , "<<r<<" , "<<z<<" ) ");
742  count++;
743  }
744 
745  }
746  lastechit=count-1;
747  }
748 
749 
750 
751  Amg::Vector3D inputMatchingPos((*isegBarrel)->globalPosition());
752 
753  if((*isegEndcap)->globalPosition().y()>0)
754  inputMatchingPos=(*isegEndcap)->globalPosition();
755 
756  Amg::Vector3D inputMatchingMom;
757  double p = 10e7;
758 
759  if((*isegBarrel)->localParameters().contains(Trk::qOverP)){
760  p = ((*isegBarrel)->localParameters()[Trk::qOverP]!=0.) ? fabs(1./((*isegBarrel)->localParameters()[Trk::qOverP])) : 10e7;
761  }
762 
763  double phi=0.;
764  if((*isegBarrel)->localParameters().contains(Trk::phi)){
765  phi = (*isegBarrel)->localParameters()[Trk::phi];
766  }
767 
768 
769  inputMatchingMom[Trk::px] = p * cos(phi) * sin(theta);
770  inputMatchingMom[Trk::py] = p * sin(phi) * sin(theta);
771  inputMatchingMom[Trk::pz] = p * cos(theta);
772 
773 
774  ATH_MSG_VERBOSE("Global position: "<<inputMatchingPos<<" Globalmomentum: "<<inputMatchingMom);
775 
776 
777 
778  //add two pseudomeasurements at the beginning and at the end of the track
779  Trk::MeasurementSet::const_iterator mit;
780  Trk::MeasurementSet::const_iterator mitE=myset.end();
781 
782  int count2=0;
783  for(mit=myset.begin();mit!=mitE;++mit){
784  myset2.push_back(*mit);
785  if(count2==firstechit || count2==lastechit){
786  const InDet::TRT_DriftCircleOnTrack* trtcirc = dynamic_cast<const InDet::TRT_DriftCircleOnTrack*>(*mit);
787  if(trtcirc){
788  const Trk::StraightLineSurface *line=dynamic_cast<const
790  if (line) {
791  //add pseudomeasurement
792  double locz=-200.;
793  if ((count2==firstechit && firstechit!=0) || (count2==lastechit && firstechit==0)) locz=200;
796 
797  Amg::MatrixX cov(1,1);
798  cov(0,0) = 16./12. ; // take actual length of straw instead !!!!!
799 
800  //create new surface
801  Amg::Vector3D C = line->transform().translation();
802 
803  //decide on movement
804 
805  const Amg::Vector3D& gpos=(*mit)->globalPosition();
806 
807  if(fabs(gpos.z())>800){
808  if(theta>M_PI/2.){
809  C[2]-=1.;
810  }else{
811  C[2]+=1.;
812  }
813  }else{
814  C[1]-=1.;
815  }
816 
817 
819  T = line->transform().rotation();
820  T *= Amg::Translation3D(C.x(),C.y(),C.z());
822 
824  std::move(cov),
825  *surface);
826 
827  tobedeleted.push_back(pseudo);
828 
829  delete surface;
830 
831  myset2.push_back(pseudo);
832  }
833  }
834  }
835  count2++;
836  }
837 
838 
839 
840  const Trk::StraightLineSurface* testSf;
841  if((*isegEndcap)->globalPosition().y()>0){
842  testSf= dynamic_cast<const Trk::StraightLineSurface*>(&((*isegEndcap)->associatedSurface()));
843  }else{
844  testSf= dynamic_cast<const Trk::StraightLineSurface*>(&((*isegBarrel)->associatedSurface()));
845  }
846 
847  const Trk::AtaStraightLine* inputMatchLine = nullptr;
848  const Trk::Perigee* inputMatchPerigee = nullptr;
849 
850  if(!testSf){
851  ATH_MSG_VERBOSE("No straightLineSurface !! Trying Perigee ...");
852 
853  const Trk::PerigeeSurface *testPSf=dynamic_cast<const Trk::PerigeeSurface*>(&((*isegBarrel)->associatedSurface()));
854 
855  if(!testPSf){
856  ATH_MSG_VERBOSE("Associated surface dynamic_cast into PerigeeSurface failed. "<<(*isegBarrel)->associatedSurface());
857  ATH_MSG_VERBOSE("Leaving input matching perigee as nullptr, will not get a fittedTrack");
858  }else{
859  ATH_MSG_VERBOSE("Ok, it seems to be a PerigeeSurface");
860  inputMatchPerigee = new Trk::Perigee(inputMatchingPos,inputMatchingMom, 1., *testPSf);
861  }
862 
863  }else{
864  inputMatchLine = new Trk::AtaStraightLine(inputMatchingPos,inputMatchingMom, 1., *testSf);
865  ATH_MSG_VERBOSE("Created testSf : " << (*inputMatchLine));
866  }
867 
868  Amg::Vector3D startMomentum( 0., 0., 1.);
869  std::unique_ptr<Trk::Track> fittedTrack;
870  if(m_materialEffects){
871  if(inputMatchLine){
872  fittedTrack=m_trackFitter->fit(ctx,
873  myset2,
874  *inputMatchLine,
875  false,
876  Trk::muon
877  );
878  }else if (inputMatchPerigee){
879  fittedTrack=m_trackFitter->fit(ctx,
880  myset2,
881  *inputMatchPerigee,
882  false,
883  Trk::muon
884  );
885  }
886  }else{
887  if(inputMatchLine){
888  fittedTrack=m_trackFitter->fit(ctx,
889  myset2,
890  *inputMatchLine,
891  false,
893  );
894  }else if (inputMatchPerigee){
895  fittedTrack=m_trackFitter->fit(ctx,
896  myset2,
897  *inputMatchPerigee,
898  false,
899  Trk::muon
900  );
901  }
902  }
903 
904  if(fittedTrack){
905  n_combined_fit++;
906  ATH_MSG_DEBUG("Successful Barrel+Endcap fit of segment. ");
907  ATH_MSG_DEBUG("Quality of Track: "<<fittedTrack->fitQuality()->chiSquared()<<" / "<<fittedTrack->fitQuality()->numberDoF());
908  ATH_MSG_VERBOSE(*fittedTrack);
909  outputCombiCollection->push_back(std::move(fittedTrack));
910 }
911 
912  delete inputMatchPerigee;
913  delete inputMatchLine;
914 
915  for(size_t i=0;i<tobedeleted.size();i++)
916  delete tobedeleted[i];
917  tobedeleted.clear();
918  }
919  }
920  }
921  m_n_combined_fit += n_combined_fit;
922 
923  if (!outputCombiCollection.isValid()) {
924  ATH_MSG_ERROR("Could not write track Barrel+EC collection TRT_Barrel_EC");
925  }
926 }

◆ 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 InDet::TRT_SegmentsToTrack::execute ( )

Definition at line 137 of file TRT_SegmentsToTrack.cxx.

138 {
139  int segmentCounter=0;
140  const EventContext& ctx = Gaudi::Hive::currentContext();
141  m_events++;
142 
143  ATH_MSG_DEBUG(name() << " execute() start");
144 
145  StatusCode sc = StatusCode::SUCCESS;
146 
147  //combine segments
148  if( m_combineSegments)
149  combineSegments(ctx);
150 
151  // input TrackSegment Collection
152 
154  if (!inputSegments.isValid()) {
155  ATH_MSG_ERROR("Could not open: " <<m_inputSegmentCollectionName.key());
156  sc = StatusCode::FAILURE;
157  return sc;
158  }
159 
160 
161  //output collections for fitted tracks
162 
163  SG::WriteHandle<TrackCollection> final_outputTrackCollection(m_outputTrackCollectionName,ctx);
164  ATH_CHECK(final_outputTrackCollection.record(std::make_unique<TrackCollection>()));
165 
166  std::vector<std::unique_ptr<Trk::Track> > output_track_collection;
167  //try to get truth information
168 
171 
172  if (!truthCollectionTRT.isValid()){
173  ATH_MSG_FATAL("Could not open PRD_MultiTruthCollection : " << m_multiTruthCollectionTRTName.key());
174  return StatusCode::FAILURE;
175  }
176  }
177 
178  Trk::SegmentCollection::const_iterator iseg = inputSegments->begin();
179  Trk::SegmentCollection::const_iterator isegEnd = inputSegments->end();
180 
181 
182 
183  for(iseg=inputSegments->begin(); iseg != isegEnd; ++ iseg) {
184 
185  segmentCounter++;
186 
187 
188  if((*iseg)->numberOfMeasurementBases()<10) continue; //only convert segments that are large enough
189 
190  Trk::MeasurementSet myset;
191  for(unsigned int i=0;i<(*iseg)->numberOfMeasurementBases();++i){
192  const Amg::VectorX& LocalParameters = (*iseg)->measurement(i)->localParameters();
193  const Amg::MatrixX& LocalErrorMatrix = (*iseg)->measurement(i)->localCovariance();
194  double z=(*iseg)->measurement(i)->globalPosition().z();
195  ATH_MSG_DEBUG("Segment "<<segmentCounter<<" rioOnTrack "<<i<<" (z="<<z<<") : "<<LocalParameters[0]
196  <<" ; "<<std::sqrt(LocalErrorMatrix(Trk::locR,Trk::locR)));
197  myset.push_back((*iseg)->measurement(i));
198  } //end of loop over measurements
199 
200  if((*iseg)->numberOfMeasurementBases()>0){
201  ATH_MSG_DEBUG("numberOfContainedRots: " << (*iseg)->numberOfMeasurementBases());
202 
203  const Trk::StraightLineSurface* testSf
204  = dynamic_cast<const Trk::StraightLineSurface*>(&((*iseg)->associatedSurface()));
205 
206 
207  const Trk::AtaStraightLine* inputMatchLine =nullptr;
208  const Trk::Perigee* inputMatchPerigee =nullptr;
209  const Amg::VectorX &p = dynamic_cast<const Amg::VectorX&>((**iseg).localParameters());
210 
211  if(!testSf){
212  ATH_MSG_DEBUG("No straightLineSurface !! Trying Perigee ...");
213  const Trk::PerigeeSurface *testPSf=dynamic_cast<const Trk::PerigeeSurface*>(&((*iseg)->associatedSurface()));
214 
215  if(!testPSf){
216  ATH_MSG_DEBUG("Associated surface dynamic_cast into PerigeeSurface failed: "<<(*iseg)->associatedSurface());
217  ATH_MSG_DEBUG("Leaving input matching perigee as nullptr, will not get a fittedTrack");
218  }else{
219  ATH_MSG_DEBUG("Ok, it seems to be a PerigeeSurface");
220  inputMatchPerigee = new Trk::Perigee(p(0),p(1),p(2),p(3),p(4), *testPSf);
221  }
222  }else{
223  inputMatchLine = new Trk::AtaStraightLine(p(0),p(1),p(2),p(3),p(4),*testSf);
224 
225  ATH_MSG_DEBUG("Created testSf : " << (*inputMatchLine));
226  int nmeas=(*iseg)->numberOfMeasurementBases();
227  Amg::Vector3D surfpos(.5*((*iseg)->measurement(nmeas/2)->globalPosition()+(*iseg)->measurement(nmeas/2+1)->globalPosition()));
228  Trk::PerigeeSurface persurf(surfpos);
229  std::unique_ptr<const Trk::TrackParameters> tmp =
230  m_extrapolator->extrapolateDirectly(ctx, *inputMatchLine, persurf);
231  if (tmp && tmp->associatedSurface().type() == Trk::SurfaceType::Perigee) {
232  inputMatchPerigee = static_cast<const Trk::Perigee*>(tmp.release());
233  }
234  }
235  ATH_MSG_DEBUG("Created inputMatchLine");
236 
237  std::unique_ptr<Trk::Track> fittedTrack;
238  const Trk::TrackParameters *inputpar=nullptr;
239  if (inputMatchPerigee) inputpar=inputMatchPerigee;
240  else if (inputMatchLine) inputpar=inputMatchLine;
241 
242  if (inputpar) {
243  fittedTrack = m_trackFitter->fit(ctx,
244  myset,
245  *inputpar,
248  }
249  if(fittedTrack){
251  Trk::TrackStates::const_iterator itSetEnd = fittedTrack->trackStateOnSurfaces()->end();
252  const Trk::TrackParameters *measpar=nullptr;
253  double mindist=9999;
254  for ( ; itSet!=itSetEnd; ++itSet) {
255  if ((**itSet).type(Trk::TrackStateOnSurface::Measurement) && (**itSet).trackParameters()->position().perp()<mindist) {
256  mindist=(**itSet).trackParameters()->position().perp();
257  measpar=(**itSet).trackParameters();
258  }
259  }
260  std::unique_ptr<Trk::TrackParameters> myper;
261  if (measpar){
263  }
264  if (!myper){
265  fittedTrack.reset();
266  }
267  else {
268  auto trajectory = std::make_unique<Trk::TrackStates>();
269  itSet = fittedTrack->trackStateOnSurfaces()->begin();
270  for ( ; itSet!=itSetEnd; ++itSet) {
271  if (!(**itSet).type(Trk::TrackStateOnSurface::Perigee)) {
272  auto trackpar=(**itSet).trackParameters() ? (**itSet).trackParameters()->uniqueClone() : nullptr;
273  auto measurement=(**itSet).measurementOnTrack() ? (**itSet).measurementOnTrack()->uniqueClone() : nullptr;
274  auto fitQual=(**itSet).fitQualityOnSurface() ;
275  auto mateff=(**itSet).materialEffectsOnTrack() ? (**itSet).materialEffectsOnTrack()->uniqueClone() : nullptr;
276  std::bitset<Trk::TrackStateOnSurface::NumberOfTrackStateOnSurfaceTypes> typePattern(0);
278  else if ((**itSet).type(Trk::TrackStateOnSurface::Outlier)) typePattern.set(Trk::TrackStateOnSurface::Outlier);
279  else if ((**itSet).type(Trk::TrackStateOnSurface::Scatterer)) typePattern.set(Trk::TrackStateOnSurface::Scatterer);
280  else if ((**itSet).type(Trk::TrackStateOnSurface::BremPoint)) typePattern.set(Trk::TrackStateOnSurface::BremPoint);
281  trajectory->push_back(
282  new Trk::TrackStateOnSurface(fitQual,
283  std::move(measurement),
284  std::move(trackpar),
285  std::move(mateff),
286  typePattern));
287  }
288  }
289  bool peradded=false;
290  itSet = trajectory->begin()+1;
291  itSetEnd = trajectory->end();
292  std::bitset<Trk::TrackStateOnSurface::NumberOfTrackStateOnSurfaceTypes> typePattern(0);
293  typePattern.set(Trk::TrackStateOnSurface::Perigee);
294  const auto myPosition {myper->position()};
295  const auto myMomentum {myper->momentum()};
296  const Trk::TrackStateOnSurface* pertsos =
297  new Trk::TrackStateOnSurface(nullptr,
298  std::move(myper),
299  nullptr,
300  typePattern);
301 
302  int index=1;
303  for ( ; itSet!=itSetEnd; ++itSet) {
304  double inprod1=((**itSet).trackParameters()->position()-myPosition).dot(myMomentum);
305  --itSet;
306  double inprod2=((**itSet).trackParameters()->position()-myPosition).dot(myMomentum);
307  ++itSet;
308  if (inprod1>0 && inprod2<0) {
309  trajectory->insert(trajectory->begin()+index,pertsos);
310  peradded=true;
311  break;
312  }
313  index++;
314  }
315  if (!peradded){
316  itSet = trajectory->begin();
317  double inprod=((**itSet).trackParameters()->position()-myPosition).dot(myMomentum);
318  if (inprod>0) trajectory->insert(trajectory->begin(),pertsos);
319  else trajectory->push_back(pertsos);
320  }
321  std::unique_ptr<Trk::Track> track =
322  std::make_unique<Trk::Track>(fittedTrack->info(),
323  std::move(trajectory),
324  fittedTrack->fitQuality()->uniqueClone());
325  fittedTrack = std::move(track);
326  }
327  }
328  if(fittedTrack){
329 
330  int nHT=nHTHits(fittedTrack.get());
331  ATH_MSG_DEBUG("Number of HT hits: "<<nHT);
332  ATH_MSG_DEBUG(" Successful fit of track.");
333  if ((*iseg)->fitQuality()) ATH_MSG_DEBUG("Quality of Segment: chi^2 /ndof "<<(*iseg)->fitQuality()->chiSquared()<<" / "<<(*iseg)->fitQuality()->numberDoF());
334  ATH_MSG_DEBUG("Quality of Track: chi^2 /ndof "<<fittedTrack->fitQuality()->chiSquared()<<" / "<<fittedTrack->fitQuality()->numberDoF());
335  ATH_MSG_DEBUG("Noise probability: "<<getNoiseProbability(fittedTrack.get()));
336  ATH_MSG_DEBUG((*fittedTrack));
337 
338  if( nTRTHits(fittedTrack.get())>=m_minTRTHits){
339  if(getNoiseProbability(fittedTrack.get())>m_noiseCut){
340  double truefraction=getRealFractionTRT(fittedTrack.get(),ctx);
341 
342  int nhits=(*iseg)->numberOfMeasurementBases();
343  ATH_MSG_DEBUG("Real/Noise : "<< truefraction << " chi2="<<fittedTrack->fitQuality()->chiSquared()/double(fittedTrack->fitQuality()->numberDoF()));
344  if(truefraction>0.5){
345  ATH_MSG_DEBUG("==> Real Track");
346 
347  if(m_MapReal.find(nhits)==m_MapReal.end()){
348  m_MapReal[nhits]=1;
349  }else{
350  m_MapReal[nhits]++;
351  }
352 
353  m_nTracksReal++;
354  m_noiseratio+=(1-truefraction);
355  }else{
356  ATH_MSG_DEBUG(" ==> Fake Track");
357 
358  if(m_MapFake.find(nhits)==m_MapFake.end()){
359  m_MapFake[nhits]=1;
360  }else{
361  m_MapFake[nhits]++;
362  }
363 
364  m_nTracksFake++;
365  }
366  }
367  output_track_collection.push_back(std::move(fittedTrack));
368  }else{
369  ATH_MSG_DEBUG("This tracks has only "<<nTRTHits(fittedTrack.get())<<" Hits! Will reject it!");
370  }
371 
372  }else{
373  ATH_MSG_DEBUG("Fit did not converge!");
374  } //end of if(fittedTrack)
375 
376  delete inputMatchLine;
377  delete inputMatchPerigee;
378 
379  } //end of if: (*iseg)->numberOfMeasurementBases()>0
380  } //end of loop over segments
381 
382  std::unique_ptr<Trk::PRDtoTrackMap> prd_to_track_map;
383  if (m_assoTool.isEnabled()) {
384  // create internal PRD-to-track map
385  prd_to_track_map = m_assoTool->createPRDtoTrackMap();
386  if (!m_inputAssoMapName.key().empty()) {
388  if (!input_asso_map.isValid()) {
389  ATH_MSG_FATAL("No valid input PRT-to-track map with key " << m_inputAssoMapName.key());
390  }
391  *prd_to_track_map = *input_asso_map;
392  ATH_MSG_INFO("PRD to track map input " << m_inputAssoMapName.key() );
393  }
394  for (const std::unique_ptr<Trk::Track> &track : output_track_collection) {
395  ATH_CHECK( m_assoTool->addPRDs(*prd_to_track_map, *track) );
396  }
397  }
398  // @TODO sort output track collection ?
399  final_outputTrackCollection->reserve(output_track_collection.size());
400  if (m_trkSummaryTool.isEnabled()) {
401  for (std::unique_ptr<Trk::Track> &track : output_track_collection) {
402  m_trkSummaryTool->computeAndReplaceTrackSummary(*track,prd_to_track_map.get());
403  final_outputTrackCollection->push_back(std::move(track));
404  }
405  }
406  else {
407  for (std::unique_ptr<Trk::Track> &track : output_track_collection) {
408  final_outputTrackCollection->push_back(std::move(track));
409  }
410  }
411  if (!m_assoMapName.key().empty()) {
412  ATH_CHECK(SG::WriteHandle<Trk::PRDtoTrackMap>(m_assoMapName,ctx).record(std::move(prd_to_track_map)));
413  }
414 
415  if (!final_outputTrackCollection.isValid()) {
416  // @TODO never reached (?)
417  ATH_MSG_ERROR("Could not write track collection " << m_outputTrackCollectionName.key());
418  return StatusCode::FAILURE;
419  //return sc;
420  }
421 
422  return sc;
423 }

◆ 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 InDet::TRT_SegmentsToTrack::finalize ( )

Definition at line 111 of file TRT_SegmentsToTrack.cxx.

112 {
113  ATH_MSG_INFO("Summary of" << m_events << " Events");
114  ATH_MSG_INFO("Found Real Tracks : " << m_nTracksReal);
115  ATH_MSG_INFO("Found Fake Tracks : " << m_nTracksFake);
116 
117  if(m_nTracksReal>0) {
118  ATH_MSG_INFO("Average noise percentage " << m_noiseratio/double(m_nTracksReal));
119  }
120 
121  for (const auto& mitr : m_MapReal) {
122  ATH_MSG_INFO("Real tracks with " << mitr.first << " hits: " << mitr.second);
123  }
124  for (const auto& mitr : m_MapFake) {
125  ATH_MSG_INFO("Fake tracks with " << mitr.first << " hits: " << mitr.second);
126  }
127 
128  if(m_combineSegments){
129  ATH_MSG_INFO("Number of combined Barrel+Endcap tracks: "<<m_n_combined_fit);
130  }
131 
132  ATH_MSG_DEBUG(name() << " finalize() successful ");
133 
134  return StatusCode::SUCCESS;
135 }

◆ getNoiseProbability()

double InDet::TRT_SegmentsToTrack::getNoiseProbability ( const Trk::Track track) const
private

Get the fraction of noise TRT hits on this Track.

Definition at line 534 of file TRT_SegmentsToTrack.cxx.

535 {
536  double fraction=0.;
537  int nDriftReal=0;
538  int nDriftNoise=0;
539 
540  //loop over the hits
541  for (const Trk::TrackStateOnSurface* tsos : *track->trackStateOnSurfaces()) {
542  const Trk::RIO_OnTrack* hitOnTrack = dynamic_cast <const Trk::RIO_OnTrack*>(tsos->measurementOnTrack());
543  if (hitOnTrack) {
544  const Identifier& surfaceID = hitOnTrack->identify();
545 
546  //take only TRT hits
547  if(m_idHelper->is_trt(surfaceID)){
548 
549  const InDet::TRT_DriftCircleOnTrack *dcot= dynamic_cast <const InDet::TRT_DriftCircleOnTrack*>(hitOnTrack);
550  if (dcot) {
551  const InDet::TRT_DriftCircle *dc=dcot->prepRawData();
552 
553  if(dc){
554 
555  if(dc->isNoise())
556  nDriftNoise++;
557  else
558  nDriftReal++;
559  }
560  }
561  }
562  }
563  }
564 
565  if(nDriftReal>0)
566  fraction=double(nDriftReal)/double(nDriftNoise+nDriftReal);
567 
568  return fraction;
569 }

◆ getNumberReal()

int InDet::TRT_SegmentsToTrack::getNumberReal ( const InDet::TRT_DriftCircle driftcircle,
const EventContext &  ctx 
) const
private

Get the number of truth particles associated with this hit.

Definition at line 425 of file TRT_SegmentsToTrack.cxx.

426 {
427  int numBarcodes = 0;
428  using iter = PRD_MultiTruthCollection::const_iterator;
429 
430  if(m_multiTruthCollectionTRTName.empty()) return 0;
431 
432  else{
434  if(truthCollectionTRT.isValid()){
435  std::pair<iter,iter> range = truthCollectionTRT->equal_range(driftcircle->identify());
436  numBarcodes+=std::distance(range.first,range.second);
437  }
438  }
439  return numBarcodes;
440 }

◆ getRealFractionTRT()

double InDet::TRT_SegmentsToTrack::getRealFractionTRT ( const Trk::Track track,
const EventContext &  ctx 
) const
private

Get the fraction of truth TRT hits on this Track.

Definition at line 444 of file TRT_SegmentsToTrack.cxx.

445 {
446  double fraction=0.;
447  int nDriftReal=0;
448  int nDriftNoise=0;
449 
450  //loop over the hits
451  for (const Trk::TrackStateOnSurface* tsos : *track->trackStateOnSurfaces()) {
452 
453  const Trk::RIO_OnTrack* hitOnTrack = dynamic_cast <const Trk::RIO_OnTrack*>(tsos->measurementOnTrack());
454  if (hitOnTrack) {
455  const Identifier& surfaceID = hitOnTrack->identify();
456 
457  //take only TRT hits
458  if(m_idHelper->is_trt(surfaceID)){
459 
460  const InDet::TRT_DriftCircleOnTrack *dcot= dynamic_cast <const InDet::TRT_DriftCircleOnTrack*>(hitOnTrack);
461  if(dcot) {
462  const InDet::TRT_DriftCircle *dc=dcot->prepRawData();
463 
464  if(dc){
465  int nreal=getNumberReal(dc,ctx);
466 
467  if(nreal>0) nDriftReal++;
468  else nDriftNoise++;
469 
470  }
471  }
472  }
473  }
474  }
475 
476  if(nDriftReal>0)
477  fraction=double(nDriftReal)/double(nDriftNoise+nDriftReal);
478 
479  return fraction;
480 }

◆ initialize()

StatusCode InDet::TRT_SegmentsToTrack::initialize ( )

Definition at line 76 of file TRT_SegmentsToTrack.cxx.

77 {
78 
79  ATH_MSG_DEBUG("TrkSegmenttoTrack initialize()");
80 
82 
83  m_nTracksReal=0;
84  m_nTracksFake=0;
85  m_events=0;
86  m_noiseratio=0.;
87 
88  // Initialize handle keys
94  ATH_CHECK(m_BECCollectionName.initialize());
95 
96  //--------- Set up fitter -------------
97  CHECK( m_trackFitter.retrieve());
98 
100 
101  CHECK(detStore()->retrieve(m_idHelper, "AtlasID"));
102 
103  CHECK(m_extrapolator.retrieve());
104  ATH_CHECK(m_trkSummaryTool.retrieve( DisableTool{ m_trkSummaryTool.empty() } ));
105  ATH_CHECK(m_assoTool.retrieve( DisableTool{ m_assoTool.empty() || (m_trkSummaryTool.empty() && m_assoMapName.empty()) } ));
108  return StatusCode::SUCCESS;
109 }

◆ 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  }

◆ nHTHits()

int InDet::TRT_SegmentsToTrack::nHTHits ( const Trk::Track track) const
private

Count number of TRT HT Hits on track.

Definition at line 483 of file TRT_SegmentsToTrack.cxx.

484 {
485 
486  int nHT=0;
487 
488  //loop over the hits
489  for (const Trk::TrackStateOnSurface* tsos : *track->trackStateOnSurfaces()) {
490 
491  const Trk::RIO_OnTrack* hitOnTrack = dynamic_cast <const Trk::RIO_OnTrack*>(tsos->measurementOnTrack());
492  if (hitOnTrack != nullptr) {
493  const Identifier& surfaceID = hitOnTrack->identify();
494 
495  //take only TRT hits
496  if(m_idHelper->is_trt(surfaceID) && !tsos->type(Trk::TrackStateOnSurface::Outlier)){
497  const InDet::TRT_DriftCircleOnTrack* trtcirc = dynamic_cast<const InDet::TRT_DriftCircleOnTrack*>(hitOnTrack);
498  if(trtcirc) {
499  if(trtcirc->highLevel()){
500  nHT++;
501  }
502  }
503  }
504  }
505  }
506 
507  return nHT;
508 }

◆ nTRTHits()

int InDet::TRT_SegmentsToTrack::nTRTHits ( const Trk::Track track) const
private

Count number of TRT Hits on track.

Definition at line 512 of file TRT_SegmentsToTrack.cxx.

513 {
514  int nhits=0;
515 
516  //loop over the hits
517  for (const Trk::TrackStateOnSurface* tsos : *track->trackStateOnSurfaces()) {
518 
519  const Trk::RIO_OnTrack* hitOnTrack = dynamic_cast <const Trk::RIO_OnTrack*>(tsos->measurementOnTrack());
520  if (hitOnTrack != nullptr) {
521  const Identifier& surfaceID = hitOnTrack->identify();
522 
523  //take only TRT hits
524  if(m_idHelper->is_trt(surfaceID) && !tsos->type(Trk::TrackStateOnSurface::Outlier)){
525  nhits++;
526  }
527  }
528  }
529 
530  return nhits;
531 }

◆ 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_assoMapName

SG::WriteHandleKey<Trk::PRDtoTrackMap> InDet::TRT_SegmentsToTrack::m_assoMapName {this,"AssociationMapName","",""}
private

key for the PRDtoTrackMap to filled by the ambiguity score processor.

key to be set to optionally store PRD to track association map

Definition at line 93 of file TRT_SegmentsToTrack.h.

◆ m_assoTool

ToolHandle<Trk::IPRDtoTrackMapTool> InDet::TRT_SegmentsToTrack::m_assoTool {this, "AssociationTool", "","" }
private

Definition at line 90 of file TRT_SegmentsToTrack.h.

◆ m_barrelSegments

SG::ReadHandleKey<Trk::SegmentCollection> InDet::TRT_SegmentsToTrack::m_barrelSegments {this,"BarrelSegments","TRTBarrelSegments","RHK to retrieve barrel track segments"}
private

Name of Barrel segment collection.

Definition at line 124 of file TRT_SegmentsToTrack.h.

◆ m_BECCollectionName

SG::WriteHandleKey<TrackCollection> InDet::TRT_SegmentsToTrack::m_BECCollectionName {this,"BarrelEndcapTracks","TRT_Barrel_EC","WHK to write tracks"}
private

Name of the combined (TRT Barrel+EC) TrackCollection to write out.

Definition at line 127 of file TRT_SegmentsToTrack.h.

◆ m_combineSegments

bool InDet::TRT_SegmentsToTrack::m_combineSegments
private

Try to combine segments from Barrel and Endcap.

Definition at line 122 of file TRT_SegmentsToTrack.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_endcapSegments

SG::ReadHandleKey<Trk::SegmentCollection> InDet::TRT_SegmentsToTrack::m_endcapSegments {this,"EndcapSegments","TRTEndcapSegments","RHK to retrieve endcap track segments"}
private

Name of Endcap segment collection.

Definition at line 125 of file TRT_SegmentsToTrack.h.

◆ m_events

std::atomic<int> InDet::TRT_SegmentsToTrack::m_events
mutableprivate

Event counter.

Definition at line 114 of file TRT_SegmentsToTrack.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_extrapolator

ToolHandle<Trk::IExtrapolator> InDet::TRT_SegmentsToTrack::m_extrapolator {this,"ExtrapolationTool","Trk::Extrapolator/InDetExtrapolator",""}
private

The Extrapolator.

Definition at line 85 of file TRT_SegmentsToTrack.h.

◆ m_idHelper

const AtlasDetectorID* InDet::TRT_SegmentsToTrack::m_idHelper
private

Definition at line 102 of file TRT_SegmentsToTrack.h.

◆ m_inputAssoMapName

SG::ReadHandleKey<Trk::PRDtoTrackMap> InDet::TRT_SegmentsToTrack::m_inputAssoMapName {this,"InputAssociationMapName","",""}
private

key to be set to optionally store PRD to track association map

Definition at line 95 of file TRT_SegmentsToTrack.h.

◆ m_inputSegmentCollectionName

SG::ReadHandleKey<Trk::SegmentCollection> InDet::TRT_SegmentsToTrack::m_inputSegmentCollectionName {this,"InputSegmentsCollection","TrackSegments","RHK to retrieve input track collection"}
private

Name of the TrackSegment Collection to read in.

Definition at line 78 of file TRT_SegmentsToTrack.h.

◆ m_MapFake

std::map<int,int> InDet::TRT_SegmentsToTrack::m_MapFake
private

Map of hits and fake tracks.

Definition at line 116 of file TRT_SegmentsToTrack.h.

◆ m_MapReal

std::map<int,int> InDet::TRT_SegmentsToTrack::m_MapReal
private

Map of hits and real tracks.

Definition at line 115 of file TRT_SegmentsToTrack.h.

◆ m_materialEffects

bool InDet::TRT_SegmentsToTrack::m_materialEffects
private

Flag to switch on Material Effects in the Fitter.

Definition at line 118 of file TRT_SegmentsToTrack.h.

◆ m_minTRTHits

int InDet::TRT_SegmentsToTrack::m_minTRTHits
private

All tracks with less Hits (after the track fit) will be thrown away.

Definition at line 100 of file TRT_SegmentsToTrack.h.

◆ m_multiTruthCollectionTRTName

SG::ReadHandleKey<PRD_MultiTruthCollection> InDet::TRT_SegmentsToTrack::m_multiTruthCollectionTRTName {this,"PRDTruthCollectionTRT","","RHK to retrieve TRT turth info"}
private

Name of the TRT MultiTruthCollection.

Definition at line 107 of file TRT_SegmentsToTrack.h.

◆ m_n_combined_fit

std::atomic<int> InDet::TRT_SegmentsToTrack::m_n_combined_fit
mutableprivate

Definition at line 129 of file TRT_SegmentsToTrack.h.

◆ m_noiseCut

double InDet::TRT_SegmentsToTrack::m_noiseCut
private

All tracks with a TRT Noise fraction larger than this variable will be thrown away.

Definition at line 99 of file TRT_SegmentsToTrack.h.

◆ m_noiseratio

double InDet::TRT_SegmentsToTrack::m_noiseratio
private

average percentage of noise in real tracks

Definition at line 112 of file TRT_SegmentsToTrack.h.

◆ m_nTracksFake

int InDet::TRT_SegmentsToTrack::m_nTracksFake
private

Counter for fake reconstructed Track.

Definition at line 110 of file TRT_SegmentsToTrack.h.

◆ m_nTracksReal

int InDet::TRT_SegmentsToTrack::m_nTracksReal
private

Counter for real reconstructed Tracks.

Definition at line 109 of file TRT_SegmentsToTrack.h.

◆ m_outlierRemoval

bool InDet::TRT_SegmentsToTrack::m_outlierRemoval
private

Flag to switch on the outlier removal in the track fitter.

Definition at line 119 of file TRT_SegmentsToTrack.h.

◆ m_outputTrackCollectionName

SG::WriteHandleKey<TrackCollection> InDet::TRT_SegmentsToTrack::m_outputTrackCollectionName {this,"OutputTrackCollection","SegmentTracks","WHK to store output tracks"}
private

Name of the TrackCollection to write out.

Definition at line 80 of file TRT_SegmentsToTrack.h.

◆ m_trackFitter

ToolHandle<Trk::ITrackFitter> InDet::TRT_SegmentsToTrack::m_trackFitter {this,"TrackFitter","Trk::KalmanFitter/TrkKalmanFitter",""}
private

The TrackFitter.

Definition at line 82 of file TRT_SegmentsToTrack.h.

◆ m_trkSummaryTool

ToolHandle<Trk::IExtendedTrackSummaryTool> InDet::TRT_SegmentsToTrack::m_trkSummaryTool {this, "SummaryTool","",""}
private

Definition at line 88 of file TRT_SegmentsToTrack.h.

◆ m_trtid

const TRT_ID* InDet::TRT_SegmentsToTrack::m_trtid
private

Definition at line 104 of file TRT_SegmentsToTrack.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.


The documentation for this class was generated from the following files:
calibdata.scount
int scount
Definition: calibdata.py:355
python.PyKernel.retrieve
def retrieve(aClass, aKey=None)
Definition: PyKernel.py:110
InDet::TRT_SegmentsToTrack::m_nTracksFake
int m_nTracksFake
Counter for fake reconstructed Track.
Definition: TRT_SegmentsToTrack.h:110
InDet::TRT_SegmentsToTrack::getNumberReal
int getNumberReal(const InDet::TRT_DriftCircle *, const EventContext &ctx) const
Get the number of truth particles associated with this hit.
Definition: TRT_SegmentsToTrack.cxx:425
Trk::anyDirection
@ anyDirection
Definition: PropDirection.h:22
beamspotman.r
def r
Definition: beamspotman.py:676
Trk::LocalParameters
Definition: LocalParameters.h:98
Trk::py
@ py
Definition: ParamDefs.h:66
TileDCSDataPlotter.dp
dp
Definition: TileDCSDataPlotter.py:840
Trk::TrackStateOnSurface::Perigee
@ Perigee
This represents a perigee, and so will contain a Perigee object only.
Definition: TrackStateOnSurface.h:117
ATH_MSG_FATAL
#define ATH_MSG_FATAL(x)
Definition: AthMsgStreamMacros.h:34
DataModel_detail::const_iterator
Const iterator class for DataVector/DataList.
Definition: DVLIterator.h:82
checkFileSG.line
line
Definition: checkFileSG.py:75
Trk::Track::fitQuality
const FitQuality * fitQuality() const
return a pointer to the fit quality const-overload
InDet::TRT_DriftCircleOnTrack::prepRawData
virtual const TRT_DriftCircle * prepRawData() const override final
returns the PrepRawData - is a TRT_DriftCircle in this scope
Definition: TRT_DriftCircleOnTrack.h:202
Amg::VectorX
Eigen::Matrix< double, Eigen::Dynamic, 1 > VectorX
Dynamic Vector - dynamic allocation.
Definition: EventPrimitives.h:32
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
phi
Scalar phi() const
phi method
Definition: AmgMatrixBasePlugin.h:64
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition: AthMsgStreamMacros.h:31
CaloCellPos2Ntuple.int
int
Definition: CaloCellPos2Ntuple.py:24
InDet::TRT_SegmentsToTrack::m_assoTool
ToolHandle< Trk::IPRDtoTrackMapTool > m_assoTool
Definition: TRT_SegmentsToTrack.h:91
Trk::PerigeeSurface
Definition: PerigeeSurface.h:43
InDet::TRT_SegmentsToTrack::nHTHits
int nHTHits(const Trk::Track *track) const
Count number of TRT HT Hits on track.
Definition: TRT_SegmentsToTrack.cxx:483
Trk::ParametersBase::position
const Amg::Vector3D & position() const
Access method for the position.
InDet::TRT_SegmentsToTrack::m_MapReal
std::map< int, int > m_MapReal
Map of hits and real tracks.
Definition: TRT_SegmentsToTrack.h:115
SG::ReadHandle
Definition: StoreGate/StoreGate/ReadHandle.h:70
index
Definition: index.py:1
AthCommonDataStore< AthCommonMsg< Algorithm > >::declareProperty
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
Definition: AthCommonDataStore.h:145
Trk::Track::trackStateOnSurfaces
const Trk::TrackStates * trackStateOnSurfaces() const
return a pointer to a const DataVector of const TrackStateOnSurfaces.
Trk::ParametersT
Dummy class used to allow special convertors to be called for surfaces owned by a detector element.
Definition: EMErrorDetail.h:25
Trk::Track::info
const TrackInfo & info() const
Returns a const ref to info of a const tracks.
theta
Scalar theta() const
theta method
Definition: AmgMatrixBasePlugin.h:71
InDet::TRT_SegmentsToTrack::getRealFractionTRT
double getRealFractionTRT(const Trk::Track *track, const EventContext &ctx) const
Get the fraction of truth TRT hits on this Track.
Definition: TRT_SegmentsToTrack.cxx:444
DMTest::C
C_v1 C
Definition: C.h:26
plotBeamSpotVxVal.cov
cov
Definition: plotBeamSpotVxVal.py:201
M_PI
#define M_PI
Definition: ActiveFraction.h:11
ParticleGun_SamplingFraction.myMomentum
myMomentum
Definition: ParticleGun_SamplingFraction.py:64
InDet::TRT_DriftCircleOnTrack::associatedSurface
virtual const Trk::Surface & associatedSurface() const override final
returns the surface for the local to global transformation
Definition: TRT_DriftCircleOnTrack.cxx:154
AthCommonDataStore< AthCommonMsg< Algorithm > >::m_evtStore
StoreGateSvc_t m_evtStore
Pointer to StoreGate (event store by default)
Definition: AthCommonDataStore.h:390
Trk::Perigee
ParametersT< 5, Charged, PerigeeSurface > Perigee
Definition: Tracking/TrkEvent/TrkParameters/TrkParameters/TrackParameters.h:29
AthCommonDataStore< AthCommonMsg< Algorithm > >::m_vhka
std::vector< SG::VarHandleKeyArray * > m_vhka
Definition: AthCommonDataStore.h:398
InDet::TRT_SegmentsToTrack::m_outputTrackCollectionName
SG::WriteHandleKey< TrackCollection > m_outputTrackCollectionName
Name of the TrackCollection to write out.
Definition: TRT_SegmentsToTrack.h:80
Trk::RIO_OnTrack
Definition: RIO_OnTrack.h:70
InDet::TRT_DriftCircleOnTrack::highLevel
bool highLevel() const
returns true if the high level threshold was passed
Definition: TRT_DriftCircleOnTrack.h:234
InDet::TRT_SegmentsToTrack::m_trtid
const TRT_ID * m_trtid
Definition: TRT_SegmentsToTrack.h:104
Trk::locR
@ locR
Definition: ParamDefs.h:50
AtlasDetectorID::is_trt
bool is_trt(Identifier id) const
Definition: AtlasDetectorID.h:782
read_hist_ntuple.t
t
Definition: read_hist_ntuple.py:5
drawFromPickle.cos
cos
Definition: drawFromPickle.py:36
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
const
bool const RAWDATA *ch2 const
Definition: LArRodBlockPhysicsV0.cxx:562
SG::VarHandleKey::empty
bool empty() const
Test if the key is blank.
Definition: AthToolSupport/AsgDataHandles/Root/VarHandleKey.cxx:150
Trk::pz
@ pz
global momentum (cartesian)
Definition: ParamDefs.h:67
InDet::TRT_DriftCircleOnTrack
Definition: TRT_DriftCircleOnTrack.h:53
InDet::TRT_DriftCircle
Definition: TRT_DriftCircle.h:32
XMLtoHeader.count
count
Definition: XMLtoHeader.py:85
InDet::TRT_SegmentsToTrack::m_barrelSegments
SG::ReadHandleKey< Trk::SegmentCollection > m_barrelSegments
Name of Barrel segment collection.
Definition: TRT_SegmentsToTrack.h:124
AthenaPoolTestRead.sc
sc
Definition: AthenaPoolTestRead.py:27
Trk::DefinedParameter
std::pair< double, ParamDefs > DefinedParameter
Definition: DefinedParameter.h: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
DeMoUpdate.reverse
reverse
Definition: DeMoUpdate.py:563
SG::VarHandleKeyArray::setOwner
virtual void setOwner(IDataHandleHolder *o)=0
Trk::TrackStateOnSurface::Outlier
@ Outlier
This TSoS contains an outlier, that is, it contains a MeasurementBase/RIO_OnTrack which was not used ...
Definition: TrackStateOnSurface.h:122
InDet::TRT_SegmentsToTrack::m_materialEffects
bool m_materialEffects
Flag to switch on Material Effects in the Fitter.
Definition: TRT_SegmentsToTrack.h:118
Trk::PseudoMeasurementOnTrack
Class to handle pseudo-measurements in fitters and on track objects.
Definition: PseudoMeasurementOnTrack.h:44
InDet::TRT_SegmentsToTrack::m_multiTruthCollectionTRTName
SG::ReadHandleKey< PRD_MultiTruthCollection > m_multiTruthCollectionTRTName
Name of the TRT MultiTruthCollection.
Definition: TRT_SegmentsToTrack.h:107
InDet::TRT_SegmentsToTrack::m_noiseCut
double m_noiseCut
All tracks with a TRT Noise fraction larger than this variable will be thrown away.
Definition: TRT_SegmentsToTrack.h:99
InDet::TRT_SegmentsToTrack::m_endcapSegments
SG::ReadHandleKey< Trk::SegmentCollection > m_endcapSegments
Name of Endcap segment collection.
Definition: TRT_SegmentsToTrack.h:125
InDet::TRT_SegmentsToTrack::m_trackFitter
ToolHandle< Trk::ITrackFitter > m_trackFitter
The TrackFitter.
Definition: TRT_SegmentsToTrack.h:83
AthCommonDataStore
Definition: AthCommonDataStore.h:52
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::locZ
@ locZ
local cylindrical
Definition: ParamDefs.h:48
InDet::TRT_DriftCircle::isNoise
bool isNoise() const
returns true if the hit is caused by noise with a high probability.
AthCommonDataStore< AthCommonMsg< Algorithm > >::outputHandles
virtual std::vector< Gaudi::DataHandle * > outputHandles() const override
Return this algorithm's output handles.
lumiFormat.i
int i
Definition: lumiFormat.py:92
z
#define z
Identifier
Definition: DetectorDescription/Identifier/Identifier/Identifier.h:32
Trk::theta
@ theta
Definition: ParamDefs.h:72
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
InDet::TRT_SegmentsToTrack::m_extrapolator
ToolHandle< Trk::IExtrapolator > m_extrapolator
The Extrapolator.
Definition: TRT_SegmentsToTrack.h:86
Amg::Transform3D
Eigen::Affine3d Transform3D
Definition: GeoPrimitives.h:46
plotBeamSpotVxVal.range
range
Definition: plotBeamSpotVxVal.py:195
Trk::px
@ px
Definition: ParamDefs.h:65
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
CHECK
#define CHECK(...)
Evaluate an expression and check for errors.
Definition: Control/AthenaKernel/AthenaKernel/errorcheck.h:422
InDet::TRT_SegmentsToTrack::nTRTHits
int nTRTHits(const Trk::Track *track) const
Count number of TRT Hits on track.
Definition: TRT_SegmentsToTrack.cxx:512
AthCommonDataStore< AthCommonMsg< Algorithm > >::m_detStore
StoreGateSvc_t m_detStore
Pointer to StoreGate (detector store by default)
Definition: AthCommonDataStore.h:393
Trk::ParametersBase
Definition: ParametersBase.h:55
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::double
double
Definition: CompositeParticle_v1.cxx:159
DeMoUpdate.tmp
string tmp
Definition: DeMoUpdate.py:1167
Trk::muon
@ muon
Definition: ParticleHypothesis.h:28
InDet::TRT_SegmentsToTrack::m_idHelper
const AtlasDetectorID * m_idHelper
Definition: TRT_SegmentsToTrack.h:102
dot.dot
def dot(G, fn, nodesToHighlight=[])
Definition: dot.py:5
Trk::MeasurementBase::localCovariance
const Amg::MatrixX & localCovariance() const
Interface method to get the localError.
Definition: MeasurementBase.h:138
Trk::TrackStateOnSurface::BremPoint
@ BremPoint
This represents a brem point on the track, and so will contain TrackParameters and MaterialEffectsBas...
Definition: TrackStateOnSurface.h:109
SG::VarHandleKeyArray::renounce
virtual void renounce()=0
Trk::MeasurementSet
std::vector< const MeasurementBase * > MeasurementSet
vector of fittable measurements
Definition: FitterTypes.h:30
SG::HandleClassifier::type
std::conditional< std::is_base_of< SG::VarHandleKeyArray, T >::value, VarHandleKeyArrayType, type2 >::type type
Definition: HandleClassifier.h:54
InDet::TRT_SegmentsToTrack::m_combineSegments
bool m_combineSegments
Try to combine segments from Barrel and Endcap.
Definition: TRT_SegmentsToTrack.h:122
Trk::MeasurementBase
Definition: MeasurementBase.h:58
Trk::PrepRawData::identify
Identifier identify() const
return the identifier
Trk::SurfaceType::Perigee
@ Perigee
merge_scale_histograms.doc
string doc
Definition: merge_scale_histograms.py:9
Trk::TrackStateOnSurface
represents the track state (measurement, material, fit parameters and quality) at a surface.
Definition: TrackStateOnSurface.h:71
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:195
createCoolChannelIdFile.par
par
Definition: createCoolChannelIdFile.py:29
Trk::FitQuality::uniqueClone
std::unique_ptr< FitQuality > uniqueClone() const
NVI uniqueClone.
Trk::nonInteracting
@ nonInteracting
Definition: ParticleHypothesis.h:25
InDet::TRT_SegmentsToTrack::m_minTRTHits
int m_minTRTHits
All tracks with less Hits (after the track fit) will be thrown away.
Definition: TRT_SegmentsToTrack.h:100
Trk::MeasurementBase::globalPosition
virtual const Amg::Vector3D & globalPosition() const =0
Interface method to get the global Position.
InDet::TRT_SegmentsToTrack::getNoiseProbability
double getNoiseProbability(const Trk::Track *track) const
Get the fraction of noise TRT hits on this Track.
Definition: TRT_SegmentsToTrack.cxx:534
Amg::Vector3D
Eigen::Matrix< double, 3, 1 > Vector3D
Definition: GeoPrimitives.h:47
InDet::TRT_SegmentsToTrack::m_noiseratio
double m_noiseratio
average percentage of noise in real tracks
Definition: TRT_SegmentsToTrack.h:112
Trk::MeasurementBase::localParameters
const LocalParameters & localParameters() const
Interface method to get the LocalParameters.
Definition: MeasurementBase.h:132
InDet::TRT_SegmentsToTrack::m_events
std::atomic< int > m_events
Event counter.
Definition: TRT_SegmentsToTrack.h:114
DataVector::end
const_iterator end() const noexcept
Return a const_iterator pointing past the end of the collection.
InDet::TRT_SegmentsToTrack::m_n_combined_fit
std::atomic< int > m_n_combined_fit
Definition: TRT_SegmentsToTrack.h:129
SG::WriteHandle
Definition: StoreGate/StoreGate/WriteHandle.h:76
Trk::ParametersBase::momentum
const Amg::Vector3D & momentum() const
Access method for the momentum.
AthAlgorithm::m_extendedExtraObjects
DataObjIDColl m_extendedExtraObjects
Definition: AthAlgorithm.h:79
DeMoScan.index
string index
Definition: DeMoScan.py:362
InDet::TRT_SegmentsToTrack::m_trkSummaryTool
ToolHandle< Trk::IExtendedTrackSummaryTool > m_trkSummaryTool
Definition: TRT_SegmentsToTrack.h:89
a
TList * a
Definition: liststreamerinfos.cxx:10
h
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition: AthMsgStreamMacros.h:32
Amg::Translation3D
Eigen::Translation< double, 3 > Translation3D
Definition: GeoPrimitives.h:44
Trk::qOverP
@ qOverP
perigee
Definition: ParamDefs.h:73
Trk::RIO_OnTrack::identify
virtual Identifier identify() const final
return the identifier -extends MeasurementBase
Definition: RIO_OnTrack.h:155
Trk::TrackStateOnSurface::Scatterer
@ Scatterer
This represents a scattering point on the track, and so will contain TrackParameters and MaterialEffe...
Definition: TrackStateOnSurface.h:113
SG::VarHandleBase::vhKey
SG::VarHandleKey & vhKey()
Return a non-const reference to the HandleKey.
Definition: StoreGate/src/VarHandleBase.cxx:616
InDet::TRT_SegmentsToTrack::m_inputAssoMapName
SG::ReadHandleKey< Trk::PRDtoTrackMap > m_inputAssoMapName
key to be set to optionally store PRD to track association map
Definition: TRT_SegmentsToTrack.h:96
declareProperty
#define declareProperty(n, p, h)
Definition: BaseFakeBkgTool.cxx:15
Trk::MeasurementBaseType::PseudoMeasurementOnTrack
@ PseudoMeasurementOnTrack
Definition: MeasurementBase.h:51
Trk::FitQuality::chiSquared
double chiSquared() const
returns the of the overall track fit
Definition: FitQuality.h:56
InDet::TRT_SegmentsToTrack::combineSegments
void combineSegments(const EventContext &ctx) const
Definition: TRT_SegmentsToTrack.cxx:573
AthAlgorithm::AthAlgorithm
AthAlgorithm()
Default constructor:
Trk::phi
@ phi
Definition: ParamDefs.h:81
python.Bindings.keys
keys
Definition: Control/AthenaPython/python/Bindings.py:790
Trk::FitQuality::numberDoF
int numberDoF() const
returns the number of degrees of freedom of the overall track or vertex fit as integer
Definition: FitQuality.h:60
xAOD::track
@ track
Definition: TrackingPrimitives.h:512
LHEF::Writer
Pythia8::Writer Writer
Definition: Prophecy4fMerger.cxx:12
drawFromPickle.sin
sin
Definition: drawFromPickle.py:36
InDet::TRT_SegmentsToTrack::m_BECCollectionName
SG::WriteHandleKey< TrackCollection > m_BECCollectionName
Name of the combined (TRT Barrel+EC) TrackCollection to write out.
Definition: TRT_SegmentsToTrack.h:127
InDet::TRT_SegmentsToTrack::m_MapFake
std::map< int, int > m_MapFake
Map of hits and fake tracks.
Definition: TRT_SegmentsToTrack.h:116
InDet::TRT_SegmentsToTrack::m_assoMapName
SG::WriteHandleKey< Trk::PRDtoTrackMap > m_assoMapName
key for the PRDtoTrackMap to filled by the ambiguity score processor.
Definition: TRT_SegmentsToTrack.h:94
InDet::TRT_SegmentsToTrack::m_inputSegmentCollectionName
SG::ReadHandleKey< Trk::SegmentCollection > m_inputSegmentCollectionName
Name of the TrackSegment Collection to read in.
Definition: TRT_SegmentsToTrack.h:78
Amg::distance
float distance(const Amg::Vector3D &p1, const Amg::Vector3D &p2)
calculates the distance between two point in 3D space
Definition: GeoPrimitivesHelpers.h:54
AthCommonDataStore::declareGaudiProperty
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>
Definition: AthCommonDataStore.h:156
Trk::TrackStateOnSurface::Measurement
@ Measurement
This is a measurement, and will at least contain a Trk::MeasurementBase.
Definition: TrackStateOnSurface.h:101
TSU::T
unsigned long long T
Definition: L1TopoDataTypes.h:35
Trk::StraightLineSurface
Definition: StraightLineSurface.h:51
DataVector::begin
const_iterator begin() const noexcept
Return a const_iterator pointing at the beginning of the collection.
fitman.k
k
Definition: fitman.py:528
ServiceHandle< ICondSvc >
InDet::TRT_SegmentsToTrack::m_outlierRemoval
bool m_outlierRemoval
Flag to switch on the outlier removal in the track fitter.
Definition: TRT_SegmentsToTrack.h:119
InDet::TRT_SegmentsToTrack::m_nTracksReal
int m_nTracksReal
Counter for real reconstructed Tracks.
Definition: TRT_SegmentsToTrack.h:109
Trk::AtaStraightLine
ParametersT< 5, Charged, StraightLineSurface > AtaStraightLine
Definition: Tracking/TrkEvent/TrkParameters/TrkParameters/TrackParameters.h:31