ATLAS Offline Software
TRT_StrawNeighbourSvc.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #ifndef TRT_STRAWNEIGHBOURSVC_H
6 #define TRT_STRAWNEIGHBOURSVC_H
7 
16 #include "GaudiKernel/ServiceHandle.h"
17 #include <string>
18 
19 class TRT_ID;
20 class StoreGateSvc;
21 
22 class TRT_StrawNeighbourSvc: public extends<AthService, ITRT_StrawNeighbourSvc>
23 {
24  public:
26  TRT_StrawNeighbourSvc( const std::string& name, ISvcLocator* pSvcLocator );
27 
30 
32  virtual StatusCode initialize();
33 
35  virtual StatusCode finalize();
36 
38  void getPad(Identifier offlineID, int& pad);
39 
40  void getChip(Identifier offlineID, int& chip ) ;
41 
42  void getPin(Identifier offlineID, int& pin ) ; // Only for barrel
43 
44  void getSocket(Identifier offlineID, int& socket ) ;
45 
46  //Disclaimers: getStrawFrom*** functions tested thouroughly for barrel only
47  // : getStrawsFromPad works only for barrel
48 
49  void getStrawsFromPad(Identifier offlineID, std::vector<Identifier>& neighbourIDs);
50  void getStrawsFromChip(Identifier offlineID, std::vector<Identifier>& neighbourIDs);
51 
53 
54  int getRing( const Identifier &id );
55 
56  static int chipToBoardEndCap(int chip);
57 
58  int strawNumber( Identifier id);
60 
61  int getRunningNumbering(Identifier offlineID);
62  void getAtlasIdentifier(int strawnumber, Identifier &outputID, Identifier inputID);
63  // chip to board conversion. Works for barrel only!
64  int chipToBoardBarrel(int chip, int layer) ;
65 
66 
67  private:
69  const TRT_ID* m_trtid;
70 
71  int m_numberOfStraws[75]{};
72  int m_TripletOrientation[2][32]{};
73 
74  std::vector<unsigned int> m_layer_m1;
75  std::vector<unsigned int> m_layer_m1_acc;
76  std::vector<unsigned int> m_layer_m2;
77  std::vector<unsigned int> m_layer_m2_acc;
78  std::vector<unsigned int> m_layer_m3;
79  std::vector<unsigned int> m_layer_m3_acc;
80 
81  std::vector<unsigned int> m_m1;
82  std::vector<unsigned int> m_m2;
83  std::vector<unsigned int> m_m3;
84 
85  std::vector<std::vector<std::vector<int> > > m_pad_to_straw;
86 
87  std::vector<std::vector<std::vector<int> > > m_chip_to_straw;
88 
89  std::vector<double> m_chip_vector1;
90  std::vector<double> m_chip_vector2;
91  std::vector<double> m_chip_vector3;
92 
99 
100  int m_endcapChipMapA0[12]{}; // endcap chip number maps
101  int m_endcapChipMapA8[12]{};
102  int m_endcapChipMapC0[12]{};
103  int m_endcapChipMapC8[12]{};
104 };
105 
106 
107 inline int sign(int a) { return (a == 0) ? 0 : (a<0 ? -1 : 1); }
108 
109 inline int getModuleType( int strawnumber ) {
110  int mod = -1;
111  if ((strawnumber%1642)<=329) mod =1;
112  else if ((strawnumber%1642)<=(329+520)) mod =2;
113  else if ((strawnumber%1642)<=(329+520+793)) mod =3;
114  return mod;
115 }
116 
117 #endif
TRT_StrawNeighbourSvc::initialize
virtual StatusCode initialize()
tool initialize
Definition: TRT_StrawNeighbourSvc.cxx:56
TRT_StrawNeighbourSvc::m_endcapChipMapC0
int m_endcapChipMapC0[12]
Definition: TRT_StrawNeighbourSvc.h:102
TRT_StrawNeighbourSvc::m_layer_m2
std::vector< unsigned int > m_layer_m2
Definition: TRT_StrawNeighbourSvc.h:76
TRT_StrawNeighbourSvc::strawNumber
int strawNumber(Identifier id)
Definition: TRT_StrawNeighbourSvc.cxx:847
TRT_StrawNeighbourSvc::m_layer_m3_acc
std::vector< unsigned int > m_layer_m3_acc
Definition: TRT_StrawNeighbourSvc.h:79
TRT_StrawNeighbourSvc::m_chipConversionChipToSocket_m1
int m_chipConversionChipToSocket_m1[22]
Definition: TRT_StrawNeighbourSvc.h:94
TRT_StrawNeighbourSvc::strawLayerNumber
int strawLayerNumber(Identifier id)
Definition: TRT_StrawNeighbourSvc.cxx:955
TRT_StrawNeighbourSvc::getChip
void getChip(Identifier offlineID, int &chip)
Definition: TRT_StrawNeighbourSvc.cxx:436
TRT_StrawNeighbourSvc::m_endcapChipMapA0
int m_endcapChipMapA0[12]
Definition: TRT_StrawNeighbourSvc.h:100
TRT_StrawNeighbourSvc::m_numberOfStraws
int m_numberOfStraws[75]
Definition: TRT_StrawNeighbourSvc.h:71
TRT_StrawNeighbourSvc::getPin
void getPin(Identifier offlineID, int &pin)
Definition: TRT_StrawNeighbourSvc.cxx:555
TRT_StrawNeighbourSvc::m_chipConversionChipToSocket_m2
int m_chipConversionChipToSocket_m2[34]
Definition: TRT_StrawNeighbourSvc.h:96
TRT_StrawNeighbourSvc::m_chip_vector2
std::vector< double > m_chip_vector2
Definition: TRT_StrawNeighbourSvc.h:90
TRT_StrawNeighbourSvc::getSocket
void getSocket(Identifier offlineID, int &socket)
Definition: TRT_StrawNeighbourSvc.cxx:414
getModuleType
int getModuleType(int strawnumber)
Definition: TRT_StrawNeighbourSvc.h:109
TRT_StrawNeighbourSvc::m_m3
std::vector< unsigned int > m_m3
Definition: TRT_StrawNeighbourSvc.h:83
TRT_StrawNeighbourSvc::m_pad_to_straw
std::vector< std::vector< std::vector< int > > > m_pad_to_straw
Definition: TRT_StrawNeighbourSvc.h:85
TRT_StrawNeighbourSvc::m_chip_to_straw
std::vector< std::vector< std::vector< int > > > m_chip_to_straw
Definition: TRT_StrawNeighbourSvc.h:87
TRT_StrawNeighbourSvc::getPad
void getPad(Identifier offlineID, int &pad)
public methods
Definition: TRT_StrawNeighbourSvc.cxx:587
TRT_StrawNeighbourSvc::getStrawsFromPad
void getStrawsFromPad(Identifier offlineID, std::vector< Identifier > &neighbourIDs)
Definition: TRT_StrawNeighbourSvc.cxx:629
TRT_StrawNeighbourSvc::~TRT_StrawNeighbourSvc
virtual ~TRT_StrawNeighbourSvc()
destructor
TRT_StrawNeighbourSvc::m_chipConversionSocketToChip_m3
int m_chipConversionSocketToChip_m3[51]
Definition: TRT_StrawNeighbourSvc.h:97
TRT_StrawNeighbourSvc::getFirstStrawFromChip
TRTCond::ExpandedIdentifier getFirstStrawFromChip(Identifier offlineID)
Definition: TRT_StrawNeighbourSvc.cxx:740
TRT_StrawNeighbourSvc::TRT_StrawNeighbourSvc
TRT_StrawNeighbourSvc(const std::string &name, ISvcLocator *pSvcLocator)
constructor
Definition: TRT_StrawNeighbourSvc.cxx:42
TRT_StrawNeighbourSvc::m_endcapChipMapC8
int m_endcapChipMapC8[12]
Definition: TRT_StrawNeighbourSvc.h:103
TRT_StrawNeighbourSvc::m_endcapChipMapA8
int m_endcapChipMapA8[12]
Definition: TRT_StrawNeighbourSvc.h:101
TRT_StrawNeighbourSvc::finalize
virtual StatusCode finalize()
tool finalize
Definition: TRT_StrawNeighbourSvc.cxx:330
TRT_StrawNeighbourSvc::m_chipConversionChipToSocket_m3
int m_chipConversionChipToSocket_m3[51]
Definition: TRT_StrawNeighbourSvc.h:98
StoreGateSvc
The Athena Transient Store API.
Definition: StoreGateSvc.h:125
maskDeadModules.mod
mod
Definition: maskDeadModules.py:36
TRT_StrawNeighbourSvc::getStrawsFromChip
void getStrawsFromChip(Identifier offlineID, std::vector< Identifier > &neighbourIDs)
Definition: TRT_StrawNeighbourSvc.cxx:672
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
TRT::Hit::layer
@ layer
Definition: HitInfo.h:79
TRT_StrawNeighbourSvc::m_trtid
const TRT_ID * m_trtid
Definition: TRT_StrawNeighbourSvc.h:69
TRT_StrawNeighbourSvc::m_detStore
ServiceHandle< StoreGateSvc > m_detStore
Definition: TRT_StrawNeighbourSvc.h:68
sign
int sign(int a)
Definition: TRT_StrawNeighbourSvc.h:107
TRT_StrawNeighbourSvc::getRunningNumbering
int getRunningNumbering(Identifier offlineID)
Definition: TRT_StrawNeighbourSvc.cxx:384
TRT_StrawNeighbourSvc::chipToBoardEndCap
static int chipToBoardEndCap(int chip)
Definition: TRT_StrawNeighbourSvc.cxx:836
TRT_StrawNeighbourSvc::m_layer_m2_acc
std::vector< unsigned int > m_layer_m2_acc
Definition: TRT_StrawNeighbourSvc.h:77
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:228
TRT_StrawNeighbourSvc::m_layer_m3
std::vector< unsigned int > m_layer_m3
Definition: TRT_StrawNeighbourSvc.h:78
TRT_StrawNeighbourSvc::m_chip_vector3
std::vector< double > m_chip_vector3
Definition: TRT_StrawNeighbourSvc.h:91
TRT_StrawNeighbourSvc::m_m1
std::vector< unsigned int > m_m1
Definition: TRT_StrawNeighbourSvc.h:81
ITRT_StrawNeighbourSvc.h
Abstract interface to information on straws electronic grouping.
TRT_StrawNeighbourSvc::m_layer_m1_acc
std::vector< unsigned int > m_layer_m1_acc
Definition: TRT_StrawNeighbourSvc.h:75
TRT_StrawNeighbourSvc::getAtlasIdentifier
void getAtlasIdentifier(int strawnumber, Identifier &outputID, Identifier inputID)
Definition: TRT_StrawNeighbourSvc.cxx:340
TRT_StrawNeighbourSvc::m_chipConversionSocketToChip_m1
int m_chipConversionSocketToChip_m1[22]
Definition: TRT_StrawNeighbourSvc.h:93
TRT_ID
Definition: TRT_ID.h:84
a
TList * a
Definition: liststreamerinfos.cxx:10
TRT_StrawNeighbourSvc::m_TripletOrientation
int m_TripletOrientation[2][32]
Definition: TRT_StrawNeighbourSvc.h:72
TRT_StrawNeighbourSvc::m_chip_vector1
std::vector< double > m_chip_vector1
Definition: TRT_StrawNeighbourSvc.h:89
TRT_StrawNeighbourSvc::chipToBoardBarrel
int chipToBoardBarrel(int chip, int layer)
Definition: TRT_StrawNeighbourSvc.cxx:780
TRT_StrawNeighbourSvc::m_m2
std::vector< unsigned int > m_m2
Definition: TRT_StrawNeighbourSvc.h:82
AthService.h
TRTCond::ExpandedIdentifier
Identifier for TRT detector elements in the conditions code.
Definition: InnerDetector/InDetConditions/TRT_ConditionsData/TRT_ConditionsData/ExpandedIdentifier.h:30
TRT_StrawNeighbourSvc
Definition: TRT_StrawNeighbourSvc.h:23
TRT_StrawNeighbourSvc::getRing
int getRing(const Identifier &id)
Definition: TRT_StrawNeighbourSvc.cxx:819
TRT_StrawNeighbourSvc::m_layer_m1
std::vector< unsigned int > m_layer_m1
Definition: TRT_StrawNeighbourSvc.h:74
TRT_StrawNeighbourSvc::m_chipConversionSocketToChip_m2
int m_chipConversionSocketToChip_m2[34]
Definition: TRT_StrawNeighbourSvc.h:95
ServiceHandle< StoreGateSvc >
Identifier
Definition: IdentifierFieldParser.cxx:14