ATLAS Offline Software
Loading...
Searching...
No Matches
PixelIDLayerComp.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
3*/
4
5#include "Identifier/Identifier.h"
7
8namespace InDet {
9
10
12 public:
14 PixelIDLayerComp(const PixelID* pixelId) : m_pixelId(pixelId) {}
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 }
52
53 void SetPixelIDSvc(PixelID* pixelId) { m_pixelId = pixelId; }
54 private:
56 };
57
58}
HWIdentifier id2
This is an Identifier helper class for the Pixel subdetector.
PixelIDLayerComp(const PixelID *pixelId)
void SetPixelIDSvc(PixelID *pixelId)
bool operator()(Identifier id1, Identifier id2) const
This is an Identifier helper class for the Pixel subdetector.
Definition PixelID.h:67
Primary Vertex Finder.