- Timestamp:
- 06/28/07 20:49:30 (17 years ago)
- Location:
- trunk/MagicSoft/Mars
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/Changelog
r8615 r8617 18 18 19 19 -*-*- END OF LINE -*-*- 20 21 22 2007/06/28 Thomas Bretz 23 24 * mars.cc: 25 - added new options to use a sequence file instead of a run 26 27 * mhbase/MFillH.h: 28 - added new member function to reset weights 29 30 * mmain/MEventDisplay.[h,cc]: 31 - added path argument to allow to give an input path 32 - added to allow to setup a sequence file for reading 33 34 * mmain/Makefile: 35 - added inlcude of mjobs for MSequence 36 20 37 21 38 -
trunk/MagicSoft/Mars/mars.cc
r8011 r8617 45 45 gLog << all << endl; 46 46 gLog << "Sorry the usage is:" << endl; 47 gLog << " mars [options] [filename]" << endl << endl; 47 gLog << " mars [options] filename|number [path]" << endl << endl; 48 gLog << " Arguments:" << endl; 49 gLog << " filename: Name of a merpped raw file, a calibrated (Y)," << endl; 50 gLog << " sequence file or sequence number." << endl; 51 gLog << " path: Path where the data is stored in case of a" << endl; 52 gLog << " sequence (datacenter default if omitted)." << endl << endl; 48 53 gLog << " Options:" << endl; 54 gLog.Usage(); 55 gLog << " --config=mars.rc: Change configuration file" << endl; 56 gLog << " <not yet implemented!>" << endl; 49 57 gLog.Usage(); 50 58 gLog << " -?/-h: This help" << endl << endl; 51 59 } 60 61 /* 62 Bool_t InflateRun(TString &run, Bool_t ismc) 63 { 64 if (run.IsDigit()) 65 { 66 const Int_t numrun = run.Atoi(); 67 seq = "/magic/"; 68 if (ismc) 69 seq += ismc ? "montecarlo/" : "rawfiles/"; 70 seq += Form("sequences/%04d/sequence%08d.txt", numseq/10000, numseq); 71 gLog << inf << "Inflated sequence file: " << seq << endl; 72 } 73 74 if (!gSystem->AccessPathName(seq, kFileExists)) 75 return kTRUE; 76 77 gLog << err << "Sorry, sequence file '" << seq << "' doesn't exist." << endl; 78 return kFALSE; 79 } 80 */ 52 81 53 82 int main(int argc, char **argv) … … 70 99 } 71 100 101 //const Bool_t kIsSequence = arg.HasOnlyAndRemove("--seq"); 102 const TString kConfig = arg.GetStringAndRemove("--config=", "mars.rc"); 103 104 if (arg.GetNumOptions()>0) 105 { 106 gLog << warn << "WARNING - Unknown commandline options..." << endl; 107 arg.Print("options"); 108 gLog << endl; 109 return 2; 110 } 111 112 // 113 // check for the right usage of the program 114 // 115 if (arg.GetNumArguments()>2) 116 { 117 Usage(); 118 return 2; 119 } 120 72 121 // 73 122 // This is to make argv[i] more readable inside the code 74 123 // 75 const TString kFilename = arg.GetArgumentStr(0); 124 TString kFilename = arg.GetArgumentStr(0); 125 TString kInpathD = arg.GetArgumentStr(1); 126 127 //if (!kIsSequence && !InflateRun(kFilename)) 128 // return 3; 76 129 77 130 #ifdef HAVE_XPM … … 100 153 #endif 101 154 155 /* 156 MEnv env(kConfig); 157 if (!env.IsValid()) 158 { 159 gLog << err << "Configuration file " << kConfig << " not found." << endl; 160 return 0xfe; 161 } 162 */ 163 102 164 // 103 165 // start the main window … … 107 169 else 108 170 { 109 MEventDisplay *d = new MEventDisplay(kFilename );171 MEventDisplay *d = new MEventDisplay(kFilename, kInpathD); 110 172 d->SetBit(MStatusDisplay::kExitLoopOnExit); 111 173 d->SetTitle(kFilename); -
trunk/MagicSoft/Mars/mmain/MEventDisplay.cc
r8611 r8617 1 1 /* ======================================================================== *\ 2 ! $Name: not supported by cvs2svn $:$Id: MEventDisplay.cc,v 1.6 0 2007-06-26 16:59:21tbretz Exp $2 ! $Name: not supported by cvs2svn $:$Id: MEventDisplay.cc,v 1.61 2007-06-28 19:49:30 tbretz Exp $ 3 3 ! -------------------------------------------------------------------------- 4 4 ! … … 95 95 // Container 96 96 // 97 #include "MSequence.h" // MSequence 98 #include "MDirIter.h" // MDirIter 97 99 #include "MHillas.h" // MHillas::Print(const MGeomCam&) 98 100 #include "MHillasExt.h" // MHillasExt::Print(const MGeomCam&) … … 118 120 // Constructor. 119 121 // 120 MEventDisplay::MEventDisplay(const char *fname ) : MStatusDisplay(), fEvtLoop(0)122 MEventDisplay::MEventDisplay(const char *fname, const char *path) : MStatusDisplay(), fEvtLoop(0) 121 123 { 122 124 // 123 125 // Setup Task list for hillas calculation 124 126 // 125 SetupTaskList("Events", fname );127 SetupTaskList("Events", fname, path); 126 128 127 129 // … … 163 165 { 164 166 TFile f(fname, "READ"); 167 if (f.IsZombie()) 168 return 0; // Not a root file 169 165 170 TTree *t = (TTree*)f.Get(tree); 166 171 if (!t) … … 181 186 // preprocess tasks and read in first event (process) 182 187 // 183 void MEventDisplay::SetupTaskList(const char *tname, const char *fname) 184 { 185 // MCalibrationChargeCam *ccam=0; 186 // MPedPhotCam *pcam=0; 187 188 void MEventDisplay::SetupTaskList(const char *tname, TString fname, const char *path) 189 { 188 190 MBadPixelsCam *badpix = new MBadPixelsCam; 189 191 190 constInt_t type = GetFileType(tname, fname);192 Int_t type = GetFileType(tname, fname); 191 193 switch (type) 192 194 { … … 195 197 case -2: gLog << err << "File type unknown... abort." << endl; return; 196 198 case -1: gLog << err << "Tree " << tname << " not found... abort." << endl; return; 197 } 199 case 0: gLog << inf << "Assuming Sequence file." << endl; break; 200 } 201 202 if (type==0 && !MSequence::InflatePath(fname)) 203 return; 204 205 // Check if file is a sequence... 206 MSequence *seq = type==0 ? new MSequence(fname, path) : new MSequence; 207 if (type==0) 208 type = 1; 198 209 199 210 // … … 209 220 plist->AddToList(tlist); 210 221 plist->AddToList(badpix); 211 212 MReadMarsFile *read = new MReadMarsFile(tname, fname); 222 plist->AddToList(seq); 223 224 MReadMarsFile *read = new MReadMarsFile(tname); 213 225 read->DisableAutoScheme(); 226 if (seq->IsValid()) 227 { 228 MDirIter iter; 229 if (seq->SetupDatRuns(iter, MSequence::kCalibrated)<=0) 230 return; 231 read->AddFiles(iter); 232 } 233 else 234 read->AddFile(fname); 214 235 tlist->AddToList(read); 215 236 -
trunk/MagicSoft/Mars/mmain/MEventDisplay.h
r6569 r8617 38 38 39 39 void UpdateDisplay(); 40 void SetupTaskList(const char *tname, const char *fname);40 void SetupTaskList(const char *tname, TString fname, const char *path); 41 41 42 42 void ReadFirstEvent(); … … 48 48 49 49 public: 50 MEventDisplay(const char *fname );50 MEventDisplay(const char *fname, const char *path=""); 51 51 ~MEventDisplay(); 52 52 -
trunk/MagicSoft/Mars/mmain/Makefile
r8611 r8617 23 23 -I../mfileio -I../mimage -I../mhistmc -I../mgbase -I../mfbase \ 24 24 -I../mdata -I../msignal -I../mcalib -I../mbadpixels \ 25 -I../mpointing -I../mpedestal -I../mmuon -I../mfilter 25 -I../mpointing -I../mpedestal -I../mmuon -I../mfilter -I../mjobs 26 26 27 27 SRCFILES = MBrowser.cc \
Note:
See TracChangeset
for help on using the changeset viewer.