\hypertarget{classCollectionAction}{
\section{CollectionAction Class Reference}
\label{classCollectionAction}\index{CollectionAction@{CollectionAction}}
}
An abstract class that defines the interface of a generic collection action.  


{\tt \#include $<$CollectionAction.h$>$}

Inheritance diagram for CollectionAction::\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[height=1.4359cm]{classCollectionAction}
\end{center}
\end{figure}
\subsection*{Public Member Functions}
\begin{CompactItemize}
\item 
\hyperlink{classCollectionAction_35e6d0d0351e0fafe4b508faeb3598d6}{CollectionAction} (const char $\ast$actionName)
\begin{CompactList}\small\item\em Constructor. \item\end{CompactList}\item 
virtual \hyperlink{classCollectionAction_d327a6cfdc6148db563ae52aa004e098}{$\sim$CollectionAction} ()
\begin{CompactList}\small\item\em Destructor. \item\end{CompactList}\item 
virtual void \hyperlink{classCollectionAction_13adbcacf5e088f7979f0644a65372b4}{Setup} (PamLevel2 $\ast$events)
\begin{CompactList}\small\item\em The initialization routine. \item\end{CompactList}\item 
virtual void \hyperlink{classCollectionAction_801dd664020b71e8a3232e5a584d96a0}{OnGood} (PamLevel2 $\ast$event)=0
\begin{CompactList}\small\item\em Routine for selected events. \item\end{CompactList}\item 
virtual void \hyperlink{classCollectionAction_ef4ee9fd63c0d232e90694e068e6e339}{OnBad} (PamLevel2 $\ast$event, int selectionResult)
\begin{CompactList}\small\item\em Routine for discarded events. \item\end{CompactList}\item 
virtual void \hyperlink{classCollectionAction_c32b42fc08bc1be7b003579b633de041}{Finalize} ()=0
\begin{CompactList}\small\item\em The finalization routine. \item\end{CompactList}\item 
const char $\ast$ \hyperlink{classCollectionAction_96783ca0685b2095bf519c17a057c926}{GetName} ()
\begin{CompactList}\small\item\em Returns the action name. \item\end{CompactList}\end{CompactItemize}
\subsection*{Private Attributes}
\begin{CompactItemize}
\item 
const char $\ast$ \hyperlink{classCollectionAction_5c046c663d75fdcb53d00cda91cc3509}{\_\-actionName}
\end{CompactItemize}


\subsection{Detailed Description}
An abstract class that defines the interface of a generic collection action. 

The \hyperlink{classCollectionAction}{CollectionAction} abstract class defines an interface for a generic action object which can be used to implement common actions that can be done by collections, like filling histograms or saving selected events. The structure of this class mimicks that of a standard collection: it has a \hyperlink{classCollectionAction_13adbcacf5e088f7979f0644a65372b4}{Setup()} and a \hyperlink{classCollectionAction_c32b42fc08bc1be7b003579b633de041}{Finalize()} methods that are meant to be called at the beginning and at the end of the selection procedure, respectively. In \hyperlink{classCollectionAction_13adbcacf5e088f7979f0644a65372b4}{Setup()} one can prepare the analysis actions like instantiating a histogram object (this can be done also in the constructor), while in \hyperlink{classCollectionAction_c32b42fc08bc1be7b003579b633de041}{Finalize()} the analysis can be closed by, eg., writing histograms on a file and closing that file. The two methods \hyperlink{classCollectionAction_801dd664020b71e8a3232e5a584d96a0}{OnGood()} and \hyperlink{classCollectionAction_ef4ee9fd63c0d232e90694e068e6e339}{OnBad()} have exactly the same purpose they have in a Collection: to define action to perform each time an event is selected as good or bad. The class \hyperlink{classSmartCollection}{SmartCollection} is specially designed to handle \hyperlink{classCollectionAction}{CollectionAction} objects: see the documentation of \hyperlink{classSmartCollection}{SmartCollection} for info on how these objects are handled. 

Definition at line 30 of file CollectionAction.h.

\subsection{Constructor \& Destructor Documentation}
\hypertarget{classCollectionAction_35e6d0d0351e0fafe4b508faeb3598d6}{
\index{CollectionAction@{CollectionAction}!CollectionAction@{CollectionAction}}
\index{CollectionAction@{CollectionAction}!CollectionAction@{CollectionAction}}
\subsubsection[{CollectionAction}]{\setlength{\rightskip}{0pt plus 5cm}CollectionAction::CollectionAction (const char $\ast$ {\em actionName})\hspace{0.3cm}{\tt  \mbox{[}inline\mbox{]}}}}
\label{classCollectionAction_35e6d0d0351e0fafe4b508faeb3598d6}


Constructor. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em actionName}]The action's name. \end{description}
\end{Desc}


Definition at line 37 of file CollectionAction.h.\hypertarget{classCollectionAction_d327a6cfdc6148db563ae52aa004e098}{
\index{CollectionAction@{CollectionAction}!$\sim$CollectionAction@{$\sim$CollectionAction}}
\index{$\sim$CollectionAction@{$\sim$CollectionAction}!CollectionAction@{CollectionAction}}
\subsubsection[{$\sim$CollectionAction}]{\setlength{\rightskip}{0pt plus 5cm}virtual CollectionAction::$\sim$CollectionAction ()\hspace{0.3cm}{\tt  \mbox{[}inline, virtual\mbox{]}}}}
\label{classCollectionAction_d327a6cfdc6148db563ae52aa004e098}


Destructor. 



Definition at line 41 of file CollectionAction.h.

\subsection{Member Function Documentation}
\hypertarget{classCollectionAction_c32b42fc08bc1be7b003579b633de041}{
\index{CollectionAction@{CollectionAction}!Finalize@{Finalize}}
\index{Finalize@{Finalize}!CollectionAction@{CollectionAction}}
\subsubsection[{Finalize}]{\setlength{\rightskip}{0pt plus 5cm}virtual void CollectionAction::Finalize ()\hspace{0.3cm}{\tt  \mbox{[}pure virtual\mbox{]}}}}
\label{classCollectionAction_c32b42fc08bc1be7b003579b633de041}


The finalization routine. 

This method is intended to be called at the end of the analysis. Its implementations contain the finalizing procedures, like writing histograms to file or printing reports. It is automatically called by \hyperlink{classSmartCollection_8105730615ad127a482a7fb399695977}{SmartCollection::Finalize()}. 

Implemented in \hyperlink{classChargeHistosAction_b0aa2e207eea6e8f80c89197f9705dbe}{ChargeHistosAction}, \hyperlink{classEvRateS11VsCutoffHistoAction_71062bd029caf54cb174b9b8df5ed6ad}{EvRateS11VsCutoffHistoAction}, \hyperlink{classFluxHistoAction_4565d0ea3ca0f895af489455dfd5ff04}{FluxHistoAction}, and \hyperlink{classSaveEventsAction_790f534c0a888c2a57814cd859b97270}{SaveEventsAction}.\hypertarget{classCollectionAction_96783ca0685b2095bf519c17a057c926}{
\index{CollectionAction@{CollectionAction}!GetName@{GetName}}
\index{GetName@{GetName}!CollectionAction@{CollectionAction}}
\subsubsection[{GetName}]{\setlength{\rightskip}{0pt plus 5cm}const char$\ast$ CollectionAction::GetName ()\hspace{0.3cm}{\tt  \mbox{[}inline\mbox{]}}}}
\label{classCollectionAction_96783ca0685b2095bf519c17a057c926}


Returns the action name. 



Definition at line 89 of file CollectionAction.h.

References \_\-actionName.

Referenced by FluxHistoAction::Finalize().\hypertarget{classCollectionAction_ef4ee9fd63c0d232e90694e068e6e339}{
\index{CollectionAction@{CollectionAction}!OnBad@{OnBad}}
\index{OnBad@{OnBad}!CollectionAction@{CollectionAction}}
\subsubsection[{OnBad}]{\setlength{\rightskip}{0pt plus 5cm}virtual void CollectionAction::OnBad (PamLevel2 $\ast$ {\em event}, \/  int {\em selectionResult})\hspace{0.3cm}{\tt  \mbox{[}inline, virtual\mbox{]}}}}
\label{classCollectionAction_ef4ee9fd63c0d232e90694e068e6e339}


Routine for discarded events. 

The concrete implementations define what to do when an event is discarded. This is conceptually the same as \hyperlink{classPamCut_cbb3b507d79f20878fac4392ffa57acb}{PamCut::OnBad()}. Call to this method is automatically done in \hyperlink{classSmartCollection_99ac049c98461fbe04167f386ca7ed76}{SmartCollection::OnBad()}. This method is not pure virtual, since many times there's nothing to do when a cut fails; this way, it's not necessary to implement it in derived classes. Current implementation is void.

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em event}]The selected event. \item[{\em selectionResult}]The code describing the reason of cut's failure (collections will automatically pass the index of the failed cut as selectionResult). \end{description}
\end{Desc}


Definition at line 78 of file CollectionAction.h.\hypertarget{classCollectionAction_801dd664020b71e8a3232e5a584d96a0}{
\index{CollectionAction@{CollectionAction}!OnGood@{OnGood}}
\index{OnGood@{OnGood}!CollectionAction@{CollectionAction}}
\subsubsection[{OnGood}]{\setlength{\rightskip}{0pt plus 5cm}virtual void CollectionAction::OnGood (PamLevel2 $\ast$ {\em event})\hspace{0.3cm}{\tt  \mbox{[}pure virtual\mbox{]}}}}
\label{classCollectionAction_801dd664020b71e8a3232e5a584d96a0}


Routine for selected events. 

The concrete implementations define what to do when an event is selected. This is conceptually the same as \hyperlink{classPamCut_56021e959232270c12528ddec3062985}{PamCut::OnGood()}. Call to this method is automatically done in \hyperlink{classSmartCollection_13ce6deb47b60d10225598dd1201cd80}{SmartCollection::OnGood()}.

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em event}]The selected event. \end{description}
\end{Desc}


Implemented in \hyperlink{classChargeHistosAction_315d81cbff24a228c85b648393d67107}{ChargeHistosAction}, \hyperlink{classEvRateS11VsCutoffHistoAction_bb38c1bcb9d3e52abd6f929db8577ac6}{EvRateS11VsCutoffHistoAction}, \hyperlink{classFluxHistoAction_363f9657ac69e1051449ec1907c04809}{FluxHistoAction}, and \hyperlink{classSaveEventsAction_47e8259afe7a68ba3c0adf3bd79fe52a}{SaveEventsAction}.\hypertarget{classCollectionAction_13adbcacf5e088f7979f0644a65372b4}{
\index{CollectionAction@{CollectionAction}!Setup@{Setup}}
\index{Setup@{Setup}!CollectionAction@{CollectionAction}}
\subsubsection[{Setup}]{\setlength{\rightskip}{0pt plus 5cm}virtual void CollectionAction::Setup (PamLevel2 $\ast$ {\em events})\hspace{0.3cm}{\tt  \mbox{[}inline, virtual\mbox{]}}}}
\label{classCollectionAction_13adbcacf5e088f7979f0644a65372b4}


The initialization routine. 

In this routine the initialization procedure is to be defined. \hyperlink{classSmartCollection}{SmartCollection} objects will call \hyperlink{classCollectionAction_13adbcacf5e088f7979f0644a65372b4}{Setup()} for each \hyperlink{classCollectionAction}{CollectionAction} object they hold during \hyperlink{classSmartCollection_9b5b11a854b9e174218ea516ceffb34c}{SmartCollection::Setup()}. This method is intended for some possible post-constructor initialization, like those who need to know the PamLevel2 object (eg., clone trees selection). This method is likely to be unnecessary most of the times, so it is implemented as a void function and it's not pure virtual.

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em events}]The PamLevel2 events which will be analyzed by the collection hosting the action. \end{description}
\end{Desc}


Reimplemented in \hyperlink{classSaveEventsAction_3a59e42181c79dcd192b0be3d14a34c2}{SaveEventsAction}.

Definition at line 55 of file CollectionAction.h.

\subsection{Member Data Documentation}
\hypertarget{classCollectionAction_5c046c663d75fdcb53d00cda91cc3509}{
\index{CollectionAction@{CollectionAction}!\_\-actionName@{\_\-actionName}}
\index{\_\-actionName@{\_\-actionName}!CollectionAction@{CollectionAction}}
\subsubsection[{\_\-actionName}]{\setlength{\rightskip}{0pt plus 5cm}const char$\ast$ {\bf CollectionAction::\_\-actionName}\hspace{0.3cm}{\tt  \mbox{[}private\mbox{]}}}}
\label{classCollectionAction_5c046c663d75fdcb53d00cda91cc3509}




Definition at line 94 of file CollectionAction.h.

Referenced by GetName().

The documentation for this class was generated from the following file:\begin{CompactItemize}
\item 
CollectionActions/CollectionAction/\hyperlink{CollectionAction_8h}{CollectionAction.h}\end{CompactItemize}
