source: trunk/MagicSoft/Mars/mreflector/MRflEvtData.cc@ 2134

Last change on this file since 2134 was 2134, checked in by tbretz, 21 years ago
*** empty log message ***
File size: 998 bytes
Line 
1#include "MRflEvtData.h"
2
3#include "MLog.h"
4#include "MLogManip.h"
5
6ClassImp(MRflEvtData);
7
8// --------------------------------------------------------------------------
9//
10// Creates a MCerPhotPix object for each pixel in the event
11//
12MRflEvtData::MRflEvtData(const char *name, const char *title)
13 : fList("MRflSinglePhoton", 0), fPos(0)
14{
15 fName = name ? name : "MRflEvtData";
16 fTitle = title ? title : "All Photons from a reflector event";
17}
18
19void MRflEvtData::Print(Option_t *o="") const
20{
21 *fLog << all << underline << GetDescriptor() << ":" << endl;
22 fList.Print();
23}
24
25MRflSinglePhoton &MRflEvtData::GetNewPhoton()
26{
27 // If necessary the []-operator creates a new element
28 // Warning: The virtual table may not be set correctly,
29 // this is why you have to call the new-operator.
30 return *new (fList[fPos++]) MRflSinglePhoton;
31}
32
33void MRflEvtData::FixSize()
34{
35 if (fList.GetEntriesFast() == fPos)
36 return;
37
38 fList.ExpandCreateFast(fPos);
39}
40
Note: See TracBrowser for help on using the repository browser.