Changeset 17699 for trunk/Mars/fact/analysis/mc/star.C
- Timestamp:
- 04/26/14 15:35:48 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Mars/fact/analysis/mc/star.C
r17641 r17699 1 1 #include <sstream> 2 2 #include <iostream> 3 4 #include "MLog.h" 5 #include "MLogManip.h" 3 6 4 7 #include "TH1F.h" … … 8 11 #include "TLine.h" 9 12 13 #include "../mcore/DrsCalib.h" 10 14 #include "MDrsCalibration.h" 11 15 //#include "MLogManip.h" … … 53 57 #include "MImgCleanStd.h" 54 58 55 56 59 using namespace std; 57 60 58 int star( 59 const char *mars_data_file_path = "/fhgfs/groups/app/callisto_star_test/callisto_for_mc_test_output/callisto.root", 60 const char *root_output_file_path = "/fhgfs/groups/app/callisto_star_test/callisto_for_mc_test_output/star.root", 61 const char *status_display_output_path = "/fhgfs/groups/app/callisto_star_test/callisto_for_mc_test_output/star_status_display.root", 62 const char *status_display_title = "star_status_display_title", 63 const char *hillas_txt_file_path = "/fhgfs/groups/app/callisto_star_test/star_hillas.txt", 64 Double_t lvl1=4.0, 65 Double_t lvl2=2.5, 66 Double_t deltat = 17.5) 61 int star(const TString callistofile, TString outfile, 62 TString displayfile, TString displaytitle, 63 const TString txtfile, 64 Double_t lvl1=4.0, Double_t lvl2=2.5, Double_t deltat = 17.5); 65 66 67 int star(const TString infile = "callisto.root", TString outfile = "", 68 Double_t lvl1=4.0, Double_t lvl2=2.5, Double_t deltat = 17.5) 67 69 { 70 return star(infile, outfile, "", "", "", lvl1, lvl2, deltat); 71 } 72 73 int star(const TString callistofile, TString outfile, 74 TString displayfile, TString displaytitle, 75 const TString txtfile, 76 Double_t lvl1, Double_t lvl2, Double_t deltat) 77 { 78 68 79 //Double_t lvl1=7.8, 69 80 //Double_t lvl2=3.9, … … 72 83 // ------------------------------------------------------ 73 84 85 if (displaytitle.IsNull()) 86 displaytitle = gSystem->BaseName(callistofile); 87 88 FileStat_t fstat; 89 int rc = gSystem->GetPathInfo(outfile, fstat); 90 bool isdir = !rc || R_ISDIR(fstat.fMode); 91 92 char *buf = gSystem->ConcatFileName(outfile, "star.root"); 93 outfile = buf; 94 delete [] buf; 95 96 if (displayfile.IsNull()) 97 { 98 displayfile = outfile; 99 displayfile.Insert(displayfile.Last('.'), "-display"); 100 } 101 else 102 { 103 if (isdir && gSystem->DirName(displayfile)==TString(".")) 104 { 105 buf = gSystem->ConcatFileName(outfile, displayfile); 106 displayfile = buf; 107 delete [] buf; 108 } 109 } 110 111 // ------------------------------------------------------ 112 74 113 gLog.Separator("Star"); 75 114 gLog << all << "Calculate image parameters of sequence "; 76 115 gLog << endl; 77 gLog << " mars_data_file_path: " << mars_data_file_path<< endl;78 gLog << " root_output_file_path: " << root_output_file_path<< endl;79 gLog << " status_display_output_path: " << status_display_output_path<< endl;80 gLog << " status_display_title: " << status_display_title << endl;116 gLog << "Callisto file: " << callistofile << endl; 117 gLog << "Output file: " << outfile << endl; 118 gLog << "Display file: " << displayfile << endl; 119 gLog << "Display title: " << displaytitle << endl; 81 120 gLog << endl; 82 gLog << "lvl1: " << lvl1 <<endl; 83 gLog << "lvl2: " << lvl2 <<endl; 121 gLog << "lvl1: " << lvl1 <<endl; 122 gLog << "lvl2: " << lvl2 <<endl; 123 gLog << "deltat: " << deltat <<endl; 84 124 85 125 … … 152 192 MReadMarsFile read("Events"); 153 193 read.DisableAutoScheme(); 154 read.AddFile( mars_data_file_path);194 read.AddFile(callistofile); 155 195 156 196 MContinue cont("MRawEvtHeader.GetTriggerID!=4", "SelectData"); … … 276 316 // --------------------------------------------------------------- 277 317 278 MWriteAsciiFile write_ascii_hillas(hillas_txt_file_path, "MHillas"); 279 write_ascii_hillas.AddColumns("MHillasExt"); 280 write_ascii_hillas.AddColumns("MHillasSrc"); 281 282 283 MWriteRootFile write(root_output_file_path, "RECREATE", "Image parameters", 2); 284 write.AddContainer("MTime", "Events"); 285 write.AddContainer("MHillas", "Events"); 286 write.AddContainer("MHillasExt", "Events"); 287 write.AddContainer("MHillasSrc", "Events"); 288 write.AddContainer("MImagePar", "Events"); 289 write.AddContainer("MNewImagePar", "Events"); 290 write.AddContainer("MRawEvtHeader", "Events"); 291 write.AddContainer("ThetaSquared", "Events"); 292 write.AddContainer("Disp", "Events"); 293 write.AddContainer("MRawRunHeader", "RunHeaders"); 294 write.AddContainer("MGeomCam", "RunHeaders"); 318 MWriteAsciiFile writeascii(txtfile, "MHillas"); 319 writeascii.AddColumns("MHillasExt"); 320 writeascii.AddColumns("MHillasSrc"); 321 322 323 MWriteRootFile write(outfile, "RECREATE", "Image parameters", 2); 324 write.AddContainer("MTime", "Events"); 325 write.AddContainer("MHillas", "Events"); 326 write.AddContainer("MHillasExt", "Events"); 327 write.AddContainer("MHillasSrc", "Events"); 328 write.AddContainer("MImagePar", "Events"); 329 write.AddContainer("MNewImagePar", "Events"); 330 write.AddContainer("MRawEvtHeader", "Events"); 331 write.AddContainer("ThetaSquared", "Events"); 332 write.AddContainer("Disp", "Events"); 333 write.AddContainer("MCorsikaEvtHeader", "Events", kFALSE); 334 write.AddContainer("MMcEvt", "Events", kFALSE); 335 write.AddContainer("IncidentAngle", "Events", kFALSE); 336 write.AddContainer("MPointingPos", "Events", kFALSE); 337 338 write.AddContainer("MRawRunHeader", "RunHeaders"); 339 write.AddContainer("MGeomCam", "RunHeaders"); 340 write.AddContainer("MMcCorsikaRunHeader", "RunHeaders", kFALSE); 341 write.AddContainer("MCorsikaRunHeader", "RunHeaders", kFALSE); 342 write.AddContainer("MMcRunHeader", "RunHeaders", kFALSE); 343 295 344 MFDataPhrase fmuonhn("MMuonCalibPar.fRelTimeSigma>=0", 296 345 "MuonHistCut"); … … 351 400 //tlist.AddToList(&writem); 352 401 tlist.AddToList(&write); 353 tlist.AddToList(&write_ascii_hillas); 402 if (!txtfile.IsNull()) 403 tlist.AddToList(&writeascii); 354 404 355 405 if (!loop.Eventloop()) … … 359 409 return 4; 360 410 361 d->SetTitle( status_display_title, kFALSE);362 d->SaveAs( status_display_output_path);411 d->SetTitle(displaytitle, kFALSE); 412 d->SaveAs(displayfile); 363 413 364 414 return 0; 365 415 } 416
Note:
See TracChangeset
for help on using the changeset viewer.