16 |
inherits form {\bf PamCut} and provides an implementation for the pure virtual |
inherits form {\bf PamCut} and provides an implementation for the pure virtual |
17 |
method {\bf Check}. |
method {\bf Check}. |
18 |
A special derived class is {\bf PamCutCollection}. This is a sort of a |
A special derived class is {\bf PamCutCollection}. This is a sort of a |
19 |
container for basic cuts, and is considered as a single cut. Its {\bf Check} |
container for basic cuts, and is considered as a single cut. It has an {\bf |
20 |
|
AddCut} method which will add a cut to the collection. Its {\bf Check} |
21 |
implementation simply invokes all the {\bf Check}s of the single cuts, and it |
implementation simply invokes all the {\bf Check}s of the single cuts, and it |
22 |
is successful if all the single cuts are succesful. |
is successful if all the single cuts are succesful. {\bf PamCut} also provides |
23 |
{\bf PamCut} also provides the interface for two methods for post-processing: |
the interface for two methods for post-processing: {\bf OnGood} and {\bf |
24 |
{\bf OnGood} and {\bf OnBad}. In derived classes these can contain specific |
OnBad}. In derived classes these can contain specific tasks to be performed |
25 |
tasks to be performed whenever an event satisfy the {\bf Check} condition or |
whenever an event satisfy the {\bf Check} condition or not. The method {\bf |
26 |
not. The method {\bf ApplyCut} takes care of invoking {\bf Check} and |
ApplyCut} takes care of invoking {\bf Check} and subsequently calls {\bf |
27 |
subsequently calls {\bf OnGood} or {\bf OnBad} according to the result of {\bf Check}. |
OnGood} or {\bf OnBad} according to the result of {\bf Check}. Summarizing, |
28 |
Summarizing, {\bf Check}ing an event simply means to ask the object if the |
{\bf Check}ing an event simply means to ask the object if the event satisfy |
29 |
event satisfy the selection criteria; applying a cut means to check and then |
the selection criteria; applying a cut means to check and then perform |
30 |
perform post-selection tasks. The cut can be applied to a bunch of events by |
post-selection tasks. The cut can be applied to a bunch of events by means of |
31 |
means of the {\bf Process} method. |
the {\bf Process} method. |
32 |
|
|
33 |
\subsection{More on collections} |
\subsection{More on collections} |
34 |
A collection is an object which inherits from {\bf PamCutCollection}, which in |
A collection is an object which inherits from {\bf PamCutCollection}, which in |
68 |
{\bf PamCutCollection}. See the Doxygen html documentation for more info about |
{\bf PamCutCollection}. See the Doxygen html documentation for more info about |
69 |
{\bf BlindCutCollection} and other specific cut implementations. |
{\bf BlindCutCollection} and other specific cut implementations. |
70 |
|
|
71 |
|
\subsection{Collections and memory management} |
72 |
|
|
73 |
|
Regarding to cuts ownership, a collection will by default own its cuts. This |
74 |
|
means that when you add a cut to a collection calling {\bf AddCut} with a |
75 |
|
pointer to the cut as argument, the collection will store this pointer and |
76 |
|
will take charge of deleting it. This is done by the collection's destructor. |
77 |
|
This way, a user can simply add a cut to a collection and forget about |
78 |
|
deleting it. However, sometimes this feature is not desirable, so it can be |
79 |
|
turned off by passing a proper value to the collection's constructor. In this |
80 |
|
case, the user is in charge of managing the memory allocated for the cuts. |
81 |
|
|
82 |
|
|
83 |
\section{Actions and the SmartCollection} |
\section{Actions and the SmartCollection} |
84 |
When performing an analysis, each time an event is selected as good some |
When performing an analysis, each time an event is selected as good some |
85 |
actions are likely to be performed, like filling histograms or writing a |
actions are likely to be performed, like filling histograms or writing a |
94 |
implementations will be called actions.\\ |
implementations will be called actions.\\ |
95 |
Actions are automatically handled by the {\bf SmartCollection} class. It |
Actions are automatically handled by the {\bf SmartCollection} class. It |
96 |
inherits from {PamCutCollection}, and contains a vector of {\bf |
inherits from {PamCutCollection}, and contains a vector of {\bf |
97 |
CollectionAction} objects. These actions can be added using {\bf |
CollectionAction} objects. These actions can be added calling {\bf |
98 |
SmartCollection::AddAction}; for each of them, the collection will take care of |
SmartCollection::AddAction}; for each of them, the collection will take care of |
99 |
calling {\bf Setup} at the beginning of the analysis, {\bf OnGood} and {\bf |
calling {\bf Setup} at the beginning of the analysis, {\bf OnGood} and {\bf |
100 |
OnBad} for every event (depending on the selection result), and {\bf Finalize} |
OnBad} for every event (depending on the selection result), and {\bf Finalize} |
136 |
Loosely speaking, after defining an action one simply has to instantiate it, |
Loosely speaking, after defining an action one simply has to instantiate it, |
137 |
add it to a {\bf SmartCollection} and launch the analysis. |
add it to a {\bf SmartCollection} and launch the analysis. |
138 |
|
|
139 |
|
\subsection{SmartCollections and memory management} |
140 |
|
Like the standard collection, SmartCollection can handle the memory management |
141 |
|
for actions. This works exactly as for cuts. Cuts and actions have to be |
142 |
|
managed uniformly, ie., one cannot turn off ownership only for cuts or only for |
143 |
|
actions. |
144 |
|
|
145 |
\section{The software organization} |
\section{The software organization} |
146 |
The software is organized in a tree of directories. The idea is that each node |
The software is organized in a tree of directories. The idea is that each node |
147 |
of this tree must provide the necessary informations about the sub-branches. In |
of this tree must provide the necessary informations about the sub-branches. In |
582 |
. |
. |
583 |
. |
. |
584 |
|
|
585 |
PamCutCollection collection; |
PamCutCollection collection("Collection"); |
586 |
|
|
587 |
DummyCut1 dummy1; |
DummyCut1 dummy1; |
588 |
collection.AddCut(dummy1); |
collection.AddCut(dummy1); |