FEDRA emulsion software from the OPERA Collaboration
emshow.cpp File Reference
#include <string.h>
#include <iostream>
#include <TEnv.h>
#include "EdbLog.h"
#include "EdbScanProc.h"
Include dependency graph for emshow.cpp:

Functions

int main (int argc, char *argv[])
 
void print_help_message ()
 
void set_default (TEnv &cenv)
 

Function Documentation

◆ main()

int main ( int  argc,
char *  argv[] 
)
46 {
47  if (argc < 2) {
49  return 0;
50  }
51 
52  TEnv cenv("showerenv");
54  gEDBDEBUGLEVEL = cenv.GetValue("emshow.EdbDebugLevel", 1);
55  const char *env = cenv.GetValue("emshow.env", "shower.rootrc");
56  const char *outdir = cenv.GetValue("emshow.outdir", "./");
57 
58  bool do_set = false;
59  bool do_pred = false;
60  bool do_VSB = false;
61  bool do_showerfrom_vt = false;
62  bool do_showerfrom_lt = false;
63  bool do_showerfrom_bt = false;
64 
65  Int_t pred_plate = 0, to_plate=0;
66  Int_t brick=0, plate=0, major=0, minor=0;
67 
68  for (int i=1; i<argc; i++ ) {
69  char *key = argv[i];
70 
71  if (!strncmp(key,"-set=",5))
72  {
73  if (strlen(key)>5) sscanf(key+5,"%d.%d.%d.%d",&brick,&plate,&major,&minor);
74  do_set=true;
75  }
76  else if (!strncmp(key,"-o=",3))
77  {
78  if (strlen(key)>3) outdir=key+3;
79  }
80  else if (!strncmp(key,"-pred=",6))
81  {
82  if (strlen(key)>6) {
83  pred_plate = atoi(key+6);
84  do_pred=true;
85  }
86  }
87  else if (!strncmp(key,"-vt=",3))
88  {
89  if (strlen(key)>3) {
90  do_showerfrom_vt=true;
91  }
92  }
93  else if (!strncmp(key,"-vt=",3))
94  {
95  if (strlen(key)>3) {
96  do_showerfrom_lt=true;
97  }
98  }
99  else if (!strncmp(key,"-bt=",3))
100  {
101  if (strlen(key)>3) {
102  do_showerfrom_bt=true;
103  }
104  }
105  else if (!strncmp(key,"-VSB=",5))
106  {
107  if (strlen(key)>5) {
108  do_VSB=true;
109  to_plate = atoi(key+5);
110  }
111  }
112  else if (!strncmp(key,"-v=",3))
113  {
114  if (strlen(key)>3) gEDBDEBUGLEVEL = atoi(key+3);
115  }
116  }
117 
118  if (!do_set) {
120  return 0;
121  }
122 
123  cenv.SetValue("emshow.env", env);
124  cenv.ReadFile( cenv.GetValue("emshow.env", "shower.rootrc"),kEnvLocal);
125  cenv.SetValue("emshow.outdir", outdir);
126  cenv.WriteFile("shower.save.rootrc");
127 
128  if (do_set) {
131  printf("\n----------------------------------------------------------------------------\n");
132  printf("tracking set %d.%d.%d.%d\n", brick,plate, major,minor);
133  printf("----------------------------------------------------------------------------\n\n");
134 
135  EdbID id(brick,plate,major,minor);
137  ss->Brick().SetID(brick);
138  //ss->MakePIDList();
139  //sproc.AssembleScanSet(*ss);
140 
141  TCut c = gEnv->GetValue("emshow.cpcut","s.eW>13&&eCHI2P<2.5&&s1.eFlag>=0&&s2.eFlag>=0&&eN1==1&&eN2==1");
142 
143  //EdbScanCond cond;
144  //cond.Print();
145  //sproc.TrackSetBT(*ss,cond,c);
147 
148  }
149  if (do_VSB) {
152  printf("\n----------------------------------------------------------------------------\n");
153  printf("prepare predictions %d.%d.%d.%d for the plate %d\n", brick,plate, major,minor, pred_plate);
154  printf("----------------------------------------------------------------------------\n\n");
155 
156  EdbID id(brick,plate,major,minor);
158  ss->Brick().SetID(brick);
160 
161  EdbID predid(id);
162  predid.ePlate = pred_plate;
163 
164  sproc.FindPredictionsRawSet(predid, *ss, to_plate);
165  EdbPVRec ali;
167  sproc.WriteSBTracks(*(ali.eTracks), id);
168 
169  }
170 
171  return 1;
172 }
BRICK brick
Definition: RecDispMC.C:103
EdbPVRec * ali
Definition: align.C:1
Definition: EdbID.h:7
Definition: EdbPVRec.h:148
TObjArray * eTracks
Definition: EdbPVRec.h:161
Definition: EdbScanProc.h:12
int TrackSetBT(EdbScanSet &sc, TEnv &cenv)
Definition: EdbScanProc.cxx:601
int ReadFoundTracks(EdbScanSet &ss, EdbPVRec &ali, int flag=-1)
Definition: EdbScanProc.cxx:220
int WriteSBTracks(TObjArray &tracks, EdbID id)
Definition: EdbScanProc.cxx:1438
int FindPredictionsRawSet(EdbID idp, EdbScanSet &ss, int npl)
Definition: EdbScanProc.cxx:2098
int AssembleScanSet(EdbScanSet &ss)
Definition: EdbScanProc.cxx:134
TString eProcDirClient
Definition: EdbScanProc.h:14
EdbScanSet * ReadScanSet(EdbID id)
Definition: EdbScanProc.cxx:1521
Definition: EdbScanSet.h:11
EdbScanProc * sproc
Definition: comptonmap.cpp:29
TEnv cenv("emrec")
bool do_set
Definition: emrec.cpp:36
const char * outdir
Definition: emrec.cpp:37
void set_default(TEnv &cenv)
Definition: emshow.cpp:27
void print_help_message()
Definition: emshow.cpp:11
gEDBDEBUGLEVEL
Definition: energy.C:7
ss
Definition: energy.C:62
Int_t plate
Definition: merge_Energy_SytematicSources_Electron.C:1
UInt_t id
Definition: tlg2pattern.C:118

◆ print_help_message()

void print_help_message ( )
12 {
13  cout<< "\nUsage: \n\t emshow -set=ID [ -o=DATA_DIRECTORY -v=DEBUG] \n\n";
14  cout<< "\t\t -set=ID - id of the dataset formed as BRICK.PLATE.MAJOR.MINOR \n";
15  cout<< "\t\t DEBUG - verbosity level: 0-print nothing, 1-errors only, 2-normal, 3-print all messages\n";
16  cout<< "\t\t -vt - start showering from linked tracks attached to vertices with IP<250 (not yet included)\n";
17  cout<< "\t\t -lt - start showering from linked tracks (all; standard)\n";
18  cout<< "\t\t -bt - start showering from basetracks (all; useful if no linked tracks done yet)\n";
19  cout<< "\nExample: \n";
20  cout<< "\t emshow -id=4554.10.1.0 -o/scratch/BRICKS -lt\n";
21  cout<< "\n The data location directory if not explicitly defined will be taken from .rootrc as: \n";
22  cout<< "\t emrec.outdir: /scratch/BRICKS \n";
23  cout<< "\t emrec.EdbDebugLevel: 1\n";
24  cout<<endl;
25 }

◆ set_default()

void set_default ( TEnv &  cenv)
28 {
29  // default parameters for shower reconstruction
30  // determined by experimental and simulation studies
31  cenv.SetValue("emshow.cpcut","s.eW>13&&eCHI2P<2.5&&s1.eFlag>=0&&s2.eFlag>=0&&eN1==1&&eN2==1");
32  /* cenv.SetValue("fedra.track.minPlate" ,-999 );
33  cenv.SetValue("fedra.track.maxPlate" , 999 );
34  cenv.SetValue("fedra.track.refPlate" , 999 );
35  cenv.SetValue("fedra.track.nsegmin" , 2 );
36  cenv.SetValue("fedra.track.ngapmax" , 4 );
37  cenv.SetValue("fedra.track.probmin" , 0.01 );
38  cenv.SetValue("fedra.track.momentum" , 2 );
39  cenv.SetValue("fedra.track.mass" , 0.14 );*/
40  cenv.SetValue("emshow.outdir", "..");
41  cenv.SetValue("emshow.env", "shower.rootrc");
42  cenv.SetValue("emshow.EdbDebugLevel", 1);
43 }