/* ======================================================================== *\ ! ! * ! * This file is part of MARS, the MAGIC Analysis and Reconstruction ! * Software. It is distributed to you in the hope that it can be a useful ! * and timesaving tool in analysing Data of imaging Cerenkov telescopes. ! * It is distributed WITHOUT ANY WARRANTY. ! * ! * Permission to use, copy, modify and distribute this software and its ! * documentation for any purpose is hereby granted without fee, ! * provided that the above copyright notice appear in all copies and ! * that both that copyright notice and this permission notice appear ! * in supporting documentation. It is provided "as is" without express ! * or implied warranty. ! * ! ! ! Author(s): Thomas Bretz, 8/2004 ! ! Copyright: MAGIC Software Development, 2004 ! ! \* ======================================================================== */ ///////////////////////////////////////////////////////////////////////////// // // MSequence // // This class describes a sequence. For sequences see: // http://magic.astro.uni-wuerzburg.de/mars/db/queryseq.html // // A sequence is a collection of runs which should be used together. // ///////////////////////////////////////////////////////////////////////////// #include "MSequence.h" #include #include #include #include // TSystem::ExpandPath #include "MLog.h" #include "MLogManip.h" #include "MDirIter.h" ClassImp(MSequence); using namespace std; // -------------------------------------------------------------------------- // // Copy the run numbers from the TString runs into the TArrayI data // void MSequence::Split(TString &runs, TArrayI &data) const { const TRegexp regexp("[0-9]+"); data.Set(0); runs = runs.Strip(TString::kTrailing); while (!runs.IsNull()) { TString num = runs(regexp); const Int_t n = data.GetSize(); data.Set(n+1); data[n] = atoi(num.Data()); runs.Remove(0, runs.First(num)+num.Length()); } } Int_t MSequence::SetupRuns(MDirIter &iter, const TArrayI &arr, const char *path, Bool_t raw) const { TString d(path); // Setup path if (d.IsNull()) { d = Form("/data/MAGIC/Period%03d/", fPeriod); d += raw ? "rawdata/" : "rootdata/"; d += fNight.GetStringFmt("%Y_%m_%d"); } for (int i=0; i" << endl; return; } gLog << "Sequence: " << fSequence << endl; gLog << "Period: " << fPeriod << endl; gLog << "Night: " << fNight << endl << endl; gLog << "Start: " << fStart << endl; gLog << "LastRun: " << fLastRun << endl; gLog << "NumEvents: " << fNumEvents << endl; gLog << "Project: " << fProject << endl; gLog << "Source: " << fSource << endl; gLog << "TriggerTable: " << fTriggerTable << endl; gLog << "HvSettings: " << fHvSettings << endl << endl; gLog << "Runs:"; for (int i=0; i