ATLAS Offline Software
Public Member Functions | Static Public Member Functions | Protected Member Functions | Private Types | Private Member Functions | Private Attributes | List of all members
InDetAlignOverlapTool Class Reference

The InDetAlignOverlapTool is to select good quality tracks for alignment to build residuals with possible cuts on overlap hits, overlaps in SCT and PIXELs (in Phi and Eta). More...

#include <InDetAlignOverlapTool.h>

Inheritance diagram for InDetAlignOverlapTool:
Collaboration diagram for InDetAlignOverlapTool:

Public Member Functions

 InDetAlignOverlapTool (const std::string &, const std::string &, const IInterface *)
 
virtual ~InDetAlignOverlapTool ()
 
virtual StatusCode initialize ()
 
virtual StatusCode finalize ()
 
int getNumberOverlapPIX (const AlignTrk &) const
 main method to get an overlap hit More...
 
int getNumberOverlapSCT (const AlignTrk &) const
 
std::vector< AlignSiHitgetOverlapHit (const AlignTrk &)
 
ServiceHandle< StoreGateSvc > & evtStore ()
 The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc. More...
 
const ServiceHandle< StoreGateSvc > & evtStore () const
 The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc. More...
 
const ServiceHandle< StoreGateSvc > & detStore () const
 The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc. More...
 
virtual StatusCode sysInitialize () override
 Perform system initialization for an algorithm. More...
 
virtual StatusCode sysStart () override
 Handle START transition. More...
 
virtual std::vector< Gaudi::DataHandle * > inputHandles () const override
 Return this algorithm's input handles. More...
 
virtual std::vector< Gaudi::DataHandle * > outputHandles () const override
 Return this algorithm's output handles. More...
 
Gaudi::Details::PropertyBase & declareProperty (Gaudi::Property< T > &t)
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, SG::VarHandleKey &hndl, const std::string &doc, const SG::VarHandleKeyType &)
 Declare a new Gaudi property. More...
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, SG::VarHandleBase &hndl, const std::string &doc, const SG::VarHandleType &)
 Declare a new Gaudi property. More...
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, SG::VarHandleKeyArray &hndArr, const std::string &doc, const SG::VarHandleKeyArrayType &)
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, T &property, const std::string &doc, const SG::NotHandleType &)
 Declare a new Gaudi property. More...
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, T &property, const std::string &doc="none")
 Declare a new Gaudi property. More...
 
void updateVHKA (Gaudi::Details::PropertyBase &)
 
MsgStream & msg () const
 
MsgStream & msg (const MSG::Level lvl) const
 
bool msgLvl (const MSG::Level lvl) const
 

Static Public Member Functions

static const InterfaceID & interfaceID ()
 

Protected Member Functions

void renounceArray (SG::VarHandleKeyArray &handlesArray)
 remove all handles from I/O resolution More...
 
std::enable_if_t< std::is_void_v< std::result_of_t< decltype(&T::renounce)(T)> > &&!std::is_base_of_v< SG::VarHandleKeyArray, T > &&std::is_base_of_v< Gaudi::DataHandle, T >, void > renounce (T &h)
 
void extraDeps_update_handler (Gaudi::Details::PropertyBase &ExtraDeps)
 Add StoreName to extra input/output deps as needed. More...
 

Private Types

typedef ServiceHandle< StoreGateSvcStoreGateSvc_t
 

Private Member Functions

Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T > &hndl, const SG::VarHandleKeyType &)
 specialization for handling Gaudi::Property<SG::VarHandleKey> More...
 
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T > &hndl, const SG::VarHandleKeyArrayType &)
 specialization for handling Gaudi::Property<SG::VarHandleKeyArray> More...
 
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T > &hndl, const SG::VarHandleType &)
 specialization for handling Gaudi::Property<SG::VarHandleBase> More...
 
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T > &t, const SG::NotHandleType &)
 specialization for handling everything that's not a Gaudi::Property<SG::VarHandleKey> or a <SG::VarHandleKeyArray> More...
 

Private Attributes

std::vector< AlignSiHitm_Overlaphits
 
const AlignSiModuleListp_modlist
 
StoreGateSvc_t m_evtStore
 Pointer to StoreGate (event store by default) More...
 
StoreGateSvc_t m_detStore
 Pointer to StoreGate (detector store by default) More...
 
std::vector< SG::VarHandleKeyArray * > m_vhka
 
bool m_varHandleArraysDeclared
 

Detailed Description

The InDetAlignOverlapTool is to select good quality tracks for alignment to build residuals with possible cuts on overlap hits, overlaps in SCT and PIXELs (in Phi and Eta).

Definition at line 27 of file InDetAlignOverlapTool.h.

Member Typedef Documentation

◆ StoreGateSvc_t

typedef ServiceHandle<StoreGateSvc> AthCommonDataStore< AthCommonMsg< AlgTool > >::StoreGateSvc_t
privateinherited

Definition at line 388 of file AthCommonDataStore.h.

Constructor & Destructor Documentation

◆ InDetAlignOverlapTool()

InDetAlignOverlapTool::InDetAlignOverlapTool ( const std::string &  t,
const std::string &  n,
const IInterface *  p 
)

Definition at line 25 of file InDetAlignOverlapTool.cxx.

26  : AthAlgTool(t, n, p)
27  , m_Overlaphits{}
28  , p_modlist{} {
29  declareInterface<IInDetAlignOverlapTool>(this);
30 }

◆ ~InDetAlignOverlapTool()

InDetAlignOverlapTool::~InDetAlignOverlapTool ( )
virtual

Definition at line 32 of file InDetAlignOverlapTool.cxx.

32 {}

Member Function Documentation

◆ declareGaudiProperty() [1/4]

Gaudi::Details::PropertyBase& AthCommonDataStore< AthCommonMsg< AlgTool > >::declareGaudiProperty ( Gaudi::Property< T > &  hndl,
const SG::VarHandleKeyArrayType  
)
inlineprivateinherited

specialization for handling Gaudi::Property<SG::VarHandleKeyArray>

Definition at line 170 of file AthCommonDataStore.h.

172  {
173  return *AthCommonDataStore<PBASE>::declareProperty(hndl.name(),
174  hndl.value(),
175  hndl.documentation());
176 
177  }

◆ declareGaudiProperty() [2/4]

Gaudi::Details::PropertyBase& AthCommonDataStore< AthCommonMsg< AlgTool > >::declareGaudiProperty ( Gaudi::Property< T > &  hndl,
const SG::VarHandleKeyType  
)
inlineprivateinherited

specialization for handling Gaudi::Property<SG::VarHandleKey>

Definition at line 156 of file AthCommonDataStore.h.

158  {
159  return *AthCommonDataStore<PBASE>::declareProperty(hndl.name(),
160  hndl.value(),
161  hndl.documentation());
162 
163  }

◆ declareGaudiProperty() [3/4]

Gaudi::Details::PropertyBase& AthCommonDataStore< AthCommonMsg< AlgTool > >::declareGaudiProperty ( Gaudi::Property< T > &  hndl,
const SG::VarHandleType  
)
inlineprivateinherited

specialization for handling Gaudi::Property<SG::VarHandleBase>

Definition at line 184 of file AthCommonDataStore.h.

186  {
187  return *AthCommonDataStore<PBASE>::declareProperty(hndl.name(),
188  hndl.value(),
189  hndl.documentation());
190  }

◆ declareGaudiProperty() [4/4]

Gaudi::Details::PropertyBase& AthCommonDataStore< AthCommonMsg< AlgTool > >::declareGaudiProperty ( Gaudi::Property< T > &  t,
const SG::NotHandleType  
)
inlineprivateinherited

specialization for handling everything that's not a Gaudi::Property<SG::VarHandleKey> or a <SG::VarHandleKeyArray>

Definition at line 199 of file AthCommonDataStore.h.

200  {
201  return PBASE::declareProperty(t);
202  }

◆ declareProperty() [1/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty ( const std::string &  name,
SG::VarHandleBase hndl,
const std::string &  doc,
const SG::VarHandleType  
)
inlineinherited

Declare a new Gaudi property.

Parameters
nameName of the property.
hndlObject holding the property value.
docDocumentation string for the property.

This is the version for types that derive from SG::VarHandleBase. The property value object is put on the input and output lists as appropriate; then we forward to the base class.

Definition at line 245 of file AthCommonDataStore.h.

249  {
250  this->declare(hndl.vhKey());
251  hndl.vhKey().setOwner(this);
252 
253  return PBASE::declareProperty(name,hndl,doc);
254  }

◆ declareProperty() [2/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty ( const std::string &  name,
SG::VarHandleKey hndl,
const std::string &  doc,
const SG::VarHandleKeyType  
)
inlineinherited

Declare a new Gaudi property.

Parameters
nameName of the property.
hndlObject holding the property value.
docDocumentation string for the property.

This is the version for types that derive from SG::VarHandleKey. The property value object is put on the input and output lists as appropriate; then we forward to the base class.

Definition at line 221 of file AthCommonDataStore.h.

225  {
226  this->declare(hndl);
227  hndl.setOwner(this);
228 
229  return PBASE::declareProperty(name,hndl,doc);
230  }

◆ declareProperty() [3/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty ( const std::string &  name,
SG::VarHandleKeyArray hndArr,
const std::string &  doc,
const SG::VarHandleKeyArrayType  
)
inlineinherited

Definition at line 259 of file AthCommonDataStore.h.

263  {
264 
265  // std::ostringstream ost;
266  // ost << Algorithm::name() << " VHKA declareProp: " << name
267  // << " size: " << hndArr.keys().size()
268  // << " mode: " << hndArr.mode()
269  // << " vhka size: " << m_vhka.size()
270  // << "\n";
271  // debug() << ost.str() << endmsg;
272 
273  hndArr.setOwner(this);
274  m_vhka.push_back(&hndArr);
275 
276  Gaudi::Details::PropertyBase* p = PBASE::declareProperty(name, hndArr, doc);
277  if (p != 0) {
278  p->declareUpdateHandler(&AthCommonDataStore<PBASE>::updateVHKA, this);
279  } else {
280  ATH_MSG_ERROR("unable to call declareProperty on VarHandleKeyArray "
281  << name);
282  }
283 
284  return p;
285 
286  }

◆ declareProperty() [4/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty ( const std::string &  name,
T &  property,
const std::string &  doc,
const SG::NotHandleType  
)
inlineinherited

Declare a new Gaudi property.

Parameters
nameName of the property.
propertyObject holding the property value.
docDocumentation string for the property.

This is the generic version, for types that do not derive from SG::VarHandleKey. It just forwards to the base class version of declareProperty.

Definition at line 333 of file AthCommonDataStore.h.

337  {
338  return PBASE::declareProperty(name, property, doc);
339  }

◆ declareProperty() [5/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty ( const std::string &  name,
T &  property,
const std::string &  doc = "none" 
)
inlineinherited

Declare a new Gaudi property.

Parameters
nameName of the property.
propertyObject holding the property value.
docDocumentation string for the property.

This dispatches to either the generic declareProperty or the one for VarHandle/Key/KeyArray.

Definition at line 352 of file AthCommonDataStore.h.

355  {
356  typedef typename SG::HandleClassifier<T>::type htype;
357  return declareProperty (name, property, doc, htype());
358  }

◆ declareProperty() [6/6]

Gaudi::Details::PropertyBase& AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty ( Gaudi::Property< T > &  t)
inlineinherited

Definition at line 145 of file AthCommonDataStore.h.

145  {
146  typedef typename SG::HandleClassifier<T>::type htype;
148  }

◆ detStore()

const ServiceHandle<StoreGateSvc>& AthCommonDataStore< AthCommonMsg< AlgTool > >::detStore ( ) const
inlineinherited

The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.

Definition at line 95 of file AthCommonDataStore.h.

95 { return m_detStore; }

◆ evtStore() [1/2]

ServiceHandle<StoreGateSvc>& AthCommonDataStore< AthCommonMsg< AlgTool > >::evtStore ( )
inlineinherited

The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.

Definition at line 85 of file AthCommonDataStore.h.

85 { return m_evtStore; }

◆ evtStore() [2/2]

const ServiceHandle<StoreGateSvc>& AthCommonDataStore< AthCommonMsg< AlgTool > >::evtStore ( ) const
inlineinherited

The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.

Definition at line 90 of file AthCommonDataStore.h.

90 { return m_evtStore; }

◆ extraDeps_update_handler()

void AthCommonDataStore< AthCommonMsg< AlgTool > >::extraDeps_update_handler ( Gaudi::Details::PropertyBase &  ExtraDeps)
protectedinherited

Add StoreName to extra input/output deps as needed.

use the logic of the VarHandleKey to parse the DataObjID keys supplied via the ExtraInputs and ExtraOuputs Properties to add the StoreName if it's not explicitly given

◆ finalize()

StatusCode InDetAlignOverlapTool::finalize ( )
virtual

Definition at line 47 of file InDetAlignOverlapTool.cxx.

47  {
48  ATH_MSG_DEBUG("finalize() successful in " << name());
49  return AlgTool::finalize();
50 }

◆ getNumberOverlapPIX()

int InDetAlignOverlapTool::getNumberOverlapPIX ( const AlignTrk trk) const
virtual

main method to get an overlap hit

Implements IInDetAlignOverlapTool.

Definition at line 54 of file InDetAlignOverlapTool.cxx.

54  {
55  ATH_MSG_DEBUG(" InDetAlignOverlapTool::get getNumberOverlapPIX inizialized");
56 
57  int nPixelBarrelOverlapEta = 0;
58  int nPixelBarrelOverlapPhi = 0;
59  int nPixelECOverlapPhi = 0;
60  int PixelSector[3] = {
61  21, 37, 51
62  };
63  int ECPixelSector = 48;
64  int nOverlapPIX = 0;
65  int nhits2 = 0;
66 
67  //--------------------
68  // first loop:
69  //--------------------
70 
71  nhits2 = trk.nhits();
72  ATH_MSG_DEBUG(" Num de Hits " << nhits2);
73  ATH_MSG_DEBUG(" Anem a entrar en el loop");
74 
75  for (std::vector<AlignSiHit>::const_iterator hit = trk.hitlist_cbegin();
76  hit != trk.hitlist_cend(); ++hit) {
77  int index = hit->index() - 1; // note index starts at 1 in ntuple!
78 
79  if (msgLvl(MSG::VERBOSE)) {
80  if ((p_modlist->vec[index]).bec() == 0 && (p_modlist->vec[index]).dettype() == 1) {
81  msg().setColor(MSG::GREEN);
82  msg(MSG::VERBOSE) << "Index " << index << " Detector: " << (p_modlist->vec[index]).dettype() << " layer : " <<
83  (p_modlist->vec[index]).layer() << " ring : "
84  << (p_modlist->vec[index]).ring() << " sector : " << (p_modlist->vec[index]).sector() <<
85  endmsg;
86  }
87  }
88 
89  //--------------------
90  // second loop:
91  //--------------------
92  for (std::vector<AlignSiHit>::const_iterator Allhit = hit;
93  Allhit != trk.hitlist_cend(); ++Allhit) {
94  int Allindex = Allhit->index() - 1; // note index starts at 1 in ntuple!
95 
96  if (msgLvl(MSG::VERBOSE)) {
97  if ((p_modlist->vec[Allindex]).bec() == 0 && (p_modlist->vec[Allindex]).dettype() == 1) {
98  msg().setColor(MSG::BLUE);
99  msg(MSG::VERBOSE) << "Index " << Allindex << endmsg;
100  }
101  }
102 
103  //------------------------//
104  // PIXEL SYSTEM //
105  //------------------------//
106 
107  if ((p_modlist->vec[index]).dettype() == 1 && (p_modlist->vec[Allindex]).dettype() == 1) {
108  if ((p_modlist->vec[index]).bec() == 0 && (p_modlist->vec[Allindex]).bec() == 0) { // BARREL
109  if ((p_modlist->vec[Allindex]).layer() == (p_modlist->vec[index]).layer() &&
110  (p_modlist->vec[Allindex]).ring() == (p_modlist->vec[index]).ring() &&
111  (std::abs((p_modlist->vec[Allindex]).sector() - (p_modlist->vec[index]).sector()) == 1. ||
112  std::abs((p_modlist->vec[Allindex]).sector() -
113  ((p_modlist->vec[index]).sector() + PixelSector[(p_modlist->vec[index]).layer()])) == 1.)) {
114  // msg()
115  if (msgLvl(MSG::DEBUG)) {
116  msg().setColor(MSG::RED);
117  msg(MSG::DEBUG) << " Index:" << index << " layer " << (p_modlist->vec[index]).layer() << " ring " <<
118  (p_modlist->vec[index]).ring() <<
119  " sector " << (p_modlist->vec[index]).sector() << endmsg;//<<"rPhi Residuals: " << hit->rphi_resid() <<"
120  // eta Residuals: " << hit->z_resid());
121  msg().setColor(MSG::RED);
122  msg(MSG::DEBUG) << " AllIndex:" << Allindex << " layer " << (p_modlist->vec[Allindex]).layer() <<
123  " ring " << (p_modlist->vec[Allindex]).ring() <<
124  " sector " << (p_modlist->vec[Allindex]).sector() << endmsg;//<<" rPhi Residuals: " <<
125  // Allhit->rphi_resid() <<" eta Residuals:
126  // " << Allhit->z_resid());
127  msg().setColor(MSG::RED);
128  msg(MSG::DEBUG) << "Pixel Overlap in Phi found" << endmsg;
129  } //msg() end
130 
131  nPixelBarrelOverlapPhi++;
132  }
133 
134  if ((p_modlist->vec[Allindex]).layer() == (p_modlist->vec[index]).layer() &&
135  std::abs((p_modlist->vec[Allindex]).ring() - (p_modlist->vec[index]).ring()) == 1 &&
136  (p_modlist->vec[Allindex]).sector() == (p_modlist->vec[index]).sector()) {
137  //msg()
138  if (msgLvl(MSG::DEBUG)) {
139  msg().setColor(MSG::RED);
140  msg(MSG::DEBUG) << " Index:" << index << " layer " << (p_modlist->vec[index]).layer() << " ring " <<
141  (p_modlist->vec[index]).ring() <<
142  " sector " << (p_modlist->vec[index]).sector() << endmsg;//<<"rPhi Residuals: " << hit->rphi_resid() <<"
143  // eta Residuals: " << hit->z_resid());
144  msg().setColor(MSG::RED);
145  msg(MSG::DEBUG) << " AllIndex:" << Allindex << " layer " << (p_modlist->vec[Allindex]).layer() <<
146  " ring " << (p_modlist->vec[Allindex]).ring() <<
147  " sector " << (p_modlist->vec[Allindex]).sector() << endmsg;// <<" rPhi Residuals: " <<
148  // Allhit->rphi_resid() <<" eta Residuals:
149  // " << Allhit->z_resid());
150  msg().setColor(MSG::RED);
151  msg(MSG::DEBUG) << "Pixel Overlap in Eta found" << endmsg;
152  } //msg() end
153 
154  nPixelBarrelOverlapEta++;
155  }
156  } // END OF BARREL
157 
158  if ((p_modlist->vec[index]).bec() != 0 && (p_modlist->vec[index]).bec() == (p_modlist->vec[Allindex]).bec()) { // ENDCAP
159  if ((p_modlist->vec[Allindex]).layer() == (p_modlist->vec[index]).layer() &&
160  (p_modlist->vec[Allindex]).ring() == (p_modlist->vec[index]).ring() &&
161  (std::abs((p_modlist->vec[Allindex]).sector() - (p_modlist->vec[index]).sector()) == 1. ||
162  std::abs((p_modlist->vec[Allindex]).sector() - ((p_modlist->vec[index]).sector() + ECPixelSector)) == 1.)) {
163  //msg()
164  if (msgLvl(MSG::DEBUG)) {
165  msg().setColor(MSG::RED);
166  msg(MSG::DEBUG) << " Index:" << index << " layer " << (p_modlist->vec[index]).layer() << " ring " <<
167  (p_modlist->vec[index]).ring() <<
168  " sector " << (p_modlist->vec[index]).sector() << endmsg;
169  msg(MSG::DEBUG) << " AllIndex:" << Allindex << " layer " << (p_modlist->vec[Allindex]).layer() <<
170  " ring " << (p_modlist->vec[Allindex]).ring() <<
171  " sector " << (p_modlist->vec[Allindex]).sector() << endmsg;
172  msg(MSG::DEBUG) << "EC Pixel Overlap in Phi found" << endmsg;
173  }// msg() end
174 
175  nPixelECOverlapPhi++;
176  }
177  } // END OF ENDCAP
178  }
179  }
180  }
181 
182  nOverlapPIX = nPixelBarrelOverlapPhi + nPixelBarrelOverlapEta + nPixelECOverlapPhi;
183  ATH_MSG_DEBUG(" Total number of Pixel overlaps in eta " << nPixelBarrelOverlapEta);
184  ATH_MSG_DEBUG(" Total number of Pixel overlaps in phi " << nPixelBarrelOverlapPhi);
185  ATH_MSG_DEBUG(" Total number of Pixel EC overlaps in phi " << nPixelECOverlapPhi);
186 
187  return nOverlapPIX;
188 }

◆ getNumberOverlapSCT()

int InDetAlignOverlapTool::getNumberOverlapSCT ( const AlignTrk trk) const
virtual

Implements IInDetAlignOverlapTool.

Definition at line 193 of file InDetAlignOverlapTool.cxx.

193  {
194  ATH_MSG_DEBUG(" InDetAlignOverlapTool::get getNumberOverlapSCT initialized");
195 
196  // counters for overlaps eta and overlaps Phi
197  int nSCTBarrelOverlapEta = 0;
198  int nSCTBarrelOverlapPhi = 0;
199  int nSCTECOverlapPhi = 0;
200  int nSCTECOverlapEta = 0;
201 
202  int SCTSector[4] = {
203  31, 39, 47, 55
204  };
205  int ECSCTSector = 52;
206 
207  int nOverlapSCT = 0;
208  int nhits2 = 0;
209 
210  nhits2 = trk.nhits();
211  ATH_MSG_DEBUG(" Num de Hits " << nhits2);
212  ATH_MSG_DEBUG(" Anem a entrar en el loop");
213 
214  //-------------
215  // first loop:
216  //-------------
217 
218  for (std::vector<AlignSiHit>::const_iterator hit = trk.hitlist_cbegin();
219  hit != trk.hitlist_cend(); ++hit) {
220  int index = hit->index() - 1; // note index starts at 1 in ntuple!
221 
222  if (msgLvl(MSG::VERBOSE)) {
223  if ((p_modlist->vec[index]).bec() == 0 && (p_modlist->vec[index]).dettype() == 1) {
224  msg().setColor(MSG::GREEN);
225  msg(MSG::VERBOSE) << "Index " << index << " Detector: " << (p_modlist->vec[index]).dettype() << " layer : " <<
226  (p_modlist->vec[index]).layer() << " ring : "
227  << (p_modlist->vec[index]).ring() << " sector : " << (p_modlist->vec[index]).sector() <<
228  endmsg;
229  }
230  }
231 
232  //-------------
233  // second loop:
234  //-------------
235 
236  for (std::vector<AlignSiHit>::const_iterator Allhit = hit;
237  Allhit != trk.hitlist_cend(); ++Allhit) {
238  int Allindex = Allhit->index() - 1; // note index starts at 1 in ntuple!
239 
240  if (msgLvl(MSG::VERBOSE)) {
241  if ((p_modlist->vec[Allindex]).bec() == 0 && (p_modlist->vec[Allindex]).dettype() == 1) {
242  msg().setColor(MSG::BLUE);
243  msg(MSG::VERBOSE) << "Index " << Allindex << endmsg;
244  }
245  }
246 
247  //------------------------//
248  // SCT SYSTEM //
249  //------------------------//
250 
251  if ((p_modlist->vec[index]).dettype() == 2 && (p_modlist->vec[Allindex]).dettype() == 2) {
252  if ((p_modlist->vec[index]).bec() == 0 && (p_modlist->vec[Allindex]).bec() == 0) { // BARREL
253  if ((p_modlist->vec[Allindex]).layer() == (p_modlist->vec[index]).layer() &&
254  (p_modlist->vec[Allindex]).ring() == (p_modlist->vec[index]).ring() &&
255  (std::abs((p_modlist->vec[Allindex]).sector() - (p_modlist->vec[index]).sector()) == 1. ||
256  std::abs((p_modlist->vec[Allindex]).sector() -
257  ((p_modlist->vec[index]).sector() + SCTSector[(p_modlist->vec[index]).layer()])) == 1.)) {
258  if (msgLvl(MSG::DEBUG)) {
259  msg().setColor(MSG::RED);
260  msg(MSG::DEBUG) << " Index:" << index << " layer " << (p_modlist->vec[index]).layer() << " ring " <<
261  (p_modlist->vec[index]).ring() <<
262  " sector " << (p_modlist->vec[index]).sector() << endmsg;
263  msg().setColor(MSG::RED);
264  msg(MSG::DEBUG) << " AllIndex:" << Allindex << " layer " << (p_modlist->vec[Allindex]).layer() <<
265  " ring " << (p_modlist->vec[Allindex]).ring() <<
266  " sector " << (p_modlist->vec[Allindex]).sector() << endmsg;
267  msg().setColor(MSG::RED);
268  msg(MSG::DEBUG) << "SCT Overlap in Phi found" << endmsg;
269  }
270  nSCTBarrelOverlapPhi++;
271  }
272 
273  if ((p_modlist->vec[Allindex]).layer() == (p_modlist->vec[index]).layer() &&
274  std::abs((p_modlist->vec[Allindex]).ring() - (p_modlist->vec[index]).ring()) == 1 &&
275  (p_modlist->vec[Allindex]).sector() == (p_modlist->vec[index]).sector()) {
276  if (msgLvl(MSG::DEBUG)) {
277  msg().setColor(MSG::RED);
278  msg(MSG::DEBUG) << " Index:" << index << " layer " << (p_modlist->vec[index]).layer() << " ring " <<
279  (p_modlist->vec[index]).ring() <<
280  " sector " << (p_modlist->vec[index]).sector() << endmsg;
281  msg().setColor(MSG::RED);
282  msg(MSG::DEBUG) << " AllIndex:" << Allindex << " layer " << (p_modlist->vec[Allindex]).layer() <<
283  " ring " << (p_modlist->vec[Allindex]).ring() <<
284  " sector " << (p_modlist->vec[Allindex]).sector() << endmsg;
285  msg().setColor(MSG::RED);
286  msg(MSG::DEBUG) << "SCT Overlap in Eta found" << endmsg;
287  }
288  nSCTBarrelOverlapEta++;
289  }
290  }
291 
292  if ((p_modlist->vec[index]).bec() != 0 && ((p_modlist->vec[index]).bec() == (p_modlist->vec[Allindex]).bec())) { // EndCap
293  // (
294  // EC
295  // values
296  // 2
297  // i
298  // -2)
299  if ((p_modlist->vec[Allindex]).layer() == (p_modlist->vec[index]).layer() &&
300  (p_modlist->vec[Allindex]).ring() == (p_modlist->vec[index]).ring() &&
301  (std::abs((p_modlist->vec[Allindex]).sector() - (p_modlist->vec[index]).sector()) == 1. ||
302  std::abs((p_modlist->vec[Allindex]).sector() - ((p_modlist->vec[index]).sector() + ECSCTSector)) == 1.)) {
303  if (msgLvl(MSG::DEBUG)) {
304  msg().setColor(MSG::RED);
305  msg(MSG::DEBUG) << " Index:" << index << " layer " << (p_modlist->vec[index]).layer() << " ring " <<
306  (p_modlist->vec[index]).ring() <<
307  " sector " << (p_modlist->vec[index]).sector() << endmsg;
308  msg().setColor(MSG::RED);
309  msg(MSG::DEBUG) << " AllIndex:" << Allindex << " layer " << (p_modlist->vec[Allindex]).layer() <<
310  " ring " << (p_modlist->vec[Allindex]).ring() <<
311  " sector " << (p_modlist->vec[Allindex]).sector() << endmsg;
312 
313  msg(MSG::DEBUG) << "EC SCT Overlap in Phi found" << endmsg;
314  }
315  nSCTECOverlapPhi++;
316  }
317 
318  if ((p_modlist->vec[Allindex]).layer() == (p_modlist->vec[index]).layer() &&
319  std::abs((p_modlist->vec[Allindex]).ring() - (p_modlist->vec[index]).ring()) == 1 &&
320  (p_modlist->vec[Allindex]).sector() == (p_modlist->vec[index]).sector()) {
321  if (msgLvl(MSG::DEBUG)) {
322  msg().setColor(MSG::GREEN);
323  msg(MSG::DEBUG) << " Index:" << index << " layer " << (p_modlist->vec[index]).layer() << " ring " <<
324  (p_modlist->vec[index]).ring() <<
325  " sector " << (p_modlist->vec[index]).sector() << endmsg;
326  msg().setColor(MSG::GREEN);
327  msg(MSG::DEBUG) << " AllIndex:" << Allindex << " layer " << (p_modlist->vec[Allindex]).layer() <<
328  " ring " << (p_modlist->vec[Allindex]).ring() <<
329  " sector " << (p_modlist->vec[Allindex]).sector() << endmsg;
330 
331  msg(MSG::DEBUG) << "EC SCT Overlap in Eta found" << endmsg;
332  }
333  nSCTECOverlapEta++;
334  }
335  }
336  }
337  }
338  }
339 
340  nOverlapSCT = nSCTBarrelOverlapPhi + nSCTBarrelOverlapEta + nSCTECOverlapPhi + nSCTECOverlapEta;
341 
342  ATH_MSG_DEBUG(" Total number of STC overlaps in eta " << nSCTBarrelOverlapEta);
343  ATH_MSG_DEBUG(" Total number of SCT overlaps in phi " << nSCTBarrelOverlapPhi);
344  ATH_MSG_DEBUG(" Total number of STC EC overlaps in phi " << nSCTECOverlapPhi);
345  ATH_MSG_DEBUG(" Total number of STC EC overlaps in Eta " << nSCTECOverlapEta);
346 
347  return nOverlapSCT;
348 }

◆ getOverlapHit()

std::vector< AlignSiHit > InDetAlignOverlapTool::getOverlapHit ( const AlignTrk trk)
virtual

Implements IInDetAlignOverlapTool.

Definition at line 353 of file InDetAlignOverlapTool.cxx.

353  { //const {
354  ATH_MSG_DEBUG(" InDetAlignOverlapTool::get getOverlapHit inizialized");
355 
356  bool isPIXOverlap = false;
357  bool isSCTOverlap = false;
358  //bool isOverlap=false;
359 
360  int PixelSector[3] = {
361  21, 37, 51
362  };
363  int ECPixelSector = 48;
364  int SCTSector[4] = {
365  31, 39, 47, 55
366  };
367  int ECSCTSector = 52;
368 
369  //----------------------------------------------------
370  // first loop: preparing info for next processing
371  //----------------------------------------------------
372  for (std::vector<AlignSiHit>::const_iterator hit = trk.hitlist_cbegin();
373  hit != trk.hitlist_cend(); ++hit) {
374  int index = hit->index() - 1; // note index starts at 1 in ntuple!
375 
376  isPIXOverlap = false;
377  isSCTOverlap = false;
378  //isOverlap=false;
379 
380  //----------------------------------------------------
381  // Second loop: preparing info for next processing
382  //----------------------------------------------------
383  for (std::vector<AlignSiHit>::const_iterator hit2 = trk.hitlist_cbegin();
384  hit2 != trk.hitlist_cend(); ++hit2) {
385  int newindex = hit2->index() - 1; // note index starts at 1 in ntuple!
386  //------------------------//
387  // PIXEL SYSTEM //
388  //------------------------//
389 
390  if ((p_modlist->vec[index]).dettype() == 1 && (p_modlist->vec[newindex]).dettype() == 1) {
391  if ((p_modlist->vec[index]).bec() == 0 && (p_modlist->vec[newindex]).bec() == 0) { // BARREL
392  if ((p_modlist->vec[newindex]).layer() == (p_modlist->vec[index]).layer() &&
393  (p_modlist->vec[newindex]).ring() == (p_modlist->vec[index]).ring() &&
394  (std::abs((p_modlist->vec[newindex]).sector() - (p_modlist->vec[index]).sector()) == 1. ||
395  std::abs((p_modlist->vec[newindex]).sector() -
396  ((p_modlist->vec[index]).sector() + PixelSector[(p_modlist->vec[index]).layer()])) == 1.)) {
397  isPIXOverlap = true;
398  }
399 
400  if ((p_modlist->vec[newindex]).layer() == (p_modlist->vec[index]).layer() &&
401  std::abs((p_modlist->vec[newindex]).ring() - (p_modlist->vec[index]).ring()) == 1 &&
402  (p_modlist->vec[newindex]).sector() == (p_modlist->vec[index]).sector()) {
403  isPIXOverlap = true;
404  }
405  }
406 
407  if ((p_modlist->vec[index]).bec() != 0 && (p_modlist->vec[index]).bec() == (p_modlist->vec[newindex]).bec()) { // ENDCAP
408  if ((p_modlist->vec[newindex]).layer() == (p_modlist->vec[index]).layer() &&
409  (p_modlist->vec[newindex]).ring() == (p_modlist->vec[index]).ring() &&
410  (std::abs((p_modlist->vec[newindex]).sector() - (p_modlist->vec[index]).sector()) == 1. ||
411  std::abs((p_modlist->vec[newindex]).sector() - ((p_modlist->vec[index]).sector() + ECPixelSector)) == 1.)) {
412  isPIXOverlap = true;
413  }
414  }
415  } // End Pixel system
416 
417 
418  //------------------------//
419  // SCT SYSTEM //
420  //------------------------//
421 
422  if ((p_modlist->vec[index]).dettype() == 2 && (p_modlist->vec[newindex]).dettype() == 2) {
423  if ((p_modlist->vec[index]).bec() == 0 && (p_modlist->vec[newindex]).bec() == 0) { // BARREL
424  if ((p_modlist->vec[newindex]).layer() == (p_modlist->vec[index]).layer() &&
425  (p_modlist->vec[newindex]).ring() == (p_modlist->vec[index]).ring() &&
426  (std::abs((p_modlist->vec[newindex]).sector() - (p_modlist->vec[index]).sector()) == 1. ||
427  std::abs((p_modlist->vec[newindex]).sector() -
428  ((p_modlist->vec[index]).sector() + SCTSector[(p_modlist->vec[index]).layer()])) == 1.)) {
429  isSCTOverlap = true;
430  }
431 
432  if ((p_modlist->vec[newindex]).layer() == (p_modlist->vec[index]).layer() &&
433  std::abs((p_modlist->vec[newindex]).ring() - (p_modlist->vec[index]).ring()) == 1 &&
434  (p_modlist->vec[newindex]).sector() == (p_modlist->vec[index]).sector()) {
435  isSCTOverlap = true;
436  }
437  }
438 
439  if ((p_modlist->vec[index]).bec() != 0 && ((p_modlist->vec[index]).bec() == (p_modlist->vec[newindex]).bec())) { // //
440  // ENDCAP
441  // (
442  // EC
443  // values
444  // 2
445  // i
446  // -2)
447  if ((p_modlist->vec[newindex]).layer() == (p_modlist->vec[index]).layer() &&
448  (p_modlist->vec[newindex]).ring() == (p_modlist->vec[index]).ring() &&
449  (std::abs((p_modlist->vec[newindex]).sector() - (p_modlist->vec[index]).sector()) == 1. ||
450  std::abs((p_modlist->vec[newindex]).sector() - ((p_modlist->vec[index]).sector() + ECSCTSector)) == 1.)) {
451  isSCTOverlap = true;
452  }
453 
454  if ((p_modlist->vec[newindex]).layer() == (p_modlist->vec[index]).layer() &&
455  std::abs((p_modlist->vec[newindex]).ring() - (p_modlist->vec[index]).ring()) == 1 &&
456  (p_modlist->vec[newindex]).sector() == (p_modlist->vec[index]).sector()) {
457  isSCTOverlap = true;
458  }
459  } // End SCT system
460  }
461  }
462  if (isPIXOverlap || isSCTOverlap) {
463  msg().setColor(MSG::GREEN);
464  ATH_MSG_DEBUG("This Hit is overlap" << index);
465  m_Overlaphits.push_back(*hit);
466  }
467  }
468 
469  return m_Overlaphits;
470 }

◆ initialize()

StatusCode InDetAlignOverlapTool::initialize ( )
virtual

Definition at line 34 of file InDetAlignOverlapTool.cxx.

34  {
36 
37  if (sc.isFailure()) return sc;
38 
39  // get DetectorStore service
41  // get pointer to AlignSiModuleList; after setup has created it
42  ATH_CHECK(detStore()->retrieve(p_modlist, "InDetAlignNt"));
43  ATH_MSG_DEBUG("initialize() successful in " << name());
44  return StatusCode::SUCCESS;
45 }

◆ inputHandles()

virtual std::vector<Gaudi::DataHandle*> AthCommonDataStore< AthCommonMsg< AlgTool > >::inputHandles ( ) const
overridevirtualinherited

Return this algorithm's input handles.

We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.

◆ interfaceID()

const InterfaceID & IInDetAlignOverlapTool::interfaceID ( )
inlinestaticinherited

Definition at line 38 of file IInDetAlignOverlapTool.h.

38  {
39  return IID_INDETALIGN_IInDetAlignOverlapTool ;
40 }

◆ msg() [1/2]

MsgStream& AthCommonMsg< AlgTool >::msg ( ) const
inlineinherited

Definition at line 24 of file AthCommonMsg.h.

24  {
25  return this->msgStream();
26  }

◆ msg() [2/2]

MsgStream& AthCommonMsg< AlgTool >::msg ( const MSG::Level  lvl) const
inlineinherited

Definition at line 27 of file AthCommonMsg.h.

27  {
28  return this->msgStream(lvl);
29  }

◆ msgLvl()

bool AthCommonMsg< AlgTool >::msgLvl ( const MSG::Level  lvl) const
inlineinherited

Definition at line 30 of file AthCommonMsg.h.

30  {
31  return this->msgLevel(lvl);
32  }

◆ outputHandles()

virtual std::vector<Gaudi::DataHandle*> AthCommonDataStore< AthCommonMsg< AlgTool > >::outputHandles ( ) const
overridevirtualinherited

Return this algorithm's output handles.

We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.

◆ renounce()

std::enable_if_t<std::is_void_v<std::result_of_t<decltype(&T::renounce)(T)> > && !std::is_base_of_v<SG::VarHandleKeyArray, T> && std::is_base_of_v<Gaudi::DataHandle, T>, void> AthCommonDataStore< AthCommonMsg< AlgTool > >::renounce ( T &  h)
inlineprotectedinherited

Definition at line 380 of file AthCommonDataStore.h.

381  {
382  h.renounce();
383  PBASE::renounce (h);
384  }

◆ renounceArray()

void AthCommonDataStore< AthCommonMsg< AlgTool > >::renounceArray ( SG::VarHandleKeyArray handlesArray)
inlineprotectedinherited

remove all handles from I/O resolution

Definition at line 364 of file AthCommonDataStore.h.

364  {
365  handlesArray.renounce();
366  }

◆ sysInitialize()

virtual StatusCode AthCommonDataStore< AthCommonMsg< AlgTool > >::sysInitialize ( )
overridevirtualinherited

Perform system initialization for an algorithm.

We override this to declare all the elements of handle key arrays at the end of initialization. See comments on updateVHKA.

Reimplemented in DerivationFramework::CfAthAlgTool, AthCheckedComponent< AthAlgTool >, AthCheckedComponent<::AthAlgTool >, and asg::AsgMetadataTool.

◆ sysStart()

virtual StatusCode AthCommonDataStore< AthCommonMsg< AlgTool > >::sysStart ( )
overridevirtualinherited

Handle START transition.

We override this in order to make sure that conditions handle keys can cache a pointer to the conditions container.

◆ updateVHKA()

void AthCommonDataStore< AthCommonMsg< AlgTool > >::updateVHKA ( Gaudi::Details::PropertyBase &  )
inlineinherited

Definition at line 308 of file AthCommonDataStore.h.

308  {
309  // debug() << "updateVHKA for property " << p.name() << " " << p.toString()
310  // << " size: " << m_vhka.size() << endmsg;
311  for (auto &a : m_vhka) {
312  std::vector<SG::VarHandleKey*> keys = a->keys();
313  for (auto k : keys) {
314  k->setOwner(this);
315  }
316  }
317  }

Member Data Documentation

◆ m_detStore

StoreGateSvc_t AthCommonDataStore< AthCommonMsg< AlgTool > >::m_detStore
privateinherited

Pointer to StoreGate (detector store by default)

Definition at line 393 of file AthCommonDataStore.h.

◆ m_evtStore

StoreGateSvc_t AthCommonDataStore< AthCommonMsg< AlgTool > >::m_evtStore
privateinherited

Pointer to StoreGate (event store by default)

Definition at line 390 of file AthCommonDataStore.h.

◆ m_Overlaphits

std::vector<AlignSiHit> InDetAlignOverlapTool::m_Overlaphits
private

Definition at line 44 of file InDetAlignOverlapTool.h.

◆ m_varHandleArraysDeclared

bool AthCommonDataStore< AthCommonMsg< AlgTool > >::m_varHandleArraysDeclared
privateinherited

Definition at line 399 of file AthCommonDataStore.h.

◆ m_vhka

std::vector<SG::VarHandleKeyArray*> AthCommonDataStore< AthCommonMsg< AlgTool > >::m_vhka
privateinherited

Definition at line 398 of file AthCommonDataStore.h.

◆ p_modlist

const AlignSiModuleList* InDetAlignOverlapTool::p_modlist
private

Definition at line 46 of file InDetAlignOverlapTool.h.


The documentation for this class was generated from the following files:
python.PyKernel.retrieve
def retrieve(aClass, aKey=None)
Definition: PyKernel.py:110
python.tests.PyTestsLib.finalize
def finalize(self)
_info( "content of StoreGate..." ) self.sg.dump()
Definition: PyTestsLib.py:50
index
Definition: index.py:1
AthCommonDataStore::declareProperty
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
Definition: AthCommonDataStore.h:145
initialize
void initialize()
Definition: run_EoverP.cxx:894
AlignTrk::nhits
int nhits() const
Definition: AlignTrk.h:110
AthCommonDataStore< AthCommonMsg< AlgTool > >::m_evtStore
StoreGateSvc_t m_evtStore
Pointer to StoreGate (event store by default)
Definition: AthCommonDataStore.h:390
AthCommonDataStore< AthCommonMsg< AlgTool > >::m_vhka
std::vector< SG::VarHandleKeyArray * > m_vhka
Definition: AthCommonDataStore.h:398
AlignTrk::hitlist_cend
std::vector< AlignSiHit >::const_iterator hitlist_cend() const
Definition: AlignTrk.h:167
AthCommonMsg< AlgTool >::msgLvl
bool msgLvl(const MSG::Level lvl) const
Definition: AthCommonMsg.h:30
read_hist_ntuple.t
t
Definition: read_hist_ntuple.py:5
AlignSiModuleList::vec
std::vector< AlignSiModule > vec
Definition: AlignSiModuleList.h:20
AthenaPoolTestRead.sc
sc
Definition: AthenaPoolTestRead.py:27
AthCommonDataStore< AthCommonMsg< AlgTool > >::detStore
const ServiceHandle< StoreGateSvc > & detStore() const
The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.
Definition: AthCommonDataStore.h:95
SG::VarHandleKeyArray::setOwner
virtual void setOwner(IDataHandleHolder *o)=0
IDTPMcnv.htype
htype
Definition: IDTPMcnv.py:27
python.utils.AtlRunQueryDQUtils.p
p
Definition: AtlRunQueryDQUtils.py:210
AthCommonDataStore
Definition: AthCommonDataStore.h:52
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
beamspotman.n
n
Definition: beamspotman.py:731
endmsg
#define endmsg
Definition: AnalysisConfig_Ntuple.cxx:63
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
TRT::Hit::layer
@ layer
Definition: HitInfo.h:79
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
AthCommonDataStore< AthCommonMsg< AlgTool > >::m_detStore
StoreGateSvc_t m_detStore
Pointer to StoreGate (detector store by default)
Definition: AthCommonDataStore.h:393
AthAlgTool::AthAlgTool
AthAlgTool()
Default constructor:
SG::VarHandleKeyArray::renounce
virtual void renounce()=0
SG::HandleClassifier::type
std::conditional< std::is_base_of< SG::VarHandleKeyArray, T >::value, VarHandleKeyArrayType, type2 >::type type
Definition: HandleClassifier.h:54
merge_scale_histograms.doc
string doc
Definition: merge_scale_histograms.py:9
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:221
python.consts.RED
RED
Definition: consts.py:3
DeMoScan.index
string index
Definition: DeMoScan.py:364
python.consts.GREEN
GREEN
Definition: consts.py:3
a
TList * a
Definition: liststreamerinfos.cxx:10
h
DEBUG
#define DEBUG
Definition: page_access.h:11
AthCommonMsg< AlgTool >::msg
MsgStream & msg() const
Definition: AthCommonMsg.h:24
SG::VarHandleBase::vhKey
SG::VarHandleKey & vhKey()
Return a non-const reference to the HandleKey.
Definition: StoreGate/src/VarHandleBase.cxx:623
InDetAlignOverlapTool::m_Overlaphits
std::vector< AlignSiHit > m_Overlaphits
Definition: InDetAlignOverlapTool.h:44
python.Bindings.keys
keys
Definition: Control/AthenaPython/python/Bindings.py:798
python.Constants.VERBOSE
int VERBOSE
Definition: Control/AthenaCommon/python/Constants.py:14
AlignTrk::hitlist_cbegin
std::vector< AlignSiHit >::const_iterator hitlist_cbegin() const
Definition: AlignTrk.h:165
AthCommonDataStore::declareGaudiProperty
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>
Definition: AthCommonDataStore.h:156
InDetAlignOverlapTool::p_modlist
const AlignSiModuleList * p_modlist
Definition: InDetAlignOverlapTool.h:46
fitman.k
k
Definition: fitman.py:528
python.logger.BLUE
BLUE
Definition: logger.py:15