ATLAS Offline Software
Loading...
Searching...
No Matches
mysort Class Reference
Collaboration diagram for mysort:

Public Member Functions

bool operator() (const Trk::PrepRawData *prd1, const Trk::PrepRawData *prd2)

Detailed Description

Definition at line 27 of file PRD_TruthTrajectorySorterID.cxx.

Member Function Documentation

◆ operator()()

bool mysort::operator() ( const Trk::PrepRawData * prd1,
const Trk::PrepRawData * prd2 )
inline

Definition at line 29 of file PRD_TruthTrajectorySorterID.cxx.

29 {
30 const InDet::PixelCluster* pixclus1=dynamic_cast<const InDet::PixelCluster*>(prd1);
31 const InDet::PixelCluster* pixclus2=dynamic_cast<const InDet::PixelCluster*>(prd2);
32 const InDet::SCT_Cluster* sctclus1=dynamic_cast<const InDet::SCT_Cluster*>(prd1);
33 const InDet::SCT_Cluster* sctclus2=dynamic_cast<const InDet::SCT_Cluster*>(prd2);
34 const InDet::TRT_DriftCircle* trtclus1=dynamic_cast<const InDet::TRT_DriftCircle*>(prd1);
35 const InDet::TRT_DriftCircle* trtclus2=dynamic_cast<const InDet::TRT_DriftCircle*>(prd2);
36 if (pixclus1 && !pixclus2) return true;
37 else if (pixclus2 && !pixclus1) return false;
38 else if (sctclus1 && trtclus2) return true;
39 else if (sctclus2 && trtclus1) return false;
40 else if (pixclus1){
41 if (pixclus1->detectorElement()->isBarrel() && pixclus2->detectorElement()->isEndcap()) return true;
42 else if (pixclus1->detectorElement()->isEndcap() && pixclus2->detectorElement()->isBarrel()) return false;
43 else if (pixclus1->detectorElement()->isBarrel()) return (pixclus1->globalPosition().perp()<pixclus2->globalPosition().perp());
44 else return (std::abs(pixclus1->globalPosition().z())<std::abs(pixclus2->globalPosition().z()));
45 }
46 else if (sctclus1){
47 if (sctclus1->detectorElement()->isBarrel() && sctclus2->detectorElement()->isEndcap()) return true;
48 else if (sctclus1->detectorElement()->isEndcap() && sctclus2->detectorElement()->isBarrel()) return false;
49 else if (sctclus1->detectorElement()->isBarrel()) return (sctclus1->globalPosition().perp()<sctclus2->globalPosition().perp());
50 else return (std::abs(sctclus1->globalPosition().z())<std::abs(sctclus2->globalPosition().z()));
51
52 }
53 else if (trtclus1){
55 else if (trtclus1->detectorElement()->type()==InDetDD::TRT_BaseElement::ENDCAP && trtclus2->detectorElement()->type()==InDetDD::TRT_BaseElement::BARREL) return false;
56 Amg::Vector3D pos1=trtclus1->detectorElement()->center(trtclus1->identify());
57 Amg::Vector3D pos2=trtclus2->detectorElement()->center(trtclus2->identify());
58 if (trtclus1->detectorElement()->type()==InDetDD::TRT_BaseElement::BARREL) return (pos1.perp()<pos2.perp());
59 else return (std::abs(pos1.z())<std::abs(pos2.z()));
60 }
61 return true;
62}
virtual TRT_BaseElement::Type type() const =0
Type information: returns BARREL or ENDCAP.
virtual const Amg::Vector3D & center() const override final
Element Surface: center of a straw layer.
const Amg::Vector3D & globalPosition() const
return global position reference
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...
virtual const InDetDD::TRT_BaseElement * detectorElement() const override final
return the detector element corresponding to this PRD
Identifier identify() const
return the identifier
Eigen::Matrix< double, 3, 1 > Vector3D

The documentation for this class was generated from the following file: