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 29 of file PRD_TruthTrajectorySorterID.cxx.

Member Function Documentation

◆ operator()()

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

Definition at line 31 of file PRD_TruthTrajectorySorterID.cxx.

31 {
32 PrepRawDataType t1 = prd1->prdType();
33 PrepRawDataType t2 = prd2->prdType();
34 //Pixels come before anything else
36 if (t1 != PrepRawDataType::PixelCluster && t2 == PrepRawDataType::PixelCluster) return false;
37 //
38 //they are both pixels
40 const InDet::PixelCluster* pixclus1=static_cast<const InDet::PixelCluster*>(prd1);
41 const InDet::PixelCluster* pixclus2=static_cast<const InDet::PixelCluster*>(prd2);
42 //barrel comes first, before endcap
43 if (pixclus1->detectorElement()->isBarrel() && pixclus2->detectorElement()->isEndcap()) return true;
44 if (pixclus1->detectorElement()->isEndcap() && pixclus2->detectorElement()->isBarrel()) return false;
45 if (pixclus1->detectorElement()->isBarrel()) return (pixclus1->globalPosition().perp()<pixclus2->globalPosition().perp());
46 return (std::abs(pixclus1->globalPosition().z())<std::abs(pixclus2->globalPosition().z()));
47 }
48 //SCT comes before TRT
51 //
52 //they are both SCT_Cluster
54 const InDet::SCT_Cluster* sctclus1=static_cast<const InDet::SCT_Cluster*>(prd1);
55 const InDet::SCT_Cluster* sctclus2=static_cast<const InDet::SCT_Cluster*>(prd2);
56 if (sctclus1->detectorElement()->isBarrel() && sctclus2->detectorElement()->isEndcap()) return true;
57 if (sctclus1->detectorElement()->isEndcap() && sctclus2->detectorElement()->isBarrel()) return false;
58 if (sctclus1->detectorElement()->isBarrel()) return (sctclus1->globalPosition().perp()<sctclus2->globalPosition().perp());
59 return (std::abs(sctclus1->globalPosition().z())<std::abs(sctclus2->globalPosition().z()));
60 }
61 //only case left: they are both TRT
63 const InDet::TRT_DriftCircle* trtclus1=static_cast<const InDet::TRT_DriftCircle*>(prd1);
64 const InDet::TRT_DriftCircle* trtclus2=static_cast<const InDet::TRT_DriftCircle*>(prd2);
67 Amg::Vector3D pos1=trtclus1->detectorElement()->center(trtclus1->identify());
68 Amg::Vector3D pos2=trtclus2->detectorElement()->center(trtclus2->identify());
69 if (trtclus1->detectorElement()->type()==InDetDD::TRT_BaseElement::BARREL) return (pos1.perp()<pos2.perp());
70 else return (std::abs(pos1.z())<std::abs(pos2.z()));
71 }
72 //when all else fails
73 return true;
74 }
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
virtual PrepRawDataType prdType() const =0
Interface method returning the prdType.
std::vector< ALFA_RawDataContainer_p1 > t2
std::vector< ALFA_RawDataCollection_p1 > t1
Eigen::Matrix< double, 3, 1 > Vector3D
PrepRawDataType
Definition PrepRawData.h:39

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