Logo ROOT   6.10/09
Reference Guide
clonesA_Event.cxx
Go to the documentation of this file.
1 #include "TFile.h"
2 #include "TClonesArray.h"
3 #include "clonesA_Event.h"
4 
10 
11 ////////////////////////////////////////////////////////////////////////////////
12 
14  fEventNumber = ev;
15  fModuleNumber = ev%4;
16  fChannel = ev+1000;
17  for (Int_t i=0;i<3;i++) fEventTime[i] = 100+ev;
18 }
19 
20 //______________________________________________________
21 
23  fNofEntries = maxent;
24  fNofHits = 0;
25  fHits = new TClonesArray("TUsrHit", fNofEntries);
26  std::cout << "ctor TUsrHitBuffer " << this << std::endl;
27 }
28 
29 //______________________________________________________
30 
32  TClonesArray & hits = *fHits;
33  TUsrHit *hit = new(hits[fNofHits++]) TUsrHit(ev);
34  return hit;
35 }
36 
37 //______________________________________________________
38 
40  fHits->Clear();
41  fNofHits = 0;
42 }
43 
44 //______________________________________________________
45 
47  Clear();
48  std::cout << "TUsrSevtData1: " << ev << std::endl;
49  fTimeStamp = 100+ev; //in TMrbSubevent_Caen
50  fSevtName = "SubEvent_1_";
51  fSevtName += ev;
52  fMer = 1100 + ev;
53  fPileup = 2100 + ev;
54  for(Int_t i = 1; i <= ev+1; i++) {
55  fHitBuffer.AddHit(i);
56  }
57 }
58 //______________________________________________________
59 
61  Clear();
62  std::cout << "TUsrSevtData2: " << ev << std::endl;
63  fTimeStamp = 100+ev; //in TMrbSubevent_Caen
64  fSevtName = "SubEvent_2_";
65  fSevtName += ev;
66  fMer = 21000 + ev;
67  fPileup = 22000 + ev;
68  for(Int_t i = 1; i <= ev+1; i++) {
69  fHitBuffer.AddHit(i);
70  }
71 }
const char Option_t
Definition: RtypesCore.h:62
void Clear(Option_t *opt="")
void SetEvent(Int_t ev)
int Int_t
Definition: RtypesCore.h:41
TClonesArray * fHits
Definition: clonesA_Event.h:39
friend class TClonesArray
Definition: TObject.h:200
virtual void Clear(Option_t *option="")
Clear the clones array.
TUsrHit * AddHit(Int_t ev)
void SetEvent(Int_t ev)
#define ClassImp(name)
Definition: Rtypes.h:336
TUsrHitBuffer(Int_t maxent=10)
An array of clone (identical) objects.
Definition: TClonesArray.h:32