| 1 | /////////////////////////////////////////////////////////////////
|
|---|
| 2 | //
|
|---|
| 3 | // CORRunEnd
|
|---|
| 4 | //
|
|---|
| 5 | // Created: Tue May 15 2001
|
|---|
| 6 | // Author: Carles Domingo
|
|---|
| 7 | // Purpose: Base class for RunEnd-classes
|
|---|
| 8 | // Notes:
|
|---|
| 9 | //
|
|---|
| 10 | /////////////////////////////////////////////////////////////////
|
|---|
| 11 |
|
|---|
| 12 | // @T \newpage
|
|---|
| 13 |
|
|---|
| 14 | // @section Source code of {\tt CORRunEnd.hxx}
|
|---|
| 15 |
|
|---|
| 16 | /* @text
|
|---|
| 17 | This section shows the include file {\tt CORRunEnd.hxx}
|
|---|
| 18 | @endtext */
|
|---|
| 19 |
|
|---|
| 20 | #ifndef CORRunEnd_Class
|
|---|
| 21 | #define CORRunEnd_Class
|
|---|
| 22 |
|
|---|
| 23 | // @subsection Include files
|
|---|
| 24 |
|
|---|
| 25 | // @code
|
|---|
| 26 | #ifdef __ROOT__
|
|---|
| 27 | #include "TROOT.h"
|
|---|
| 28 | #include "TObject.h"
|
|---|
| 29 | #else // not __ROOT__
|
|---|
| 30 | #include "Rtypes.h"
|
|---|
| 31 | #endif
|
|---|
| 32 |
|
|---|
| 33 | #include <iostream.h>
|
|---|
| 34 | #include <iomanip.h>
|
|---|
| 35 | #include <fstream.h>
|
|---|
| 36 | #include <stdlib.h>
|
|---|
| 37 | #include <math.h>
|
|---|
| 38 |
|
|---|
| 39 | #include "COREventHeader.hxx"
|
|---|
| 40 |
|
|---|
| 41 | // @endcode
|
|---|
| 42 |
|
|---|
| 43 | // @subsection Class {\em CORRunEnd}: Definition
|
|---|
| 44 |
|
|---|
| 45 | // @code
|
|---|
| 46 | class CORRunEnd {
|
|---|
| 47 |
|
|---|
| 48 | public:
|
|---|
| 49 |
|
|---|
| 50 | char RUNE[4];
|
|---|
| 51 | Float_t RunNumber;
|
|---|
| 52 | Float_t NumEvts;
|
|---|
| 53 |
|
|---|
| 54 | Float_t dmmy[270];
|
|---|
| 55 |
|
|---|
| 56 | public:
|
|---|
| 57 | CORRunEnd(void) {} // default constructor
|
|---|
| 58 |
|
|---|
| 59 | virtual ~CORRunEnd(void) {} // default destructor
|
|---|
| 60 |
|
|---|
| 61 | // reads RunEnd from binary input stream
|
|---|
| 62 | Int_t read ( ifstream &is ) {
|
|---|
| 63 | is.read ( (char *)this, sizeof( float ) * 273 );
|
|---|
| 64 | return is.gcount();
|
|---|
| 65 | }
|
|---|
| 66 |
|
|---|
| 67 | // writes RunEnd to binary output stream
|
|---|
| 68 | Int_t write ( ofstream &os ) {
|
|---|
| 69 | os.write ( (char *)this, sizeof( float ) * 273 );
|
|---|
| 70 | return 0;
|
|---|
| 71 | }
|
|---|
| 72 |
|
|---|
| 73 | // get information about the RunEnd
|
|---|
| 74 |
|
|---|
| 75 | // print-out of the RUNE
|
|---|
| 76 | void print(void);
|
|---|
| 77 |
|
|---|
| 78 | // get the run number
|
|---|
| 79 | inline Float_t get_runnumber ( void ) { return (RunNumber); }
|
|---|
| 80 |
|
|---|
| 81 | // get the number of events
|
|---|
| 82 | inline Float_t get_numberevents ( void ) { return ( NumEvts ); }
|
|---|
| 83 |
|
|---|
| 84 | // fill Run Header
|
|---|
| 85 | inline void fill ( Float_t theRunNumber,
|
|---|
| 86 | Float_t theNumEvts) {
|
|---|
| 87 |
|
|---|
| 88 | strcpy(RUNE,"RUNE");
|
|---|
| 89 | RunNumber = theRunNumber;
|
|---|
| 90 | NumEvts = theNumEvts;
|
|---|
| 91 |
|
|---|
| 92 | for (Int_t i=0; i<270; i++){
|
|---|
| 93 | dmmy[i]=0.;
|
|---|
| 94 | }
|
|---|
| 95 | return;
|
|---|
| 96 | }
|
|---|
| 97 |
|
|---|
| 98 | };
|
|---|
| 99 | // @endcode
|
|---|
| 100 |
|
|---|
| 101 | #endif // not defined CORRunEnd_Class
|
|---|