10 char NewRootFile[255],
17 sprintf(NewRootFile,
"%s",
file);
18 sprintf(NewRootFile+strlen(
file)-5,
"%s\0",
"+seg.root");
19 cout<<strlen(NewRootFile)<<endl;
23 cout<<NewRootFile<<endl;
24 sprintf(TextFile,
"%s",
file);
25 sprintf(TextFile+strlen(
file)-5,
"%s\0",
".txt");
27 sprintf(TextFileTop,
"%s",
file);
28 sprintf(TextFileTop+strlen(
file)-5,
"%s\0",
"_top.txt");
30 sprintf(TextFileBot,
"%s",
file);
31 sprintf(TextFileBot+strlen(
file)-5,
"%s\0",
"_bot.txt");
42 FILE *
f=fopen(TextFile,
"w");
43 FILE *ftop=fopen(TextFileTop,
"w");
44 FILE *fbot=fopen(TextFileBot,
"w");
48 if (pred_file) fpred = fopen(pred_file,
"rt");
50 if (!fscanf(fpred,
"%d",&npr)) npr = 0;
52 printf(
"npr=%d\n",npr);
54 if (npr) nv = npr*2*NumAcq;
56 if (nv>nEntries) nv = nEntries;
57 if ((NumOfViews>0)&&(NumOfViews+firstView<nv)) nv = NumOfViews+firstView;
62 fprintf(
f,
"view,sID,X,Y,Z,Tx,Ty,puls,side\n");
63 fprintf(ftop,
"view,sID,X,Y,Z,Tx,Ty,puls,side\n");
64 fprintf(fbot,
"view,sID,X,Y,Z,Tx,Ty,puls,side\n");
65 float Xpred[2], Ypred[2], tgXpr[2], tgYpr[2];
68 for (
int j=firstView; j<nv; j++) {
77 float tgxmin = -0.050;
79 float tgymin = -0.050;
88 float xpr, ypr, tgxpr, tgypr;
91 if (fpred)
for(;cPred<j/(2*NumAcq);cPred++) {
95 fscanf(fpred,
"%f %f %f %f %d %d",&xpr,&ypr,&tgxpr,&tgypr,&idpr,&pulspr);
97 for(
int l=0;l<2;l++) {
98 if (fscanf(fpred,
"%s %f %f %f %f %d %d", b,&xpr,&ypr,&tgxpr,&tgypr,&idpr,&pulspr)==7) {
99 cout<<b[0]<<
" "<<xpr<<
" "<<ypr<<endl;
101 if (toupper(b[0])==
'T') {
108 else if (toupper(b[0])==
'B') {
115 else printf(
"<<<<<<<<<< UNKNOWN PREDICTION FILE FORMAT! >>>>>>>>>>>>>>\n");
118 printf(
"<<<<<<<<<< UNKNOWN PREDICTION FILE FORMAT >>>>>>>>>>>>>>\n");
124 a2v(Xpred[0],Ypred[0],mark,v,&xv,&yv);
126 tgxmin = tgXpr[0]-0.050;
127 tgxmax = tgXpr[0]+0.050;
128 tgymin = tgYpr[0]-0.050;
129 tgymax = tgYpr[0]+0.050;
138 a2v(Xpred[1],Ypred[1],mark,v,&xv,&yv);
140 tgxmin = tgXpr[1]-0.050;
141 tgxmax = tgXpr[1]+0.050;
142 tgymin = tgYpr[1]-0.050;
143 tgymax = tgYpr[1]+0.050;
152 cout<<
xmin<<
" "<<
xmax<<
" "<<
ymin<<
" "<<
ymax<<
" "<<tgxmin<<
" "<<tgxmax<<
" "<<tgymin<<
" "<<tgymax<<endl<<endl;
161 EdbView* vnew =
tr->AdoptSegment(v,Sx,Sy,
xmin,
xmax,
ymin,
ymax,1.7*Sx,pulsthres,accept,1,1,1);
166 printf(
"View number=%d, nseg=%d, xView=%f, yView=%f \n",j,nseg,v->
GetXview(),v->
GetYview());
167 fprintf(
f,
"View number=%d, nseg=%d \n",j,nseg);
168 for (
int i=0; i<nseg; i++) {
171 fprintf(
f,
"%d , %d , %f , %f , %f , %f , %f , %d , %d\n",j,
s->GetID(),
s->GetX0(),
s->GetY0(),
s->GetZ0(),
s->GetTx(),
s->GetTy(),
s->GetPuls(),
s->GetSide());
172 if (
even(j)) fprintf(ftop,
"%d , %d , %f , %f , %f , %f , %f , %d , %d\n",j,
s->GetID(),
s->GetX0(),
s->GetY0(),
s->GetZ0(),
s->GetTx(),
s->GetTy(),
s->GetPuls(),
s->GetSide());
173 else fprintf(fbot,
"%d , %d , %f , %f , %f , %f , %f , %d , %d\n",j,
s->GetID(),
s->GetX0(),
s->GetY0(),
s->GetZ0(),
s->GetTx(),
s->GetTy(),
s->GetPuls(),
s->GetSide());
174 int nclust =
s->GetNelements();
176 for (
int ic=0; ic<nclust; ic++) {
179 printf(
"<<<<<<<< %d: X=%f, Y=%f, Z=%f\n", ic+1, c->
GetX(), c->
GetY(), c->
GetZ());
180 fprintf(
f,
"<<<<<<<< %d: X=%f, Y=%f, Z=%f\n", ic+1, c->
GetX(), c->
GetY(), c->
GetZ());
FILE * f
Definition: RecDispMC.C:150
TTree * tr
Definition: Shower_E_FromShowerRoot.C:5
Definition: EdbCluster.h:19
Float_t GetX() const
Definition: EdbCluster.h:51
Float_t GetY() const
Definition: EdbCluster.h:52
Float_t GetZ() const
Definition: EdbCluster.h:53
Definition: EdbFiducial.h:88
void Close()
Definition: EdbRun.cxx:466
int GetEntries() const
Definition: EdbRun.h:135
void Save()
Definition: EdbRun.cxx:451
EdbMarksSet * GetMarks() const
Definition: EdbRun.h:119
EdbView * GetEntry(int entry, int ih=1, int icl=0, int iseg=1, int itr=0, int ifr=0)
Definition: EdbRun.cxx:489
void AddView()
Definition: EdbRun.cxx:332
void Print(Option_t *opt="") const
Definition: EdbSegP.cxx:405
Definition: EdbSegment.h:61
Definition: EdbView.h:134
Float_t GetXview() const
Definition: EdbView.h:193
Int_t GetNframesTop() const
Definition: EdbView.h:207
Int_t Nsegments() const
Definition: EdbView.h:216
EdbSegment * GetSegment(int i) const
Definition: EdbView.h:219
Float_t GetYview() const
Definition: EdbView.h:194
float xmin
Definition: emthickness.cpp:61
float ymin
Definition: emthickness.cpp:63
float xmax
Definition: emthickness.cpp:61
float ymax
Definition: emthickness.cpp:63
EdbRun * run
Definition: check_raw.C:38
#define NULL
Definition: nidaqmx.h:84
void a2v(float xa, float ya, EdbMarksSet *mark, EdbView *v, float *xv, float *yv)
Definition: setSegment.C:208
int even(const int n)
Definition: setSegment.C:3
EdbSegP * s
Definition: tlg2pattern.C:32
TFile * file
Definition: write_pvr.C:3