FEDRA emulsion software from the OPERA Collaboration
shower_tr.C File Reference
#include "TMultiLayerPerceptron.h"
Include dependency graph for shower_tr.C:

Namespaces

namespace  SHOWER_PAR
 

Functions

void link ()
 
void PrintShowerPar ()
 
void SetShowerPar (int down, int plate, int maxplate, int piece2, int piece2par, int data)
 
void shower_tr ()
 

Variables

const char * SHOWER_PAR::def = "pi0.def"
 
int SHOWER_PAR::event = 1
 

Function Documentation

◆ link()

void link ( )
51{
52 using namespace SHOWER_PAR;
53
54 // this function read basetracks for a given simulated event and create
55 // the linked_track.root file
56 char cmd[256];
57 /*
58 FILE *f = fopen("default.par","w");
59 fprintf(f,"INCLUDE opera_emulsion.par\n");
60 fprintf(f,"RCUT 0 abs(s.eTX)<1.\&\&abs(s.eTY)<1.\&\&(s.eMCEvt==%d\|\|s.eMCEvt<0)\n",event);
61 fclose(f);
62 */
63 sprintf(cmd,"recset -t -p1. %s",def);
64 gSystem->Exec(cmd);
65}
Definition: shower_btr.C:15
const char * def
Definition: shower_tr.C:24

◆ PrintShowerPar()

void PrintShowerPar ( )
42{
43 std::cout << "DOWN: " << SHOWER_PAR::DOWN << "\n" <<
44 "PLATE: " << SHOWER_PAR::PLATE << "\n" <<
45 "MAX_PLATE: " << SHOWER_PAR::MAXPLATE << "\n" <<
46 "piece2: " << SHOWER_PAR::piece2 << "\n" <<
47 "piece2par: " << SHOWER_PAR::piece2par << std::endl ;
48}
int piece2par
Definition: shower_btr.C:22
int DOWN
Definition: shower_btr.C:16
int piece2
Definition: shower_btr.C:21
int PLATE
Definition: shower_btr.C:18
int MAXPLATE
Definition: shower_btr.C:19

◆ SetShowerPar()

void SetShowerPar ( int  down,
int  plate,
int  maxplate,
int  piece2,
int  piece2par,
int  data 
)
32{
33 SHOWER_PAR::DOWN = down ;
35 SHOWER_PAR::MAXPLATE = maxplate ;
38 SHOWER_PAR::DATA = data ;
39}
Int_t plate
Definition: merge_Energy_SytematicSources_Electron.C:1
int DATA
Definition: shower_btr.C:24

◆ shower_tr()

void shower_tr ( )
68{
69 using namespace SHOWER_PAR;
70
71 //link();
72
73 EdbShowerRec shower;
74 char fname[128];
75 char nme[64];
76 float a11, a12, a21, a22, bb1, bb2;
77 float Zoff;
78 int Zbrick [57];
79 double x0[10000];
80 double y0[10000];
81 double z0[10000];
82 double tx0[10000];
83 double ty0[10000];
84 double chi20[10000];
85 double P0[10000];
86 int W0[10000];
87 int Flag0[10000];
88 int MCid[10000];
89 int TRid[10000];
90 int id[10000];
91 int Pid[10000];
92 double Esim[10000];
93 int Ncand=0;
94 int trid(0), nseg, n0;
95
96 //SELECTION of the FIRST BASETRACK of each reconstructed tracks in linked_tracks.root
97 //
98 sprintf(fname,"linked_tracks.root");
99 file1 = new TFile(fname ,"READ");
100
101 EdbSegP *tr = new EdbSegP();
102 EdbSegP *s = new EdbSegP();
103 TClonesArray *as = 0;
104
105 TTree *tree= (TTree*)file1->Get("tracks");
106
107 tree->SetBranchAddress("trid",&trid);
108 tree->SetBranchAddress("nseg",&nseg);
109 tree->SetBranchAddress("n0",&n0);
110
111 b1 = tree->GetBranch("t.");
112 b1->SetAddress(&tr);
113
114 b2 = tree->GetBranch("s");
115 b2->SetAddress(&as);
116
117 //if (tr->TX()<0.2) continue;
118 //if (tr->TY()<0.2) continue;
119 //if (nseg<3) continue;
120
121 int nentries = int(tree->GetEntries());
122
123 for(int i=0;i<nentries;i++){
124 tree->GetEntry(i);
125
126 int k = as->GetEntries();
127 s=(EdbSegP*)(as->At(0));
128
129 //filling
130
131 x0[Ncand] = s->X();
132 y0[Ncand] = s->Y();
133 z0[Ncand] = s->Z() ;
134 tx0[Ncand] = s->TX();
135 ty0[Ncand] = s->TY();
136 chi20[Ncand] = s->Chi2();
137 W0[Ncand] = s->W();
138 P0[Ncand] = s->P();
139 Flag0[Ncand] = s->Flag();
140 TRid[Ncand] = s->MCEvt();//this has to be a positive number
141 Esim[Ncand] = s->P();
142 id[Ncand] = s->ID();
143 Pid[Ncand] = s->Z()/1290+1;
144 //cout << s->X() << " " << s->Y() << " " << s->Z() << " " << s->TX() << " " << s->TY() << " " << Pid[Ncand] << " " <<nseg <<endl;
145 Ncand++;
146 }
147
148 printf("Ncand: %f\n",Ncand);
149
150 file1->Close();
151
152 /* --- Depreciated
153 // Here call of the shower algorithm using x0,y0,z0,tx0,ty0,Pid,id,TRid,Esim as seed
154 // The results will be put in Shower.root file
155 shower.rec(PLATE,MAXPLATE,0,Ncand,x0,y0,z0,tx0,ty0,Pid,id,TRid,Esim,piece2,piece2par,DOWN);
156 */
157
158 int num = PLATE ;
159 int UPDOWN = DOWN ;
160 // Here call of the shower algorithm using x0,y0,z0,tx0,ty0,chi20,W0,P0,Flag0,Pid,id,TRid,Esim as seed
161 // chi20,W0,P0,Flag0 are not necessary but if not given first segment in shower will not have these values!
162 shower.rec(num,MAXPLATE,DATA,Ncand,x0,y0,z0,tx0,ty0,chi20,W0,P0,Flag0,Pid,id,TRid,Esim,piece2,piece2par,UPDOWN);
163
164 gROOT->ProcessLine(".q");
165}
brick z0
Definition: RecDispMC.C:106
TTree * tr
Definition: Shower_E_FromShowerRoot.C:5
Definition: EdbSegP.h:21
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
int nentries
Definition: check_shower.C:40
s
Definition: check_shower.C:55
const char * fname
Definition: mc2raw.cxx:41