FEDRA emulsion software from the OPERA Collaboration
viewdist.cpp File Reference
#include <string.h>
#include <iostream>
#include <TRint.h>
#include <TEnv.h>
#include "EdbLog.h"
#include "EdbRun.h"
#include "EdbViewMatch.h"
Include dependency graph for viewdist.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[] 
)
40{
41 if (argc < 2) { print_help_message(); return 0; }
42
43 TEnv cenv("viewenv");
44
46 gEDBDEBUGLEVEL = cenv.GetValue("viewdist.EdbDebugLevel" , 1);
47 const char *env = cenv.GetValue("viewdist.env" , "viewdist.rootrc");
48
49 const char *addfile=0;
50 const char *fname=0;
51 for(int i=1; i<argc; i++ ) {
52 char *key = argv[i];
53
54 if (!strncmp(key,"-f=",3))
55 {
56 if(strlen(key)>3) fname = key+3;
57 }
58 else if(!strncmp(key,"-v=",3))
59 {
60 if(strlen(key)>3) gEDBDEBUGLEVEL = atoi(key+3);
61 }
62 else if(!strncmp(key,"-add=",5))
63 {
64 if(strlen(key)>5) addfile = key+5;
65 }
66 }
67
68 if(!fname) { print_help_message(); return 0; }
69
70 cenv.SetValue("viewdist.env" , env);
71 cenv.ReadFile( cenv.GetValue("viewdist.env" , "viewdist.rootrc") ,kEnvLocal);
72
73 EdbViewMatch vm;
74 vm.MakeDistortionMap( fname, cenv, addfile );
75
76 cenv.WriteFile("viewdist.save.rootrc");
77 return 1;
78}
Definition: EdbViewMatch.h:34
void MakeDistortionMap(const char *fname, TEnv &env, const char *addfile=0)
Definition: EdbViewMatch.cxx:392
TEnv cenv("emrec")
gEDBDEBUGLEVEL
Definition: energy.C:7
const char * fname
Definition: mc2raw.cxx:41
void set_default(TEnv &cenv)
Definition: viewdist.cpp:24
void print_help_message()
Definition: viewdist.cpp:13

◆ print_help_message()

void print_help_message ( )
14{
15 cout<< "\nUsage: \n\t viewdist -f=FILE [-v=DEBUG -add=primary_correction.txt] \n";
16 cout<< "\t\t DEBUG - verbosity level: 0-print nothing, 1-errors only, 2-normal, 3-print all messages\n";
17 cout<< "\nExample: \n";
18 cout<< "\t viewdist -f=one_layer.root -v=2\n";
19 cout<< "\n If the parameters file (viewdist.rootrc) is not presented - the default \n";
20 cout<< " parameters will be used. After the execution them are saved into viewdist.save.rootrc file\n";
21 cout<<endl;
22}

◆ set_default()

void set_default ( TEnv &  cenv)
25{
26 // default parameters for the new alignment
27 cenv.SetValue("viewdist.env" , "viewdist.rootrc");
28 cenv.SetValue("viewdist.EdbDebugLevel" , 1 );
29 cenv.SetValue("viewdist.DumpGr" , 0 );
30 cenv.SetValue("viewdist.NClMin" , 20);
31 cenv.SetValue("viewdist.R2CenterMax" , 15.);
32 cenv.SetValue("viewdist.Rmax" , 1.);
33 cenv.SetValue("viewdist.Xpix" , 0.30625);
34 cenv.SetValue("viewdist.Ypix" , 0.30714);
35 cenv.SetValue("viewdist.NXpix", 1280);
36 cenv.SetValue("viewdist.NYpix", 1024);
37}