ATLAS Offline Software
Loading...
Searching...
No Matches
SharedHitMapper Class Reference

#include <SharedHitMapper.h>

Inheritance diagram for SharedHitMapper:
Collaboration diagram for SharedHitMapper:

Public Member Functions

 SharedHitMapper (const std::string &name, ISvcLocator *pSvcLocator)
virtual ~SharedHitMapper ()
virtual StatusCode initialize ()
virtual StatusCode execute ()
virtual StatusCode finalize ()
int numberSharedBLayer () const
int numberSharedPix () const
int numberSharedSct () const
virtual StatusCode sysInitialize () override
 Override sysInitialize.
virtual const DataObjIDColl & extraOutputDeps () const override
 Return the list of extra output dependencies.
ServiceHandle< StoreGateSvc > & evtStore ()
 The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.
const ServiceHandle< StoreGateSvc > & detStore () const
 The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.
virtual StatusCode sysStart () override
 Handle START transition.
virtual std::vector< Gaudi::DataHandle * > inputHandles () const override
 Return this algorithm's input handles.
virtual std::vector< Gaudi::DataHandle * > outputHandles () const override
 Return this algorithm's output handles.
Gaudi::Details::PropertyBase & declareProperty (Gaudi::Property< T, V, H > &t)
void updateVHKA (Gaudi::Details::PropertyBase &)
MsgStream & msg () const
bool msgLvl (const MSG::Level lvl) const

Protected Member Functions

void renounceArray (SG::VarHandleKeyArray &handlesArray)
 remove all handles from I/O resolution
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.

Private Types

typedef ServiceHandle< StoreGateSvcStoreGateSvc_t

Private Member Functions

Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyType &)
 specialization for handling Gaudi::Property<SG::VarHandleKey>

Private Attributes

std::string m_inputTrackCollection
std::string m_sharedHitMapLocation
 location of inputTracks in StoreGate
double m_deltaRCut
 location of sharedHitMap in StoreGate
bool m_qualOrder
 pairs of tracks with dR>dRCut not considered
bool m_useTrackSummaryShared
const PixelIDm_pixelId
 if true use shared info from track summary instead of recomputing them
const SCT_IDm_sctId
int m_npl [m_nbpl]
int m_npd [m_nbpd]
int m_nsl [m_nbsl]
int m_nsd [m_nbsd]
DataObjIDColl m_extendedExtraObjects
StoreGateSvc_t m_evtStore
 Pointer to StoreGate (event store by default)
StoreGateSvc_t m_detStore
 Pointer to StoreGate (detector store by default)
std::vector< SG::VarHandleKeyArray * > m_vhka
bool m_varHandleArraysDeclared

Static Private Attributes

static const int m_nbpl = 3
static const int m_nbpd = 3
static const int m_nbsl = 4
static const int m_nbsd = 9

Detailed Description

Definition at line 21 of file SharedHitMapper.h.

Member Typedef Documentation

◆ StoreGateSvc_t

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

Definition at line 388 of file AthCommonDataStore.h.

Constructor & Destructor Documentation

◆ SharedHitMapper()

SharedHitMapper::SharedHitMapper ( const std::string & name,
ISvcLocator * pSvcLocator )

Definition at line 74 of file SharedHitMapper.cxx.

75 : AthAlgorithm(name, pSvcLocator) {
76 declareProperty("inputTrackCollection", m_inputTrackCollection = "TrackParticleCandidate");
77 declareProperty("sharedHitMapLocation", m_sharedHitMapLocation = "SharedHitMap");
78 declareProperty("deltaRCut", m_deltaRCut = 1.0);
79 declareProperty("QualityOrdering", m_qualOrder = false);
80 declareProperty("useTrackSummaryShared", m_useTrackSummaryShared = true);
81}
AthAlgorithm()
Default constructor:
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)
bool m_qualOrder
pairs of tracks with dR>dRCut not considered
std::string m_inputTrackCollection
std::string m_sharedHitMapLocation
location of inputTracks in StoreGate
double m_deltaRCut
location of sharedHitMap in StoreGate

◆ ~SharedHitMapper()

SharedHitMapper::~SharedHitMapper ( )
virtual

Definition at line 83 of file SharedHitMapper.cxx.

83 {
84}

Member Function Documentation

◆ declareGaudiProperty()

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

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

Definition at line 156 of file AthCommonDataStore.h.

158 {
160 hndl.value(),
161 hndl.documentation());
162
163 }

◆ declareProperty()

Gaudi::Details::PropertyBase & AthCommonDataStore< AthCommonMsg< Algorithm > >::declareProperty ( Gaudi::Property< T, V, H > & t)
inlineinherited

Definition at line 145 of file AthCommonDataStore.h.

145 {
146 typedef typename SG::HandleClassifier<T>::type htype;
148 }
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>

◆ detStore()

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

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

Definition at line 95 of file AthCommonDataStore.h.

◆ evtStore()

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

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

Definition at line 85 of file AthCommonDataStore.h.

◆ execute()

StatusCode SharedHitMapper::execute ( )
virtual

retrieve input tracks:

Definition at line 102 of file SharedHitMapper.cxx.

102 {
103
104 MsgStream mlog(msgSvc(), name());
105
107 const xAOD::TrackParticleContainer* inputTracks(0);
108 StatusCode sc = evtStore()->retrieve(inputTracks, m_inputTrackCollection);
109 if (sc.isFailure()) {
110 ATH_MSG_ERROR("TrackParticles " << m_inputTrackCollection << " not found in StoreGate.");
111 return StatusCode::SUCCESS;
112 }
113 ATH_MSG_VERBOSE("TrackParticleContainer " << m_inputTrackCollection << " found.");
114
115 SharedHitTrackAssoc* assoc = new SharedHitTrackAssoc();
116 ATH_MSG_INFO("Number of initial TrackParticles: " << inputTracks->size());
117
119 // --- Use shared hit information from TrackSummary:
120 // loop on first track:
121 xAOD::TrackParticleContainer::const_iterator trk1I(inputTracks->begin());
122 xAOD::TrackParticleContainer::const_iterator trkE(inputTracks->end());
123 for (; trk1I!=trkE; ++trk1I) {
124 int nbs, nps, nss;
125 (*trk1I)->summaryValue(nbs, xAOD::numberOfInnermostPixelLayerSharedHits);
126 (*trk1I)->summaryValue(nps, xAOD::numberOfPixelSharedHits);
127 (*trk1I)->summaryValue(nss, xAOD::numberOfSCTSharedHits);
128 if (nbs < 0) nbs = 0;
129 if (nps < 0) nps = 0;
130 if (nss < 0) nss = 0;
131 if(nbs+nps+nss>0) assoc->add( (*trk1I), nbs, nps, nss);
132 }
133 } else {
134 // --- Recompute shared hit information from TrkTracks:
135
136 vecpairTrkRio myvecTrkRio(0);
137
138 // loop on first track:
139 xAOD::TrackParticleContainer::const_iterator trk1I(inputTracks->begin());
140 xAOD::TrackParticleContainer::const_iterator trkE(inputTracks->end());
141 for (; trk1I!=trkE; ++trk1I) {
142 const xAOD::TrackParticle* trk1 = (*trk1I);//->track();
143 if(trk1==0) {
144 ATH_MSG_ERROR("Can't get the original track ! Please run on ESD");
145 return StatusCode::SUCCESS;
146 }
147 //
148 // For the quality computation
149 int q1 = 0 ,q2 = 0;
150 int np1 = 0, np2 = 0, ns1 = 0, ns2 = 0;
151 int nhp1 = 0, nhp2 = 0, nhs1 = 0, nhs2 = 0, nh1 = 0, nh2 = 0;
152 int nprec1 = 0, nprec2 = 0;
153 double chi21 = 0., chi22 = 0.;
154 if (m_qualOrder) {
155 chi21 = (*trk1I)->chiSquared();
156 (*trk1I)->summaryValue(np1, xAOD::numberOfPixelHits); if (np1<0)np1=0;
157 (*trk1I)->summaryValue(ns1, xAOD::numberOfSCTHits); if (ns1<0)ns1=0;
158 nprec1 = np1 + ns1;
159 (*trk1I)->summaryValue(nhp1, xAOD::numberOfPixelHoles); if (nhp1<0)nhp1=0;
160 (*trk1I)->summaryValue(nhs1, xAOD::numberOfSCTHoles); if (nhs1<0)nhs1=0;
161 nh1 = nhp1 + nhs1;
162 q1 = 10000*(2*nprec1-nh1) - int(20.*chi21/float(nprec1));
163
164 }
165 //
166 xAOD::IParticle::FourMom_t t1p4 = (*trk1I)->p4();
167 const DataVector<const Trk::MeasurementBase>* mb = (*trk1->track())->measurementsOnTrack();
170 ATH_MSG_VERBOSE("First track (pT="<<t1p4.Pt()<<", eta="<<t1p4.Eta ()<<") has " << mb->size() << " RIOs on track");
171 // init arrays for pixels:
172 bool pl[m_nbpl]; // layers
173 for(int i=0;i<m_nbpl;i++) m_npl[i] = 0;
174 bool pd[m_nbpd]; // disks
175 for(int i=0;i<m_nbpd;i++) m_npd[i] = 0;
176 // init arrays for sct:
177 bool sl[m_nbsl];
178 for(int i=0;i<m_nbsl;i++) m_nsl[i] = 0;
179 bool sd[m_nbsd];
180 for(int i=0;i<m_nbsd;i++) m_nsd[i] = 0;
181 // loop on second track:
182 xAOD::TrackParticleContainer::const_iterator trk2I(inputTracks->begin());
183 for (; trk2I!=trkE; ++trk2I) {
184 if(trk2I==trk1I) continue;
185 const xAOD::TrackParticle* trk2 = (*trk2I);
186 if(trk2==0) {
187 ATH_MSG_ERROR("Can't get the original track ! Please run on ESD");
188 return StatusCode::SUCCESS;
189 }
190 xAOD::IParticle::FourMom_t t2p4 = (*trk2I)->p4();
191 double deltaR = t1p4.DeltaR(t2p4);
192 if(deltaR<m_deltaRCut) {
193 // Assign the shared hit to the worst quality track
194 // If a hit is shared by more than 2 tracks, this will not be perfect...
195 // From IG : Quality = 10000*(2*Nhit-Nhole) - int(20.*Xi2/float(Nhit))
196 if (m_qualOrder) {
197 chi22 = (*trk2I)->chiSquared();
198 (*trk2I)->summaryValue(np2, xAOD::numberOfPixelHits); if (np2<0)np2=0;
199 (*trk2I)->summaryValue(ns2, xAOD::numberOfSCTHits); if (ns2<0)ns2=0;
200 nprec1 = np1 + ns1;
201 (*trk2I)->summaryValue(nhp2, xAOD::numberOfPixelHoles); if (nhp2<0)nhp2=0;
202 (*trk2I)->summaryValue(nhs2, xAOD::numberOfSCTHoles); if (nhs2<0)nhs2=0;
203 nh2 = nhp2 + nhs2;
204 q2 = 10000*(2*nprec2-nh2) - int(20.*chi22/float(nprec2));
205 if (q1 > q2) continue;
206 }
207 // loop on 1st track clusters:
208 nextMb = mb->begin();
209 for(; nextMb != lastMb; ++nextMb) {
210 const Trk::RIO_OnTrack* nextRio = dynamic_cast<const Trk::RIO_OnTrack*>(*nextMb);
211 bool pixl = m_pixelId->is_pixel(nextRio->identify());
212 bool ssct = m_sctId->is_sct(nextRio->identify());
213 if( (!pixl) && (!ssct) ) continue;
214 // pixels:
215 for(int i=0;i<m_nbpl;i++) pl[i] = false;
216 for(int i=0;i<m_nbpd;i++) pd[i] = false;
217 if(pixl) {
218 pl[0] = m_pixelId->is_blayer(nextRio->identify());
219 if(m_pixelId->is_barrel(nextRio->identify())) {
220 int player = m_pixelId->layer_disk(nextRio->identify());
221 for(int i=1;i<m_nbpl;i++) pl[i] = ( player == i );
222 } else {
223 int pdisk = m_pixelId->layer_disk(nextRio->identify());
224 for(int i=0;i<m_nbpd;i++) pd[i] = ( pdisk == i );
225 }
226 }
227 // sct:
228 for(int i=0;i<m_nbsl;i++) sl[i] = false;
229 for(int i=0;i<m_nbsd;i++) sd[i] = false;
230 if(ssct) {
231 if(m_sctId->is_barrel(nextRio->identify())) {
232 int slayer = m_sctId->layer_disk(nextRio->identify());
233 for(int i=0;i<m_nbsl;i++) sl[i] = ( slayer == i );
234 } else {
235 int sdisk = m_sctId->layer_disk(nextRio->identify());
236 for(int i=0;i<m_nbsd;i++) sd[i] = ( sdisk == i );
237 }
238 }
239 // loop on 2nd track clusters:
240 const DataVector<const Trk::MeasurementBase>* mb2 = (*trk2->track())->measurementsOnTrack();
243 if (nextMb == mb->begin()) ATH_MSG_VERBOSE("Second track (pT="<<t2p4.Pt()<<") has " << mb2->size() << " RIOs on track");
244 int nriosi = 0;
245 for(; nextMb2 != lastMb2; ++nextMb2) {
246 const Trk::RIO_OnTrack* nextRio2 = dynamic_cast<const Trk::RIO_OnTrack*>(*nextMb2);
247 bool pixl2 = m_pixelId->is_pixel(nextRio2->identify());
248 bool ssct2 = m_sctId->is_sct(nextRio2->identify());
249 if( (!pixl2) && (!ssct2) ) continue;
250 nriosi++;
251 if( nextRio2->identify() == nextRio->identify() ) {
252 ATH_MSG_DEBUG("Shared hit ! Track1 Pt = " << t1p4.Pt() <<" Track2 Pt = " << t2p4.Pt());
253 if (m_qualOrder) {
254 ATH_MSG_VERBOSE("Track1 chi2 = " << chi21 << " nprec = " << nprec1 << " (np,ns) = (" << np1 << " , " << ns1 << ") " << " nhole = " << nh1 << " (nhp,nhs) = (" << nhp1 << " , " << nhs1 << ") " << " quality = " << q1);
255 ATH_MSG_VERBOSE("Track2 chi2 = " << chi22 << " nprec = " << nprec2 << " (np,ns) = (" << np2 << " , " << ns2 << ") " << " nhole = " << nh2 << " (nhp,nhs) = (" << nhp2 << " , " << nhs2 << ") " << " quality = " << q2);
256 }
257 ATH_MSG_DEBUG(pl[0] << " "<< pl[1] << " " << pl[2]);
258 ATH_MSG_DEBUG(pd[0] << " "<< pd[1] << " " << pd[2]);
259 ATH_MSG_DEBUG(sl[0] << " "<< sl[1] << " " << sl[2] << " " << sl[3]);
260 ATH_MSG_DEBUG(sd[0] << " "<< sd[1] << " " << sd[2] << " " << sd[3] << " " << sd[4] << " "<< sd[5] << " " << sd[6] << " " << sd[7] << " " << sd[8]);
261 pairTrkRio p = std::make_pair(*trk1I,nextRio);
262 for(int i=0;i<m_nbpl;i++) {
263 if (pl[i] && std::find(myvecTrkRio.begin(), myvecTrkRio.end(), p) == myvecTrkRio.end()) {m_npl[i]++;myvecTrkRio.push_back(p);}
264 }
265 for(int i=0;i<m_nbpd;i++) {
266 if (pd[i] && std::find(myvecTrkRio.begin(), myvecTrkRio.end(), p) == myvecTrkRio.end()) {m_npd[i]++;myvecTrkRio.push_back(p);}
267 }
268 for(int i=0;i<m_nbsl;i++) {
269 if (sl[i] && std::find(myvecTrkRio.begin(), myvecTrkRio.end(), p) == myvecTrkRio.end()) {m_nsl[i]++;myvecTrkRio.push_back(p);}
270 }
271 for(int i=0;i<m_nbsd;i++) {
272 if (sd[i] && std::find(myvecTrkRio.begin(), myvecTrkRio.end(), p) == myvecTrkRio.end()) {m_nsd[i]++;myvecTrkRio.push_back(p);}
273 }
274 }
275 } // end loop on rio2
276 } // end loop on rio1
277 }
278 } // end loop on trk2
279 // now store the result:
280 if(this->numberSharedBLayer()+this->numberSharedPix()+this->numberSharedSct()>0) {
281 assoc->add( (*trk1I), this->numberSharedBLayer(),
282 this->numberSharedPix(),
283 this->numberSharedSct() );
284 }
285 } // end loop on trk1
286 }
287
288 ATH_MSG_INFO("Size of SharedHitMap: " << assoc->size());
289
290 if (mlog.level() <= MSG::DEBUG) assoc->dump();
291
292 if(evtStore()->record(assoc,m_sharedHitMapLocation,false).isFailure()) {
293 ATH_MSG_ERROR("recording of SharedHitAssoc " << m_sharedHitMapLocation << " failed.");
294 } else {
295 ATH_MSG_VERBOSE("Recording of SharedHitAssoc " << m_sharedHitMapLocation << " succeeded, coll is now const." );
296 }
297
298
299 return StatusCode::SUCCESS;
300}
Scalar deltaR(const MatrixBase< Derived > &vec) const
#define ATH_MSG_ERROR(x)
#define ATH_MSG_INFO(x)
#define ATH_MSG_VERBOSE(x)
#define ATH_MSG_DEBUG(x)
static Double_t sc
std::vector< pairTrkRio > vecpairTrkRio
std::pair< const xAOD::TrackParticle *, const Trk::RIO_OnTrack * > pairTrkRio
DataModel_detail::const_iterator< DataVector > const_iterator
Definition DataVector.h:838
const_iterator end() const noexcept
Return a const_iterator pointing past the end of the collection.
const_iterator begin() const noexcept
Return a const_iterator pointing at the beginning of the collection.
size_type size() const noexcept
Returns the number of elements in the collection.
int m_nsl[m_nbsl]
static const int m_nbsl
const PixelID * m_pixelId
if true use shared info from track summary instead of recomputing them
int numberSharedPix() const
int numberSharedSct() const
int m_npl[m_nbpl]
static const int m_nbpl
const SCT_ID * m_sctId
int m_nsd[m_nbsd]
int m_npd[m_nbpd]
static const int m_nbsd
static const int m_nbpd
int numberSharedBLayer() const
void add(const xAOD::TrackParticle *const trk, int shPattern)
Identifier identify() const
return the identifier -extends MeasurementBase
TLorentzVector FourMom_t
Definition of the 4-momentum type.
const Trk::Track * track() const
Returns a pointer (which can be NULL) to the Trk::Track which was used to make this TrackParticle.
::StatusCode StatusCode
StatusCode definition for legacy code.
msgSvc
Provide convenience handles for various services.
Definition StdJOSetup.py:36
TrackParticle_v1 TrackParticle
Reference the current persistent version:
TrackParticleContainer_v1 TrackParticleContainer
Definition of the current "TrackParticle container version".
@ numberOfPixelHoles
number of pixel layers on track with absence of hits [unit8_t].
@ numberOfInnermostPixelLayerSharedHits
number of Pixel 0th layer barrel hits shared by several tracks.
@ numberOfSCTHits
number of hits in SCT [unit8_t].
@ numberOfPixelHits
these are the pixel hits, including the b-layer [unit8_t].
@ numberOfPixelSharedHits
number of Pixel all-layer hits shared by several tracks [unit8_t].
@ numberOfSCTSharedHits
number of SCT hits shared by several tracks [unit8_t].
@ numberOfSCTHoles
number of SCT holes [unit8_t].

◆ extraDeps_update_handler()

void AthCommonDataStore< AthCommonMsg< Algorithm > >::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

◆ extraOutputDeps()

const DataObjIDColl & AthAlgorithm::extraOutputDeps ( ) const
overridevirtualinherited

Return the list of extra output dependencies.

This list is extended to include symlinks implied by inheritance relations.

Definition at line 50 of file AthAlgorithm.cxx.

51{
52 // If we didn't find any symlinks to add, just return the collection
53 // from the base class. Otherwise, return the extended collection.
54 if (!m_extendedExtraObjects.empty()) {
56 }
57 return Algorithm::extraOutputDeps();
58}
DataObjIDColl m_extendedExtraObjects

◆ finalize()

StatusCode SharedHitMapper::finalize ( )
virtual

Definition at line 302 of file SharedHitMapper.cxx.

302 {
303 return StatusCode::SUCCESS;
304}

◆ initialize()

StatusCode SharedHitMapper::initialize ( )
virtual

Definition at line 86 of file SharedHitMapper.cxx.

86 {
88 StatusCode sc = detStore()->retrieve(m_pixelId, "PixelID");
89 if (sc.isFailure()) {
90 ATH_MSG_ERROR("Could not get PixelID helper !");
91 }
92 sc = detStore()->retrieve(m_sctId, "SCT_ID");
93 if (sc.isFailure()) {
94 ATH_MSG_ERROR("Could not get SCT_ID helper !");
95 }
96 }
97 std::cout<<name()<<" with input tracks "<<m_inputTrackCollection<<std::endl;
98 std::cout<<name()<<" initialized"<<std::endl;
99 return StatusCode::SUCCESS;
100}
const ServiceHandle< StoreGateSvc > & detStore() const

◆ inputHandles()

virtual std::vector< Gaudi::DataHandle * > AthCommonDataStore< AthCommonMsg< Algorithm > >::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.

◆ msg()

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

Definition at line 24 of file AthCommonMsg.h.

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

◆ msgLvl()

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

Definition at line 30 of file AthCommonMsg.h.

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

◆ numberSharedBLayer()

int SharedHitMapper::numberSharedBLayer ( ) const

Definition at line 306 of file SharedHitMapper.cxx.

306 {
307 return m_npl[0];
308}

◆ numberSharedPix()

int SharedHitMapper::numberSharedPix ( ) const

Definition at line 310 of file SharedHitMapper.cxx.

310 {
311 int nbs = 0;
312 for(int i=0;i<m_nbpl;i++) nbs += m_npl[i];
313 for(int i=0;i<m_nbpd;i++) nbs += m_npd[i];
314 return nbs;
315}

◆ numberSharedSct()

int SharedHitMapper::numberSharedSct ( ) const

Definition at line 317 of file SharedHitMapper.cxx.

317 {
318 int nbs = 0;
319 for(int i=0;i<m_nbsl;i++) nbs += m_nsl[i];
320 for(int i=0;i<m_nbsd;i++) nbs += m_nsd[i];
321 return nbs;
322}

◆ outputHandles()

virtual std::vector< Gaudi::DataHandle * > AthCommonDataStore< AthCommonMsg< Algorithm > >::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< Algorithm > >::renounce ( T & h)
inlineprotectedinherited

Definition at line 380 of file AthCommonDataStore.h.

381 {
382 h.renounce();
384 }
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)

◆ renounceArray()

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

remove all handles from I/O resolution

Definition at line 364 of file AthCommonDataStore.h.

364 {
366 }

◆ sysInitialize()

StatusCode AthAlgorithm::sysInitialize ( )
overridevirtualinherited

Override sysInitialize.

Override sysInitialize from the base class.

Loop through all output handles, and if they're WriteCondHandles, automatically register them and this Algorithm with the CondSvc

Scan through all outputHandles, and if they're WriteCondHandles, register them with the CondSvc

Reimplemented from AthCommonDataStore< AthCommonMsg< Algorithm > >.

Reimplemented in AthAnalysisAlgorithm, AthFilterAlgorithm, AthHistogramAlgorithm, and PyAthena::Alg.

Definition at line 66 of file AthAlgorithm.cxx.

66 {
68
69 if (sc.isFailure()) {
70 return sc;
71 }
72 ServiceHandle<ICondSvc> cs("CondSvc",name());
73 for (auto h : outputHandles()) {
74 if (h->isCondition() && h->mode() == Gaudi::DataHandle::Writer) {
75 // do this inside the loop so we don't create the CondSvc until needed
76 if ( cs.retrieve().isFailure() ) {
77 ATH_MSG_WARNING("no CondSvc found: won't autoreg WriteCondHandles");
78 return StatusCode::SUCCESS;
79 }
80 if (cs->regHandle(this,*h).isFailure()) {
81 sc = StatusCode::FAILURE;
82 ATH_MSG_ERROR("unable to register WriteCondHandle " << h->fullKey()
83 << " with CondSvc");
84 }
85 }
86 }
87 return sc;
88}
#define ATH_MSG_WARNING(x)
virtual StatusCode sysInitialize() override
Override sysInitialize.
AthCommonDataStore(const std::string &name, T... args)
virtual std::vector< Gaudi::DataHandle * > outputHandles() const override

◆ sysStart()

virtual StatusCode AthCommonDataStore< AthCommonMsg< Algorithm > >::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< Algorithm > >::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) {
313 for (auto k : keys) {
314 k->setOwner(this);
315 }
316 }
317 }
std::vector< SG::VarHandleKeyArray * > m_vhka

Member Data Documentation

◆ m_deltaRCut

double SharedHitMapper::m_deltaRCut
private

location of sharedHitMap in StoreGate

Definition at line 38 of file SharedHitMapper.h.

◆ m_detStore

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

Pointer to StoreGate (detector store by default)

Definition at line 393 of file AthCommonDataStore.h.

◆ m_evtStore

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

Pointer to StoreGate (event store by default)

Definition at line 390 of file AthCommonDataStore.h.

◆ m_extendedExtraObjects

DataObjIDColl AthAlgorithm::m_extendedExtraObjects
privateinherited

Definition at line 79 of file AthAlgorithm.h.

◆ m_inputTrackCollection

std::string SharedHitMapper::m_inputTrackCollection
private

Definition at line 36 of file SharedHitMapper.h.

◆ m_nbpd

const int SharedHitMapper::m_nbpd = 3
staticprivate

Definition at line 45 of file SharedHitMapper.h.

◆ m_nbpl

const int SharedHitMapper::m_nbpl = 3
staticprivate

Definition at line 44 of file SharedHitMapper.h.

◆ m_nbsd

const int SharedHitMapper::m_nbsd = 9
staticprivate

Definition at line 47 of file SharedHitMapper.h.

◆ m_nbsl

const int SharedHitMapper::m_nbsl = 4
staticprivate

Definition at line 46 of file SharedHitMapper.h.

◆ m_npd

int SharedHitMapper::m_npd[m_nbpd]
private

Definition at line 49 of file SharedHitMapper.h.

◆ m_npl

int SharedHitMapper::m_npl[m_nbpl]
private

Definition at line 48 of file SharedHitMapper.h.

◆ m_nsd

int SharedHitMapper::m_nsd[m_nbsd]
private

Definition at line 51 of file SharedHitMapper.h.

◆ m_nsl

int SharedHitMapper::m_nsl[m_nbsl]
private

Definition at line 50 of file SharedHitMapper.h.

◆ m_pixelId

const PixelID* SharedHitMapper::m_pixelId
private

if true use shared info from track summary instead of recomputing them

Definition at line 41 of file SharedHitMapper.h.

◆ m_qualOrder

bool SharedHitMapper::m_qualOrder
private

pairs of tracks with dR>dRCut not considered

Definition at line 39 of file SharedHitMapper.h.

◆ m_sctId

const SCT_ID* SharedHitMapper::m_sctId
private

Definition at line 42 of file SharedHitMapper.h.

◆ m_sharedHitMapLocation

std::string SharedHitMapper::m_sharedHitMapLocation
private

location of inputTracks in StoreGate

Definition at line 37 of file SharedHitMapper.h.

◆ m_useTrackSummaryShared

bool SharedHitMapper::m_useTrackSummaryShared
private

Definition at line 40 of file SharedHitMapper.h.

◆ m_varHandleArraysDeclared

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

Definition at line 399 of file AthCommonDataStore.h.

◆ m_vhka

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

Definition at line 398 of file AthCommonDataStore.h.


The documentation for this class was generated from the following files: