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

#include <PixelIDLayerComp.h>

Collaboration diagram for InDet::PixelIDLayerComp:

Public Member Functions

 PixelIDLayerComp ()
 
 PixelIDLayerComp (const PixelID *pixelId)
 
bool operator() (Identifier id1, Identifier id2) const
 
void SetPixelIDSvc (PixelID *pixelId)
 

Private Attributes

const PixelIDm_pixelId
 

Detailed Description

Definition at line 11 of file PixelIDLayerComp.h.

Constructor & Destructor Documentation

◆ PixelIDLayerComp() [1/2]

InDet::PixelIDLayerComp::PixelIDLayerComp ( )
inline

Definition at line 13 of file PixelIDLayerComp.h.

13 : m_pixelId(0) {}

◆ PixelIDLayerComp() [2/2]

InDet::PixelIDLayerComp::PixelIDLayerComp ( const PixelID pixelId)
inline

Definition at line 14 of file PixelIDLayerComp.h.

14 : m_pixelId(pixelId) {}

Member Function Documentation

◆ operator()()

bool InDet::PixelIDLayerComp::operator() ( Identifier  id1,
Identifier  id2 
) const
inline

Definition at line 15 of file PixelIDLayerComp.h.

15  {
16 
17  bool id1_is_pixel = m_pixelId->is_pixel(id1);
18  bool id2_is_pixel = m_pixelId->is_pixel(id2);
19  if(!id1_is_pixel && id2_is_pixel) return false;
20  if(id1_is_pixel && !id2_is_pixel) return true;
21 
22  // FIX ME:
23  // this situation isn't well defined, unfortunately.
24  // But in principle we should never be in this situation, right?
25  if(!id1_is_pixel && !id2_is_pixel){
26  // ATH_MSG_WARNING("Passed a non-pixel ID into the pixel ID map!");
27  return false;
28  }
29 
30  if(!m_pixelId->is_pixel(id1) || !m_pixelId->is_pixel(id2))
31  return (&id1 < &id2);
32 
33  bool id1_is_barrel = m_pixelId->is_barrel(id1);
34  bool id2_is_barrel = m_pixelId->is_barrel(id2);
35  if((id1_is_barrel && id2_is_barrel) ||
36  (!id1_is_barrel && !id2_is_barrel)){
37  // they're both in the barrel or both in the endcap,
38  // so check the layer
39  return (m_pixelId->layer_disk(id1) < m_pixelId->layer_disk(id2));
40  }
41 
42  // one is in the barrel and one is in the endcap
43  if(!id1_is_barrel && id2_is_barrel){
44  return false;
45  }
46 
47  //remaining possibility is if(id1_is_barrel && !id2_is_barrel), remove 'if' statement to make coverity happy, otherwise complains about logically dead code
48  return true;
49 
50 
51  }

◆ SetPixelIDSvc()

void InDet::PixelIDLayerComp::SetPixelIDSvc ( PixelID pixelId)
inline

Definition at line 53 of file PixelIDLayerComp.h.

53 { m_pixelId = pixelId; }

Member Data Documentation

◆ m_pixelId

const PixelID* InDet::PixelIDLayerComp::m_pixelId
private

Definition at line 55 of file PixelIDLayerComp.h.


The documentation for this class was generated from the following file:
AtlasDetectorID::is_pixel
bool is_pixel(Identifier id) const
Definition: AtlasDetectorID.h:760
PixelID::is_barrel
bool is_barrel(const Identifier &id) const
Test for barrel - WARNING: id MUST be pixel id, otherwise answer is not accurate. Use SiliconID for g...
Definition: PixelID.h:605
id2
HWIdentifier id2
Definition: LArRodBlockPhysicsV0.cxx:564
InDet::PixelIDLayerComp::m_pixelId
const PixelID * m_pixelId
Definition: PixelIDLayerComp.h:55
PixelID::layer_disk
int layer_disk(const Identifier &id) const
Definition: PixelID.h:626