ATLAS Offline Software
Loading...
Searching...
No Matches
InDet::SegmentDriftCircleAssValidation Class Reference

#include <SegmentDriftCircleAssValidation.h>

Inheritance diagram for InDet::SegmentDriftCircleAssValidation:
Collaboration diagram for InDet::SegmentDriftCircleAssValidation:

Public Member Functions

 SegmentDriftCircleAssValidation (const std::string &name, ISvcLocator *pSvcLocator)
virtual ~SegmentDriftCircleAssValidation ()
StatusCode initialize ()
StatusCode execute ()
StatusCode finalize ()
MsgStream & dump (MsgStream &out) const
std::ostream & dump (std::ostream &out) 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 newCirclesEvent (const PRD_MultiTruthCollection *)
void tracksComparison (const Trk::SegmentCollection *, const PRD_MultiTruthCollection *)
void efficiencyReconstruction ()
int QualityTracksSelection ()
std::list< int > kine (const InDet::TRT_DriftCircle *, const PRD_MultiTruthCollection *prdCollection)
std::list< PRD_MultiTruthCollection::const_iterator > kinpart (const InDet::TRT_DriftCircle *, const PRD_MultiTruthCollection *)
bool isTheSameStrawElement (int, const Trk::PrepRawData *)
std::list< PRD_MultiTruthCollection::const_iterator > findTruth (const InDet::TRT_DriftCircle *, bool &, const PRD_MultiTruthCollection *)
MsgStream & dumptools (MsgStream &out) const
MsgStream & dumpevent (MsgStream &out) const
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.

Protected Attributes

int m_nprint
SG::ReadHandleKey< Trk::SegmentCollectionm_origtrackKey { this, "OrigTracksLocation", "TRTSegments", "TRT Segments collection name" }
SG::ReadHandleKey< PRD_MultiTruthCollectionm_PRDTruthTRTKey { this, "TruthNameTRT", "PRD_MultiTruthTRT", "PRD Multitruth collection name" }
SG::ReadHandleKey< TRT_DriftCircleContainer > m_circlesTRTKey { this, "TRT_DriftCirclesName", "TRT_DriftCircles", "TRT Driftcircle container name" }
double m_pTmin
double m_tcut
double m_rapcut
int m_dccut
double m_rmin
double m_rmax
int m_events
int m_ncircles
std::multimap< int, const Trk::PrepRawData * > m_kinecircle
std::list< int > m_allBarcodes
int m_nqsegments
std::list< int > m_particles
std::multimap< int, int > m_allParticles
std::multimap< int, int > m_tracks
int m_efficiency [5] {}

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

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

Detailed Description

Definition at line 28 of file SegmentDriftCircleAssValidation.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

◆ SegmentDriftCircleAssValidation()

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

Definition at line 31 of file SegmentDriftCircleAssValidation.cxx.

31 :
32 AthAlgorithm(name,pSvcLocator),
33 m_nprint (0),
34 m_tcut (0.),
35 m_events (0),
36 m_ncircles (0),
37 m_nqsegments (0)
38{
39
40 // SegmentDriftCircleAssValidation steering parameters
41 //
42 m_pTmin = 500. ;
43 m_rapcut = 2.1 ;
44 m_dccut = 10 ;
45 m_rmin = 0. ;
46 m_rmax = 20. ;
47
48 declareProperty("pTmin", m_pTmin );
49 declareProperty("Pseudorapidity", m_rapcut );
50 declareProperty("MinNumberDCs" , m_dccut );
51 declareProperty("RadiusMin", m_rmin );
52 declareProperty("RadiusMax", m_rmax );
53}
AthAlgorithm()
Default constructor:
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)

◆ ~SegmentDriftCircleAssValidation()

virtual InDet::SegmentDriftCircleAssValidation::~SegmentDriftCircleAssValidation ( )
inlinevirtual

Definition at line 42 of file SegmentDriftCircleAssValidation.h.

42{}

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.

◆ dump() [1/2]

MsgStream & InDet::SegmentDriftCircleAssValidation::dump ( MsgStream & out) const

Definition at line 186 of file SegmentDriftCircleAssValidation.cxx.

187{
188 out<<std::endl;
189 if(m_nprint) return dumpevent(out);
190 return dumptools(out);
191}

◆ dump() [2/2]

std::ostream & InDet::SegmentDriftCircleAssValidation::dump ( std::ostream & out) const

Definition at line 271 of file SegmentDriftCircleAssValidation.cxx.

272{
273 return out;
274}

◆ dumpevent()

MsgStream & InDet::SegmentDriftCircleAssValidation::dumpevent ( MsgStream & out) const
protected

Definition at line 248 of file SegmentDriftCircleAssValidation.cxx.

249{
250 out<<"|---------------------------------------------------------------------|"
251 <<std::endl;
252 out<<"| TRT Drift Circles | "
253 <<std::setw(12)<<m_ncircles
254 <<" |"<<std::endl;
255 out<<"| Good TRT particles size | "
256 <<std::setw(12)<<m_particles.size()
257 <<" |"<<std::endl;
258 out<<"| Number good kine segments | "
259 <<std::setw(12)<<m_nqsegments
260 <<" |"<<std::endl;
261 out<<"|---------------------------------------------------------------------|"
262 <<std::endl;
263
264 return out;
265}

◆ dumptools()

MsgStream & InDet::SegmentDriftCircleAssValidation::dumptools ( MsgStream & out) const
protected

Definition at line 197 of file SegmentDriftCircleAssValidation.cxx.

198{
199 int n;
200
201 out<<"|----------------------------------------------------------------"
202 <<"----------------------------------------------------|"
203 <<std::endl;
204 n = 65-m_origtrackKey.key().size();
205 std::string s1; for(int i=0; i<n; ++i) s1.append(" "); s1.append("|");
206 n = 65-m_circlesTRTKey.key().size();
207 std::string s2; for(int i=0; i<n; ++i) s2.append(" "); s2.append("|");
208 n = 65-m_PRDTruthTRTKey.key().size();
209 std::string s3; for(int i=0; i<n; ++i) s3.append(" "); s3.append("|");
210
211 out<<"| Location of input segmentss | "<<m_origtrackKey.key() <<s1
212 <<std::endl;
213 out<<"| TRT clusters | "<<m_circlesTRTKey.key() <<s2
214 <<std::endl;
215 out<<"| Truth location for trt | "<<m_PRDTruthTRTKey.key() <<s3
216 <<std::endl;
217 out<<"| pT cut | "
218 <<std::setw(14)<<std::setprecision(5)<<m_pTmin
219 <<" |"
220 <<std::endl;
221 out<<"| rapidity cut | "
222 <<std::setw(14)<<std::setprecision(5)<<m_rapcut
223 <<" |"
224 <<std::endl;
225 out<<"| min Radius | "
226 <<std::setw(14)<<std::setprecision(5)<<m_rmin
227 <<" |"
228 <<std::endl;
229 out<<"| max Radius | "
230 <<std::setw(14)<<std::setprecision(5)<<m_rmax
231 <<" |"
232 <<std::endl;
233 out<<"| Min. number drift circles for generated segment | "
234 <<std::setw(14)<<std::setprecision(5)<<m_dccut
235 <<" |"
236 <<std::endl;
237 out<<"|----------------------------------------------------------------"
238 <<"----------------------------------------------------|"
239 <<std::endl;
240
241 return out;
242}
SG::ReadHandleKey< TRT_DriftCircleContainer > m_circlesTRTKey
SG::ReadHandleKey< Trk::SegmentCollection > m_origtrackKey
SG::ReadHandleKey< PRD_MultiTruthCollection > m_PRDTruthTRTKey

◆ efficiencyReconstruction()

void InDet::SegmentDriftCircleAssValidation::efficiencyReconstruction ( )
protected

Definition at line 435 of file SegmentDriftCircleAssValidation.cxx.

436{
437 if(m_particles.empty()) return;
438 std::multimap<int,int>::iterator t, te = m_tracks.end();
439
440 for (auto k: m_particles) {
441
442 std::multimap<int,int>::iterator im = m_allParticles.find(k);
443 int n = (*im).second;
444
445 int m = 0;
446 t = m_tracks.find(k);
447 for(; t!=te; ++t) { //* check if reaching the end of the multimap instead
448 if((*t).first!=k) break;
449 if((*t).second > m) m = (*t).second;
450 }
451 int d = 0;
452 double rd = (double)m/n; if(rd>0.9) d = 0;
453 else if(rd > 0.75) d=1;
454 else if(rd > 0.50) d=2;
455 else if(rd > 0.25) d=3;
456 else if(rd <= 0.25) d=4;
457 ++m_efficiency[d]; ++m_events;
458 }
459
460}

◆ 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 InDet::SegmentDriftCircleAssValidation::execute ( )

Definition at line 88 of file SegmentDriftCircleAssValidation.cxx.

89{
90 msg(MSG::DEBUG) << " InDetSegmentDriftCircleAssValidation execute()" << endmsg;
91
92 SG::ReadHandle<Trk::SegmentCollection> origColTracks( m_origtrackKey );
93
94 if( !origColTracks.isValid() ){
95 msg(MSG::FATAL) << "No TRT tracks with name " << m_origtrackKey.key() << " found in StoreGate!" << endmsg;
96 return StatusCode::FAILURE;
97 }else{
98 msg(MSG::DEBUG) << "Found TRT trak collection " << m_origtrackKey.key() << " in StoreGate!" << endmsg;
99 }
100
101 SG::ReadHandle<PRD_MultiTruthCollection> prdCollection( m_PRDTruthTRTKey );
102
103 if ( !prdCollection.isValid() ){
104 msg(MSG::FATAL) << "TRT PRD_MultiTruthCollection " << m_PRDTruthTRTKey.key() << " NOT found!" << endmsg;
105 return StatusCode::FAILURE;
106 } else {
107 msg(MSG::DEBUG) << "Got TRT PRD_MultiTruthCollection " << m_PRDTruthTRTKey.key() << endmsg;
108 }
109
110 newCirclesEvent( prdCollection.cptr() );
112
113 tracksComparison( origColTracks.cptr(), prdCollection.cptr() );
114
115 if(m_particles.size() > 0) {
116
118
119 }
120
121 if(msgLvl(MSG::DEBUG)){m_nprint=1; msg(MSG::DEBUG) << (*this) << endmsg;}
122
123 return StatusCode::SUCCESS;
124}
#define endmsg
bool msgLvl(const MSG::Level lvl) const
MsgStream & msg() const
void tracksComparison(const Trk::SegmentCollection *, const PRD_MultiTruthCollection *)
void newCirclesEvent(const PRD_MultiTruthCollection *)

◆ 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 InDet::SegmentDriftCircleAssValidation::finalize ( )

Definition at line 130 of file SegmentDriftCircleAssValidation.cxx.

130 {
131
132 if(m_events<=0) return StatusCode::SUCCESS;
133
134 std::cout<<"|-----------------------------------------------------------------------------------|"
135 <<std::endl;
136 std::cout<<"| TrackSegmentValidation statistics"<<std::endl;
137
138 double ne = double(m_events);
139 double ef[5]; for(int i=0; i!=5; ++i) ef[i] = double(m_efficiency[i])/ne;
140
141 std::cout<<"|-----------------------------------------------------------------------------------|"
142 <<std::endl;
143 std::cout<<"| TRT Particles >0.9 >0.75 >0.50 >0.25 <=0.25 |"
144 <<std::endl;
145 std::cout<<"|-----------------------------------------------------------------------------------|"
146 <<std::endl;
147
148 std::cout<<"| "
149 <<std::setw(6)<<m_events<<" "
150 <<std::setw(13)<<std::setprecision(5)<<ef[0]
151 <<std::setw(13)<<std::setprecision(5)<<ef[1]
152 <<std::setw(13)<<std::setprecision(5)<<ef[2]
153 <<std::setw(13)<<std::setprecision(5)<<ef[3]
154 <<std::setw(13)<<std::setprecision(5)<<ef[4]<<" |"
155 <<std::endl;
156 std::cout<<"|-----------------------------------------------------------------------------------|"
157 <<std::endl;
158
159 return StatusCode::SUCCESS;
160}

◆ findTruth()

std::list< PRD_MultiTruthCollection::const_iterator > InDet::SegmentDriftCircleAssValidation::findTruth ( const InDet::TRT_DriftCircle * d,
bool & Q,
const PRD_MultiTruthCollection * prdCollection )
protected

Definition at line 582 of file SegmentDriftCircleAssValidation.cxx.

583{
584 Q = true;
585 std::list<PRD_MultiTruthCollection::const_iterator> mc;
586 if (d) {
587 auto r = prdCollection->equal_range(d->identify());
588 for( auto i = r.first; i != r.second && i != prdCollection->end(); ++i){
589 mc.push_back(i);
590 }
591 }
592 if (mc.empty()) Q = false;
593
594 return mc;
595}
int r
Definition globals.cxx:22

◆ initialize()

StatusCode InDet::SegmentDriftCircleAssValidation::initialize ( )

Definition at line 59 of file SegmentDriftCircleAssValidation.cxx.

60{
61
63
64 m_tcut = 1./tan(2.*atan(exp(-m_rapcut)));
65
66 // Get output print level
67 //
68 if(msgLvl(MSG::DEBUG)){m_nprint=0; msg(MSG::DEBUG) << (*this) << endmsg;}
69
70 // Erase statistics information
71 //
72 m_events = 0 ;
73
74 for(int i=0; i!=5; ++i) m_efficiency[i] = 0;
75
76 // Initialize ReadHandleKey
77 ATH_CHECK( m_origtrackKey.initialize() );
78 ATH_CHECK( m_PRDTruthTRTKey.initialize() );
79 ATH_CHECK( m_circlesTRTKey.initialize() );
80
81 return sc;
82}
#define ATH_CHECK
Evaluate an expression and check for errors.
static Double_t sc
::StatusCode StatusCode
StatusCode definition for legacy code.

◆ 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.

◆ isTheSameStrawElement()

bool InDet::SegmentDriftCircleAssValidation::isTheSameStrawElement ( int K,
const Trk::PrepRawData * d )
protected

Definition at line 566 of file SegmentDriftCircleAssValidation.cxx.

568{
569 std::multimap<int,const Trk::PrepRawData*>::iterator k = m_kinecircle.find(K);
570 for(; k!=m_kinecircle.end(); ++k) {
571
572 if((*k).first!= K) return false;
573 if(d->detectorElement()==(*k).second->detectorElement()) return true;
574 }
575 return false;
576}
std::multimap< int, const Trk::PrepRawData * > m_kinecircle

◆ kine()

std::list< int > InDet::SegmentDriftCircleAssValidation::kine ( const InDet::TRT_DriftCircle * d,
const PRD_MultiTruthCollection * prdCollection )
protected

Definition at line 466 of file SegmentDriftCircleAssValidation.cxx.

468{
469 std::list<int> lk;
470 bool find;
471 std::list<PRD_MultiTruthCollection::const_iterator> mc = findTruth(d,find, prdCollection );
472 if(!find) return lk;
473 std::list<PRD_MultiTruthCollection::const_iterator>::iterator imc, imce=mc.end();
474 for(imc=mc.begin();imc!=imce;++imc){
475 const int uniqueID = HepMC::uniqueID((*imc)->second); if(uniqueID<=0) continue;
476
477 HepMC::ConstGenParticlePtr pa = (*imc)->second.cptr();
478 if(!pa || !pa->production_vertex()) continue;
479
480 // Charge != 0 test
481 //
482 int pdg = pa->pdg_id();
483 if (MC::isNucleus(pdg)) continue; // ignore nuclei from hadronic interactions
484 if(std::abs(MC::charge(pdg)) < .5) continue;
485
486 // pT cut
487 //
488 double pt = pa->momentum().perp();
489 if( pt < m_pTmin ) continue;
490
491 // Rapidity cut
492 //
493 double t = std::abs(pa->momentum().pz())/pt;
494 if( t > m_tcut ) continue;
495
496 // Radius cut
497 //
498 Point3D<double> v(pa->production_vertex()->position().x(),
499 pa->production_vertex()->position().y(),
500 pa->production_vertex()->position().z());
501 double r = sqrt(v.x()*v.x()+v.y()*v.y());
502 if( r < m_rmin || r > m_rmax) continue;
503
504 lk.push_back(uniqueID);
505 }
506
507 return lk;
508}
std::list< PRD_MultiTruthCollection::const_iterator > findTruth(const InDet::TRT_DriftCircle *, bool &, const PRD_MultiTruthCollection *)
std::string find(const std::string &s)
return a remapped string
Definition hcg.cxx:138
int uniqueID(const T &p)
const GenParticle * ConstGenParticlePtr
Definition GenParticle.h:38
double charge(const T &p)
bool isNucleus(const T &p)
PDG rule 16 Nuclear codes are given as 10-digit numbers ±10LZZZAAAI.

◆ kinpart()

std::list< PRD_MultiTruthCollection::const_iterator > InDet::SegmentDriftCircleAssValidation::kinpart ( const InDet::TRT_DriftCircle * d,
const PRD_MultiTruthCollection * prdCollection )
protected

Definition at line 514 of file SegmentDriftCircleAssValidation.cxx.

516{
517
518 std::list<PRD_MultiTruthCollection::const_iterator> lk;
519 bool find;
520 std::list<PRD_MultiTruthCollection::const_iterator> mc = findTruth(d,find, prdCollection );
521 if(!find) return lk;
522
523 std::list<PRD_MultiTruthCollection::const_iterator>::iterator imc, imce=mc.end();
524 for(imc=mc.begin();imc!=imce;++imc){
525
526 const int uniqueID = HepMC::uniqueID((*imc)->second); if(uniqueID<=0) continue;
527
528 HepMC::ConstGenParticlePtr pa = (*imc)->second.cptr();
529 if(!pa || !pa->production_vertex()) continue;
530
531 // Charge != 0 test
532 //
533 int pdg = pa->pdg_id();
534 if (MC::isNucleus(pdg)) continue; // ignore nuclei from hadronic interactions
535 if (std::abs(MC::charge(pdg)) < .5) continue;
536
537 // pT cut
538 //
539 double pt = pa->momentum().perp();
540 if( pt < m_pTmin ) continue;
541
542
543 // Rapidity cut
544 //
545 double t = std::abs(pa->momentum().pz())/pt;
546 if( t > m_tcut ) continue;
547
548 // Radius cut
549 //
550 Point3D<double> v(pa->production_vertex()->position().x(),
551 pa->production_vertex()->position().y(),
552 pa->production_vertex()->position().z());
553 double r = sqrt(v.x()*v.x()+v.y()*v.y());
554 if( r < m_rmin || r > m_rmax) continue;
555
556 lk.push_back((*imc));
557 }
558
559 return lk;
560}

◆ 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 }

◆ newCirclesEvent()

void InDet::SegmentDriftCircleAssValidation::newCirclesEvent ( const PRD_MultiTruthCollection * prdCollection)
protected

Definition at line 280 of file SegmentDriftCircleAssValidation.cxx.

281{
282 m_ncircles = 0;
283 m_kinecircle.clear();
284 m_allBarcodes.clear();
285
286 // Get Drift Circles container
287 //
288 SG::ReadHandle<TRT_DriftCircleContainer> trtcontainer( m_circlesTRTKey );
289
290 // Loop through all pixel clusters
291 //
292 if( trtcontainer.isValid() ) {
293
294 InDet::TRT_DriftCircleContainer::const_iterator w = trtcontainer->begin();
295 InDet::TRT_DriftCircleContainer::const_iterator we = trtcontainer->end ();
296
297 for(; w!=we; ++w) {
298
299 InDet::TRT_DriftCircleCollection::const_iterator c = (*w)->begin();
300 InDet::TRT_DriftCircleCollection::const_iterator ce = (*w)->end ();
301
302 for(; c!=ce; ++c) {
303
304 ++m_ncircles;
305
306 std::list<int> lk = kine((*c), prdCollection );
307 if(int(lk.size())==0) continue;
308 std::list<int>::iterator ik,ike=lk.end();
309 for(ik=lk.begin();ik!=ike;++ik){
310 if(!isTheSameStrawElement((*ik),(*c))) {
311 m_kinecircle.insert(std::make_pair((*ik),(*c)));
312 bool isThere = false;
313 std::list<int>::iterator ii, iie=m_allBarcodes.end();
314 for(ii=m_allBarcodes.begin();ii!=iie;++ii) {
315 if((*ik)==(*ii)) isThere = true;
316 }
317 if(!isThere) m_allBarcodes.push_back((*ik));
318 }
319 }
320 }
321 }
322 }
323}
std::list< int > kine(const InDet::TRT_DriftCircle *, const PRD_MultiTruthCollection *prdCollection)
bool isTheSameStrawElement(int, const Trk::PrepRawData *)

◆ 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.

◆ QualityTracksSelection()

int InDet::SegmentDriftCircleAssValidation::QualityTracksSelection ( )
protected

Definition at line 329 of file SegmentDriftCircleAssValidation.cxx.

330{
331 m_particles.clear();
332 m_allParticles.clear();
333
334 if (m_kinecircle.empty()) return 0;
335
336 std::list<int>::iterator ii,iie=m_allBarcodes.end();
337 for(ii=m_allBarcodes.begin();ii!=iie;++ii) {
338 int ndc = 0;
339 std::multimap<int,const Trk::PrepRawData*>::iterator dc = m_kinecircle .begin();
340 for(; dc!=m_kinecircle.end(); ++dc) {
341 if((*ii)==(*dc).first) ndc++;
342 }
343 m_allParticles.insert(std::make_pair((*ii),ndc));
344 }
345
346 int t = 0;
347 std::multimap<int,int>::iterator im, ime=m_allParticles.end();
348 for(im=m_allParticles.begin(); im!=ime; ++im) {
349 if((*im).second>=m_dccut){
350 m_particles.push_back((*im).first);
351 ++t;
352 }else{
353 m_kinecircle.erase((*im).first);
354 }
355 }
356
357 return t;
358}

◆ 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_ERROR(x)
#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.

◆ tracksComparison()

void InDet::SegmentDriftCircleAssValidation::tracksComparison ( const Trk::SegmentCollection * origColTracks,
const PRD_MultiTruthCollection * prdCollection )
protected

Get the track segment

Definition at line 364 of file SegmentDriftCircleAssValidation.cxx.

365{
366 if(!m_nqsegments) return;
367
368 m_tracks.clear();
369
370 int KINE[200],NKINE[200];
371 for(int i=0;i<200;++i){
372 KINE[i] =0; NKINE[i] = 0;
373 }
374
375 Trk::SegmentCollection::const_iterator iseg = origColTracks->begin();
376 Trk::SegmentCollection::const_iterator isegEnd = origColTracks->end();
377 for(; iseg != isegEnd; ++ iseg) {
378
380 const Trk::TrackSegment *tS = dynamic_cast<const Trk::TrackSegment*>(*iseg);
381 if(!tS) continue;
382
383 int NK = 0;
384
385 for(int it=0; it<int(tS->numberOfMeasurementBases()); ++it){
386 //test if it is a pseudo measurement
387 if ( dynamic_cast<const Trk::PseudoMeasurementOnTrack*>(tS->measurement(it)) ) continue;
388
389 const InDet::TRT_DriftCircleOnTrack* trtcircle = dynamic_cast<const InDet::TRT_DriftCircleOnTrack*>(tS->measurement(it));
390 if(!trtcircle) continue;
391
392 const InDet::TRT_DriftCircle* RawDataClus=dynamic_cast<const InDet::TRT_DriftCircle*>(trtcircle->prepRawData());
393 if(!RawDataClus) continue;
394
395 std::list<PRD_MultiTruthCollection::const_iterator> lk = kinpart(RawDataClus, prdCollection );
396 if (int(lk.size())==0) continue;
397 std::list<PRD_MultiTruthCollection::const_iterator>::iterator ik, ike=lk.end();
398
399 //* looping over the returned list of genParticles
400 for(ik=lk.begin(); ik!=ike; ++ik){
401 const int uniqueID = HepMC::uniqueID((*ik)->second);
402 if (uniqueID<=0) continue;
403 int m = -1;
404
405 for(int n=0; n!=NK; ++n) {
406 if(uniqueID==KINE[n]) {
407 ++NKINE[n];
408 m=n;
409 break;
410 }
411 }
412
413 if(m<0) {
414 KINE[NK] = uniqueID;
415 NKINE[NK] = 1;
416 if(NK < 200) ++NK;
417 }
418 }
419 }
420 int nm = 0, m = 0;
421 for(int n=0; n!=NK; ++n) {
422 if(NKINE[n] > m) {
423 nm = n;
424 m=NKINE[n];
425 }
426 }
427 m_tracks.insert(std::make_pair(KINE[nm],m) ); //* if m=0, the KINE[nm] will be set to the previous one
428 }
429}
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.
std::list< PRD_MultiTruthCollection::const_iterator > kinpart(const InDet::TRT_DriftCircle *, const PRD_MultiTruthCollection *)
virtual const TRT_DriftCircle * prepRawData() const override final
returns the PrepRawData - is a TRT_DriftCircle in this scope
const MeasurementBase * measurement(unsigned int) const
returns the Trk::MeasurementBase objects depending on the integer
unsigned int numberOfMeasurementBases() const
Return the number of contained Trk::MeasurementBase (s)

◆ 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_allBarcodes

std::list<int> InDet::SegmentDriftCircleAssValidation::m_allBarcodes
protected

Definition at line 74 of file SegmentDriftCircleAssValidation.h.

◆ m_allParticles

std::multimap<int,int> InDet::SegmentDriftCircleAssValidation::m_allParticles
protected

Definition at line 77 of file SegmentDriftCircleAssValidation.h.

◆ m_circlesTRTKey

SG::ReadHandleKey<TRT_DriftCircleContainer> InDet::SegmentDriftCircleAssValidation::m_circlesTRTKey { this, "TRT_DriftCirclesName", "TRT_DriftCircles", "TRT Driftcircle container name" }
protected

Definition at line 63 of file SegmentDriftCircleAssValidation.h.

63{ this, "TRT_DriftCirclesName", "TRT_DriftCircles", "TRT Driftcircle container name" };

◆ m_dccut

int InDet::SegmentDriftCircleAssValidation::m_dccut
protected

Definition at line 67 of file SegmentDriftCircleAssValidation.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_efficiency

int InDet::SegmentDriftCircleAssValidation::m_efficiency[5] {}
protected

Definition at line 79 of file SegmentDriftCircleAssValidation.h.

79{} ;

◆ m_events

int InDet::SegmentDriftCircleAssValidation::m_events
protected

Definition at line 71 of file SegmentDriftCircleAssValidation.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_kinecircle

std::multimap<int,const Trk::PrepRawData*> InDet::SegmentDriftCircleAssValidation::m_kinecircle
protected

Definition at line 73 of file SegmentDriftCircleAssValidation.h.

◆ m_ncircles

int InDet::SegmentDriftCircleAssValidation::m_ncircles
protected

Definition at line 72 of file SegmentDriftCircleAssValidation.h.

◆ m_nprint

int InDet::SegmentDriftCircleAssValidation::m_nprint
protected

Definition at line 60 of file SegmentDriftCircleAssValidation.h.

◆ m_nqsegments

int InDet::SegmentDriftCircleAssValidation::m_nqsegments
protected

Definition at line 75 of file SegmentDriftCircleAssValidation.h.

◆ m_origtrackKey

SG::ReadHandleKey<Trk::SegmentCollection> InDet::SegmentDriftCircleAssValidation::m_origtrackKey { this, "OrigTracksLocation", "TRTSegments", "TRT Segments collection name" }
protected

Definition at line 61 of file SegmentDriftCircleAssValidation.h.

61{ this, "OrigTracksLocation", "TRTSegments", "TRT Segments collection name" };

◆ m_particles

std::list<int> InDet::SegmentDriftCircleAssValidation::m_particles
protected

Definition at line 76 of file SegmentDriftCircleAssValidation.h.

◆ m_PRDTruthTRTKey

SG::ReadHandleKey<PRD_MultiTruthCollection> InDet::SegmentDriftCircleAssValidation::m_PRDTruthTRTKey { this, "TruthNameTRT", "PRD_MultiTruthTRT", "PRD Multitruth collection name" }
protected

Definition at line 62 of file SegmentDriftCircleAssValidation.h.

62{ this, "TruthNameTRT", "PRD_MultiTruthTRT", "PRD Multitruth collection name" };

◆ m_pTmin

double InDet::SegmentDriftCircleAssValidation::m_pTmin
protected

Definition at line 64 of file SegmentDriftCircleAssValidation.h.

◆ m_rapcut

double InDet::SegmentDriftCircleAssValidation::m_rapcut
protected

Definition at line 66 of file SegmentDriftCircleAssValidation.h.

◆ m_rmax

double InDet::SegmentDriftCircleAssValidation::m_rmax
protected

Definition at line 69 of file SegmentDriftCircleAssValidation.h.

◆ m_rmin

double InDet::SegmentDriftCircleAssValidation::m_rmin
protected

Definition at line 68 of file SegmentDriftCircleAssValidation.h.

◆ m_tcut

double InDet::SegmentDriftCircleAssValidation::m_tcut
protected

Definition at line 65 of file SegmentDriftCircleAssValidation.h.

◆ m_tracks

std::multimap<int,int> InDet::SegmentDriftCircleAssValidation::m_tracks
protected

Definition at line 78 of file SegmentDriftCircleAssValidation.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: