FEDRA emulsion software from the OPERA Collaboration
any2run.C File Reference

Functions

void any2run (char *file="run.root")
 
void fillViewWithSegments (EdbView &v)
 

Function Documentation

◆ any2run()

void any2run ( char *  file = "run.root")
15 {
16  EdbRun r(file,"RECREATE"); // create new run file
17  EdbView *view = r.GetView(); // use this view as a container
18 
19  int nx=10, ny=10; // generate 1 area of 10x10 views
20  int ic=0;
21  for(int ix=0; ix<nx; ix++) {
22  for(int iy=0; iy<ny; iy++) {
23  view->Clear();
24  view->SetAreaID( 0 );
25  view->SetCoordXY( ix*300, iy*300 ); // center of the view is here
26  view->SetNframes(16,0); // ntop, nbot
27 
28  fillViewWithSegments( *view );
29 // fillViewWithClusters( *view );
30 // fillViewWithFrames( *view );
31 // fillViewWithImages( *view );
32 
33  r.AddView(view);
34  }
35  }
36 
37  r.Close();
38 }
void fillViewWithSegments(EdbView &v)
Definition: any2run.C:41
Definition: EdbRun.h:74
Definition: EdbView.h:134
void SetAreaID(int id)
Definition: EdbView.h:183
void SetCoordXY(float x, float y)
Definition: EdbView.h:185
void Clear()
Definition: EdbView.cxx:79
void SetNframes(int top, int bot)
Definition: EdbView.h:184
int nx
Definition: emthickness.cpp:60
int ny
Definition: emthickness.cpp:62
void r(int rid=2)
Definition: test.C:201
TFile * file
Definition: write_pvr.C:3

◆ fillViewWithSegments()

void fillViewWithSegments ( EdbView v)
42 {
43  // generate segments inside 300x300 microns area in a local view coordinates
44 
45  EdbSegment s;
46  for(int i=0; i<100; i++) {
47 
48  int id = i; // seg id
49  float x = 300*gRandom->Rndm()-150;
50  float y = 300*gRandom->Rndm()-150;
51  float z = 0;
52  float tx = gRandom->Gaus(0,0.3);
53  float ty = gRandom->Gaus(0,0.3);
54  float dz = 45;
55  int side = 0; // 0/1 for top/bot
56  int puls = Min(gRandom->Poisson(10),16);
57 
58  s.Set( x, y, z, tx, ty, dz, side, puls, id);
59 
60  v.AddSegment(s);
61  }
62 
63 }
brick dz
Definition: RecDispMC.C:107
void Set(int id, float x, float y, float tx, float ty, float w, int flag)
Definition: EdbSegP.h:86
Definition: EdbSegment.h:61
EdbSegment * AddSegment(float x, float y, float z, float tx, float ty, float dz=0, int side=0, int puls=0, int id=-1)
Definition: EdbView.h:231
EdbSegP * s
Definition: tlg2pattern.C:32