ROOT  6.07/01
Reference Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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 
13  TUsrHit::TUsrHit(Int_t ev) {
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 }
TString fSevtName
Definition: clonesA_Event.h:69
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
TUsrHitBuffer fHitBuffer
Definition: clonesA_Event.h:56
TClonesArray * fHits
Definition: clonesA_Event.h:39
void Clear(Option_t *="")
Definition: clonesA_Event.h:51
friend class TClonesArray
Definition: TObject.h:214
TString fSevtName
Definition: clonesA_Event.h:86
virtual void Clear(Option_t *option="")
Clear the clones array.
TUsrHit * AddHit(Int_t ev)
void SetEvent(Int_t ev)
TUsrHitBuffer(Int_t maxent=10)
ClassImp(TUsrHit) ClassImp(TUsrHitBuffer) ClassImp(TUsrSevtData1) ClassImp(TUsrSevtData2) ClassImp(TMrbSubevent_Caen) TUsrHit
An array of clone (identical) objects.
Definition: TClonesArray.h:32