ROOT
master
Reference Guide
Loading...
Searching...
No Matches
clones_event.cxx
Go to the documentation of this file.
1
#include "
TFile.h
"
2
#include "
TClonesArray.h
"
3
#include "
clones_event.h
"
4
5
////////////////////////////////////////////////////////////////////////////////
6
7
TUsrHit::TUsrHit
(
Int_t
ev
)
8
{
9
fEventNumber
=
ev
;
10
fModuleNumber
=
ev
%4;
11
fChannel
=
ev
+1000;
12
for
(
Int_t
i = 0; i < 3; i++)
13
fEventTime
[i] = 100 +
ev
;
14
}
15
16
//______________________________________________________
17
18
TUsrHitBuffer::TUsrHitBuffer
(
Int_t
maxent
)
19
{
20
fNofEntries
=
maxent
;
21
fNofHits
= 0;
22
fHits
=
new
TClonesArray
(
"TUsrHit"
,
fNofEntries
);
23
std::cout <<
"ctor TUsrHitBuffer "
<<
this
<< std::endl;
24
}
25
26
//______________________________________________________
27
28
TUsrHit
*
TUsrHitBuffer::AddHit
(
Int_t
ev
)
29
{
30
TClonesArray
&
hits
= *
fHits
;
31
TUsrHit
*
hit
=
new
(
hits
[
fNofHits
++])
TUsrHit
(
ev
);
32
return
hit
;
33
}
34
35
//______________________________________________________
36
37
void
TUsrHitBuffer::Clear
(
Option_t
*)
38
{
39
fHits
->
Clear
();
40
fNofHits
= 0;
41
}
42
43
//______________________________________________________
44
45
void
TUsrSevtData1::SetEvent
(
Int_t
ev
)
46
{
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
60
void
TUsrSevtData2::SetEvent
(
Int_t
ev
)
61
{
62
Clear
();
63
std::cout <<
"TUsrSevtData2: "
<<
ev
<< std::endl;
64
fTimeStamp
= 100 +
ev
;
//in TMrbSubevent_Caen
65
fSevtName
=
"SubEvent_2_"
;
66
fSevtName
+=
ev
;
67
fMer
= 21000 +
ev
;
68
fPileup
= 22000 +
ev
;
69
for
(
Int_t
i = 1; i <=
ev
+1; i++) {
70
fHitBuffer
.
AddHit
(i);
71
}
72
}
Option_t
const char Option_t
Definition
RtypesCore.h:66
TClonesArray.h
TRangeDynCast
ROOT::Detail::TRangeCast< T, true > TRangeDynCast
TRangeDynCast is an adapter class that allows the typed iteration through a TCollection.
Definition
TCollection.h:358
TFile.h
ROOT::Detail::TRangeCast
Definition
TCollection.h:311
TClonesArray
An array of clone (identical) objects.
Definition
TClonesArray.h:29
TClonesArray::Clear
void Clear(Option_t *option="") override
Clear the clones array.
Definition
TClonesArray.cxx:420
TMrbSubevent_Caen::Clear
void Clear(Option_t *="")
Definition
clones_event.h:51
TMrbSubevent_Caen::fTimeStamp
Int_t fTimeStamp
Definition
clones_event.h:55
TMrbSubevent_Caen::fHitBuffer
TUsrHitBuffer fHitBuffer
Definition
clones_event.h:56
TObject::TClonesArray
friend class TClonesArray
Definition
TObject.h:240
TUsrHitBuffer::fNofEntries
Int_t fNofEntries
Definition
clones_event.h:37
TUsrHitBuffer::AddHit
TUsrHit * AddHit(Int_t ev)
Definition
clones_event.cxx:28
TUsrHitBuffer::Clear
void Clear(Option_t *opt="")
Definition
clones_event.cxx:37
TUsrHitBuffer::TUsrHitBuffer
TUsrHitBuffer(Int_t maxent=10)
Definition
clones_event.cxx:18
TUsrHitBuffer::fNofHits
Int_t fNofHits
Definition
clones_event.h:38
TUsrHitBuffer::fHits
TClonesArray * fHits
Definition
clones_event.h:39
TUsrHit
Definition
clones_event.h:4
TUsrHit::TUsrHit
TUsrHit(Int_t ev=0)
Definition
clones_event.cxx:7
TUsrHit::fEventNumber
Int_t fEventNumber
Definition
clones_event.h:10
TUsrHit::fModuleNumber
Int_t fModuleNumber
Definition
clones_event.h:11
TUsrHit::fEventTime
UShort_t fEventTime[3]
Definition
clones_event.h:13
TUsrHit::fChannel
Int_t fChannel
Definition
clones_event.h:12
TUsrSevtData1::fPileup
Int_t fPileup
Definition
clones_event.h:74
TUsrSevtData1::fMer
Int_t fMer
Definition
clones_event.h:73
TUsrSevtData1::SetEvent
void SetEvent(Int_t ev)
Definition
clones_event.cxx:45
TUsrSevtData1::fSevtName
TString fSevtName
Definition
clones_event.h:72
TUsrSevtData2::fPileup
Int_t fPileup
Definition
clones_event.h:91
TUsrSevtData2::fMer
Int_t fMer
Definition
clones_event.h:90
TUsrSevtData2::SetEvent
void SetEvent(Int_t ev)
Definition
clones_event.cxx:60
TUsrSevtData2::fSevtName
TString fSevtName
Definition
clones_event.h:89
int
clones_event.h
tutorials
io
tree
clones_event.cxx
ROOT master - Reference Guide Generated on Mon Feb 17 2025 15:03:47 (GVA Time) using Doxygen 1.10.0