Changeset 4723 for trunk/MagicSoft/Mars/callisto.cc
- Timestamp:
- 08/24/04 18:15:29 (20 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/callisto.cc
r4722 r4723 16 16 #include "MJPedestal.h" 17 17 #include "MJCalibration.h" 18 #include "MJCalibrateSignal.h" 18 19 19 20 using namespace std; … … 40 41 gLog << all << endl; 41 42 gLog << "Sorry the usage is:" << endl; 42 gLog << " callisto [ options] sequence.txt" << endl << endl;43 gLog << " callisto [-c] [-y] [options] sequence.txt" << endl << endl; 43 44 gLog << " Arguments:" << endl; 44 45 gLog << " sequence.txt: An ascii file defining a sequence of runs" << endl; 45 46 gLog << " Root Options:" << endl; 46 47 gLog << " -b Batch mode (no graphical output to screen)" << endl<<endl; 48 gLog << " Operation Modes:" << endl; 49 gLog << " -c Calculate the calibration constants" << endl; 50 gLog << " -y Extract and calibrate signal" << endl << endl; 47 51 gLog << " Options:" << endl; 48 52 gLog.Usage(); … … 50 54 gLog << " -f Force overwrite of existing files" << endl; 51 55 gLog << " --in=path Path where to search for the data files" << endl; 52 gLog << " --out=path Path where to write the result to" << endl; 56 gLog << " [default=standard path in datacenter]" << endl; 57 gLog << " --iny=path Path where to search for the calibration files" << endl; 58 gLog << " [default=local path or output path of Mode-C]" << endl; 59 gLog << " --out=path Path to write the all results to [def=local path]" << endl; 60 gLog << " --outc=path Path to write Mode-C result to [def=local path]" << endl; 61 gLog << " --outy=path Path to write Mode-Y result to [def=local path]" << endl; 53 62 gLog << " --printseq Print Sequence information" << endl; 54 63 gLog << " --printfiles Print Files taken from Sequence" << endl; … … 92 101 const Bool_t kPrintOnly = arg.HasOnlyAndRemove("--printonly"); 93 102 const Bool_t kOverwrite = arg.HasOnlyAndRemove("-f"); 103 const TString kInpathY = arg.GetStringAndRemove("--iny=", ""); 104 TString kInpath = arg.GetStringAndRemove("--in=", ""); 94 105 const TString kOutpath = arg.GetStringAndRemove("--out=", ""); 95 const TString kInpath = arg.GetStringAndRemove("--in=", ""); 96 106 TString kOutpathC = arg.GetStringAndRemove("--outc=", ""); 107 TString kOutpathY = arg.GetStringAndRemove("--outy=", ""); 108 109 const Bool_t kModeC = arg.HasOnlyAndRemove("-c"); 110 const Bool_t kModeY = arg.HasOnlyAndRemove("-y"); 111 112 if (!kModeC && !kModeY) 113 { 114 gLog << err << "Neither calibration (-c) nor signal extraction (-y) mode specified!" << endl; 115 return 0; 116 } 117 118 if (!kOutpath.IsNull()) 119 { 120 if (!kOutpathC.IsNull() || !kOutpathY.IsNull()) 121 { 122 gLog << err << "You cannot use --out= and --outc= or --outy= together!" << endl; 123 return 0; 124 } 125 if (kOutpathC.IsNull()) 126 kOutpathC = kOutpath; 127 if (kOutpathY.IsNull()) 128 kOutpathY = kOutpath; 129 } 97 130 if (arg.GetNumOptions()>0) 98 131 { … … 116 149 if (gROOT->IsBatch() || !gClient) 117 150 { 118 gLog << "Bombing... maybe your DISPLAY variable is not set correctly!" << endl;151 gLog << err << "Bombing... maybe your DISPLAY variable is not set correctly!" << endl; 119 152 return 1; 120 153 } … … 164 197 d->SetTitle(kSequence); 165 198 166 MJPedestal job1; 167 job1.SetSequence(&seq); 168 job1.SetEnv(kConfig); 169 job1.SetDisplay(d);; 170 job1.SetOutputPath(kOutpath); 171 172 if (!job1.ProcessFile()) 173 { 174 gLog << err << "Calculation of pedestal failed." << endl << endl; 175 return -1; 176 } 177 178 if (!job1.GetDisplay()) 179 { 180 gLog << warn << "Display closed by user... execution aborted." << endl << endl; 181 return 1; 182 } 183 184 MJCalibration job2; 185 job2.SetSequence(&seq); 186 job2.SetEnv(kConfig); 187 job2.SetDisplay(d);; 188 job2.SetBadPixels(job1.GetBadPixels()); 189 job2.SetOutputPath(kOutpath); 190 job2.SetOverwrite(kOverwrite); 191 192 if (!job2.ProcessFile(job1.GetPedestalCam())) 193 { 194 gLog << err << "Calculation of calibration failed." << endl << endl; 195 return -1; 196 } 197 198 if (!job2.GetDisplay()) 199 { 200 gLog << warn << "Display closed by user... execution aborted." << endl << endl; 201 return 1; 199 if (kModeC) 200 { 201 MJPedestal job1("MJPedestal1"); 202 job1.SetSequence(&seq); 203 job1.SetEnv(kConfig); 204 job1.SetDisplay(d);; 205 job1.SetInputPath(kInpath); 206 job1.SetOutputPath(kOutpathC); 207 job1.SetOverwrite(kOverwrite); 208 209 if (!job1.ProcessFile()) 210 { 211 gLog << err << "Calculation of pedestal failed." << endl << endl; 212 return -1; 213 } 214 215 if (!job1.GetDisplay()) 216 { 217 gLog << warn << "Display closed by user... execution aborted." << endl << endl; 218 return 1; 219 } 220 221 MJCalibration job2("MJCalibration"); 222 job2.SetSequence(&seq); 223 job2.SetEnv(kConfig); 224 job2.SetDisplay(d);; 225 job2.SetBadPixels(job1.GetBadPixels()); 226 job2.SetInputPath(kInpath); 227 job2.SetOutputPath(kOutpathC); 228 job2.SetOverwrite(kOverwrite); 229 230 if (!job2.ProcessFile(job1.GetPedestalCam())) 231 { 232 gLog << err << "Calculation of calibration failed." << endl << endl; 233 return -1; 234 } 235 236 if (!job2.GetDisplay()) 237 { 238 gLog << warn << "Display closed by user... execution aborted." << endl << endl; 239 return 1; 240 } 241 } 242 243 if (kModeY) 244 { 245 d->Reset(); 246 247 MJCalibrateSignal job("MJCalibrateSignal"); 248 job.SetDisplay(d);; 249 job.SetInputPath(kInpath); // Where to search for data files 250 job.SetOutputPath(kOutpathY); 251 job.SetOverwrite(kOverwrite); 252 // Where to search for calibration files 253 if (!job.ProcessFile(seq, kConfig, kModeC ? kOutpathC : kInpathY)) 254 return -1; 255 256 if (!job.GetDisplay()) 257 { 258 gLog << warn << "Display closed by user... execution aborted." << endl << endl; 259 return 1; 260 } 202 261 } 203 262
Note:
See TracChangeset
for help on using the changeset viewer.