Changeset 458 for trunk/MagicSoft
- Timestamp:
- 12/28/00 13:49:28 (24 years ago)
- Location:
- trunk/MagicSoft/Mars
- Files:
-
- 2 deleted
- 23 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/Changelog
r457 r458 1 1 -*-*- END -*-*- 2 2000/12/28: Thomas Bretz 3 4 * merpp.cc, MArray.cc, MArray.h, MArrayB.cc, MArrayB.h, MArrayS.cc, 5 MArrayS.h, MEvtLoop.cc, MEvtLoop.h, MInputStreamID.cc, MInputStreamID.h, 6 MParContainer.cc, MParContainer.h, MParList.cc, MParList.h, MReadTree.cc, 7 MTask.cc, MTask.h, MTaskList.cc, MTaskList.h, MTime.cc, MTime.h: 8 - Added changes some comments. 9 10 * MLoopEvt.cc, MLoopEvt.h: 11 - Removed 2 12 3 13 2000/12/22 - Thomas Bretz: -
trunk/MagicSoft/Mars/mbase/MArray.cc
r454 r458 1 ///////////////////////////////////////////////////////////////////////////// 2 // // 3 // MArray // 4 // // 5 // This is an abstract base class for TObject derived Arrays. In principal // 6 // it is almost the same than TArray. The difference is that this array // 7 // base classed is derived from TObject which makes storage of variable // 8 // sized arrays possible with splitlevel=1. // 9 // // 10 // This should not be needed anymore for root >3.00 // 11 // // 12 ///////////////////////////////////////////////////////////////////////////// 1 13 #include "MArray.h" 2 14 -
trunk/MagicSoft/Mars/mbase/MArray.h
r454 r458 1 1 #ifndef MARRAY_H 2 2 #define MARRAY_H 3 4 ///////////////////////////////////////////////////////////////////////////// 5 // // 6 // MArray // 7 // // 8 // Abstract array base class for TObject derived Arrays // 9 // // 10 ///////////////////////////////////////////////////////////////////////////// 3 11 4 12 #ifndef MAGIC_H -
trunk/MagicSoft/Mars/mbase/MArrayB.cc
r454 r458 1 ///////////////////////////////////////////////////////////////////////////// 2 // // 3 // MArrayB // 4 // // 5 // Array of Byte_t. It is almost the same than TArrayC, but it containes // 6 // Byte_t instead of Char_t and it can be stored with splitlevel=1 to a // 7 // a root-file because of it's derivement from MArray (TObject) // // 8 // // 9 ///////////////////////////////////////////////////////////////////////////// 1 10 #include "MArrayB.h" 2 11 -
trunk/MagicSoft/Mars/mbase/MArrayB.h
r454 r458 1 1 #ifndef MARRAYB_H 2 2 #define MARRAYB_H 3 4 ///////////////////////////////////////////////////////////////////////////// 5 // // 6 // MArrayB // 7 // // 8 // Array of Byte_t // 9 // // 10 ///////////////////////////////////////////////////////////////////////////// 3 11 4 12 #ifndef MARRAY_H -
trunk/MagicSoft/Mars/mbase/MArrayS.cc
r454 r458 1 ///////////////////////////////////////////////////////////////////////////// 2 // // 3 // MArrayS // 4 // // 5 // Array of UShort_t. It is almost the same than TArrayS, but it containes // 6 // UShort_t instead of Short_t and it can be stored with splitlevel=1 to a // 7 // a root-file because of it's derivement from MArray (TObject) // // 8 // // 9 ///////////////////////////////////////////////////////////////////////////// 1 10 #include "MArrayS.h" 2 11 -
trunk/MagicSoft/Mars/mbase/MArrayS.h
r454 r458 1 1 #ifndef MARRAYS_H 2 2 #define MARRAYS_H 3 4 ///////////////////////////////////////////////////////////////////////////// 5 // // 6 // MArrayS // 7 // // 8 // Array of UShort_t // 9 // // 10 ///////////////////////////////////////////////////////////////////////////// 3 11 4 12 #ifndef MARRAY_H -
trunk/MagicSoft/Mars/mbase/MEvtLoop.cc
r454 r458 1 ///////////////////////////////////////////////////////////////////////////// 2 // // 3 // MEvtLoop // 4 // // 5 // This class is the core of each event processing. // 6 // First you must set the parameter list to use. The parameter list // 7 // must contain the task list (MTaskList) to use. The name of the task // 8 // list can be specified if you call Eventloop. The standard name is // 9 // "MTaskList". The name you specify must match the name of the MTaskList // 10 // object. // 11 // // 12 // If you call Eventloop first all PreProcess functions - with the // 13 // parameter list as an argument - of the tasks in the task list are // 14 // executed. If one of them returns kFALSE then the execution is stopped. // 15 // If the preprocessing was ok. The Process funtion of the tasks are // 16 // as long as one function returns kSTOP. Only the tasks which are marked // 17 // marked as "All" or with a string which matches the MInputStreamID of // 18 // MTaskList are executed. If one tasks returns kCONTINUE the pending // 19 // tasks in the list are skipped and the execution in continued with // 20 // the first one in the list. // 21 // Afterwards the PostProcess functions are executed. // 22 // // 23 ///////////////////////////////////////////////////////////////////////////// 1 24 #include "MEvtLoop.h" 2 25 … … 25 48 void MEvtLoop::Eventloop(Int_t maxcnt, const char *ftasks) 26 49 { 50 // See class description above. 51 27 52 // 28 53 // check if the needed parameter list is set. -
trunk/MagicSoft/Mars/mbase/MEvtLoop.h
r454 r458 1 1 #ifndef MEVTLOOP_H 2 2 #define MEVTLOOP_H 3 4 ///////////////////////////////////////////////////////////////////////////// 5 // // 6 // MEvtLoop // 7 // // 8 // Class to execute the tasks in a tasklist // 9 // // 10 ///////////////////////////////////////////////////////////////////////////// 3 11 4 12 #ifndef MAGIC_H … … 21 29 void Eventloop(Int_t maxcnt=-1, const char *tlist="MTaskList"); 22 30 23 ClassDef(MEvtLoop, 1) 31 ClassDef(MEvtLoop, 1) // Class to execute the tasks in a tasklist 24 32 }; 25 33 -
trunk/MagicSoft/Mars/mbase/MInputStreamID.cc
r454 r458 1 /////////////////////////////////////////////////////////////////////// 2 // // 3 // MInpuStreamID // 4 // // 5 // This is a ID which is assigned to tasks and to a task list. // 6 // It depends on this ID whether a task is executed by the // 7 // MTaskList::Process member funtion or not. // 8 // // 9 /////////////////////////////////////////////////////////////////////// 10 1 11 #include "MInputStreamID.h" 2 12 -
trunk/MagicSoft/Mars/mbase/MInputStreamID.h
r454 r458 1 1 #ifndef MINPUTSTREAMID_H 2 2 #define MINPUTSTREAMID_H 3 3 4 /////////////////////////////////////////////////////////////////////// 4 5 // // 5 6 // MInpuStreamID // 6 7 // // 7 // This is the storage container for general (CaOs, Raw, ...) Event // 8 // Info like the type of the 'actual' event // 8 // Assigns an ID to tasks or a task list // 9 9 // // 10 10 /////////////////////////////////////////////////////////////////////// … … 35 35 } 36 36 37 ClassDef(MInputStreamID, 1) // Process control container for thetask list37 ClassDef(MInputStreamID, 1) //Assigns an ID to tasks or a task list 38 38 }; 39 39 -
trunk/MagicSoft/Mars/mbase/MParContainer.cc
r454 r458 1 ////////////////////////////////////////////////////////////////////////// 2 // // 3 // TNamed // 4 // // 5 // The TNamed class is the base class for all named ROOT classes // 6 // A TNamed contains the essential elements (name, title) // 7 // to identify a derived object in containers, directories and files. // 8 // Most member functions defined in this base class are in general // 9 // overridden by the derived classes. // 1 /////////////////////////////////////////////////////////////////////////// 2 // // 3 // MParContainer // 4 // // 5 // The MParContainer class is the base class for all MARS parameter // 6 // containers. At the moment it is almost the same than ROOT's TNamed. // 7 // A TNamed contains the essential elements (name, title) // 8 // to identify a derived object in lists like our MParList or MTaskList. // 9 // The main difference is that the name and title isn't stored and read // 10 // to and from root files ("\\!") // 10 11 // // 11 12 ////////////////////////////////////////////////////////////////////////// … … 14 15 #include <iostream.h> // cout 15 16 16 #include "TClass.h"// IsA17 #include "TROOT.h"// TROOT::Identlevel18 #include "TVirtualPad.h"// gPad17 #include <TClass.h> // IsA 18 #include <TROOT.h> // TROOT::Identlevel 19 #include <TVirtualPad.h> // gPad 19 20 20 21 ClassImp(MParContainer) … … 23 24 MParContainer::MParContainer(const MParContainer &named) 24 25 { 25 // TNamedcopy ctor.26 // MParContainer copy ctor. 26 27 27 28 *fName = *(named.fName); … … 32 33 MParContainer& MParContainer::operator=(const MParContainer& rhs) 33 34 { 34 // TNamedassignment operator.35 // MParContainer assignment operator. 35 36 36 37 if (this != &rhs) { … … 45 46 Int_t MParContainer::Compare(TObject *obj) 46 47 { 47 // Compare two TNamedobjects. Returns 0 when equal, -1 when this is48 // Compare two MParContainer objects. Returns 0 when equal, -1 when this is 48 49 // smaller and +1 when bigger (like strcmp). 49 50 … … 65 66 void MParContainer::FillBuffer(char *&buffer) 66 67 { 67 // Encode TNamedinto output buffer.68 // Encode MParContainer into output buffer. 68 69 69 70 fName->FillBuffer(buffer); … … 74 75 void MParContainer::ls(Option_t *) 75 76 { 76 // List TNamedname and title.77 // List MParContainer name and title. 77 78 78 79 TROOT::IndentLevel(); … … 84 85 void MParContainer::Print(Option_t *) 85 86 { 86 // Print TNamedname and title.87 // Print MParContainer name and title. 87 88 88 89 cout <<"OBJ: " << IsA()->GetName() << "\t" << GetName() << "\t" << GetTitle() << endl; … … 92 93 void MParContainer::SetName(const char *name) 93 94 { 94 // Change (i.e. set) the name of the TNamed.95 // Change (i.e. set) the name of the MParContainer. 95 96 // WARNING !! 96 97 // If the object is a member of a THashTable, THashList container … … 105 106 void MParContainer::SetObject(const char *name, const char *title) 106 107 { 107 // Change (i.e. set) all the TNamedparameters (name and title).108 // Change (i.e. set) all the MParContainer parameters (name and title). 108 109 // See also WARNING in SetName 109 110 … … 116 117 void MParContainer::SetTitle(const char *title) 117 118 { 118 // Change (i.e. set) the title of the TNamed.119 // Change (i.e. set) the title of the MParContainer. 119 120 120 121 *fTitle = title; … … 125 126 Int_t MParContainer::Sizeof() const 126 127 { 127 // Return size of the TNamedpart of the TObject.128 // Return size of the MParContainer part of the TObject. 128 129 129 130 Int_t nbytes = fName->Sizeof() + fTitle->Sizeof(); -
trunk/MagicSoft/Mars/mbase/MParContainer.h
r454 r458 4 4 ////////////////////////////////////////////////////////////////////////// 5 5 // // 6 // TNamed//6 // MParContainer // 7 7 // // 8 // The basis for a named object (name, title).//8 // The basis for all parameter containers // 9 9 // // 10 10 ////////////////////////////////////////////////////////////////////////// … … 19 19 class MParContainer : public TObject 20 20 { 21 21 private: 22 22 void Init(const char *name, const char *title) 23 { 24 fName = new TString; 25 (*fName) = name; 26 fTitle = new TString; 27 (*fTitle) = title; 28 } 29 protected: 30 TString *fName; //! object identifier 31 TString *fTitle; //! object title 32 33 public: 23 { 24 fName = new TString; 25 (*fName) = name; 26 fTitle = new TString; 27 (*fTitle) = title; 28 } 29 30 protected: 31 TString *fName; //! parameter container identifier (name) 32 TString *fTitle; //! parameter container title 33 34 public: 34 35 MParContainer(const char *name="", const char *title="") { Init(name, title); } 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 ClassDef(MParContainer, 1) //The basis for Parameter Containers36 MParContainer(const TString &name, const TString &title) { Init(name, title); } 37 MParContainer(const MParContainer &named); 38 MParContainer& operator=(const MParContainer& rhs); 39 virtual ~MParContainer() { delete fName; delete fTitle; } 40 virtual Int_t Compare(TObject *obj); 41 virtual void Copy(TObject &named); 42 virtual void FillBuffer(char *&buffer); 43 virtual const char *GetName() const {return fName->Data();} 44 virtual const char *GetTitle() const {return fTitle->Data();} 45 virtual ULong_t Hash() { return fName->Hash(); } 46 virtual Bool_t IsSortable() const { return kTRUE; } 47 virtual void SetName(const char *name); // *MENU* 48 virtual void SetObject(const char *name, const char *title); 49 virtual void SetTitle(const char *title=""); // *MENU* 50 virtual void ls(Option_t *option=""); 51 virtual void Print(Option_t *option=""); 52 virtual Int_t Sizeof() const; 53 54 ClassDef(MParContainer, 1) //The basis for all parameter containers 54 55 }; 55 56 -
trunk/MagicSoft/Mars/mbase/MParList.cc
r454 r458 1 /////////////////////////////////////////////////////////////////////// 2 // 3 // MParList 4 // 5 // This class contains a list of different Parameter and Data 6 // Containers. 7 // 8 // You can add every parameter Container (Named object) to the 9 // instance and access it from somewhere else via its Name. 10 // 11 /////////////////////////////////////////////////////////////////////// 1 ///////////////////////////////////////////////////////////////////////////// 2 // // 3 // MParList // 4 // // 5 // This class contains a list of different parameter containers. // 6 // // 7 // A parameter container is an object which is derived from // 8 // MParContainer. // 9 // // 10 // Normally a parameter container is used for data exchange between two // 11 // tasks at runtime. // 12 // // 13 // You can add every parameter container (Named object) to the // 14 // instance and access it from somewhere else via its Name. // 15 // // 16 ///////////////////////////////////////////////////////////////////////////// 12 17 13 18 #include "MParList.h" -
trunk/MagicSoft/Mars/mbase/MParList.h
r454 r458 1 1 #ifndef MPARLIST_H 2 2 #define MPARLIST_H 3 4 ///////////////////////////////////////////////////////////////////////////// 5 // // 6 // MParList // 7 // // 8 // List of parameter containers (MParContainer) // 9 // // 10 ///////////////////////////////////////////////////////////////////////////// 3 11 4 12 #ifndef MAGIC_H … … 46 54 void Print(Option_t *t = NULL); 47 55 48 ClassDef(MParList, 1) // list of Parameter Containers56 ClassDef(MParList, 1) //list of parameter containers (MParContainer) 49 57 }; 50 58 -
trunk/MagicSoft/Mars/mbase/MReadTree.cc
r454 r458 1 //////////////////////////////////////////////////////////////////////// 2 // 3 // MRawFile 4 // 5 // This tasks reads the raw binary file like specified in the TDAS??? 6 // and writes the data in the corresponding containers which are 7 // either retrieved from the parameter list or created and added. 8 // 9 //////////////////////////////////////////////////////////////////////// 1 ///////////////////////////////////////////////////////////////////////////// 2 // // 3 // MReadTree // 4 // // 5 // This tasks opens all branches in a specified tree and creates the // 6 // corresponding parameter containers if not already existing in the // 7 // parameter list. // 8 // // 9 // The Process function reads one events from the tree. To go through the // 10 // events of one tree make sure that the event number is increased from // 11 // outside. It makes also possible to go back by decreasing the number. // 12 // // 13 ///////////////////////////////////////////////////////////////////////////// 10 14 11 15 #include "MReadTree.h" -
trunk/MagicSoft/Mars/mbase/MTask.cc
r454 r458 1 /////////////////////////////////////////////////////////////////////// 2 // 3 // MTask 4 // 5 // Base class for all tasks which can perfomed in a tasklist 6 // For each event processed in the eventloop all the different 7 // tasks in the tasklist will be processed. 8 // 9 // So all tasks must inherit from this baseclass. 10 // 11 // The data member fEventType is used to indicate the type of events12 // t hat are process by this task. There are the following different13 // event types:14 // 15 // This is the type of task for which this task should be processed16 // taskType-bits: 7 6 5 4 3 2 1 017 // 0 DATA_EVT18 // 1 CALIBRATION_EVT19 // ? etc. etc.20 // 21 // Inside this abstract class, there are three fundamental function:22 // 23 // - Pr eProcess() : executed before the eventloop starts. Here you24 // can initiate different things, open files, etc.25 // 26 // - Process() : executed for each event in the eventloop. Do in27 // one task after the other (as the occur in the28 // t asklist) the action of one task.29 // 30 // - PostProcess(): executed after the eventloop. Here you can close31 // output files, start display of the run parameter,32 // etc.33 // 34 // 35 /////////////////////////////////////////////////////////////////////// 1 ///////////////////////////////////////////////////////////////////////////// 2 // // 3 // MTask // 4 // // 5 // Base class for all tasks which can perfomed in a tasklist // 6 // For each event processed in the eventloop all the different // 7 // tasks in the tasklist will be processed. // 8 // // 9 // So all tasks must inherit from this baseclass. // 10 // // 11 // The inheritance from MInputStreamID is used to indicate the // 12 // type of event that this task is for. If it is "All" it is executed // 13 // independantly of the actual ID of the task list. // 14 // // 15 // Inside this abstract class, there are three fundamental function: // 16 // // 17 // - PreProcess(): executed before the eventloop starts. Here you // 18 // can initiate different things, open files, etc. // 19 // As an argument this function gets a pointer to the // 20 // parameter list. You can stop the execution by // 21 // kFALSE instread of kTRUE. // 22 // // 23 // - Process(): executed for each event in the eventloop. Do in // 24 // one task after the other (as the occur in the // 25 // tasklist) the action of one task. Only the tasks // 26 // with a Stream ID which matches the actual ID of the // 27 // task list are executed. A task can return kFALSE // 28 // to stop the execuition of the pending taks in a // 29 // list or kCONTINUE to skip the pending tasks. // 30 // // 31 // - PostProcess(): executed after the eventloop. Here you can close // 32 // output files, start display of the run parameter, // 33 // etc. // 34 // // 35 ///////////////////////////////////////////////////////////////////////////// 36 36 37 37 #include "MTask.h" -
trunk/MagicSoft/Mars/mbase/MTask.h
r454 r458 1 1 #ifndef MTASK_H 2 2 #define MTASK_H 3 4 ///////////////////////////////////////////////////////////////////////////// 5 // // 6 // MTask // 7 // // 8 // Abstract base class for a task // 9 // // 10 ///////////////////////////////////////////////////////////////////////////// 3 11 4 12 #ifndef MINPUTSTREAMID_H … … 20 28 virtual Bool_t PostProcess(); 21 29 22 ClassDef(MTask, 1) // Base (abstract)class for a task30 ClassDef(MTask, 1) //Abstract base class for a task 23 31 }; 24 32 -
trunk/MagicSoft/Mars/mbase/MTaskList.cc
r454 r458 1 1 /////////////////////////////////////////////////////////////////////// 2 2 // // 3 // MTaskList 3 // MTaskList // 4 4 // // 5 // Collection of tasks which should be processed in the eventloop//5 // Collection of tasks to be processed in the eventloop // 6 6 // // 7 7 /////////////////////////////////////////////////////////////////////// -
trunk/MagicSoft/Mars/mbase/MTaskList.h
r454 r458 1 1 #ifndef MTASKLIST_H 2 2 #define MTASKLIST_H 3 4 /////////////////////////////////////////////////////////////////////// 5 // // 6 // MTaskList // 7 // // 8 // Collection of tasks to be processed in the eventloop // 9 // // 10 /////////////////////////////////////////////////////////////////////// 3 11 4 12 #ifndef ROOT_TOrdCollection … … 31 39 void Print(Option_t *t = NULL); 32 40 33 ClassDef(MTaskList, 1) // Collection of tasks to be performed in the eventloop41 ClassDef(MTaskList, 1) //collection of tasks to be performed in the eventloop 34 42 }; 35 43 -
trunk/MagicSoft/Mars/mbase/MTime.cc
r454 r458 1 /////////////////////////////////////////////////////////////////////// 2 // 3 // MTime 4 // 5 /////////////////////////////////////////////////////////////////////// 1 ///////////////////////////////////////////////////////////////////////////// 2 // // 3 // MTime // 4 // // 5 // A generalized MARS time stamp // 6 // // 7 ///////////////////////////////////////////////////////////////////////////// 6 8 7 9 #include "MTime.h" -
trunk/MagicSoft/Mars/mbase/MTime.h
r454 r458 1 1 #ifndef MTIME_H 2 2 #define MTIME_H 3 4 ///////////////////////////////////////////////////////////////////////////// 5 // // 6 // MTime // 7 // // 8 // A generalized MARS time stamp // 9 // // 10 ///////////////////////////////////////////////////////////////////////////// 3 11 4 12 #ifndef MPARCONTAINER_H … … 75 83 } 76 84 77 ClassDef(MTime, 1) // A general Marstime stamp85 ClassDef(MTime, 1) //A generalized MARS time stamp 78 86 }; 79 87 -
trunk/MagicSoft/Mars/merpp.cc
r454 r458 17 17 #include "MInputStreamID.h" 18 18 19 ///////////////////////////////////////////////////////////////////////////// 20 // 21 // This is an easy implementation of the Merging process (as compilable prog) 22 // 23 // at the moment it reads a binary file ("rawtest.bin") which was written 24 // in the DAQ raw format. 25 // 26 // The data are stored in root container objects (classes derived from 27 // TObject like MRawRunHeader) 28 // 29 // This containers are written to a root file ("rawtest.root") 30 // 31 ///////////////////////////////////////////////////////////////////////////// 19 ////////////////////////////////////////////////////////////////////////////// 20 // // 21 // This is an easy implementation of the Merging process // 22 // (as compilable prog) // 23 // // 24 // at the moment it reads a binary file ("rawtest.bin") which was written // 25 // in the DAQ raw format. // 26 // // 27 // The data are stored in root container objects (classes derived from // 28 // TObject like MRawRunHeader) // 29 // // 30 // This containers are written to a root file ("rawtest.root") // 31 // // 32 ////////////////////////////////////////////////////////////////////////////// 32 33 33 34 int main(const int argc, const char **argv)
Note:
See TracChangeset
for help on using the changeset viewer.