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 (const EventContext &ctx)
 Execute method.
StatusCode finalize ()
MsgStream & dump (MsgStream &out) const
std::ostream & dump (std::ostream &out) const
virtual StatusCode sysInitialize () override
 Override sysInitialize.
virtual bool isClonable () const override
 Specify if the algorithm is clonable.
virtual StatusCode sysExecute (const EventContext &ctx) override
 Execute an algorithm.
virtual const DataObjIDColl & extraOutputDeps () const override
 Return the list of extra output dependencies.
virtual bool filterPassed (const EventContext &ctx) const
 Get filter decision:
virtual void setFilterPassed (bool state, const EventContext &ctx) const
 Set filter decision:
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
virtual bool isReEntrant () const override final
 Legacy algorithms are not thread-safe.
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
 Extra output dependency collection, extended by AthAlgorithmDHUpdate to add symlinks.
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 31 of file SegmentDriftCircleAssValidation.h.

Member Typedef Documentation

◆ StoreGateSvc_t

typedef ServiceHandle<StoreGateSvc> AthCommonDataStore< AthCommonMsg< Gaudi::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 33 of file SegmentDriftCircleAssValidation.cxx.

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

◆ ~SegmentDriftCircleAssValidation()

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

Definition at line 45 of file SegmentDriftCircleAssValidation.h.

45{}

Member Function Documentation

◆ declareGaudiProperty()

Gaudi::Details::PropertyBase & AthCommonDataStore< AthCommonMsg< Gaudi::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< Gaudi::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< Gaudi::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 188 of file SegmentDriftCircleAssValidation.cxx.

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

◆ dump() [2/2]

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

Definition at line 273 of file SegmentDriftCircleAssValidation.cxx.

274{
275 return out;
276}

◆ dumpevent()

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

Definition at line 250 of file SegmentDriftCircleAssValidation.cxx.

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

◆ dumptools()

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

Definition at line 199 of file SegmentDriftCircleAssValidation.cxx.

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

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

◆ evtStore()

ServiceHandle< StoreGateSvc > & AthCommonDataStore< AthCommonMsg< Gaudi::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 ( const EventContext & ctx)
virtual

Execute method.

Implements AthAlgorithm.

Definition at line 90 of file SegmentDriftCircleAssValidation.cxx.

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

◆ extraDeps_update_handler()

void AthCommonDataStore< AthCommonMsg< Gaudi::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 & AthCommonAlgorithm< Gaudi::Algorithm >::extraOutputDeps ( ) const
overridevirtualinherited

Return the list of extra output dependencies.

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

Definition at line 89 of file AthCommonAlgorithm.cxx.

54{
55 // If we didn't find any symlinks to add, just return the collection
56 // from the base class. Otherwise, return the extended collection.
57 if (!m_extendedExtraObjects.empty()) {
59 }
61}
Common base class for algorithms.

◆ filterPassed()

virtual bool AthCommonAlgorithm< Gaudi::Algorithm >::filterPassed ( const EventContext & ctx) const
inlinevirtualinherited

Get filter decision:

Definition at line 93 of file AthCommonAlgorithm.h.

93 {
94 return execState( ctx ).filterPassed();
95 }
virtual bool filterPassed(const EventContext &ctx) const
Get filter decision:

◆ finalize()

StatusCode InDet::SegmentDriftCircleAssValidation::finalize ( )

Definition at line 132 of file SegmentDriftCircleAssValidation.cxx.

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

◆ 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 585 of file SegmentDriftCircleAssValidation.cxx.

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

◆ initialize()

StatusCode InDet::SegmentDriftCircleAssValidation::initialize ( )

Definition at line 61 of file SegmentDriftCircleAssValidation.cxx.

62{
63
65
66 m_tcut = 1./tan(2.*atan(exp(-m_rapcut)));
67
68 // Get output print level
69 //
70 if(msgLvl(MSG::DEBUG)){m_nprint=0; msg(MSG::DEBUG) << (*this) << endmsg;}
71
72 // Erase statistics information
73 //
74 m_events = 0 ;
75
76 for(int i=0; i!=5; ++i) m_efficiency[i] = 0;
77
78 // Initialize ReadHandleKey
79 ATH_CHECK( m_origtrackKey.initialize() );
80 ATH_CHECK( m_PRDTruthTRTKey.initialize() );
81 ATH_CHECK( m_circlesTRTKey.initialize() );
82
83 return sc;
84}
#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< Gaudi::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.

◆ isClonable()

virtual bool AthCommonAlgorithm< Gaudi::Algorithm >::isClonable ( ) const
inlineoverridevirtualinherited

Specify if the algorithm is clonable.

Only relevant for non-reentrant algorithms. Actual number of clones needs to be set via the "Cardinality" property.

Reimplemented in AFP_DigiTop, AlgB, AlgT, BCM_Digitization, CscDigitBuilder, CscDigitToCscRDO, G4AtlasAlg, G4RunAlg, HGTD_Digitization, HiveAlgBase, InDet::GNNSeedingTrackMaker, InDet::SCT_Clusterization, InDet::SiSPGNNTrackMaker, InDet::SiSPSeededTrackFinder, InDet::SiTrackerSpacePointFinder, ISF::SimKernelMT, ITk::StripDigitization, ITkPixelCablingAlg, ITkStripCablingAlg, LArHitEMapMaker, LArTTL1Maker, LUCID_DigiTop, LVL1::L1TopoSimulation, MergeCalibHits, MergeGenericMuonSimHitColl, MergeHijingPars, MergeMcEventCollection, MergeTrackRecordCollection, MergeTruthJets, MergeTruthParticles, MuonDigitizer, PileUpMTAlg, PixelDigitization, RoIBResultToxAOD, SCT_ByteStreamErrorsTestAlg, SCT_CablingCondAlgFromCoraCool, SCT_CablingCondAlgFromText, SCT_ConditionsParameterTestAlg, SCT_ConditionsSummaryTestAlg, SCT_ConfigurationConditionsTestAlg, SCT_Digitization, SCT_FlaggedConditionTestAlg, SCT_LinkMaskingTestAlg, SCT_MajorityConditionsTestAlg, SCT_ModuleVetoTestAlg, SCT_MonitorConditionsTestAlg, SCT_PrepDataToxAOD, SCT_RawDataToxAOD, SCT_ReadCalibChipDataTestAlg, SCT_ReadCalibDataTestAlg, SCT_RODVetoTestAlg, SCT_SensorsTestAlg, SCT_SiliconConditionsTestAlg, SCT_StripVetoTestAlg, SCT_TdaqEnabledTestAlg, SCT_TestCablingAlg, SCTEventFlagWriter, SCTRawDataProvider, SCTSiLorentzAngleTestAlg, SCTSiPropertiesTestAlg, SGInputLoader, Simulation::BeamEffectsAlg, TileHitVecToCnt, TileMuonFitter, TilePulseForTileMuonReceiver, TileRawChannelMaker, TRTDigitization, and ZDC_DigiTop.

Definition at line 68 of file AthCommonAlgorithm.h.

68 {
69 return true;
70 }

◆ isReEntrant()

virtual bool AthAlgorithm::isReEntrant ( ) const
inlinefinaloverrideprotectedvirtualinherited

Legacy algorithms are not thread-safe.

Definition at line 47 of file AthAlgorithm.h.

47{ return false; }

◆ isTheSameStrawElement()

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

Definition at line 569 of file SegmentDriftCircleAssValidation.cxx.

571{
572 std::multimap<int,const Trk::PrepRawData*>::iterator k = m_kinecircle.find(K);
573 for(; k!=m_kinecircle.end(); ++k) {
574
575 if((*k).first!= K) return false;
576 if(d->detectorElement()==(*k).second->detectorElement()) return true;
577 }
578 return false;
579}
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 469 of file SegmentDriftCircleAssValidation.cxx.

471{
472 std::list<int> lk;
473 bool find;
474 std::list<PRD_MultiTruthCollection::const_iterator> mc = findTruth(d,find, prdCollection );
475 if(!find) return lk;
476 std::list<PRD_MultiTruthCollection::const_iterator>::iterator imc, imce=mc.end();
477 for(imc=mc.begin();imc!=imce;++imc){
478 const int uniqueID = HepMC::uniqueID((*imc)->second); if(uniqueID<=0) continue;
479
480 HepMC::ConstGenParticlePtr pa = (*imc)->second.cptr();
481 if(!pa || !pa->production_vertex()) continue;
482
483 // Charge != 0 test
484 //
485 int pdg = pa->pdg_id();
486 if (MC::isNucleus(pdg)) continue; // ignore nuclei from hadronic interactions
487 if(std::abs(MC::charge(pdg)) < .5) continue;
488
489 // pT cut
490 //
491 double pt = pa->momentum().perp();
492 if( pt < m_pTmin ) continue;
493
494 // Rapidity cut
495 //
496 double t = std::abs(pa->momentum().pz())/pt;
497 if( t > m_tcut ) continue;
498
499 // Radius cut
500 //
501 Point3D<double> v(pa->production_vertex()->position().x(),
502 pa->production_vertex()->position().y(),
503 pa->production_vertex()->position().z());
504 double r = sqrt(v.x()*v.x()+v.y()*v.y());
505 if( r < m_rmin || r > m_rmax) continue;
506
507 lk.push_back(uniqueID);
508 }
509
510 return lk;
511}
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:140
int uniqueID(const T &p)
HepMC3::ConstGenParticlePtr ConstGenParticlePtr
Definition GenParticle.h:20
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 517 of file SegmentDriftCircleAssValidation.cxx.

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

◆ msg()

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

Definition at line 24 of file AthCommonMsg.h.

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

◆ msgLvl()

bool AthCommonMsg< Gaudi::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 282 of file SegmentDriftCircleAssValidation.cxx.

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

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

◆ 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< Gaudi::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< Gaudi::Algorithm > >::renounceArray ( SG::VarHandleKeyArray & handlesArray)
inlineprotectedinherited

remove all handles from I/O resolution

Definition at line 364 of file AthCommonDataStore.h.

364 {
366 }

◆ setFilterPassed()

virtual void AthCommonAlgorithm< Gaudi::Algorithm >::setFilterPassed ( bool state,
const EventContext & ctx ) const
inlinevirtualinherited

Set filter decision:

Reimplemented in AthFilterAlgorithm.

Definition at line 99 of file AthCommonAlgorithm.h.

99 {
101 }
virtual void setFilterPassed(bool state, const EventContext &ctx) const
Set filter decision:

◆ sysExecute()

StatusCode AthCommonAlgorithm< Gaudi::Algorithm >::sysExecute ( const EventContext & ctx)
overridevirtualinherited

Execute an algorithm.

We override this in order to work around an issue with the Algorithm base class storing the event context in a member variable that can cause crashes in MT jobs.

Reimplemented in AthAnalysisAlgorithm.

Definition at line 80 of file AthCommonAlgorithm.cxx.

41{
42 return BaseAlg::sysExecute (ctx);
43}

◆ sysInitialize()

StatusCode AthCommonAlgorithm< Gaudi::Algorithm >::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< Gaudi::Algorithm > >.

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

Definition at line 60 of file AthCommonAlgorithm.cxx.

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

◆ sysStart()

virtual StatusCode AthCommonDataStore< AthCommonMsg< Gaudi::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 366 of file SegmentDriftCircleAssValidation.cxx.

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

Member Data Documentation

◆ m_allBarcodes

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

Definition at line 77 of file SegmentDriftCircleAssValidation.h.

◆ m_allParticles

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

Definition at line 80 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 66 of file SegmentDriftCircleAssValidation.h.

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

◆ m_dccut

int InDet::SegmentDriftCircleAssValidation::m_dccut
protected

Definition at line 70 of file SegmentDriftCircleAssValidation.h.

◆ m_detStore

StoreGateSvc_t AthCommonDataStore< AthCommonMsg< Gaudi::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 82 of file SegmentDriftCircleAssValidation.h.

82{} ;

◆ m_events

int InDet::SegmentDriftCircleAssValidation::m_events
protected

Definition at line 74 of file SegmentDriftCircleAssValidation.h.

◆ m_evtStore

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

Pointer to StoreGate (event store by default).

Definition at line 390 of file AthCommonDataStore.h.

◆ m_extendedExtraObjects

DataObjIDColl AthCommonAlgorithm< Gaudi::Algorithm >::m_extendedExtraObjects
privateinherited

Extra output dependency collection, extended by AthAlgorithmDHUpdate to add symlinks.

Empty if no symlinks were found.

Definition at line 108 of file AthCommonAlgorithm.h.

◆ m_kinecircle

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

Definition at line 76 of file SegmentDriftCircleAssValidation.h.

◆ m_ncircles

int InDet::SegmentDriftCircleAssValidation::m_ncircles
protected

Definition at line 75 of file SegmentDriftCircleAssValidation.h.

◆ m_nprint

int InDet::SegmentDriftCircleAssValidation::m_nprint
protected

Definition at line 63 of file SegmentDriftCircleAssValidation.h.

◆ m_nqsegments

int InDet::SegmentDriftCircleAssValidation::m_nqsegments
protected

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

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

◆ m_particles

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

Definition at line 79 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 65 of file SegmentDriftCircleAssValidation.h.

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

◆ m_pTmin

double InDet::SegmentDriftCircleAssValidation::m_pTmin
protected

Definition at line 67 of file SegmentDriftCircleAssValidation.h.

◆ m_rapcut

double InDet::SegmentDriftCircleAssValidation::m_rapcut
protected

Definition at line 69 of file SegmentDriftCircleAssValidation.h.

◆ m_rmax

double InDet::SegmentDriftCircleAssValidation::m_rmax
protected

Definition at line 72 of file SegmentDriftCircleAssValidation.h.

◆ m_rmin

double InDet::SegmentDriftCircleAssValidation::m_rmin
protected

Definition at line 71 of file SegmentDriftCircleAssValidation.h.

◆ m_tcut

double InDet::SegmentDriftCircleAssValidation::m_tcut
protected

Definition at line 68 of file SegmentDriftCircleAssValidation.h.

◆ m_tracks

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

Definition at line 81 of file SegmentDriftCircleAssValidation.h.

◆ m_varHandleArraysDeclared

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

Definition at line 399 of file AthCommonDataStore.h.

◆ m_vhka

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

Definition at line 398 of file AthCommonDataStore.h.


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