73{
75
76 TEnv *
cenv =
new TEnv(
"comptonenv");
78 cenv->ReadFile(
"comptonmap.rootrc",kEnvLocal);
79
80 bool do_ida = false;
81 bool do_idb = false;
82
83
84 bool do_tlglista = false;
85 bool do_tlglistb = false;
86
87 bool do_align_jap = false;
88 bool do_align_jap2 = false;
89
90 bool do_apply_map = false;
91 bool do_apply_test_map = false;
92 bool do_link = false;
93
94 for(int i=1; i<argc; i++ ) {
95 char *key = argv[i];
96
97 if (!strncmp(key,"-A",2))
98 {
99
100 if(strlen(key)>2)
cenv->SetValue(
"comptonmap.runA",key+2);
101 do_ida=true;
102 }
103 else if(!strncmp(key,"-B",2))
104 {
105
106 if(strlen(key)>2)
cenv->SetValue(
"comptonmap.runB",key+2);
107 do_idb=true;
108 }
109 else if(!strncmp(key,"-par=",5))
110 {
111 cenv->ReadFile(key+5,kEnvLocal);
112 }
113 else if(!strncmp(key,"-outmap=",8))
114 {
115 if(strlen(key)>8)
cenv->SetValue(
"comptonmap.out",key+8);
116 }
117 else if(!strncmp(key,"-jap2",5))
118 {
119 do_align_jap2=true;
120 }
121 else if(!strncmp(key,"-jap",4))
122 {
123 do_align_jap=true;
124 }
125 else if(!strncmp(key,"-listA=",7))
126 {
127 do_tlglista=true;
128 if(strlen(key)>7)
cenv->SetValue(
"comptonmap.listA",key+7);
129 }
130 else if(!strncmp(key,"-listB=",7))
131 {
132 do_tlglistb=true;
133 if(strlen(key)>7)
cenv->SetValue(
"comptonmap.listB",key+7);
134 }
135 else if(!strncmp(key,"-o",2))
136 {
137 if(strlen(key)>2)
cenv->SetValue(
"comptonmap.outdir",key+2);
138 }
139 else if(!strncmp(key,"-applytest",10))
140 {
141 do_apply_test_map = true;
142 }
143 else if(!strncmp(key,"-apply",6))
144 {
145 do_apply_map = true;
146
147 }
148 else if(!strncmp(key,"-link=",6))
149 {
150 do_link = true;
151 if(strlen(key)>6)
cenv->SetValue(
"comptonmap.link.runfile",key+6);
152 }
153 else if(!strncmp(key,"-v",2))
154 {
155 if(strlen(key)>2)
cenv->SetValue(
"comptonmap.EdbDebugLevel",atoi(key+2));
156 }
157 }
158
161
162 if(do_ida&&do_idb)
163 {
164 printf("\n----------------------------------------------------------------------------\n");
165 printf("make compton map for runs %s and %s\n",
166 cenv->GetValue(
"comptonmap.runA" ,
""),
167 cenv->GetValue(
"comptonmap.runB" ,
"")
168 );
169 printf("----------------------------------------------------------------------------\n\n");
170
172 }
173 else if(do_link)
174 {
175
176 const char *runfile =
cenv->GetValue(
"comptonmap.link.runfile",
"run.root");
177 EdbAlignmentMap amap(Form(
"%s.root",
cenv->GetValue(
"comptonmap.link.out" ,
"link_test")),
"RECREATE");
180 float DZ =
cenv->GetValue(
"fedra.link.DZbase",214.);
181 p.SetPlateLayout(
DZ,45,45);
182 amap.Link(runfile,
p);
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201 }
202 else if(do_tlglista&&do_tlglistb)
203 {
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
234
235
236
237
238
239
240
244
245 }
247
248 cenv->WriteFile(
"comptonmap.save.rootrc");
249
250 return 1;
251}
Definition: EdbBrick.h:14
void LinkJap2(TEnv *cenv)
Definition: comptonmap.cpp:323
void set_default(TEnv &cenv)
Definition: comptonmap.cpp:48
void AlignMap(TEnv *cenv)
Definition: comptonmap.cpp:278
void print_help_message()
Definition: comptonmap.cpp:32
void AlignMapJap(TEnv *cenv)
Definition: comptonmap.cpp:302
void AlignRunMap(TEnv *cenv)
Definition: comptonmap.cpp:254
void ApplyMap(TEnv *cenv)
Definition: comptonmap.cpp:385
void ApplyTestMap(TEnv *cenv)
Definition: comptonmap.cpp:341
float DZ
Definition: hwinit.C:66
gEDBDEBUGLEVEL
Definition: energy.C:7