source: trunk/MagicSoft/include-Classes/MRawFormat/MRawCrateArray.cc@ 9492

Last change on this file since 9492 was 498, checked in by magicsol, 24 years ago
*** empty log message ***
  • Property svn:executable set to *
File size: 1.8 KB
Line 
1/////////////////////////////////////////////////////////////////////////////
2//
3// MRawCrateArray
4//
5// This class exists to make it possible to read in the crate data
6// TClones Array. In principal we can directly write the TClonesArray
7// to the root file, but when we read in again the root file we cannot
8// put the TClonesArray into our parameter list, becaus it isn't derived
9// from TNamed. This class is derived from TNamed and can be put in the list
10//
11/////////////////////////////////////////////////////////////////////////////
12#include "MRawCrateArray.h"
13
14#include <iostream.h>
15
16#include <TClonesArray.h>
17
18ClassImp(MRawCrateArray)
19
20MRawCrateArray::MRawCrateArray(const char *name, const char *title)
21{
22 *fName = name ? name : "MRawCrateArray";
23 *fTitle = title ? title : "Array of MRawCrateData Information";
24
25 //
26 // craete an (almost) empty array. The size is easily determined
27 // while filling the array
28 //
29 fArray = new TClonesArray("MRawCrateData", 0);
30}
31
32MRawCrateArray::~MRawCrateArray()
33{
34 delete fArray;
35}
36
37void MRawCrateArray::Clear(Option_t *opt)
38{
39 //
40 // clear the entries in the TClonesArray
41 //
42 fArray->Clear();
43}
44
45void MRawCrateArray::Print(Option_t *opt)
46{
47 cout << "MRawCrateArray::Print()" << endl;
48}
49
50MRawCrateData *MRawCrateArray::GetEntry(Int_t i)
51{
52 //
53 // Return a pointer the i-th entry in the array
54 //
55 return (MRawCrateData*)fArray->AddrAt(i);
56}
57
58MRawCrateData* &MRawCrateArray::operator[](Int_t i)
59{
60 //
61 // Return the i-th entry in the array
62 //
63 return (MRawCrateData*&)(*fArray)[i];
64}
65
66TClonesArray **MRawCrateArray::GetArray()
67{
68 //
69 // return a pointer to the pointer of the array
70 // (actually not used. You may need it if you want to write
71 // the TClonesArray directly)
72 //
73 return &fArray;
74}
75
Note: See TracBrowser for help on using the repository browser.