Logo ROOT   6.12/07
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 
5 ////////////////////////////////////////////////////////////////////////////////
6 
8  fEventNumber = ev;
9  fModuleNumber = ev%4;
10  fChannel = ev+1000;
11  for (Int_t i=0;i<3;i++) fEventTime[i] = 100+ev;
12 }
13 
14 //______________________________________________________
15 
17  fNofEntries = maxent;
18  fNofHits = 0;
19  fHits = new TClonesArray("TUsrHit", fNofEntries);
20  std::cout << "ctor TUsrHitBuffer " << this << std::endl;
21 }
22 
23 //______________________________________________________
24 
26  TClonesArray & hits = *fHits;
27  TUsrHit *hit = new(hits[fNofHits++]) TUsrHit(ev);
28  return hit;
29 }
30 
31 //______________________________________________________
32 
34  fHits->Clear();
35  fNofHits = 0;
36 }
37 
38 //______________________________________________________
39 
41  Clear();
42  std::cout << "TUsrSevtData1: " << ev << std::endl;
43  fTimeStamp = 100+ev; //in TMrbSubevent_Caen
44  fSevtName = "SubEvent_1_";
45  fSevtName += ev;
46  fMer = 1100 + ev;
47  fPileup = 2100 + ev;
48  for(Int_t i = 1; i <= ev+1; i++) {
49  fHitBuffer.AddHit(i);
50  }
51 }
52 //______________________________________________________
53 
55  Clear();
56  std::cout << "TUsrSevtData2: " << ev << std::endl;
57  fTimeStamp = 100+ev; //in TMrbSubevent_Caen
58  fSevtName = "SubEvent_2_";
59  fSevtName += ev;
60  fMer = 21000 + ev;
61  fPileup = 22000 + ev;
62  for(Int_t i = 1; i <= ev+1; i++) {
63  fHitBuffer.AddHit(i);
64  }
65 }
virtual void Clear(Option_t *="")
Definition: TObject.h:100
Int_t fEventNumber
Definition: clonesA_Event.h:10
const char Option_t
Definition: RtypesCore.h:62
void Clear(Option_t *opt="")
TUsrHit(Int_t ev=0)
Int_t fChannel
Definition: clonesA_Event.h:12
void SetEvent(Int_t ev)
int Int_t
Definition: RtypesCore.h:41
Int_t fModuleNumber
Definition: clonesA_Event.h:11
friend class TClonesArray
Definition: TObject.h:213
TUsrHit * AddHit(Int_t ev)
void SetEvent(Int_t ev)
UShort_t fEventTime[3]
Definition: clonesA_Event.h:13
TUsrHitBuffer(Int_t maxent=10)
An array of clone (identical) objects.
Definition: TClonesArray.h:32