/[PAMELA software]/ParDirCalc/option.cpp
ViewVC logotype

Contents of /ParDirCalc/option.cpp

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.1 - (show annotations) (download)
Tue Sep 16 09:50:16 2008 UTC (16 years, 2 months ago) by pam-mep
Branch: MAIN
CVS Tags: HEAD
new

1 #include <TObject.h>
2 #include <string.h>
3 #include <option.h>
4 #include "TString.h"
5 #include <iostream>
6
7 using namespace std;
8
9 OptionParam::OptionParam() : TObject(){
10
11 debug = false; opt.Neve = 0; opt.Nverb = -1; opt.Nstart = 0;
12 opt.DoTr = false;
13 //opt.PX.PamExpOn = false; opt.AH.AnglHystOn = false; opt.PE.PamEffOn = false; opt.DH.DiffHystOn = false;
14 //opt.DH.Z = false; opt.DH.Az = false;
15
16 };
17
18 OptionParam::~OptionParam(){
19 }
20
21 void OptionParam::helprint(){
22 cout<<"Help is Empty now"<<endl;
23 }
24
25 Double_t OptionParam::CheckDouble(char* Arg, char* Mess){
26 if(strcmp(Arg,"0")){
27 if(!atof(Arg)){
28 cout<<"ERROR!: Incorect Number of "<<Mess<<" : "<<Mess<<" "<<Arg<<"\n";
29 exit(1);
30 }else return atof(Arg);
31 }else return 0;
32 }
33
34 Int_t OptionParam::CheckInt(char* Arg, char* Mess){
35 if(strcmp(Arg,"0")){
36 if(!atoi(Arg)){
37 cout<<"ERROR!: Incorect Number of "<<Mess<<" : "<<Mess<<" "<<Arg<<"\n";
38 exit(1);
39 }else return atoi(Arg);
40 }else return 0;
41 }
42
43 /*Int_t FindSS(Double_t Rmin, Double_t Rmax, Int_t detrminf, Int_t detrmaxf, Double_t detrmore, Double_t detrless, Float_t betamin, Float_t betamax, Bool_t AC, Bool_t Calo){
44 Int_t NS = 0;
45 if(debug) cout<<"\tFind earlier SelectionScheme's\n";
46 for(Int_t sen=0; sen<US.size();sen++){
47 if(SS[sen].SP.Rmin == Rmin && SS[sen].SP.Rmax == Rmax && SS[sen].SP.detrminf == detrminf && SS[sen].SP.detrmaxf &&
48 SS[sen].SP.detrmore == detrmore && SS[sen].SP.detrless == detrless && SS[sen].SP.betamin == betamin &&
49 SS[sen].SP.betamax == betamax && SS[sen].SP.AC == AC && SS[sen].SP.Calo == Calo) NS = sen;
50 }
51 if(NS==0){
52 if(debug) cout<<"\tNot found SS with such parameters\n";
53 SS.resize(SS.size()+1);
54 if(debug) cout<<"\t\tsize of SS was increased...\tNew size = "<<SS.size()<<"\n";
55 NS = SS.size()-1;
56 }
57 return NS;
58 }*/
59
60 Int_t OptionParam::FindUS(Double_t altmore, Double_t altless, Double_t Bmore, Double_t Bless, Double_t Lmore, Double_t Lless, Double_t Rmore, Double_t Rless){
61 Int_t NS = -1;
62 if(debug) cout<<"\tFind earlier US's\n";
63 for(Int_t sen=0; sen<US.size();sen++){
64 Bool_t bay = false;
65 for(Int_t zen=0; zen<US[sen].USP.size();zen++){
66 if(US[sen].USP[zen].altmore == altmore && US[sen].USP[zen].altless == altless && US[sen].USP[zen].Bmore == Bmore && US[sen].USP[zen].Bless == Bless && US[sen].USP[zen].Lmore == Lmore && US[sen].USP[zen].Lless == Lless && US[sen].USP[zen].Rmore == Rmore && US[sen].USP[zen].Rless == Rless) bay = true;else bay = false;
67 }
68 if(bay) NS = sen;
69 }
70 if(NS==-1){
71 if(debug) cout<<"\tNot found US with such boundaries\n";
72 US.resize(US.size()+1);
73 if(debug) cout<<"\t\tsize of US was increased...\tNew size = "<<US.size()<<"\n";
74 NS = US.size()-1;
75 }
76 return NS;
77 }
78
79 void OptionParam::SetupGeo(Double_t altmore, Double_t altless, Double_t Bmore, Double_t Bless, Double_t Lmore, Double_t Lless, Double_t Rmore, Double_t Rless, Int_t N, Int_t k){
80 if(debug) cout<<"\tSet Geo Selection boundaries:\n";
81 if(k==0) tmpNUS = FindUS(altmore,altless,Bmore,Bless,Lmore,Lless,Rmore,Rless);
82 if(tmpNUS==US.size()-1){
83 if(debug)cout<<"\tFill USP["<<k<<"]...\n";
84 if(US[tmpNUS].USP.size()!=N) US[tmpNUS].USP.resize(N);
85 US[tmpNUS].USP[k].altmore = altmore;
86 US[tmpNUS].USP[k].altless = altless;
87 US[tmpNUS].USP[k].Bmore = Bmore;
88 US[tmpNUS].USP[k].Bless = Bless;
89 US[tmpNUS].USP[k].Lmore = Lmore;
90 US[tmpNUS].USP[k].Lless = Lless;
91 US[tmpNUS].USP[k].Rmore = Rmore;
92 US[tmpNUS].USP[k].Rless = Rless;
93 //US[tmpNUS].USP[k].Pmore = Pmore;
94 //US[tmpNUS].USP[k].Pless = Pless;
95 }
96 if(debug) cout<<"\t\taltmore = "<<altmore<<"\taltless = "<<altless<<"\n\t\tBmore = "<<Bmore<<"\tBless = "<<Bless<<"\n\t\tLmore = "<<Lmore<<"\tLless = "<<Lless<<"\n\n";
97 }
98
99 void OptionParam::SimpleCheck(char* hystname,char* NBinsx, char* firstx, char* lastx, char* NBinsy, char* firsty, char* lasty, char* NBinsz, char* firstz, char* lastz, char* filename, char* format, char* extype, Int_t Dim){
100 Int_t NBinsX = CheckInt(NBinsx,"NBinsx");
101 if(debug) cout<<"\t\tNbinsx is correct... "<<NBinsX<<"\n";
102 Int_t NBinsY = CheckInt(NBinsy,"NBinsy");
103 if(debug) cout<<"\t\tNbinsy is correct... "<<NBinsY<<"\n";
104 Int_t NBinsZ = CheckInt(NBinsz,"NBinsz");
105 if(debug) cout<<"\t\tNbinsz is correct... "<<NBinsZ<<"\n";
106 Double_t Firstx = CheckDouble(firstx,"firstx");
107 if(debug) cout<<"\t\tfirstx is correct... "<<Firstx<<"\n";
108 Double_t Lastx = CheckDouble(lastx,"lastx");
109 if(debug) cout<<"\t\tlastx is correct... "<<Lastx<<"\n";
110 if(Lastx<=Firstx){
111 cout<<"ERROR!: Incorect hystogramm diapason: NBins "<<NBinsx<<"\tfirst x bin "<<firstx<<"\tlast x bin "<<lastx<<"\n";
112 exit(1);
113 }
114 Double_t Firsty = CheckDouble(firsty,"firsty");
115 if(debug) cout<<"\t\tfirsty is correct... "<<Firsty<<"\n";
116 Double_t Lasty = CheckDouble(lasty,"lasty");
117 if(debug) cout<<"\t\tlasty is correct... "<<Lasty<<"\n";
118 if(NBinsY!=0 && Lasty<=Firsty){
119 cout<<"ERROR!: Incorect hystogramm diapason: NBinsy "<<NBinsY<<"\tfirst Y bin "<<firsty<<"\tlast y bin "<<lasty<<"\n";
120 exit(1);
121 }
122 Double_t Firstz = CheckDouble(firstz,"firstz");
123 if(debug) cout<<"\t\tfirstz is correct... "<<Firstz<<"\n";
124 Double_t Lastz = CheckDouble(lastz,"lastz");
125 if(debug) cout<<"\t\tlastz is correct... "<<Lastz<<"\n";
126 if(NBinsZ!=0 && Lastz<=Firstz){
127 cout<<"ERROR!: Incorect hystogramm diapason: NBinsz "<<NBinsZ<<"\tfirst Z bin "<<firstz<<"\tlast z bin "<<lastz<<"\n";
128 exit(1);
129 }
130 if(debug) cout<<"\t\tHystogramm diapason is correct... \n";
131 Int_t TypeExt;
132 if(!strcmp(format,"RootOnly")) TypeExt = 0; else
133 if(!strcmp(format,"PictureOnly")) TypeExt = 1; else
134 if(!strcmp(format,"All")) TypeExt = 2;else{
135 cout<<"ERROR!: Incorrect format of output - "<<format<<"\n";
136 exit(1);
137 }
138 if(debug) cout<<"\t\tformat is correct... \n";
139 Int_t Extype = CheckInt(extype,"extype");
140 if(Extype<0 || Extype>7){
141 cout<<"ERROR!: Incorect Type of Exposure: Extype "<<Extype<<"\n";
142 exit(1);
143 }
144 if(debug) cout<<"\t\textype is correct... Exposure = "<<Extype<<" \n";
145 if (Dim==1){
146 //Hyst1D.resize(Hyst1D.size()+1);
147 //if(debug) cout<<"\tvector of Hyst1D was increased, New size is "<<Hyst1D.size()<<endl;
148 if(debug)cout<<"\tFilling 1D hystogramm"<<endl;
149 Hyst1D[Hyst1D.size()-1].Hyst1DF.SetName(hystname);
150 if(debug)cout<<"\thystname = "<<hystname<<endl;
151 Hyst1D[Hyst1D.size()-1].Hyst1DF.SetBins(NBinsX,Firstx,Lastx);
152 Hyst1D[Hyst1D.size()-1].HI.NUS = tmpNUS;
153 if(debug)cout<<"\tNUS = "<<tmpNUS<<endl;
154 Hyst1D[Hyst1D.size()-1].HI.NED = ED.size()-1;
155 if(debug)cout<<"\tNED = "<<ED.size()-1<<endl;
156 Hyst1D[Hyst1D.size()-1].HI.NSS = tmpSS;
157 if(debug)cout<<"\tNSS = "<<tmpSS<<endl;
158 Hyst1D[Hyst1D.size()-1].HI.NPT = PS.size()-1;
159 if(debug)cout<<"\tNPT = "<<PS.size()-1<<endl;
160 Hyst1D[Hyst1D.size()-1].HI.TypeExt = TypeExt;
161 Hyst1D[Hyst1D.size()-1].HI.ExpType = Extype;
162 Hyst1D[Hyst1D.size()-1].HI.LieveTime = 0;
163 Hyst1D[Hyst1D.size()-1].HI.DeathTime = 0;
164 Hyst1D[Hyst1D.size()-1].HI.filename = filename;
165 if(debug)cout<<"\tfilename = "<<filename<<endl;
166 US[tmpNUS].NAH1D.resize(US[tmpNUS].NAH1D.size()+1);
167 if(debug)cout<<"US["<<tmpNUS<<"].NAH1D.size = "<<US[tmpNUS].NAH1D.size()<<endl;
168 US[tmpNUS].NAH1D[US[tmpNUS].NAH1D.size()-1] = Hyst1D.size()-1;
169 SS[tmpSS].NAH1D.resize(SS[tmpSS].NAH1D.size()+1);
170 SS[tmpSS].NAH1D[SS[tmpSS].NAH1D.size()-1] = Hyst1D.size()-1;
171 PS[PS.size()-1].NAH1D.resize(PS[PS.size()-1].NAH1D.size()+1);
172 PS[PS.size()-1].NAH1D[PS[PS.size()-1].NAH1D.size()-1] = Hyst1D.size()-1;
173 if(debug)cout<<"PS["<<PS.size()-1<<"].NAH1D["<<PS[PS.size()-1].NAH1D.size()-1<<"] = "<<Hyst1D.size()-1;
174 if(Extype!=0){
175 if(debug)cout<<"\tHyst1DExpFilling..."<<endl;
176 Hyst1D[Hyst1D.size()-1].Hyst1DFExp.SetName(hystname);
177 Hyst1D[Hyst1D.size()-1].Hyst1DFExp.SetBins(NBinsX,Firstx,Lastx);
178 }
179 }
180 if (Dim==2){
181 //Hyst2D.resize(Hyst2D.size()+1);
182 //if(debug) cout<<"\tvector of Hyst2D was increased, New size is "<<Hyst2D.size()<<endl;
183 if(debug)cout<<"\tFilling 2D hystogramm"<<endl;
184 //cout<<"Hyst2D.size() = "<<Hyst2D.size()<<endl;
185 Hyst2D[Hyst2D.size()-1].Hyst2DF.SetName(hystname);
186 if(debug)cout<<"\thystname = "<<hystname<<endl;
187 Hyst2D[Hyst2D.size()-1].Hyst2DF.SetBins(NBinsX,Firstx,Lastx,NBinsY,Firsty,Lasty);
188 Hyst2D[Hyst2D.size()-1].HI.NUS = tmpNUS;
189 if(debug)cout<<"\tNUS = "<<tmpNUS<<endl;
190 Hyst2D[Hyst2D.size()-1].HI.NED = ED.size()-1;
191 if(debug)cout<<"\tNED = "<<ED.size()-1<<endl;
192 Hyst2D[Hyst2D.size()-1].HI.NSS = tmpSS;
193 if(debug)cout<<"\tNSS = "<<tmpSS<<endl;
194 Hyst2D[Hyst2D.size()-1].HI.NPT = PS.size()-1;
195 if(debug)cout<<"\tNPT = "<<PS.size()-1<<endl;
196 Hyst2D[Hyst2D.size()-1].HI.TypeExt = TypeExt;
197 Hyst2D[Hyst2D.size()-1].HI.ExpType = Extype;
198 if(debug) cout<<"\tTypeExt = "<<Hyst2D[Hyst2D.size()-1].HI.TypeExt<<endl;
199 Hyst2D[Hyst2D.size()-1].HI.LieveTime = 0;
200 Hyst2D[Hyst2D.size()-1].HI.DeathTime = 0;
201 Hyst2D[Hyst2D.size()-1].HI.filename = filename;
202 if(debug)cout<<"\tfilename = "<<filename<<endl;
203 //if(debug)cout<<"\ttmpNUS = "<<tmpNUS<<endl;
204 US[tmpNUS].NAH2D.resize(US[tmpNUS].NAH2D.size()+1);
205 if(debug)cout<<"US["<<tmpNUS<<"].NAH2D.size = "<<US[tmpNUS].NAH2D.size()<<endl;
206 US[tmpNUS].NAH2D[US[tmpNUS].NAH2D.size()-1] = Hyst2D.size()-1;
207 SS[tmpSS].NAH2D.resize(SS[tmpSS].NAH2D.size()+1);
208 SS[tmpSS].NAH2D[SS[tmpSS].NAH2D.size()-1] = Hyst2D.size()-1;
209 PS[PS.size()-1].NAH2D.resize(PS[PS.size()-1].NAH2D.size()+1);
210 PS[PS.size()-1].NAH2D[PS[PS.size()-1].NAH2D.size()-1] = Hyst2D.size()-1;
211 if(Extype!=0){
212 if(debug)cout<<"\tHyst1DExpFilling..."<<endl;
213 Hyst2D[Hyst2D.size()-1].Hyst2DFExp.SetName(hystname);
214 Hyst2D[Hyst2D.size()-1].Hyst2DFExp.SetBins(NBinsX,Firstx,Lastx,NBinsY,Firsty,Lasty);
215 }
216 }
217 if (Dim==3){
218 //Hyst2D.resize(Hyst2D.size()+1);
219 //if(debug) cout<<"\tvector of Hyst2D was increased, New size is "<<Hyst2D.size()<<endl;
220 if(debug)cout<<"\tFilling 3D hystogramm"<<endl;
221 //cout<<"Hyst2D.size() = "<<Hyst2D.size()<<endl;
222 Hyst3D[Hyst3D.size()-1].Hyst3DF.SetName(hystname);
223 if(debug)cout<<"\thystname = "<<hystname<<endl;
224 Hyst3D[Hyst3D.size()-1].Hyst3DF.SetBins(NBinsX,Firstx,Lastx,NBinsY,Firsty,Lasty,NBinsZ,Firstx,Lastz);
225 Hyst3D[Hyst3D.size()-1].HI.NUS = tmpNUS;
226 if(debug)cout<<"\tNUS = "<<tmpNUS<<endl;
227 Hyst3D[Hyst3D.size()-1].HI.NED = ED.size()-1;
228 if(debug)cout<<"\tNED = "<<ED.size()-1<<endl;
229 Hyst3D[Hyst3D.size()-1].HI.NSS = tmpSS;
230 if(debug)cout<<"\tNSS = "<<tmpSS<<endl;
231 Hyst3D[Hyst3D.size()-1].HI.NPT = PS.size()-1;
232 if(debug)cout<<"\tNPT = "<<PS.size()-1<<endl;
233 Hyst3D[Hyst3D.size()-1].HI.TypeExt = TypeExt;
234 Hyst3D[Hyst3D.size()-1].HI.ExpType = Extype;
235 if(debug) cout<<"\tTypeExt = "<<Hyst3D[Hyst3D.size()-1].HI.TypeExt<<endl;
236 Hyst3D[Hyst3D.size()-1].HI.LieveTime = 0;
237 Hyst3D[Hyst3D.size()-1].HI.DeathTime = 0;
238 Hyst3D[Hyst3D.size()-1].HI.filename = filename;
239 if(debug)cout<<"\tfilename = "<<filename<<endl;
240 //if(debug)cout<<"\ttmpNUS = "<<tmpNUS<<endl;
241 US[tmpNUS].NAH3D.resize(US[tmpNUS].NAH2D.size()+1);
242 if(debug)cout<<"US["<<tmpNUS<<"].NAH2D.size = "<<US[tmpNUS].NAH3D.size()<<endl;
243 US[tmpNUS].NAH3D[US[tmpNUS].NAH3D.size()-1] = Hyst3D.size()-1;
244 SS[tmpSS].NAH3D.resize(SS[tmpSS].NAH3D.size()+1);
245 SS[tmpSS].NAH3D[SS[tmpSS].NAH3D.size()-1] = Hyst3D.size()-1;
246 PS[PS.size()-1].NAH3D.resize(PS[PS.size()-1].NAH3D.size()+1);
247 PS[PS.size()-1].NAH3D[PS[PS.size()-1].NAH3D.size()-1] = Hyst3D.size()-1;
248 if(Extype!=0){
249 if(debug)cout<<"\tHyst1DExpFilling..."<<endl;
250 Hyst3D[Hyst3D.size()-1].Hyst3DFExp.SetName(hystname);
251 Hyst3D[Hyst3D.size()-1].Hyst3DFExp.SetBins(NBinsX,Firstx,Lastx);
252 }
253 }
254 }
255
256 void OptionParam::CheckBrackets(int Argc, char* Argv[], Int_t& i){
257 if(debug) cout<<"\tCheck brackets expresion...\n\n";
258 if(!strcmp(Argv[i],"[") && !strcmp(Argv[i+8],"]")){ //Dlya tempov scheta v savisimosti ot Pitch dlya GEO stroitsya eshe i zavisimosti ot L, B, LB, Altitude - eto i est' 9-yi parametr
259 SimpleCheck(Argv[i+1],Argv[i+2],Argv[i+3], Argv[i+4],"0","0","0","0","0","0", Argv[i+6], Argv[i+5],Argv[i+7],1);
260 i+=8;
261 }else
262 if(!strcmp(Argv[i],"[") && !strcmp(Argv[i+11],"]")){
263 SimpleCheck(Argv[i+1],Argv[i+2],Argv[i+3], Argv[i+4],Argv[i+5],Argv[i+6],Argv[i+7],"0","0","0",Argv[i+9],Argv[i+8],Argv[i+10],2);
264 i+=11;
265 }else
266 if(!strcmp(Argv[i],"[") && !strcmp(Argv[i+14],"]")){
267 SimpleCheck(Argv[i+1],Argv[i+2],Argv[i+3], Argv[i+4],Argv[i+5],Argv[i+6],Argv[i+7],Argv[i+8],Argv[i+9],Argv[i+10],Argv[i+12],Argv[i+11],Argv[i+13],3);
268 i+=14;
269 }else{
270 cout<<"ERROR!\tYou must indicate Parameters of Hystogramm and outputh file for saving!\t See --help\n\n";
271 exit(1);
272 }
273 }
274
275 void OptionParam::Run(int Argc, char* Argv[], Int_t& i){
276 i++;
277 if(debug) cout<<"\tRUN FUNCTION AnglCount....\n\n";
278 while(i<Argc && ((!strcmp(Argv[i],"-Brazil")) || (!strcmp(Argv[i],"-Br")) || (!strcmp(Argv[i],"-WithoutBrazil")) || (!strcmp(Argv[i],"-WBr")) ||
279 (!strcmp(Argv[i],"-Equator")) || (!strcmp(Argv[i],"-Eq")) || (!strcmp(Argv[i],"-Polar")) || (!strcmp(Argv[i],"-Po")) || (!strcmp(Argv[i],"-UserSelection")) ||
280 (!strcmp(Argv[i],"-US")) || (!strcmp(Argv[i],"-AllGeography")) || (!strcmp(Argv[i],"-AGP")) || (!strcmp(Argv[i],"-Mode")) || (!strcmp(Argv[i],"[")))){
281
282 if(debug)cout<<"Argv["<<i<<"] = "<<Argv[i]<<endl;
283 if((!strcmp(Argv[i],"-Brazil")) || (!strcmp(Argv[i],"-Br"))){
284 SetupGeo(350,500,0,0.216,0,1.15,0.1,0.5,34,0); //altmore altless; Bmore Bless; Lmore Lless; Rmore Rless;
285 SetupGeo(350,600,0,0.216,0,1.15,0.1,1,34,1);
286 SetupGeo(350,400,0,0.216,1.15,1.2,0.1,0.5,34,2);
287 SetupGeo(500,600,0,0.213,0,1.15,0.1,0.5,34,3);
288 SetupGeo(400,500,0,0.213,1.35,1.4,0,1,34,4);
289 SetupGeo(550,600,0,0.213,1.35,1.4,0.5,1,34,5);
290 SetupGeo(350,600,0,0.210,0,1.15,1,1.5,34,6);
291 SetupGeo(350,400,0,0.210,0,1.15,1.5,2,34,7);
292 SetupGeo(400,600,0,0.210,1.15,1.2,0.1,1,34,8);
293 SetupGeo(350,400,0,0.210,1.15,1.2,0.5,1,34,9);
294 SetupGeo(350,400,0,0.210,1.2,1.25,0.1,1,34,10);
295 SetupGeo(450,600,0,0.210,1.2,1.25,0.5,1,34,11);
296 SetupGeo(450,500,0,0.210,1.2,1.25,0.1,0.5,34,12);
297 SetupGeo(350,400,0,0.210,1.25,1.3,0.1,1,34,13);
298 SetupGeo(450,600,0,0.210,1.25,1.3,0.1,1,34,14);
299 SetupGeo(350,550,0,0.210,1.3,1.35,0.1,1,34,15);
300 SetupGeo(350,400,0,0.210,1.35,1.4,0.1,1,34,16);
301 SetupGeo(550,600,0,0.210,1.35,1.4,0.1,0.5,34,17);
302 SetupGeo(550,600,0,0.208,1.3,1.35,0.1,1,34,18);
303 SetupGeo(550,600,0,0.208,1.35,1.4,0.1,1,34,19);
304 SetupGeo(450,500,0,0.205,0,1.15,1.5,2,34,20);
305 SetupGeo(550,600,0,0.205,0,1.15,1.5,2,34,21);
306 SetupGeo(350,600,0,0.205,1.2,1.25,0.1,1,34,22);
307 SetupGeo(400,450,0,0.205,1.2,1.25,0.1,1,34,23);
308 SetupGeo(500,600,0,0.205,1.2,1.25,0.1,0.5,34,24);
309 SetupGeo(400,450,0,0.205,1.25,1.3,0.1,1,34,25);
310 SetupGeo(500,550,0,0.202,0,1.2,1.5,2,34,26);
311 SetupGeo(450,550,0,0.202,1.2,1.25,1,1.5,34,27);
312 SetupGeo(550,600,0,0.198,1.15,1.2,1.5,2,34,28);
313 SetupGeo(350,450,0,0.198,1.2,1.25,1,1.5,34,29);
314 SetupGeo(550,600,0,0.198,1.2,1.25,1,1.5,34,30);
315 SetupGeo(450,500,0,0.195,1.15,1.2,1.5,2,34,31);
316 SetupGeo(350,600,0,0.195,1.25,1.3,1,1.5,34,32);
317 SetupGeo(350,600,0,0.211,1.1,1.4,2,1000,34,33);
318 }
319 if((!strcmp(Argv[i],"-WithoutBrazil")) || (!strcmp(Argv[i],"-WBr"))) SetupGeo(300,700,0.24,100,0.1,1000,0.1,1000,1,0);
320 if((!strcmp(Argv[i],"-Equator")) || (!strcmp(Argv[i],"-Eq"))) SetupGeo(300,700,0.24,100,0,1.2,0.1,1000,1,0);
321 if((!strcmp(Argv[i],"-Polar")) || (!strcmp(Argv[i],"-Po"))) SetupGeo(300,700,0,100,6,1000,0.1,1000,1,0);
322 if((!strcmp(Argv[i],"-AllGeography")) || (!strcmp(Argv[i],"-AGP"))) SetupGeo(300,700,0,100,0,1000,0.1,1000,1,0);
323 if((!strcmp(Argv[i],"-UserSelection")) || (!strcmp(Argv[i],"-US"))){
324 if(debug) cout<<"\tUser Selection Option was selected: \n\n";
325 Int_t j = i+1;
326 Double_t Bmore = 0; Double_t Bless = 100;
327 Double_t Lmore = 0; Double_t Lless = 1000;
328 Double_t altmore = 0; Double_t altless = 700;
329 Double_t Rmore = 0.1; Double_t Rless = 1000;
330 //Double_t Pmore = -360; Double_t Pless = 360;
331 while(j<Argc && ((!strcmp(Argv[j],"-Bmore")) || (!strcmp(Argv[j],"-Bless")) || (!strcmp(Argv[j],"-Lmore")) ||
332 (!strcmp(Argv[j],"-Lless")) || (!strcmp(Argv[j],"-altmore")) || (!strcmp(Argv[j],"-altless")) ||
333 (!strcmp(Argv[j],"-Pmore")) || (!strcmp(Argv[j],"-Pless")) || atof(Argv[j]))){
334
335 if(!strcmp(Argv[j],"-Bmore")) Bmore = CheckDouble(Argv[j+1],Argv[j]);
336 if(!strcmp(Argv[j],"-Bless")) Bless = CheckDouble(Argv[j+1],Argv[j]);
337 if(!strcmp(Argv[j],"-Lmore")) Lmore = CheckDouble(Argv[j+1],Argv[j]);
338 if(!strcmp(Argv[j],"-Lless")) Lless = CheckDouble(Argv[j+1],Argv[j]);
339 if(!strcmp(Argv[j],"-altmore")) altmore = CheckDouble(Argv[j+1],Argv[j]);
340 if(!strcmp(Argv[j],"-altless")) altless = CheckDouble(Argv[j+1],Argv[j]);
341 if(!strcmp(Argv[j],"-Rmore")) Rmore = CheckDouble(Argv[j+1],Argv[j]);
342 if(!strcmp(Argv[j],"-Rless")) Rless = CheckDouble(Argv[j+1],Argv[j]);
343 //if(!strcmp(Argv[j],"-Pmore")) Pmore = CheckDouble(Argv[j+1],Argv[j]);
344 //if(!strcmp(Argv[j],"-Pless")) Pless = CheckDouble(Argv[j+1],Argv[j]);
345 j++;i++;
346 }
347 SetupGeo(altmore,altless,Bmore,Bless,Lmore,Lless,Rmore,Rless,1,0);
348 }
349 i++;
350 }//While
351 if(debug){Int_t u; cin>>u;}
352 }
353
354 void OptionParam::CheckAD(int Argc, char* Argv[], Int_t& i){
355 if(debug) cout<<"\t"<<Argv[i]<<" Option was selected: \n\n";
356 i++;
357 while(i<Argc && ((!strcmp(Argv[i],"-Emin")) || (!strcmp(Argv[i],"-Emax")) || (!strcmp(Argv[i],"-detrmin")) || (!strcmp(Argv[i],"-detrmax")))){
358 if(debug)cout<<"Argv["<<i<<"] = "<<Argv[i]<<endl;
359 if(!strcmp(Argv[i],"-Emin")){
360 ED.resize(ED.size()+1);
361 if(debug) cout<<"\tvector EnergyDiapason was increased...\tNew size = "<<ED.size()<<"\n\n";
362 ED[ED.size()-1].Emin = CheckDouble(Argv[i+1],Argv[i]);
363 ED[ED.size()-1].Emax = 1000;
364 ED[ED.size()-1].detrmin = 0;
365 ED[ED.size()-1].detrmax = 1000;
366 //ED[ED.size()-1].NAH = -1;
367 if(debug) cout<<"\t\t Emin = "<<ED[ED.size()-1].Emin<<"\n";
368 i++;
369 }
370 if(!strcmp(Argv[i],"-Emax")){
371 ED[ED.size()-1].Emax = CheckDouble(Argv[i+1],Argv[i]);
372 if(debug) cout<<"\t\t Emax = "<<ED[ED.size()-1].Emax<<"\n";
373 i++;
374 }
375 if(ED[ED.size()-1].Emax<=ED[ED.size()-1].Emin || ED[ED.size()-1].Emax<=0 || ED[ED.size()-1].Emin<0){
376 cout<<"ERROR! Incorrect Energy Diapason Emin = "<<ED[ED.size()-1].Emin<<" Emax = "<<ED[ED.size()-1].Emax<<"\n\n";
377 exit(1);
378 }
379 if(ED[ED.size()-1].Emin>1000) cout<<"WARNING\tPamela don't able to register particles of SUCH high energy\n\n";
380 if(!strcmp(Argv[i],"-detrmin")){
381 ED[ED.size()-1].detrmin = CheckDouble(Argv[i+1],Argv[i]);
382 if(debug) cout<<"\t\t detrmin = "<<ED[ED.size()-1].detrmin<<"\n";
383 i++;
384 }
385 if(!strcmp(Argv[i],"-detrmax")){
386 ED[ED.size()-1].detrmax = CheckDouble(Argv[i+1],Argv[i]);
387 if(debug) cout<<"\t\t detrmax = "<<ED[ED.size()-1].detrmax<<"\n";
388 i++;
389 }
390 if(ED[ED.size()-1].detrmax<=ED[ED.size()-1].detrmin || ED[ED.size()-1].detrmax<=0 || ED[ED.size()-1].detrmin<0){
391 cout<<"ERROR! Incorrect Energy Diapason detrmin = "<<ED[ED.size()-1].detrmin<<" detrmax = "<<ED[ED.size()-1].detrmax<<"\n\n";
392 exit(1);
393 }
394
395 i++;
396 }
397 if(debug)cout<<"LastArgv["<<i<<"] = "<<Argv[i]<<endl<<endl;
398 }
399
400 void OptionParam::CheckPitch(int Argc, char* Argv[], Int_t& i){
401 if(debug) cout<<"\t"<<Argv[i]<<" Option was selected: \n\n";
402 i++;
403 while(i<Argc && ((!strcmp(Argv[i],"-Pthmin")) || (!strcmp(Argv[i],"-Pthmax")))){
404 if(debug)cout<<"Argv["<<i<<"] = "<<Argv[i]<<endl;
405 if(!strcmp(Argv[i],"-Pthmin")){
406 PS.resize(PS.size()+1);
407 PS[PS.size()-1].PitchMin = CheckDouble(Argv[i+1],Argv[i]);
408 PS[PS.size()-1].PitchMax = 360;
409 if(debug)cout<<"\tPitchmin = "<<PS[PS.size()-1].PitchMin<<endl;
410 i++;
411 }
412 if(!strcmp(Argv[i],"-Pthmax")){
413 PS[PS.size()-1].PitchMax = CheckDouble(Argv[i+1],Argv[i]);
414 if(debug)cout<<"\tPitchmax = "<<PS[PS.size()-1].PitchMax<<endl;
415 i++;
416 }
417 i++;
418 }
419 }
420
421 void OptionParam::SetExpOption(int Argc, char* Argv[], Int_t& i){
422 if(debug) cout<<"\t Exposition Option was selected: \n\n";
423 i++;
424 while(i<Argc && ((!strcmp(Argv[i],"-infile")) || (!strcmp(Argv[i],"-effhyst")))){
425 if(!strcmp(Argv[i],"-infile")){
426 EffHyst.resize(EffHyst.size()+1);
427 EffHyst[EffHyst.size()-1].inputfile = Argv[i+1];
428 i++;
429 }
430 if(!strcmp(Argv[i],"-effhyst")){
431 EffHyst[EffHyst.size()-1].inputhyst = Argv[i+1];
432 }
433 i++;
434 }
435 }
436
437 /*
438 void OptionParam::ShowSSInfo(vector<SelectScheme> SS){
439 for(UInt_t i = 0; i<SS.size(); i++){
440 cout<<"\t\tSS["<<i<<"].Rmin = "<<SS[i].Rmin<<"\n";
441 cout<<"\t\tSS["<<i<<"].Rmax = "<<SS[i].Rmax<<"\n";
442 cout<<"\t\tSS["<<i<<"].detrminf = "<<SS[i].detrminf<<"\n";
443 cout<<"\t\tSS["<<i<<"].detrmaxf = "<<SS[i].detrmaxf<<"\n";
444 cout<<"\t\tSS["<<i<<"].detrmore = "<<SS[i].detrmore<<"\n";
445 cout<<"\t\tSS["<<i<<"].detrless = "<<SS[i].detrless<<"\n";
446 cout<<"\t\tSS["<<i<<"].betamin = "<<SS[i].betamin<<"\n";
447 cout<<"\t\tSS["<<i<<"].betamax = "<<SS[i].betamax<<"\n";
448 cout<<"\t\tSS["<<i<<"].AC = "<<SS[i].AC<<"\n";
449 cout<<"\t\tSS["<<i<<"].Calo = "<<SS[i].Calo<<"\n\n";
450 }
451 }
452 */
453 Int_t OptionParam::CheckSS(Double_t Rmin, Double_t Rmax, Int_t detrminf, Int_t detrmaxf, Double_t detrmore, Double_t detrless, Float_t betamin, Float_t betamax, Bool_t AC, Bool_t Calo, Int_t NSP){
454 if(debug)cout<<"\tCHeckUS function..."<<endl;
455 if(debug)cout<<"US.size = "<<US.size()<<endl;
456 for(Int_t sen=0; sen<US.size();sen++){
457 if(SS[sen].SP.size()>NSP){
458 if(SS[sen].SP[NSP].Rmin == Rmin && SS[sen].SP[NSP].Rmax == Rmax && SS[sen].SP[NSP].detrminf == detrminf && SS[sen].SP[NSP].detrmaxf &&
459 SS[sen].SP[NSP].detrmore == detrmore && SS[sen].SP[NSP].detrless == detrless && SS[sen].SP[NSP].betamin == betamin &&
460 SS[sen].SP[NSP].betamax == betamax && SS[sen].SP[NSP].AC == AC && SS[sen].SP[NSP].Calo == Calo) return sen;
461 }
462 }
463 cout<<"end"<<endl;
464 return -1;
465 }
466
467 void OptionParam::FillSS(SelectParam& SP, Double_t Rmin, Double_t Rmax, Int_t detrmin, Int_t detrmax, Double_t detrmore, Double_t detrless, Float_t betamin, Float_t betamax, Bool_t AC, Bool_t Calo){
468 SP.Rmin = Rmin;
469 SP.Rmax = Rmax;
470 SP.detrminf = detrmin;
471 SP.detrmaxf = detrmax;
472 SP.detrmore = detrmore;
473 SP.detrless = detrless;
474 SP.betamin = betamin;
475 SP.betamax = betamax;
476 SP.AC = AC;
477 SP.Calo = Calo;
478 }
479
480 void OptionParam::DefaultSelect(Int_t Np){
481 if(debug) cout<<"\tCreating default selection scheme for "<<Np;
482 if(Np == 0){
483 if(debug) cout<<"All particle...\n\n";
484 Int_t u=CheckSS(-1000,1000,0,0,0,200,0.2,1,false,false,0);
485 if(u!=-1){if(SS[u].SP.size()==1) tmpSS = u;}else{
486 SS[SS.size()-1].SP.resize(1);
487 tmpSS = SS.size()-1;
488 if(debug) cout<<"\tvector SelectParam was increased...\tNew size = "<<SS[SS.size()-1].SP.size()<<"\n\n";
489 FillSS(SS[SS.size()-1].SP[0],-1000,1000,0,0,0,200,0.2,1,false,false);
490 }
491 }else
492 if(Np == 1){
493 if(debug) cout<<" Proton...\n\n";
494 Int_t u = 0;
495 u=CheckSS(0,0.4,1,0,0,20,0.2,1,false,false,0);
496 if(u!=-1) u=CheckSS(0.4,0.8,1,2,0,0,0.2,1,false,false,1);
497 if(u!=-1) u=CheckSS(0.8,3.0,0,2,0,0,0.2,1,false,true,2);
498 if(u!=-1) u=CheckSS(3.0,1000,0,3,0,0,0.2,1,false,false,3);
499 if(debug) cout<<"\tu = "<<u<<endl;
500 if(u!=-1){if(SS[u].SP.size()==4) tmpSS = u;}else{
501 SS[SS.size()-1].SP.resize(4);
502 tmpSS = SS.size()-1;
503 if(debug) cout<<"\tvector SelectParam was increased...\tNew size = "<<SS[SS.size()-1].SP.size()<<"\n\n";
504 FillSS(SS[SS.size()-1].SP[0],0,0.4,1,0,0,20,0.2,1,false,false);
505 FillSS(SS[SS.size()-1].SP[1],0.4,0.8,1,2,0,0,0.2,1,false,false);
506 FillSS(SS[SS.size()-1].SP[2],0.8,3.0,0,2,0,0,0.2,1,false,true);
507 FillSS(SS[SS.size()-1].SP[3],3.0,1000,0,3,0,0,0.2,1,false,true);
508 }
509 if(debug)cout<<"\tProton Selection scheme was filled"<<endl;
510 //if(debug) ShowSSInfo(SS);
511 }else
512 if(Np == 2){
513 if(debug) cout<<"Electron...\n\n";
514 Int_t u=0;
515 u=CheckSS(-0.8,0,0,1,0,0,0.8,1,true,false,0);
516 if(u!=-1) u=CheckSS(-1000,-0.8,0,2,0,0,0.8,1,false,true,1);
517 if(u!=-1){if(SS[u].SP.size()==2) tmpSS = u;}else{
518 SS[SS.size()-1].SP.resize(2);
519 tmpSS = SS.size()-1;
520 if(debug) cout<<"\tvector SelectScheme was increased...\tNew size = "<<SS.size()<<"\n\n";
521 FillSS(SS[SS.size()-1].SP[0],-0.8,0,0,1,0,0,0.8,1,true,false);
522 FillSS(SS[SS.size()-1].SP[1],-1000,-0.8,0,2,0,0,0.8,1,false,true);
523 }
524 //if(debug) ShowSSInfo(SS);
525 }else
526 if(Np == 3){
527 if(debug) cout<<"Positron...\n\n";
528 Int_t u = 0;
529 u=CheckSS(0,0.8,0,1,0,0,0.8,1,true,false,0);
530 if(u!=-1) u=CheckSS(0.8,1000,0,2,0,0,0.8,1,false,true,1);
531 if(u!=-1){if(SS[u].SP.size()==2) tmpSS = u;}else{
532 SS[SS.size()-1].SP.resize(2);
533 tmpSS = SS.size()-1;
534 if(debug) cout<<"\tvector SelectScheme was increased...\tNew size = "<<SS.size()<<"\n\n";
535 FillSS(SS[SS.size()-1].SP[0],0,0.8,0,1,0,0,0.8,1,true,false);
536 FillSS(SS[SS.size()-1].SP[1],0.8,1000,0,2,0,0,0.8,1,false,true);
537 }
538 //if(debug) ShowSSInfo(SS);
539 }else
540 if(Np == 4){
541 if(debug) cout<<"Antiproton...\n\n";
542 Int_t u = 0;
543 u=CheckSS(-0.8,0,1,0,0,30,0.2,1,false,false,0);
544 if(u!=-1) u=CheckSS(-1000,-0.8,0,0,0,0,0.2,1,false,true,1);
545 if(u!=-1){if(SS[u].SP.size()==2) tmpSS = u;}else{
546 SS[SS.size()-1].SP.resize(2);
547 tmpSS = SS.size()-1;
548 if(debug) cout<<"\tvector SelectScheme was increased...\tNew size = "<<SS.size()<<"\n\n";
549 FillSS(SS[SS.size()-1].SP[0],-0.8,0,1,0,0,30,0.2,1,false,false);
550 FillSS(SS[SS.size()-1].SP[1],-1000,-0.8,0,0,0,0,0.2,1,false,true);
551 //tmpSS =
552 }
553 //if(debug) ShowSSInfo(SS);
554 }
555 cout<<"\ttmpSS = "<<tmpSS<<endl;
556 SS[tmpSS].PartType = Np;
557 if(debug){Int_t ut; cin>>ut;}
558 }
559
560 void OptionParam::MakeSelectScheme(int Argc, char* Argv[], Int_t& i, Int_t type){
561 if(debug) cout<<"\tSelect separation Scheme...\n\n";
562 if(type==-1 && i==Argc){
563 cout<<"ERROR!: SelectionScheme option needs in at least 1 parameters!\n";
564 exit(1);
565 }
566 SS.resize(SS.size()+1);
567 if(type!=-1) DefaultSelect(type);else{
568 i++;
569 SS[SS.size()-1].PartType = -1;
570 tmpSS=SS.size()-1;
571 while(i<Argc && ((!strcmp(Argv[i],"-Rmin")) || (!strcmp(Argv[i],"-Rmax")) || (!strcmp(Argv[i],"-detrminf")) || (!strcmp(Argv[i],"-detrmaxf")) ||
572 (!strcmp(Argv[i],"-detrmore")) || (!strcmp(Argv[i],"-detrless")) || (!strcmp(Argv[i],"-AC")) || (!strcmp(Argv[i],"-Calo")) ||
573 (!strcmp(Argv[i],"-betamin")) || (!strcmp(Argv[i],"-betamax")))){
574
575 if(!strcmp(Argv[i],"-Rmin")){
576 SS[SS.size()-1].SP.resize(SS[SS.size()-1].SP.size()+1);
577 if(debug) cout<<"\tvector SelectScheme was increased...\tNew size = "<<SS[SS.size()-1].SP.size()<<"\n\n";
578 SS[SS.size()-1].SP[SS[SS.size()-1].SP.size()-1].Rmin = CheckDouble(Argv[i+1],Argv[i]);
579 if(debug) cout<<"\t\t Rmin = "<<SS[SS.size()-1].SP[SS[SS.size()-1].SP.size()-1].Rmin<<"\n";
580 SS[SS.size()-1].SP[SS[SS.size()-1].SP.size()-1].Rmax = 1000;
581 SS[SS.size()-1].SP[SS[SS.size()-1].SP.size()-1].detrminf = 0;
582 SS[SS.size()-1].SP[SS[SS.size()-1].SP.size()-1].detrmaxf = 0;
583 SS[SS.size()-1].SP[SS[SS.size()-1].SP.size()-1].detrmore = 0;
584 SS[SS.size()-1].SP[SS[SS.size()-1].SP.size()-1].detrless = 1000;
585 SS[SS.size()-1].SP[SS[SS.size()-1].SP.size()-1].betamin = 0.2;
586 SS[SS.size()-1].SP[SS[SS.size()-1].SP.size()-1].betamax = 1;
587 SS[SS.size()-1].SP[SS[SS.size()-1].SP.size()-1].AC = false;
588 SS[SS.size()-1].SP[SS[SS.size()-1].SP.size()-1].Calo = false;
589 i++;
590 }
591 if(!strcmp(Argv[i],"-Rmax")){
592 SS[SS.size()-1].SP[SS[SS.size()-1].SP.size()-1].Rmax = CheckDouble(Argv[i+1],Argv[i]);
593 if(debug) cout<<"\t\t Rmax = "<<SS[SS.size()-1].SP[SS[SS.size()-1].SP.size()-1].Rmax<<"\n";
594 i++;
595 }
596 if(SS[SS.size()-1].SP[SS[SS.size()-1].SP.size()-1].Rmax <= SS[SS.size()-1].SP[SS[SS.size()-1].SP.size()-1].Rmin){
597 cout<<"SelectionScheme: ERROR!!\tYou have incorrect rigidity diapason...\n\n";
598 exit(1);
599 }
600 if(!strcmp(Argv[i],"-detrminf")){
601 SS[SS.size()-1].SP[SS[SS.size()-1].SP.size()-1].detrminf = CheckInt(Argv[i+1],Argv[i]);
602 if(debug) cout<<"\t\t detrminf = "<<SS[SS.size()-1].SP[SS[SS.size()-1].SP.size()-1].detrminf<<"\n";
603 if(SS[SS.size()-1].SP[SS[SS.size()-1].SP.size()-1].detrminf<0 || SS[SS.size()-1].SP[SS[SS.size()-1].SP.size()-1].detrminf>3){
604 cout<<"ERROR:\t-detrminf have incorrect value of argument: -detrminf = "<<Argv[i+1]<<"\n\n";
605 exit(1);
606 }
607 i++;
608 }
609 if(!strcmp(Argv[i],"-detrmaxf")){
610 SS[SS.size()-1].SP[SS[SS.size()-1].SP.size()-1].detrmaxf = CheckInt(Argv[i+1],Argv[i]);;
611 if(debug) cout<<"\t\t detrmaxf = "<<SS[SS.size()-1].SP[SS[SS.size()-1].SP.size()-1].detrmaxf<<"\n";
612 if(SS[SS.size()-1].SP[SS[SS.size()-1].SP.size()-1].detrmaxf<0 || SS[SS.size()-1].SP[SS[SS.size()-1].SP.size()-1].detrmaxf>3){
613 cout<<"ERROR:\t-detrmaxf have incorrect value of argument: -detrmaxf = "<<Argv[i+1]<<"\n\n";
614 exit(1);
615 }
616 i++;
617 }
618 if(!strcmp(Argv[i],"-detrmore")){
619 SS[SS.size()-1].SP[SS[SS.size()-1].SP.size()-1].detrmore = CheckDouble(Argv[i+1],Argv[i]);
620 if(debug) cout<<"\t\t detrmore = "<<SS[SS.size()-1].SP[SS[SS.size()-1].SP.size()-1].detrmore<<"\n";
621 i++;
622 }
623 if(!strcmp(Argv[i],"-detrless")){
624 SS[SS.size()-1].SP[SS[SS.size()-1].SP.size()-1].detrless = CheckDouble(Argv[i+1],Argv[i]);
625 if(debug) cout<<"\t\t detrless = "<<SS[SS.size()-1].SP[SS[SS.size()-1].SP.size()-1].detrless<<"\n";
626 i++;
627 }
628 if(!strcmp(Argv[i],"-betamin")){
629 SS[SS.size()-1].SP[SS[SS.size()-1].SP.size()-1].betamin = CheckDouble(Argv[i+1],Argv[i]);
630 if(debug) cout<<"\t\t betamin = "<<SS[SS.size()-1].SP[SS[SS.size()-1].SP.size()-1].betamin<<"\n";
631 i++;
632 }
633 if(!strcmp(Argv[i],"-betamax")){
634 SS[SS.size()-1].SP[SS[SS.size()-1].SP.size()-1].betamax = CheckDouble(Argv[i+1],Argv[i]);
635 if(debug) cout<<"\t\t betamax = "<<SS[SS.size()-1].SP[SS[SS.size()-1].SP.size()-1].betamax<<"\n";
636 i++;
637 }
638 if(SS[SS.size()-1].SP[SS[SS.size()-1].SP.size()-1].betamax <= SS[SS.size()-1].SP[SS[SS.size()-1].SP.size()-1].betamin){
639 cout<<"SlectionScheme: ERROR!!\tYou have incorrect detr diapason...\n\n";
640 exit(1);
641 }
642 if(!strcmp(Argv[i],"-AC")){
643 SS[SS.size()-1].SP[SS[SS.size()-1].SP.size()-1].AC = true;
644 if(debug) cout<<"\t\t AntiCounter = "<<SS[SS.size()-1].SP[SS[SS.size()-1].SP.size()-1].AC<<"\n";
645 }
646 if(!strcmp(Argv[i],"-Calo")){
647 SS[SS.size()-1].SP[SS[SS.size()-1].SP.size()-1].Calo = true;
648 if(debug) cout<<"\t\t Calorimeter = "<<SS[SS.size()-1].SP[SS[SS.size()-1].SP.size()-1].Calo<<"\n";
649 }
650 i++;
651 }//while
652 }//else
653 if(debug)cout<<"LastArgv["<<i<<"] = "<<Argv[i]<<endl<<endl;
654 if(debug){Int_t u; cin>>u;}
655 }
656
657 void OptionParam::MakeHystAxis(int Argc, char* Argv[], Int_t& i){
658 i++;
659 if(debug)cout<<"MakeHystAxis function..."<<endl;
660
661 if(!strcmp(Argv[i],"-Z")){
662 if(Argc<=i+5){
663 cout<<"ERROR! -Z Needs at least 3 argument!"<<endl;
664 exit(1);
665 }
666 if(strcmp(Argv[i+2],"-Y")){
667 cout<<"ERROR! You need indicate meaning for Y-axis of hyst"<<endl;
668 exit(1);
669 }
670 if(strcmp(Argv[i+4],"-X")){
671 cout<<"ERROR! You need indicate meaning for X-axis of hyst"<<endl;
672 exit(1);
673 }
674 //Hyst3D.resize(Hyst3D.size()+1);
675 //if(debug)cout<<"Hyst3D was increased. New size is "<<Hyst3D.size()<<endl;
676 Int_t size = Hyst3D.size()-1;
677 if(!strcmp(Argv[i+1],"-PamAzim")) Hyst3D[size].ZType = 1;
678 if(!strcmp(Argv[i+1],"-PamZenith")) Hyst3D[size].ZType = 2;
679 if(!strcmp(Argv[i+1],"-Pitch")) Hyst3D[size].ZType = 3;
680 if(!strcmp(Argv[i+1],"-detr")) Hyst3D[size].ZType = 4;
681 if(!strcmp(Argv[i+1],"-rigev")) Hyst3D[size].ZType = 5;
682 if(!strcmp(Argv[i+1],"-lat")) Hyst3D[size].ZType = 6;
683 if(!strcmp(Argv[i+1],"-lon")) Hyst3D[size].ZType = 7;
684 if(!strcmp(Argv[i+1],"-L")) Hyst3D[size].ZType = 8;
685 if(!strcmp(Argv[i+1],"-Babs")) Hyst3D[size].ZType = 9;
686 if(!strcmp(Argv[i+1],"-Alt")) Hyst3D[size].ZType = 10;
687 if(!strcmp(Argv[i+1],"-LieveTime")) Hyst3D[size].ZType = 11;
688 if(!strcmp(Argv[i+1],"-DeathTime")) Hyst3D[size].ZType = 12;
689 if(!strcmp(Argv[i+1],"-PNO")) Hyst3D[size].ZType = 13;
690 if(!strcmp(Argv[i+1],"-MA")) Hyst3D[size].ZType = 14;
691 if(!strcmp(Argv[i+1],"-Eff")) Hyst3D[size].ZType = 15;
692 if(!strcmp(Argv[i+1],"-dS")) Hyst3D[size].ZType = 16;
693 if(!strcmp(Argv[i+1],"-LogE")) Hyst3D[size].XType = 17;
694 if(!strcmp(Argv[i+3],"-PamAzim")) Hyst3D[size].YType = 1;
695 if(!strcmp(Argv[i+3],"-PamZenith")) Hyst3D[size].YType = 2;
696 if(!strcmp(Argv[i+3],"-Pitch")) Hyst3D[size].YType = 3;
697 if(!strcmp(Argv[i+3],"-detr")) Hyst3D[size].YType = 4;
698 if(!strcmp(Argv[i+3],"-rigev")) Hyst3D[size].YType = 5;
699 if(!strcmp(Argv[i+3],"-lat")) Hyst3D[size].YType = 6;
700 if(!strcmp(Argv[i+3],"-lon")) Hyst3D[size].YType = 7;
701 if(!strcmp(Argv[i+3],"-L")) Hyst3D[size].YType = 8;
702 if(!strcmp(Argv[i+3],"-Babs")) Hyst3D[size].YType = 9;
703 if(!strcmp(Argv[i+3],"-Alt")) Hyst3D[size].YType = 10;
704 if(!strcmp(Argv[i+3],"-LieveTime")) Hyst3D[size].YType = 11;
705 if(!strcmp(Argv[i+3],"-DeathTime")) Hyst3D[size].YType = 12;
706 if(!strcmp(Argv[i+3],"-PNO")) Hyst3D[size].YType = 13;
707 if(!strcmp(Argv[i+3],"-MA")) Hyst3D[size].YType = 14;
708 if(!strcmp(Argv[i+3],"-Eff")) Hyst3D[size].YType = 15;
709 if(!strcmp(Argv[i+3],"-dS")) Hyst3D[size].YType = 16;
710 if(!strcmp(Argv[i+3],"-LogE")) Hyst3D[size].YType = 17;
711 if(!strcmp(Argv[i+5],"-PamAzim")) Hyst3D[size].XType = 1;
712 if(!strcmp(Argv[i+5],"-PamZenith")) Hyst3D[size].XType = 2;
713 if(!strcmp(Argv[i+5],"-Pitch")) Hyst3D[size].XType = 3;
714 if(!strcmp(Argv[i+5],"-detr")) Hyst3D[size].XType = 4;
715 if(!strcmp(Argv[i+5],"-rigev")) Hyst3D[size].XType = 5;
716 if(!strcmp(Argv[i+5],"-lat")) Hyst3D[size].XType = 6;
717 if(!strcmp(Argv[i+5],"-lon")) Hyst3D[size].XType = 7;
718 if(!strcmp(Argv[i+5],"-L")) Hyst3D[size].XType = 8;
719 if(!strcmp(Argv[i+5],"-Babs")) Hyst3D[size].XType = 9;
720 if(!strcmp(Argv[i+5],"-Alt")) Hyst3D[size].XType = 10;
721 if(!strcmp(Argv[i+5],"-LieveTime")) Hyst3D[size].XType = 11;
722 if(!strcmp(Argv[i+5],"-DeathTime")) Hyst3D[size].XType = 12;
723 if(!strcmp(Argv[i+5],"-PNO")) Hyst3D[size].XType = 13;
724 if(!strcmp(Argv[i+5],"-MA")) Hyst3D[size].XType = 14;
725 if(!strcmp(Argv[i+5],"-Eff")) Hyst3D[size].XType = 15;
726 if(!strcmp(Argv[i+5],"-dS")) Hyst3D[size].XType = 16;
727 if(!strcmp(Argv[i+5],"-LogE")) Hyst3D[size].XType = 17;
728 Hyst3D[size].NEI = EffHyst.size()-1;
729 i+=5;
730 };
731
732 if(!strcmp(Argv[i],"-Y")){
733 if(Argc<=i+3){
734 cout<<"ERROR! -Y Needs at least 3 argument!"<<endl;
735 exit(1);
736 }
737 if(strcmp(Argv[i+2],"-X")){
738 cout<<"ERROR! You need indicate meaning for X-axis of hyst"<<endl;
739 exit(1);
740 }
741 Hyst2D.resize(Hyst2D.size()+1);
742 if(debug)cout<<"Hyst2D was increased. New size is "<<Hyst2D.size()<<endl;
743 Int_t size = Hyst2D.size()-1;
744 if(!strcmp(Argv[i+1],"-PamAzim")) Hyst2D[size].YType = 1;
745 if(!strcmp(Argv[i+1],"-PamZenith")) Hyst2D[size].YType = 2;
746 if(!strcmp(Argv[i+1],"-Pitch")) Hyst2D[size].YType = 3;
747 if(!strcmp(Argv[i+1],"-detr")) Hyst2D[size].YType = 4;
748 if(!strcmp(Argv[i+1],"-rigev")) Hyst2D[size].YType = 5;
749 if(!strcmp(Argv[i+1],"-lat")) Hyst2D[size].YType = 6;
750 if(!strcmp(Argv[i+1],"-lon")) Hyst2D[size].YType = 7;
751 if(!strcmp(Argv[i+1],"-L")) Hyst2D[size].YType = 8;
752 if(!strcmp(Argv[i+1],"-Babs")) Hyst2D[size].YType = 9;
753 if(!strcmp(Argv[i+1],"-Alt")) Hyst2D[size].YType = 10;
754 if(!strcmp(Argv[i+1],"-LieveTime")) Hyst2D[size].YType = 11;
755 if(!strcmp(Argv[i+1],"-DeathTime")) Hyst2D[size].YType = 12;
756 if(!strcmp(Argv[i+1],"-PNO")) Hyst2D[size].YType = 13;
757 if(!strcmp(Argv[i+1],"-MA")) Hyst2D[size].YType = 14;
758 if(!strcmp(Argv[i+1],"-LogE")) Hyst2D[size].YType = 17;
759 if(!strcmp(Argv[i+3],"-PamAzim")) Hyst2D[size].XType = 1;
760 if(!strcmp(Argv[i+3],"-PamZenith")) Hyst2D[size].XType = 2;
761 if(!strcmp(Argv[i+3],"-Pitch")) Hyst2D[size].XType = 3;
762 if(!strcmp(Argv[i+3],"-detr")) Hyst2D[size].XType = 4;
763 if(!strcmp(Argv[i+3],"-rigev")) Hyst2D[size].XType = 5;
764 if(!strcmp(Argv[i+3],"-lat")) Hyst2D[size].XType = 6;
765 if(!strcmp(Argv[i+3],"-lon")) Hyst2D[size].XType = 7;
766 if(!strcmp(Argv[i+3],"-L")) Hyst2D[size].XType = 8;
767 if(!strcmp(Argv[i+3],"-Babs")) Hyst2D[size].XType = 9;
768 if(!strcmp(Argv[i+3],"-Alt")) Hyst2D[size].XType = 10;
769 if(!strcmp(Argv[i+3],"-LieveTime")) Hyst2D[size].XType = 11;
770 if(!strcmp(Argv[i+3],"-DeathTime")) Hyst2D[size].XType = 12;
771 if(!strcmp(Argv[i+3],"-PNO")) Hyst2D[size].XType = 13;
772 if(!strcmp(Argv[i+3],"-MA")) Hyst2D[size].XType = 14;
773 if(!strcmp(Argv[i+2],"-LogE")) Hyst2D[size].XType = 17;
774 i+=3;
775 }
776 if(!strcmp(Argv[i],"-X")){
777 if(Argc<=i+1){
778 cout<<"ERROR! -X Needs at least 1 argument!"<<endl;
779 exit(1);
780 }
781 Hyst1D.resize(Hyst1D.size()+1);
782 if(debug)cout<<"Hyst1D was increased. New size is "<<Hyst1D.size()<<endl;
783 Int_t size = Hyst1D.size()-1;
784 if(!strcmp(Argv[i+1],"-PamAzim")) Hyst1D[size].XType = 1;
785 if(!strcmp(Argv[i+1],"-PamZenith")) Hyst1D[size].XType = 2;
786 if(!strcmp(Argv[i+1],"-Pitch")) Hyst1D[size].XType = 3;
787 if(!strcmp(Argv[i+1],"-detr")) Hyst1D[size].XType = 4;
788 if(!strcmp(Argv[i+1],"-rigev")) Hyst1D[size].XType = 5;
789 if(!strcmp(Argv[i+1],"-lat")) Hyst1D[size].XType = 6;
790 if(!strcmp(Argv[i+1],"-lon")) Hyst1D[size].XType = 7;
791 if(!strcmp(Argv[i+1],"-L")) Hyst1D[size].XType = 8;
792 if(!strcmp(Argv[i+1],"-Babs")) Hyst1D[size].XType = 9;
793 if(!strcmp(Argv[i+1],"-Alt")) Hyst1D[size].XType = 10;
794 if(!strcmp(Argv[i+1],"-LieveTime")) Hyst1D[size].XType = 11;
795 if(!strcmp(Argv[i+1],"-DeathTime")) Hyst1D[size].XType = 12;
796 if(!strcmp(Argv[i+1],"-PNO")) Hyst1D[size].XType = 13;
797 if(!strcmp(Argv[i+1],"-MA")) Hyst1D[size].XType = 14;
798 if(!strcmp(Argv[i+1],"-LogE")) Hyst1D[size].XType = 17;
799 i++;
800 }
801 }
802
803 void OptionParam::PamEffFunc(int Argc, char* Argv[]){
804 Int_t i = 0;
805 while(i<Argc){
806 if(debug)cout<<"Argv["<<i<<"] = "<<Argv[i]<<endl;
807 if(!strcmp(Argv[i],"-p") || !strcmp(Argv[i],"-Antiproton")) MakeSelectScheme(Argc, Argv, i, 4);
808 if(!strcmp(Argv[i],"+p") || !strcmp(Argv[i],"-Proton")) MakeSelectScheme(Argc, Argv, i, 1);
809 if(!strcmp(Argv[i],"-e") || !strcmp(Argv[i],"-Electron")) MakeSelectScheme(Argc, Argv, i, 2);
810 if(!strcmp(Argv[i],"+e") || !strcmp(Argv[i],"-Positron")) MakeSelectScheme(Argc, Argv, i, 3);
811 if(!strcmp(Argv[i],"-all") || !strcmp(Argv[i],"-AllParticles")) MakeSelectScheme(Argc, Argv, i, 0);
812 if(!strcmp(Argv[i],"-SS") || !strcmp(Argv[i],"-SelectionScheme")) MakeSelectScheme(Argc, Argv, i, -1);
813 if(!strcmp(Argv[i],"-ED") || !strcmp(Argv[i],"-EnergyDiapason")) CheckAD(Argc, Argv, i);
814 if(!strcmp(Argv[i],"-GS") || !strcmp(Argv[i],"-GeoSelect")) Run(Argc, Argv, i);
815 if(!strcmp(Argv[i],"-PS") || !strcmp(Argv[i],"-PitchSelect")) CheckPitch(Argc, Argv, i);
816 if(!strcmp(Argv[i],"-Exp") || !strcmp(Argv[i],"-Exposition")) SetExpOption(Argc, Argv, i);
817 if(!strcmp(Argv[i],"-HM") || !strcmp(Argv[i],"-HystMeaning")) MakeHystAxis(Argc, Argv, i);
818 if(!strcmp(Argv[i],"[")) CheckBrackets(Argc, Argv, i);
819 i++;
820 }
821 if(debug){
822 for(Int_t se = 0; se<Hyst1D.size(); se++){
823 cout<<"Hyst1D["<<se<<"]..."<<endl;
824 cout<<"filename "<<Hyst1D[se].HI.filename<<endl;
825 cout<<"X axis is "<<Hyst1D[se].XType<<endl;
826 cout<<"NUS = "<<Hyst1D[se].HI.NUS<<endl;
827 for(Int_t U = 0; U<US[Hyst1D[se].HI.NUS].USP.size(); U++){
828 cout<<"\tBmore = "<<US[Hyst1D[se].HI.NUS].USP[U].Bmore<<"\tBless = "<<US[Hyst1D[se].HI.NUS].USP[U].Bless<<endl;
829 cout<<"\tLmore = "<<US[Hyst1D[se].HI.NUS].USP[U].Lmore<<"\tLless = "<<US[Hyst1D[se].HI.NUS].USP[U].Lless<<endl;
830 cout<<"\taltmore = "<<US[Hyst1D[se].HI.NUS].USP[U].altmore<<"\taltless = "<<US[Hyst1D[se].HI.NUS].USP[U].altless<<endl;
831 cout<<"\tRmore = "<<US[Hyst1D[se].HI.NUS].USP[U].Rmore<<"\tRless = "<<US[Hyst1D[se].HI.NUS].USP[U].Rless<<endl;
832 cout<<"\t\tNumbers of according 1D hystogramms:\t";
833 for(Int_t su = 0; su<US[Hyst1D[se].HI.NUS].NAH1D.size(); su++){
834 cout<<US[Hyst1D[se].HI.NUS].NAH1D[su]<<" ";
835 }
836 }
837 cout<<"NED = "<<Hyst1D[se].HI.NED<<endl;
838 cout<<"\tRmax = "<<ED[Hyst1D[se].HI.NED].Emax<<"\tRmin = "<<ED[Hyst1D[se].HI.NED].Emin<<endl;
839 cout<<"\tDetrmax = "<<ED[Hyst1D[se].HI.NED].detrmax<<"\tDetrmin = "<<ED[Hyst1D[se].HI.NED].detrmin<<endl;
840 cout<<"NSS = "<<Hyst1D[se].HI.NSS<<endl;
841 cout<<"NPT = "<<Hyst1D[se].HI.NPT<<endl;
842 cout<<"\tPitchmax = "<<PS[Hyst1D[se].HI.NPT].PitchMax<<"\tPitchmin = "<<PS[Hyst1D[se].HI.NPT].PitchMin<<endl;
843 cout<<"\t\t Size of PS["<<Hyst1D[se].HI.NPT<<"].NAH1D = "<<PS[Hyst1D[se].HI.NPT].NAH1D.size()<<endl;
844 cout<<"\t\tNumbers of according 1D hystogramms:\t";
845 for(Int_t su = 0; su<PS[Hyst1D[se].HI.NPT].NAH1D.size(); su++){
846 cout<<PS[Hyst1D[se].HI.NPT].NAH1D[su]<<" ";
847 }
848 //Int_t ytr;
849 //cin>>ytr;
850 }
851 for(Int_t se = 0; se<Hyst2D.size(); se++){
852 cout<<"Hyst1D["<<se<<"]..."<<endl;
853 cout<<"filename "<<Hyst2D[se].HI.filename<<endl;
854 cout<<"X axis is "<<Hyst2D[se].XType<<endl;
855 cout<<"Y axis is "<<Hyst2D[se].YType<<endl;
856 cout<<"NUS = "<<Hyst2D[se].HI.NUS<<endl;
857 for(Int_t U = 0; U<US[Hyst2D[se].HI.NUS].USP.size(); U++){
858 cout<<"\tBmore = "<<US[Hyst2D[se].HI.NUS].USP[U].Bmore<<"\tBless = "<<US[Hyst2D[se].HI.NUS].USP[U].Bless<<endl;
859 cout<<"\tLmore = "<<US[Hyst2D[se].HI.NUS].USP[U].Lmore<<"\tLless = "<<US[Hyst2D[se].HI.NUS].USP[U].Lless<<endl;
860 cout<<"\taltmore = "<<US[Hyst2D[se].HI.NUS].USP[U].altmore<<"\taltless = "<<US[Hyst2D[se].HI.NUS].USP[U].altless<<endl;
861 cout<<"\tRmore = "<<US[Hyst2D[se].HI.NUS].USP[U].Rmore<<"\tRless = "<<US[Hyst2D[se].HI.NUS].USP[U].Rless<<endl;
862 cout<<"\t\tNumbers of according 2D hystogramms:\t";
863 for(Int_t su = 0; su<US[Hyst2D[se].HI.NUS].NAH2D.size(); su++){
864 cout<<US[Hyst2D[se].HI.NUS].NAH2D[su]<<" ";
865 }
866 }
867 cout<<"NED = "<<Hyst2D[se].HI.NED<<endl;
868 cout<<"\tRmax = "<<ED[Hyst2D[se].HI.NED].Emax<<"\tRmin = "<<ED[Hyst2D[se].HI.NED].Emin<<endl;
869 cout<<"\tDetrmax = "<<ED[Hyst2D[se].HI.NED].detrmax<<"\tDetrmin = "<<ED[Hyst2D[se].HI.NED].detrmin<<endl;
870 cout<<"NSS = "<<Hyst2D[se].HI.NSS<<endl;
871 cout<<"NPT = "<<Hyst2D[se].HI.NPT<<endl;
872 cout<<"\tPitchmax = "<<PS[Hyst2D[se].HI.NPT].PitchMax<<"\tPitchmin = "<<PS[Hyst2D[se].HI.NPT].PitchMin<<endl;
873 cout<<"\t\tNumbers of according 2D hystogramms:\t";
874 for(Int_t su = 0; su<PS[Hyst2D[se].HI.NPT].NAH2D.size(); su++){
875 cout<<PS[Hyst2D[se].HI.NPT].NAH2D[su]<<" ";
876 }
877 //Int_t ytr;
878 //cin>>ytr;
879 }
880 }
881 }
882 /*
883 void OptionParam::SelectParam(int Argc, char* Argv[], Int_t& i, DHBuild& DHB){
884 i++;
885 while(i<Argc && ((!strcmp(Argv[i],"-AGD")) || (!strcmp(Argv[i],"-BGD")) || (!strcmp(Argv[i],"-LGD")) || (!strcmp(Argv[i],"-LTGD")))){
886 if(!strcmp(Argv[i],"-AGD")){DHB.AltNAH.resize(DHB.AltNAH.size()+1);DHB.AltNAH[DHB.AltNAH.size()-1] = Hyst1D.size();Run(Argc, Argv, i, DHB.AltNUS);}else
887 if(!strcmp(Argv[i],"-BGD")){DHB.BNAH.resize(DHB.BNAH.size()+1);DHB.BNAH[DHB.BNAH.size()-1] = Hyst1D.size();Run(Argc, Argv, i, DHB.BNUS);}else
888 if(!strcmp(Argv[i],"-LGD")){DHB.LNAH.resize(DHB.LNAH.size()+1);DHB.LNAH[DHB.LNAH.size()-1] = Hyst1D.size();Run(Argc, Argv, i, DHB.LNUS);}else
889 if(!strcmp(Argv[i],"-LTGD")){DHB.LTNAH.resize(DHB.LTNAH.size()+1);DHB.LTNAH[DHB.LTNAH.size()-1] = Hyst1D.size();Run(Argc, Argv, i, DHB.LTNUS);} //LiveTime
890 i++;
891 }
892 }
893
894 void OptionParam::DiffHystFunc(int Argc, char* Argv[]){
895 Int_t i=0;
896 if(debug) cout<<"DiffHyst Function...\n\n";
897 while(i<Argc){
898 if(!strcmp(Argv[i],"-GS") || !strcmp(Argv[i],"-GeoSelect")) SelectParam(Argc, Argv, i, opt.DH.GEOS);else
899 if(!strcmp(Argv[i],"-BS") || !strcmp(Argv[i],"-BSelect")) SelectParam(Argc, Argv, i, opt.DH.BS);else
900 if(!strcmp(Argv[i],"-LS") || !strcmp(Argv[i],"-LSelect")) SelectParam(Argc, Argv, i, opt.DH.LS);else
901 if(!strcmp(Argv[i],"-C") || !strcmp(Argv[i],"-Count")) SelectParam(Argc, Argv, i, opt.DH.Count);else
902 if(!strcmp(Argv[i],"-Z")) opt.DH.Z = true;else
903 if(!strcmp(Argv[i],"-Az")) opt.DH.Az = true;
904 i++;
905 }
906 }
907
908 void OptionParam::PamExpFunc(int Argc, char* Argv[]){
909 opt.PX.PamExpOn = true;
910 Int_t i = 0;
911 while(i<Argc){
912 if(!strcmp(Argv[i],"-EO") || !strcmp(Argv[i],"-ExpOnly")){}
913 if(!strcmp(Argv[i],"-GS") || !strcmp(Argv[i],"-GeoSelect")){}// SelectParam(Argc, Argv, i, opt.PX.In[opt.PX.In.size()-1].NUS);
914 if(!strcmp(Argv[i],"-FN") || !strcmp(Argv[i],"-filename")){
915 if(i+1<Argc){
916 opt.PX.In.resize(opt.PX.In.size()+1);
917 opt.PX.In[opt.PX.In.size()-1].file = (TString)Argv[i];
918 opt.PX.In[opt.PX.In.size()-1].HystName = Argv[i+1];
919 }
920 }
921 i++;
922 }
923 }
924 */

  ViewVC Help
Powered by ViewVC 1.1.23