- Timestamp:
- 10/05/19 16:53:52 (5 years ago)
- Location:
- trunk/Mars/hawc
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Mars/hawc/callisto.C
r19704 r19719 66 66 // Range in which the pulse extraction searches for the 67 67 // pulse (in samples). 68 const int first_slice = 100;69 const int last_slice = 500;68 const int first_slice = 290; 69 const int last_slice = 350; 70 70 71 71 // Calibration constant (for the moment a single constant to 72 72 // convert the extracted charge to photo-electrons) 73 double scale = 0.2;73 double scale = 1./22.553;//0.2; 74 74 75 75 // ------------------------------------------------------ … … 179 179 // ------------------ Setup the tasks --------------- 180 180 181 MDirIter files(datafile); 182 181 183 // Instantiate the reading task 182 184 // You can use 183 185 // read5.AddFiles("*.fits.fz") 184 186 // for example to read more than one file at once 185 MRawFitsRead read5(datafile); 187 MRawFitsRead read5; 188 read5.AddFiles(files); 186 189 if (mmap) 187 190 read5.LoadMap(mmap); … … 278 281 //MWriteRootFile write5(2, fname, "RECREATE", "Calibrated Data"); 279 282 283 /* 280 284 // Convert the name of the input file to the name of the output file 281 285 TString fname = gSystem->ConcatFileName(outpath, gSystem->BaseName(datafile)); … … 286 290 287 291 gSystem->ExpandPathName(fname); 292 */ 293 294 const TString rule(Form("s/(([0-9]+_)?[0-9.]+)_[PCD]_(.*)([.]fits)$/%s\\/$1_Y_$3.root/", 295 MJob:: Esc(outpath).Data())); 288 296 289 297 // Instantitate the writing task and setup the writing 290 MWriteRootFile write5( fname, "RECREATE", "Calibrated Data", 2);298 MWriteRootFile write5(2, rule, "RECREATE", "Calibrated Data"); 291 299 write5.AddContainer("MSignalCam", "Events"); 292 300 write5.AddContainer("MRawEvtHeader", "Events"); … … 340 348 // ============================================================ 341 349 342 // Check if the output file is still accessible from root 343 TFile *ofile = (TFile*)gROOT->GetListOfFiles()->FindObject(fname); 344 cout << ofile << endl; 345 if (!ofile || !ofile->IsOpen() || ofile->IsZombie()) 346 { 347 gLog << err << "File " << fname << " not found" << endl; 348 return 20; 349 } 350 TString fname = write5.GetFileName(); 351 fname.ReplaceAll(".root", "-display.root"); 350 352 351 353 // Write the status display to the file … … 355 357 d->SetTitle(title, kFALSE); 356 358 357 ofile->cd(); 358 d->Write(); 359 d->SaveAsRoot(fname); 359 360 360 361 return 0; -
trunk/Mars/hawc/star.C
r19705 r19719 94 94 loop.SetParList(&plist2); 95 95 96 MDirIter files(datafile); 97 96 98 // Instantiate the reading task 97 99 // You can use … … 100 102 MReadMarsFile read("Events"); 101 103 read.DisableAutoScheme(); 102 read.AddFile (datafile);104 read.AddFiles(files); 103 105 104 106 // Instantiate the task which takes care of the size of all containers … … 116 118 MImgCleanTime clean; 117 119 clean.SetMinCount(0); 118 clean.SetMinSize(5 0);120 clean.SetMinSize(55); 119 121 clean.SetDeltaT(17.5); 120 122 … … 173 175 //MWriteRootFile write5(2, fname, "RECREATE", "Image parameters"); 174 176 177 const TString rule(Form("s/(([0-9]+_)?[0-9.]+)_Y_(.*)([.]root)$/%s\\/$1_Y_$3.root/", 178 MJob:: Esc(outpath).Data())); 179 175 180 // Instantiate writing the file 176 MWriteRootFile write( fname, "RECREATE", "Image parameters", 2);181 MWriteRootFile write(2, rule, "RECREATE", "Image parameters"); 177 182 write.AddContainer("MTime", "Events"); 178 183 write.AddContainer("MHillas", "Events"); … … 224 229 // ============================================================ 225 230 226 // Check if the output file is still accessible from root 227 TFile *ofile = (TFile*)gROOT->GetListOfFiles()->FindObject(fname); 228 if (!ofile || !ofile->IsOpen() || ofile->IsZombie()) 229 { 230 gLog << err << "File " << fname << " not found" << endl; 231 return 20; 232 } 231 TString fname = write.GetFileName(); 232 fname.ReplaceAll(".root", "-display.root"); 233 233 234 234 // Write the status display to the file … … 238 238 d->SetTitle(title, kFALSE); 239 239 240 ofile->cd(); 241 d->Write(); 240 d->SaveAsRoot(fname); 242 241 243 242 return 0;
Note:
See TracChangeset
for help on using the changeset viewer.