ATLAS Offline Software
TRT_StrawNeighbourSvc.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2025 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 #include <vector>
19 
20 class TRT_ID;
21 class StoreGateSvc;
22 
23 class TRT_StrawNeighbourSvc: public extends<AthService, ITRT_StrawNeighbourSvc>
24 {
25  public:
27  TRT_StrawNeighbourSvc( const std::string& name, ISvcLocator* pSvcLocator );
28 
31 
33  virtual StatusCode initialize();
34 
36  virtual StatusCode finalize();
37 
39  void getPad(Identifier offlineID, int& pad);
40 
41  void getChip(Identifier offlineID, int& chip ) ;
42 
43  void getPin(Identifier offlineID, int& pin ) ; // Only for barrel
44 
45  void getSocket(Identifier offlineID, int& socket ) ;
46 
47  //Disclaimers: getStrawFrom*** functions tested thouroughly for barrel only
48  // : getStrawsFromPad works only for barrel
49 
50  void getStrawsFromPad(Identifier offlineID, std::vector<Identifier>& neighbourIDs);
51  void getStrawsFromChip(Identifier offlineID, std::vector<Identifier>& neighbourIDs);
52 
54 
55  int getRing( const Identifier &id );
56 
57  static int chipToBoardEndCap(int chip);
58 
59  int strawNumber( Identifier id);
61 
62  int getRunningNumbering(Identifier offlineID);
63  void getAtlasIdentifier(int strawnumber, Identifier &outputID, Identifier inputID);
64  // chip to board conversion. Works for barrel only!
65  int chipToBoardBarrel(int chip, int layer) ;
66 
67 
68  private:
70  const TRT_ID* m_trtid;
71 
72  int m_numberOfStraws[75]{};
73  int m_TripletOrientation[2][32]{};
74 
75  std::vector<unsigned int> m_layer_m1;
76  std::vector<unsigned int> m_layer_m1_acc;
77  std::vector<unsigned int> m_layer_m2;
78  std::vector<unsigned int> m_layer_m2_acc;
79  std::vector<unsigned int> m_layer_m3;
80  std::vector<unsigned int> m_layer_m3_acc;
81 
82  std::vector<unsigned int> m_m1;
83  std::vector<unsigned int> m_m2;
84  std::vector<unsigned int> m_m3;
85 
86  std::vector<std::vector<std::vector<int> > > m_pad_to_straw;
87 
88  std::vector<std::vector<std::vector<int> > > m_chip_to_straw;
89 
90  std::vector<double> m_chip_vector1;
91  std::vector<double> m_chip_vector2;
92  std::vector<double> m_chip_vector3;
93 
100 
101  int m_endcapChipMapA0[12]{}; // endcap chip number maps
102  int m_endcapChipMapA8[12]{};
103  int m_endcapChipMapC0[12]{};
104  int m_endcapChipMapC8[12]{};
105 };
106 
107 
108 inline int sign(int a) { return (a == 0) ? 0 : (a<0 ? -1 : 1); }
109 
110 inline int getModuleType( int strawnumber ) {
111  int mod = -1;
112  if ((strawnumber%1642)<=329) mod =1;
113  else if ((strawnumber%1642)<=(329+520)) mod =2;
114  else if ((strawnumber%1642)<=(329+520+793)) mod =3;
115  return mod;
116 }
117 
118 #endif
TRT_StrawNeighbourSvc::initialize
virtual StatusCode initialize()
tool initialize
Definition: TRT_StrawNeighbourSvc.cxx:58
TRT_StrawNeighbourSvc::m_endcapChipMapC0
int m_endcapChipMapC0[12]
Definition: TRT_StrawNeighbourSvc.h:103
TRT_StrawNeighbourSvc::m_layer_m2
std::vector< unsigned int > m_layer_m2
Definition: TRT_StrawNeighbourSvc.h:77
TRT_StrawNeighbourSvc::strawNumber
int strawNumber(Identifier id)
Definition: TRT_StrawNeighbourSvc.cxx:849
TRT_StrawNeighbourSvc::m_layer_m3_acc
std::vector< unsigned int > m_layer_m3_acc
Definition: TRT_StrawNeighbourSvc.h:80
TRT_StrawNeighbourSvc::m_chipConversionChipToSocket_m1
int m_chipConversionChipToSocket_m1[22]
Definition: TRT_StrawNeighbourSvc.h:95
TRT_StrawNeighbourSvc::strawLayerNumber
int strawLayerNumber(Identifier id)
Definition: TRT_StrawNeighbourSvc.cxx:957
TRT_StrawNeighbourSvc::getChip
void getChip(Identifier offlineID, int &chip)
Definition: TRT_StrawNeighbourSvc.cxx:438
TRT_StrawNeighbourSvc::m_endcapChipMapA0
int m_endcapChipMapA0[12]
Definition: TRT_StrawNeighbourSvc.h:101
TRT_StrawNeighbourSvc::m_numberOfStraws
int m_numberOfStraws[75]
Definition: TRT_StrawNeighbourSvc.h:72
TRT_StrawNeighbourSvc::getPin
void getPin(Identifier offlineID, int &pin)
Definition: TRT_StrawNeighbourSvc.cxx:557
TRT_StrawNeighbourSvc::m_chipConversionChipToSocket_m2
int m_chipConversionChipToSocket_m2[34]
Definition: TRT_StrawNeighbourSvc.h:97
TRT_StrawNeighbourSvc::m_chip_vector2
std::vector< double > m_chip_vector2
Definition: TRT_StrawNeighbourSvc.h:91
TRT_StrawNeighbourSvc::getSocket
void getSocket(Identifier offlineID, int &socket)
Definition: TRT_StrawNeighbourSvc.cxx:416
getModuleType
int getModuleType(int strawnumber)
Definition: TRT_StrawNeighbourSvc.h:110
TRT_StrawNeighbourSvc::m_m3
std::vector< unsigned int > m_m3
Definition: TRT_StrawNeighbourSvc.h:84
TRT_StrawNeighbourSvc::m_pad_to_straw
std::vector< std::vector< std::vector< int > > > m_pad_to_straw
Definition: TRT_StrawNeighbourSvc.h:86
TRT_StrawNeighbourSvc::m_chip_to_straw
std::vector< std::vector< std::vector< int > > > m_chip_to_straw
Definition: TRT_StrawNeighbourSvc.h:88
TRT_StrawNeighbourSvc::getPad
void getPad(Identifier offlineID, int &pad)
public methods
Definition: TRT_StrawNeighbourSvc.cxx:589
TRT_StrawNeighbourSvc::getStrawsFromPad
void getStrawsFromPad(Identifier offlineID, std::vector< Identifier > &neighbourIDs)
Definition: TRT_StrawNeighbourSvc.cxx:631
TRT_StrawNeighbourSvc::~TRT_StrawNeighbourSvc
virtual ~TRT_StrawNeighbourSvc()
destructor
TRT_StrawNeighbourSvc::m_chipConversionSocketToChip_m3
int m_chipConversionSocketToChip_m3[51]
Definition: TRT_StrawNeighbourSvc.h:98
TRT_StrawNeighbourSvc::getFirstStrawFromChip
TRTCond::ExpandedIdentifier getFirstStrawFromChip(Identifier offlineID)
Definition: TRT_StrawNeighbourSvc.cxx:742
TRT_StrawNeighbourSvc::TRT_StrawNeighbourSvc
TRT_StrawNeighbourSvc(const std::string &name, ISvcLocator *pSvcLocator)
constructor
Definition: TRT_StrawNeighbourSvc.cxx:44
TRT_StrawNeighbourSvc::m_endcapChipMapC8
int m_endcapChipMapC8[12]
Definition: TRT_StrawNeighbourSvc.h:104
TRT_StrawNeighbourSvc::m_endcapChipMapA8
int m_endcapChipMapA8[12]
Definition: TRT_StrawNeighbourSvc.h:102
TRT_StrawNeighbourSvc::finalize
virtual StatusCode finalize()
tool finalize
Definition: TRT_StrawNeighbourSvc.cxx:332
TRT_StrawNeighbourSvc::m_chipConversionChipToSocket_m3
int m_chipConversionChipToSocket_m3[51]
Definition: TRT_StrawNeighbourSvc.h:99
StoreGateSvc
The Athena Transient Store API.
Definition: StoreGateSvc.h:122
maskDeadModules.mod
mod
Definition: maskDeadModules.py:36
TRT_StrawNeighbourSvc::getStrawsFromChip
void getStrawsFromChip(Identifier offlineID, std::vector< Identifier > &neighbourIDs)
Definition: TRT_StrawNeighbourSvc.cxx:674
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:70
TRT_StrawNeighbourSvc::m_detStore
ServiceHandle< StoreGateSvc > m_detStore
Definition: TRT_StrawNeighbourSvc.h:69
sign
int sign(int a)
Definition: TRT_StrawNeighbourSvc.h:108
TRT_StrawNeighbourSvc::getRunningNumbering
int getRunningNumbering(Identifier offlineID)
Definition: TRT_StrawNeighbourSvc.cxx:386
TRT_StrawNeighbourSvc::chipToBoardEndCap
static int chipToBoardEndCap(int chip)
Definition: TRT_StrawNeighbourSvc.cxx:838
TRT_StrawNeighbourSvc::m_layer_m2_acc
std::vector< unsigned int > m_layer_m2_acc
Definition: TRT_StrawNeighbourSvc.h:78
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:240
TRT_StrawNeighbourSvc::m_layer_m3
std::vector< unsigned int > m_layer_m3
Definition: TRT_StrawNeighbourSvc.h:79
TRT_StrawNeighbourSvc::m_chip_vector3
std::vector< double > m_chip_vector3
Definition: TRT_StrawNeighbourSvc.h:92
TRT_StrawNeighbourSvc::m_m1
std::vector< unsigned int > m_m1
Definition: TRT_StrawNeighbourSvc.h:82
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:76
TRT_StrawNeighbourSvc::getAtlasIdentifier
void getAtlasIdentifier(int strawnumber, Identifier &outputID, Identifier inputID)
Definition: TRT_StrawNeighbourSvc.cxx:342
TRT_StrawNeighbourSvc::m_chipConversionSocketToChip_m1
int m_chipConversionSocketToChip_m1[22]
Definition: TRT_StrawNeighbourSvc.h:94
TRT_ID
Definition: TRT_ID.h:82
a
TList * a
Definition: liststreamerinfos.cxx:10
TRT_StrawNeighbourSvc::m_TripletOrientation
int m_TripletOrientation[2][32]
Definition: TRT_StrawNeighbourSvc.h:73
TRT_StrawNeighbourSvc::m_chip_vector1
std::vector< double > m_chip_vector1
Definition: TRT_StrawNeighbourSvc.h:90
TRT_StrawNeighbourSvc::chipToBoardBarrel
int chipToBoardBarrel(int chip, int layer)
Definition: TRT_StrawNeighbourSvc.cxx:782
TRT_StrawNeighbourSvc::m_m2
std::vector< unsigned int > m_m2
Definition: TRT_StrawNeighbourSvc.h:83
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:24
TRT_StrawNeighbourSvc::getRing
int getRing(const Identifier &id)
Definition: TRT_StrawNeighbourSvc.cxx:821
TRT_StrawNeighbourSvc::m_layer_m1
std::vector< unsigned int > m_layer_m1
Definition: TRT_StrawNeighbourSvc.h:75
TRT_StrawNeighbourSvc::m_chipConversionSocketToChip_m2
int m_chipConversionSocketToChip_m2[34]
Definition: TRT_StrawNeighbourSvc.h:96
ServiceHandle< StoreGateSvc >
Identifier
Definition: IdentifierFieldParser.cxx:14