28{
30
32
34 char nme[64];
35 float a11, a12, a21, a22, bb1, bb2;
36 float Zoff;
37
38 double x0[10000];
39 double y0[10000];
41 double tx0[10000];
42 double ty0[10000];
43 double chi20[10000];
44 double P0[10000];
45 int W0[10000];
46 int Flag0[10000];
47 int MCid[10000];
48 int TRid[10000];
49 double Esim[10000];
50 int id[10000];
51 int Pid[10000];
52 int Ncand=0;
53 int trid(0), nseg, n0;
54
55
56
57
58
59
60
61 sprintf(
fname,
"data/01_001.cp.root");
62
63 file1 =
new TFile(
fname ,
"READ");
64
65 sprintf(nme,"par/01_001.par");
66 shower.
ReadAffAndZ(nme,&Zoff,&a11,&a12,&a21,&a22,&bb1,&bb2 );
67
68
69 TTree *tree = (TTree*)file1->Get("couples");
72
74 tree->SetBranchAddress(
"s.", &
s);
75 tree->SetBranchAddress(
"cp", &
cp);
76 int nentries = int(tree->GetEntries());
77
79 tree->GetEntry(i);
80
81
82
83
84
85 if (
s->MCEvt()!=1)
continue;
86
87
88
89
90
91
93 {
94 x0[Ncand] = a11*
s->X() + a12*
s->Y() + bb1;
95 y0[Ncand] = a21*
s->X() + a22*
s->Y() + bb2;
97 tx0[Ncand] = a11*
s->TX()+ a12*
s->TY() ;
98 ty0[Ncand] = a21*
s->TX()+ a22*
s->TY();
99 TRid[Ncand] =
s->MCEvt();
100 Esim[Ncand] =
s->P();
102 Pid[Ncand] = Zoff/1290+1;
103
104 }
105 else
106 {
110 tx0[Ncand] =
s->TX();
111 ty0[Ncand] =
s->TY();
112 chi20[Ncand] =
s->Chi2();
115 Flag0[Ncand] =
s->Flag();
116 TRid[Ncand] =
s->MCEvt();
117 Esim[Ncand] =
s->P();
119 Pid[Ncand] = Zoff/1290+1;
120
121 }
122 Ncand++;
123 }
124 printf("Ncand: %f\n",Ncand);
125 file1->Close();
126
127
128
129
130
131
132
133
134
135 shower.
rec(num,
MAXPLATE,
DATA,Ncand,x0,y0,
z0,tx0,ty0,chi20,W0,P0,Flag0,Pid,
id,TRid,Esim,
piece2,
piece2par,UPDOWN);
136
137
138}
brick z0
Definition: RecDispMC.C:106
Definition: EdbSegCouple.h:17
Definition: EdbShowerRec.h:25
void rec(int num, int MAXPLATE, int DATA, int Ncand, double *x0, double *y0, double *z0, double *tx0, double *ty0, int *plate0, int *id0, int *TRid, double *Esim, int *mcDigitIndexTop, int *mcDigitIndexBottom, int piece2, int piece2par, int DOWN, EdbPVRec *pvr)
OLD — not used anymore....
Definition: EdbShowerRec.cxx:317
void ReadAffAndZ(char *fname, Float_t *pZoffs, Float_t *a11, Float_t *a12, Float_t *a21, Float_t *a22, Float_t *b1, Float_t *b2)
Definition: EdbShowerRec.cxx:1860
int nentries
Definition: check_shower.C:40
s
Definition: check_shower.C:55
EdbSegCouple * cp
Definition: tlg2couples.C:28
const char * fname
Definition: mc2raw.cxx:41
Definition: shower_btr.C:15
int piece2par
Definition: shower_btr.C:22
int piece2
Definition: shower_btr.C:21
int DATA
Definition: shower_btr.C:24
int MAXPLATE
Definition: shower_btr.C:19