KaliVeda
Toolkit for HIC analysis
Loading...
Searching...
No Matches
KVTemplateEvent.cpp
1/***************************************************************************
2$Id: KVEvent.cpp,v 1.41 2008/12/17 11:23:12 ebonnet Exp $
3 kvevent.cpp - description
4 -------------------
5 begin : Sun May 19 2002
6 copyright : (C) 2002 by J.D. Frankland
7 email : frankland@ganil.fr
8 ***************************************************************************/
9
10/***************************************************************************
11 * *
12 * This program is free software; you can redistribute it and/or modify *
13 * it under the terms of the GNU General Public License as published by *
14 * the Free Software Foundation; either version 2 of the License, or *
15 * (at your option) any later version. *
16 * *
17 ***************************************************************************/
18
19#include "KVTemplateEvent.h"
20
22
23
24/*
25<h2>KVEvent</h2>
26<h4>Base class for all types of multiparticle event consisting of KVNucleus objects</h4>
27
28Particles are stored in a TClonesArray and KVEvent provides some basic
29functionality for accessing and manipulating the list.
30
31Events can be built using any class derived from KVNucleus to represent particles.
32These classes can allocate memory in their default ctor: when filling events in a loop,
33the same 'particle' objects are re-used for each new event, the ctor of each object will
34only be called once when the object is first created (e.g. in the first event).
35The particle class Clear() method will be called before each new event.
36Therefore the cycle of use of the particle objects in a loop over many events is:
37
38~~~~~~~~~~~~~~~
39<particle ctor>
40 Building 1st event
41 <particle Clear()>
42 Building 2nd event
43 <particle Clear()>
44 ...
45 Building last event
46<particle dtor>
47~~~~~~~~~~~~~~~
48
49When writing events in a TTree, it is very important to call the TBranch::SetAutoDelete(kFALSE)
50method of the branch which is used to store the event object.
51
52If not, when the events are read back, the KVEvent constructor and destructor will be called
53every time an event is read from the TTree meading to very slow reading times (& probably
54memory leaks).
55
56For this reason we provide the method:
57
58~~~~~~~~~~~~~~~
59 void MakeEventBranch(TTree*, const TString&, const TString&, void*)
60~~~~~~~~~~~~~~~
61
62which should be used whenever it is required to stock KVEvent-derived objects in a TTree.
63*/
65
templateClassImp(THaarMatrixT)
Base class for event classes (containers for different types of particle objects)