ATLAS Offline Software
Loading...
Searching...
No Matches
ClusterSeg::ClusterNtuple Struct Reference

#include <ClusterNtuple.h>

Collaboration diagram for ClusterSeg::ClusterNtuple:

Public Member Functions

void initForWrite (TTree &tree)
void initForRead (TTree &tree)
void fill (const double &fillVal, FillType theFillType)
void fill (const Cluster &cluster)
void fill (const std::vector< Cluster * > &clusters)
bool read (std::vector< Cluster * > &clusters)
void reset ()
void init ()

Static Public Member Functions

static void clean (std::vector< Cluster * > &clusters)

Public Attributes

double residualT [CLUSTERSIZE]
double residual [CLUSTERSIZE]
int nMDT
int nMDTT
double chi2T [CLUSTERSIZE]
double chi2 [CLUSTERSIZE]
int ntracksT
int ntracks
int nclusters
double x [CLUSTERSIZE]
double y [CLUSTERSIZE]
double z [CLUSTERSIZE]
int tIndex [CLUSTERSIZE]
int pIndex [CLUSTERSIZE]
bool isPhi [CLUSTERSIZE]
bool isMatch [CLUSTERSIZE]
int barcode [CLUSTERSIZE]

Static Public Attributes

static const int CLUSTERSIZE = 50000

Detailed Description

Definition at line 22 of file ClusterNtuple.h.

Member Function Documentation

◆ clean()

void ClusterSeg::ClusterNtuple::clean ( std::vector< Cluster * > & clusters)
static

Definition at line 117 of file ClusterNtuple.cxx.

117 {
118 for(auto& it: clusters) delete it;
119 }

◆ fill() [1/3]

void ClusterSeg::ClusterNtuple::fill ( const Cluster & cluster)

Definition at line 54 of file ClusterNtuple.cxx.

54 {
55 if( nclusters >= CLUSTERSIZE ) return;
56 x[nclusters] = cluster.m_x;
57 y[nclusters] = cluster.m_y;
58 z[nclusters] = cluster.m_z;
59 isPhi[nclusters] = cluster.m_isPhi;
60 tIndex[nclusters] = (int)cluster.m_tIndex;
61 pIndex[nclusters] = (int)cluster.m_pIndex;
62 isMatch[nclusters] = cluster.m_isMatch;
63 barcode[nclusters] = cluster.m_barcode;
64 ++nclusters;
65 }
int tIndex[CLUSTERSIZE]
int pIndex[CLUSTERSIZE]
double x[CLUSTERSIZE]
int barcode[CLUSTERSIZE]
bool isPhi[CLUSTERSIZE]
double z[CLUSTERSIZE]
static const int CLUSTERSIZE
double y[CLUSTERSIZE]
bool isMatch[CLUSTERSIZE]

◆ fill() [2/3]

void ClusterSeg::ClusterNtuple::fill ( const double & fillVal,
FillType theFillType )

Definition at line 67 of file ClusterNtuple.cxx.

67 {
68 if (theFillType == FillType::chi2){
69 if( ntracks >= CLUSTERSIZE ) return;
70 chi2[ntracks] = theVal;
71 ++ntracks;
72 }
73
74 if (theFillType == FillType::chi2T){
75 if( ntracksT >= CLUSTERSIZE ) return;
76 chi2T[ntracksT] = theVal;
77 ++ntracksT;
78 }
79
80 if (theFillType == FillType::residual){
81 if( ntracks >= CLUSTERSIZE ) return;
82 residual[nMDT] = theVal;
83 ++nMDT;
84 }
85
86 if (theFillType == FillType::residualT){
87 if( ntracksT >= CLUSTERSIZE ) return;
88 residualT[nMDTT] = theVal;
89 ++nMDTT;
90 }
91
92 }
double chi2[CLUSTERSIZE]
double chi2T[CLUSTERSIZE]
double residual[CLUSTERSIZE]
double residualT[CLUSTERSIZE]

◆ fill() [3/3]

void ClusterSeg::ClusterNtuple::fill ( const std::vector< Cluster * > & clusters)

Definition at line 50 of file ClusterNtuple.cxx.

50 {
51 for(const auto& it: clusters) fill(*it);
52 }
void fill(const double &fillVal, FillType theFillType)

◆ init()

void ClusterSeg::ClusterNtuple::init ( )

Definition at line 121 of file ClusterNtuple.cxx.

121 {
122 nclusters = 0;
123 ntracks = 0;
124 ntracksT = 0;
125 nMDT = 0;
126 nMDTT = 0;
127 }

◆ initForRead()

void ClusterSeg::ClusterNtuple::initForRead ( TTree & tree)

Definition at line 38 of file ClusterNtuple.cxx.

38 {
39 tree.SetBranchAddress("nclusters",&nclusters);
40 tree.SetBranchAddress("x",&x);
41 tree.SetBranchAddress("y",&y);
42 tree.SetBranchAddress("z",&z);
43 tree.SetBranchAddress("isPhi",&isPhi);
44 tree.SetBranchAddress("techIndex",&tIndex);
45 tree.SetBranchAddress("phiIndex",&pIndex);
46 tree.SetBranchAddress("isMatch",&isMatch);
47 tree.SetBranchAddress("barcode",&barcode);
48 }
TChain * tree

◆ initForWrite()

void ClusterSeg::ClusterNtuple::initForWrite ( TTree & tree)

Definition at line 17 of file ClusterNtuple.cxx.

17 {
18 init();
19 tree.Branch("nclusters",&nclusters,"nclusters/I");
20 tree.Branch("x",&x,"x[nclusters]/D");
21 tree.Branch("y",&y,"y[nclusters]/D");
22 tree.Branch("z",&z,"z[nclusters]/D");
23 tree.Branch("isPhi",&isPhi,"isPhi[nclusters]/O");
24 tree.Branch("techIndex",&tIndex,"techIndex[nclusters]/I");
25 tree.Branch("phiIndex",&pIndex,"phiIndex[nclusters]/I");
26 tree.Branch("isMatch",&isMatch,"isMatch[nclusters]/O");
27 tree.Branch("barcode",&barcode,"barcode[nclusters]/I");
28 tree.Branch("ntracks",&ntracks,"ntracks/I");
29 tree.Branch("chi2",&chi2,"chi2[ntracks]/D");
30 tree.Branch("ntracksT",&ntracksT,"ntracksT/I");
31 tree.Branch("chi2T",&chi2T,"chi2T[ntracksT]/D");
32 tree.Branch("nMDT",&nMDT,"nMDT/I");
33 tree.Branch("residual",&residual,"residual[nMDT]/D");
34 tree.Branch("nMDTT",&nMDTT,"nMDTT/I");
35 tree.Branch("residualT",&residualT,"residualT[nMDTT]/D");
36 }

◆ read()

bool ClusterSeg::ClusterNtuple::read ( std::vector< Cluster * > & clusters)

Definition at line 102 of file ClusterNtuple.cxx.

102 {
103 if( nclusters == 0 ) {
104 MsgStream log(Athena::getMessageSvc(),"ClusterNtuple::read");
105 if(log.level()<=MSG::DEBUG) log << MSG::DEBUG << " ntuple not initialized for reading " << endmsg;
106 return false;
107 }
108
109 for( int i=0;i<nclusters;++i){
110 Cluster* cluster = new Cluster(x[i],y[i],z[i],isPhi[i],tIndex[i],pIndex[i],isMatch[i],barcode[i]);
111 clusters.push_back(cluster);
112 }
113
114 return true;
115 }
#define endmsg
IMessageSvc * getMessageSvc(bool quiet=false)

◆ reset()

void ClusterSeg::ClusterNtuple::reset ( )

Definition at line 94 of file ClusterNtuple.cxx.

94 {
95 nclusters = 0;
96 ntracks = 0;
97 ntracksT = 0;
98 nMDT = 0;
99 nMDTT = 0;
100 }

Member Data Documentation

◆ barcode

int ClusterSeg::ClusterNtuple::barcode[CLUSTERSIZE]

Definition at line 55 of file ClusterNtuple.h.

◆ chi2

double ClusterSeg::ClusterNtuple::chi2[CLUSTERSIZE]

Definition at line 44 of file ClusterNtuple.h.

◆ chi2T

double ClusterSeg::ClusterNtuple::chi2T[CLUSTERSIZE]

Definition at line 43 of file ClusterNtuple.h.

◆ CLUSTERSIZE

const int ClusterSeg::ClusterNtuple::CLUSTERSIZE = 50000
static

Definition at line 37 of file ClusterNtuple.h.

◆ isMatch

bool ClusterSeg::ClusterNtuple::isMatch[CLUSTERSIZE]

Definition at line 54 of file ClusterNtuple.h.

◆ isPhi

bool ClusterSeg::ClusterNtuple::isPhi[CLUSTERSIZE]

Definition at line 53 of file ClusterNtuple.h.

◆ nclusters

int ClusterSeg::ClusterNtuple::nclusters

Definition at line 47 of file ClusterNtuple.h.

◆ nMDT

int ClusterSeg::ClusterNtuple::nMDT

Definition at line 41 of file ClusterNtuple.h.

◆ nMDTT

int ClusterSeg::ClusterNtuple::nMDTT

Definition at line 42 of file ClusterNtuple.h.

◆ ntracks

int ClusterSeg::ClusterNtuple::ntracks

Definition at line 46 of file ClusterNtuple.h.

◆ ntracksT

int ClusterSeg::ClusterNtuple::ntracksT

Definition at line 45 of file ClusterNtuple.h.

◆ pIndex

int ClusterSeg::ClusterNtuple::pIndex[CLUSTERSIZE]

Definition at line 52 of file ClusterNtuple.h.

◆ residual

double ClusterSeg::ClusterNtuple::residual[CLUSTERSIZE]

Definition at line 40 of file ClusterNtuple.h.

◆ residualT

double ClusterSeg::ClusterNtuple::residualT[CLUSTERSIZE]

Definition at line 39 of file ClusterNtuple.h.

◆ tIndex

int ClusterSeg::ClusterNtuple::tIndex[CLUSTERSIZE]

Definition at line 51 of file ClusterNtuple.h.

◆ x

double ClusterSeg::ClusterNtuple::x[CLUSTERSIZE]

Definition at line 48 of file ClusterNtuple.h.

◆ y

double ClusterSeg::ClusterNtuple::y[CLUSTERSIZE]

Definition at line 49 of file ClusterNtuple.h.

◆ z

double ClusterSeg::ClusterNtuple::z[CLUSTERSIZE]

Definition at line 50 of file ClusterNtuple.h.


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