#include <EdbGA.h>
|
| void | CheckViewGrains (const char *options="") |
| |
| void | CheckViewGrains (int vid, const char *options="") |
| |
| | EdbGA () |
| |
| | EdbGA (char *fname, float bx, float by, float bz) |
| |
| void | GetClustPFile (const char *file) |
| |
| TTree * | GetTree (void) |
| |
| void | GrainStat (TClonesArray *clusters, float &x0, float &y0, float &z0) |
| |
| int | GrainStat2 (TClonesArray *clusters, float &x0, float &y0, float &z0, float &vol, float &amin, float &amax, float &zmin, float &zmax, int &fmin, int &fmax) |
| |
| void | InitTree (const char *file="grain_chains.root") |
| |
| int | MakeGrainsTree (TClonesArray *clust, TIndexCell &chains, const char *options="") |
| |
| void | SelectGrains (const char *selection, const char *outfile="grains_chains_selection.root") |
| |
| void | SelectGrains (TCut c1, const char *outfile="grains_chains_selection.root") |
| |
| void | SetBin (float bx, float by, float bz) |
| |
| void | SetRun (char *fname) |
| |
| void | VerticalChains (TClonesArray *clusters, TIndexCell &chains) |
| |
| void | VerticalChainsA (TClonesArray *clusters) |
| |
| virtual | ~EdbGA () |
| |
◆ EdbGA() [1/2]
EdbRun * eRun
Definition: EdbGA.h:21
◆ EdbGA() [2/2]
| EdbGA::EdbGA |
( |
char * |
fname, |
|
|
float |
bx, |
|
|
float |
by, |
|
|
float |
bz |
|
) |
| |
◆ ~EdbGA()
TFile * eGrainsFile
Definition: EdbGA.h:29
◆ CheckViewGrains() [1/2]
| void EdbGA::CheckViewGrains |
( |
const char * |
options = "" | ) |
|
void CheckViewGrains(const char *options="")
Definition: EdbGA.cxx:93
int GetEntries() const
Definition: EdbRun.h:135
◆ CheckViewGrains() [2/2]
| void EdbGA::CheckViewGrains |
( |
int |
vid, |
|
|
const char * |
options = "" |
|
) |
| |
103 TClonesArray *clusters=0;
107 printf(
"%d clusters are read for view %d \n", clusters->GetEntriesFast(), vid );
Int_t eVid
Definition: EdbGA.h:27
void VerticalChains(TClonesArray *clusters, TIndexCell &chains)
Definition: EdbGA.cxx:151
int MakeGrainsTree(TClonesArray *clust, TIndexCell &chains, const char *options="")
Definition: EdbGA.cxx:201
TClonesArray * GetEntryClusters(int entry) const
Definition: EdbRun.cxx:534
Definition: TIndexCell.h:19
◆ GetClustPFile()
| void EdbGA::GetClustPFile |
( |
const char * |
file | ) |
|
51 TFile *fcl =
new TFile(
file);
52 TTree *clust = (TTree *)fcl->Get(
"clust");
54 clust->SetBranchAddress(
"cl",&clp);
56 int nentr = (int)(clust->GetEntries());
57 TClonesArray *clarr =
new TClonesArray(
"EdbCluster");
60 for(
int i=0; i<nentr; i++) {
75 printf(
"%d clusters are readed from %s\n",ncl,
file);
86 printf(
"\n tree: \n\n");
float Xcg() const
Definition: EdbIP.h:71
float Ycg() const
Definition: EdbIP.h:72
float Peak() const
Definition: EdbIP.h:73
Definition: EdbCluster.h:19
Int_t GetFrame() const
Definition: EdbCluster.h:56
virtual Float_t Z() const
Definition: EdbCluster.h:80
Float_t GetArea() const
Definition: EdbCluster.h:54
void SetBin(float bx, float by, float bz)
Definition: EdbGA.h:41
void InitTree(const char *file="grain_chains.root")
Definition: EdbGA.cxx:176
TFile * file
Definition: write_pvr.C:3
◆ GetTree()
| TTree* EdbGA::GetTree |
( |
void |
| ) |
|
|
inline |
TTree * eGrains
Definition: EdbGA.h:30
◆ GrainStat()
| void EdbGA::GrainStat |
( |
TClonesArray * |
clusters, |
|
|
float & |
x0, |
|
|
float & |
y0, |
|
|
float & |
z0 |
|
) |
| |
292 double xs=0,ys=0,zs=0;
294 int ncl = clusters->GetEntriesFast();
295 for(
int i=0; i<ncl; i++ ) {
brick z0
Definition: RecDispMC.C:106
virtual Float_t Y() const
Definition: EdbCluster.h:79
virtual Float_t X() const
Definition: EdbCluster.h:78
◆ GrainStat2()
| int EdbGA::GrainStat2 |
( |
TClonesArray * |
clusters, |
|
|
float & |
x0, |
|
|
float & |
y0, |
|
|
float & |
z0, |
|
|
float & |
vol, |
|
|
float & |
amin, |
|
|
float & |
amax, |
|
|
float & |
zmin, |
|
|
float & |
zmax, |
|
|
int & |
fmin, |
|
|
int & |
fmax |
|
) |
| |
310 float x,y,z,area,xs=0,ys=0,zs=0,areasum=0;
320 int ncl = clusters->GetEntriesFast();
321 for(
int i=0; i<ncl; i++ )
329 if(area < amin) amin = area ;
330 if(area > amax) amax = area ;
331 if(frame < fmin ) { fmin = frame ; zmax = z ;}
332 if(frame > fmax ) { fmax = frame ; zmin = z ;}
348 float zlen = zmax - zmin;
349 if(zlen && ncl>1)
vol = areasum*zlen/(ncl-1) ;
EdbPatternsVolume * vol
Definition: RecDispNU.C:116
◆ InitTree()
| void EdbGA::InitTree |
( |
const char * |
file = "grain_chains.root" | ) |
|
179 eGrains=
new TTree(
"grains",
"grains");
181 Int_t ncl=0,fmin,fmax;
182 eClusters=
new TClonesArray(
"EdbCluster");
183 Float_t x0,y0,
z0,
vol,amin,amax, zmin, zmax;
186 eGrains->Branch(
"ncl",&ncl,
"ncl/I");
188 eGrains->Branch(
"x0",&x0,
"x0/F");
189 eGrains->Branch(
"y0",&y0,
"y0/F");
192 eGrains->Branch(
"amin",&amin,
"amin/F");
193 eGrains->Branch(
"amax",&amax,
"amax/F");
194 eGrains->Branch(
"zmin",&zmin,
"zmin/F");
195 eGrains->Branch(
"zmax",&zmax,
"zmax/F");
196 eGrains->Branch(
"fmin",&fmin,
"fmin/I");
197 eGrains->Branch(
"fmax",&fmax,
"fmax/I");
TClonesArray * eClusters
Definition: EdbGA.h:31
◆ MakeGrainsTree()
| int EdbGA::MakeGrainsTree |
( |
TClonesArray * |
clust, |
|
|
TIndexCell & |
chains, |
|
|
const char * |
option = "" |
|
) |
| |
206 if (! sscanf(option,
"MIN_NCL") ) sscanf(option,
"MIN_NCL=%d",&min_ncl);
209 Int_t ncl=0,fmin, fmax;
210 Float_t x0,y0,
z0,
vol,amin,amax, zmin, zmax;
212 eGrains->SetBranchAddress(
"ncl",&ncl);
214 eGrains->SetBranchAddress(
"x0",&x0);
215 eGrains->SetBranchAddress(
"y0",&y0);
218 eGrains->SetBranchAddress(
"amin",&amin);
219 eGrains->SetBranchAddress(
"amax",&amax);
220 eGrains->SetBranchAddress(
"zmin",&zmin);
221 eGrains->SetBranchAddress(
"zmax",&zmax);
222 eGrains->SetBranchAddress(
"fmin",&fmin);
223 eGrains->SetBranchAddress(
"fmax",&fmax);
238 for(
int ix=0; ix<nix; ix++) {
241 for(
int iy=0; iy<niy; iy++) {
245 for(
int iz=0; iz<niz; iz++) {
248 for(
int ie=0; ie<nie; ie++) {
252 if( cl->
Z()-zlvl > 2.*
eBinZ ) {
256 GrainStat2(
eClusters,x0,y0,
z0,
vol,amin,amax, zmin, zmax, fmin, fmax);
273 GrainStat2(
eClusters,x0,y0,
z0,
vol,amin,amax, zmin, zmax, fmin, fmax);
284 printf(
"%d grains are selected\n",ngr);
TLegendEntry * entry
Definition: Canv_SYSTEMATICS_ALLCOMBINED__RMSEnergy__vs__Energy__ELECTRON.C:130
Float_t eBinZ
Definition: EdbGA.h:25
int GrainStat2(TClonesArray *clusters, float &x0, float &y0, float &z0, float &vol, float &amin, float &amax, float &zmin, float &zmax, int &fmin, int &fmax)
Definition: EdbGA.cxx:306
Long_t Value() const
Definition: TIndexCell.h:79
Int_t GetEntriesFast() const
Definition: TIndexCell.h:82
TIndexCell const * At(Int_t narg, Int_t vind[]) const
Definition: TIndexCell.cpp:519
◆ SelectGrains() [1/2]
| void EdbGA::SelectGrains |
( |
const char * |
selection, |
|
|
const char * |
outfile = "grains_chains_selection.root" |
|
) |
| |
365 Int_t ncl,fmin, fmax;
366 Float_t x0,y0,
z0,
vol,amin,amax, zmin, zmax;
368 eGrains->SetBranchAddress(
"ncl",&ncl);
370 eGrains->SetBranchAddress(
"x0",&x0);
371 eGrains->SetBranchAddress(
"y0",&y0);
374 eGrains->SetBranchAddress(
"amin",&amin);
375 eGrains->SetBranchAddress(
"amax",&amax);
376 eGrains->SetBranchAddress(
"zmin",&zmin);
377 eGrains->SetBranchAddress(
"zmax",&zmax);
378 eGrains->SetBranchAddress(
"fmin",&fmin);
379 eGrains->SetBranchAddress(
"fmax",&fmax);
382 printf(
"Total: %d grains\n", (
int)
eGrains->GetEntries());
383 eGrains->Draw(
">>lst",selection);
384 TEventList* lst = (TEventList*) gDirectory->Get(
"lst");
387 TFile* nfile =
new TFile(outfile,
"recreate");
388 TTree* tree2 = (TTree*)
eGrains->CloneTree(0);
391 int nentries = lst->GetN(); printf(
"Select %d grains",
nentries); printf(
" with \"%s\"\n", selection);
392 printf(
"Create the new tree... ");
395 eGrains->GetEntry(lst->GetEntry(i));
397 if((i%5000)==0) printf(
"\b\b\b\b%3d%%",(
int)((
double)i/
double(
nentries)*100.)) ;
399 printf(
"\b\b\b\b100%%\n");
400 tree2->Write(
"grains",TObject::kOverwrite);
int nentries
Definition: check_shower.C:40
◆ SelectGrains() [2/2]
| void EdbGA::SelectGrains |
( |
TCut |
c1, |
|
|
const char * |
outfile = "grains_chains_selection.root" |
|
) |
| |
void SelectGrains(TCut c1, const char *outfile="grains_chains_selection.root")
Definition: EdbGA.cxx:355
TCanvas * c1
Definition: energy.C:13
◆ SetBin()
| void EdbGA::SetBin |
( |
float |
bx, |
|
|
float |
by, |
|
|
float |
bz |
|
) |
| |
|
inline |
Float_t eBinX
Definition: EdbGA.h:23
Float_t eBinY
Definition: EdbGA.h:24
◆ SetRun()
| void EdbGA::SetRun |
( |
char * |
fname | ) |
|
|
inline |
const char * fname
Definition: mc2raw.cxx:41
◆ VerticalChains()
| void EdbGA::VerticalChains |
( |
TClonesArray * |
clusters, |
|
|
TIndexCell & |
chains |
|
) |
| |
160 int ncl = clusters->GetEntriesFast();
161 for(
int i=0; i<ncl; i++ ) {
163 v[0] = (Long_t)(cl->
X()/xb);
164 v[1] = (Long_t)(cl->
Y()/yb);
165 v[2] = (Long_t)(cl->
Z()/zb);
void Sort(Int_t upto=kMaxInt)
Definition: TIndexCell.cpp:539
Int_t Add(Int_t narg, Long_t varg[])
Definition: TIndexCell.cpp:602
◆ VerticalChainsA()
| void EdbGA::VerticalChainsA |
( |
TClonesArray * |
clusters | ) |
|
117 float eDX = 1301, eDY=1025;
119 const int nx = (int)(eDX/
eBinX);
120 const int ny = (int)(eDY/
eBinY);
123 int *v =
new int[
nx*
nx*
ny];
129 for(iz=0; iz<nz; iz++)
130 for(iy=0; iy<
ny; iy++)
131 for(ix=0; ix<
nx; ix++) {
132 iv = ix +
nx*iy +
nx*
ny*iz;
136 int ncl = clusters->GetEntriesFast();
137 for(
int i=0; i<ncl; i++ ) {
139 ix = (int)(cl->
X()/
eBinX);
140 iy = (int)(cl->
Y()/
eBinY);
143 iv = ix +
nx*iy +
nx*
ny*iz;
int nx
Definition: emthickness.cpp:60
int ny
Definition: emthickness.cpp:62
◆ eBinX
◆ eBinY
◆ eBinZ
◆ eClusters
| TClonesArray* EdbGA::eClusters |
|
private |
◆ eGrains
◆ eGrainsFile
| TFile* EdbGA::eGrainsFile |
|
private |
◆ eRun
◆ eVid
The documentation for this class was generated from the following files: