FEDRA emulsion software from the OPERA Collaboration
EdbTopology Class Reference

#include <EdbVertexComb.h>

Inheritance diagram for EdbTopology:
Collaboration diagram for EdbTopology:

Public Member Functions

void AddSingleTracks (TObjArray &tracks)
 
EdbVertexAddVertex (EdbVertex *v)
 
Float_t DZ ()
 
 EdbTopology ()
 
EdbTrackPGetTrack (int i) const
 
EdbVertexGetVertex (int i) const
 
bool IsEqual (EdbTopology &t)
 
Int_t MaxV ()
 
Int_t Ntr () const
 
Int_t Nvtx () const
 
void OrderVtxByZ ()
 
void Print ()
 
void PrintTracks ()
 
Float_t Probability ()
 
char * TracksStr ()
 
char * VertexStr (EdbVertex &v)
 
virtual ~EdbTopology ()
 

Private Attributes

TObjArray eTracks
 detached tracks - part of the topology but not participated in any vtx More...
 
TObjArray eVertices
 

Constructor & Destructor Documentation

◆ EdbTopology()

EdbTopology::EdbTopology ( )
inline
14{}

◆ ~EdbTopology()

virtual EdbTopology::~EdbTopology ( )
inlinevirtual
15{}

Member Function Documentation

◆ AddSingleTracks()

void EdbTopology::AddSingleTracks ( TObjArray &  tracks)
inline
24{ eTracks.AddAll(&tracks); }
TObjArray eTracks
detached tracks - part of the topology but not participated in any vtx
Definition: EdbVertexComb.h:11
TTree * tracks
Definition: check_tr.C:19

◆ AddVertex()

EdbVertex * EdbTopology::AddVertex ( EdbVertex v)
inline
21{ eVertices.Add(v); return v; }
TObjArray eVertices
Definition: EdbVertexComb.h:10

◆ DZ()

Float_t EdbTopology::DZ ( )
37{
38 float dz=0;
39 int n=Nvtx(); if(n<2) return dz;
40 float zmin,zmax;
41 zmin=zmax=GetVertex(0)->VZ();
42 for(int i=1; i<n; i++)
43 {
44 float z = GetVertex(i)->VZ();
45 if(z>zmax) zmax=z;
46 if(z<zmin) zmin=z;
47 }
48 return zmax-zmin;
49}
brick dz
Definition: RecDispMC.C:107
EdbVertex * GetVertex(int i) const
Definition: EdbVertexComb.h:22
Int_t Nvtx() const
Definition: EdbVertexComb.h:17
Float_t VZ() const
Definition: EdbVertex.h:135

◆ GetTrack()

EdbTrackP * EdbTopology::GetTrack ( int  i) const
inline
23{ return (EdbTrackP *)eTracks.At(i); }
Definition: EdbPattern.h:113

◆ GetVertex()

EdbVertex * EdbTopology::GetVertex ( int  i) const
inline
22{ return (EdbVertex *)eVertices.At(i); }
Definition: EdbVertex.h:69

◆ IsEqual()

bool EdbTopology::IsEqual ( EdbTopology t)
53{
54 if( Nvtx() != t.Nvtx() ) return false;
55 if(Probability() != t.Probability()) return false;
56 if( DZ() != t.DZ() ) return false;
57 return true;
58}
Float_t DZ()
Definition: EdbVertexComb.cxx:36
Float_t Probability()
Definition: EdbVertexComb.cxx:23
TTree * t
Definition: check_shower.C:4

◆ MaxV()

Int_t EdbTopology::MaxV ( )
inline
31{return 0;}

◆ Ntr()

Int_t EdbTopology::Ntr ( ) const
inline
18{return eTracks.GetEntries();}

◆ Nvtx()

Int_t EdbTopology::Nvtx ( ) const
inline
17{return eVertices.GetEntries();}

◆ OrderVtxByZ()

void EdbTopology::OrderVtxByZ ( )
62{
63 int nt = Nvtx();
64 TArrayF rating(nt); TArrayI ind(nt);
65 for(int i=0; i<nt; i++) rating[i] = GetVertex(i)->VZ();
66 Sort( nt, rating.GetArray(), ind.GetArray(), 1 );
67 TObjArray tmparr(nt);
68 for(int i=0; i<nt; i++) tmparr.Add( GetVertex(ind[i]) );
69 eVertices.Clear(); eVertices.AddAll( &tmparr );
70}

◆ Print()

void EdbTopology::Print ( )
114{
115 int nvtx = eVertices.GetEntries();
116 printf("\nEdbTopology: prob = %10.8f dz= %10.2f\n",Probability(), DZ());
117 printf(" id Prob X Y Z MaxImp MaxApert Vol[(0.1mm)³] Tracks\n");
118 for(int i=0; i< nvtx; i++)
119 {
120 EdbVertex *v = GetVertex(i);
121 printf( "%s\n", VertexStr(*v) );
122 }
123 printf( "%s\n", TracksStr() );
124}
char * TracksStr()
Definition: EdbVertexComb.cxx:88
char * VertexStr(EdbVertex &v)
Definition: EdbVertexComb.cxx:99

◆ PrintTracks()

void EdbTopology::PrintTracks ( )
74{
75 printf("---------------------------- Single Tracks --------------------------------------------------------\n");
76 printf(" idtr X Y Z TX TY P idpl\n");
77 printf("--------------------------------------------------------------------------------------------------\n");
78 int ntr = eTracks.GetEntries();
79 for(int i=0; i<ntr; i++) {
80 EdbTrackP *t = GetTrack(i);
81 printf("%5d %12.2f %12.2f %12.2f %8.4f %8.4f %8.2f %4d\n"
82 ,t->ID(), t->X(), t->Y(), t->Z(), t->TX(), t->TY(), t->P(), t->Plate() );
83 }
84 printf("--------------------------------------------------------------------------------------------------\n");
85}
EdbTrackP * GetTrack(int i) const
Definition: EdbVertexComb.h:23

◆ Probability()

Float_t EdbTopology::Probability ( )
24{
25 float prob=1;
26 int n=Nvtx(); if(!n) return 0;
27 for(int i=0; i<n; i++)
28 {
29 EdbVertex *v = GetVertex(i);
30 prob *= v->V()->prob();
31 }
32 return prob;
33}
VERTEX::Vertex * V() const
Definition: EdbVertex.h:154
float prob() const
upper tail $\chi^2$ probability
Definition: VtVertex.C:237

◆ TracksStr()

char * EdbTopology::TracksStr ( )
89{
90 char *str = new char[1000]; memset(str,'\0',1000);
91 char *cstr=str; cstr+=75; memset(str,' ',75);
92 sprintf(cstr," ("); cstr+=4;
93 for(int j=0; j<Ntr(); j++) { sprintf(cstr," %6d", GetTrack(j)->ID() ); cstr+=7; }
94 sprintf(cstr," )"); cstr+=2;
95 return str;
96}
Int_t Ntr() const
Definition: EdbVertexComb.h:18

◆ VertexStr()

char * EdbTopology::VertexStr ( EdbVertex v)
100{
101 char *str = new char[1000]; memset(str,'\0',1000);
102 char *cstr=str;
103 sprintf(cstr,"%5d %9.7f %9.1f %9.1f %9.1f %9.3f %9.4f %9.6f",
104 v.ID(),v.V()->prob(), v.VX(), v.VY(), v.VZ(), v.MaxImpact(), v.MaxAperture(), v.Volume()/100/100/100 );
105 cstr+=75;
106 sprintf(cstr," ("); cstr+=4;
107 for(int j=0; j<v.N(); j++) { sprintf(cstr," %6d", v.GetTrack(j)->ID() ); cstr+=7; }
108 sprintf(cstr," )"); cstr+=2;
109 return str;
110}
Int_t ID() const
Definition: EdbSegP.h:147
Int_t ID() const
Definition: EdbVertex.h:126
Float_t Volume()
Definition: EdbVertex.h:114
Float_t VX() const
Definition: EdbVertex.h:133
Int_t N() const
Definition: EdbVertex.h:121
Float_t VY() const
Definition: EdbVertex.h:134
EdbTrackP * GetTrack(int i)
Definition: EdbVertex.h:141
Float_t MaxImpact()
Definition: EdbVertex.h:116
Float_t MaxAperture()
Definition: EdbVertex.cxx:252

Member Data Documentation

◆ eTracks

TObjArray EdbTopology::eTracks
private

detached tracks - part of the topology but not participated in any vtx

◆ eVertices

TObjArray EdbTopology::eVertices
private

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