--- PamCut/CollectionActions/RigFillAction/RigFillAction.h 2009/07/17 08:22:48 1.1 +++ PamCut/CollectionActions/RigFillAction/RigFillAction.h 2009/10/27 10:18:21 1.4 @@ -5,7 +5,7 @@ * Author: Nicola Mori */ -/*! @file RigFillAction.h The RigFillAction class declaration file */ +/*! @file RigFillAction.h The RigFillAction class declaration file. */ #ifndef RIGFILLACTION_H_ #define RIGFILLACTION_H_ @@ -16,16 +16,19 @@ /*! @brief The rigidity vs threshold rigidity histogram filling. * - * This class builds a 2D histogram binned in rigidity modulus + * This class builds a 2D histogram binned in event rigidity modulus * and threshold rigidity. Each 2D bin will contain the number of events whose - * rigidity modulus and threshold rigidity (eg., Stoermer cutoff rigidity times a threshold coefficient) - * lie in that bin. Note that the meaning of this threshold coefficient is the same as in - * TrkRigGeoCut, so it must have the same value used for TrkRigGeoCut (consider - * using TrkRigGeoCut::GetThresholdCoeff() to retrieve its value). - * Events are discarded only if their rigidity modulus or cutoff rigidity lies - * outside the histogram bounds. + * event rigidity modulus and threshold rigidity (eg., Stoermer cutoff rigidity times a + * threshold coefficient) lie in that bin. Note that the meaning of this threshold coefficient + * is the same as in TrkRigGeoCut, so it must have the same value used for TrkRigGeoCut + * (consider using TrkRigGeoCut::GetThresholdCoeff() to retrieve its value). + * Events whose threshold rigidity is below the lower limit of the bins are recorded in a vector + * of event rigidities with threshold rigidity in the "inferior threshold bin", which ranges + * from zero to the the lowest threshold rigidity of the "normal" bins. + * Events are discarded only if their rigidity modulus or threshold rigidity lies + * outside the histogram boundaries. * - * CUT DEPENDECIES: TrkPhSinCut for single physical track, TrkRigGeoCut for galactic event. + * CUT DEPENDENCIES: TrkPhSinCut for single physical track, TrkRigGeoCut for galactic event. * */ class RigFillAction: public CollectionAction { @@ -34,27 +37,43 @@ /*! @brief Constructor. * * outFileBase is the base name for output file: #Finalize will add .txt for ASCII output - * and .root for ROOT output. outFileBase has to contain the path (otherwise, files will be - * saved in the current directory). + * and .root for ROOT output. "-report" will be also added for the report file (in which + * the content of the zero bins will be saved). outFileBase has to contain the path (otherwise, + * files will be saved in the current directory). * The file containing the rigidity bins must be a text file. It must contain both the * lower and upper limits of the rigidity axis, so that if it contains N values it * defines a set of N-1 bins. * * @param actionName The action's name. - * @param outFileBase The output file base name. - * @param rigBinsFile The file containing the rigidity bins. + * @param outFileBase The output file base name. If "" is given as name, + * no file output will be performed. + * @param rigBinsFile The file containing the rigidity bins * @param thresholdCoeff The threshold coefficient for critical rigidity. */ RigFillAction(const char *actionName, TString outFileBase, TString rigBinsFile, float thresholdCoeff); + /*! @brief Constructor. + * + * outFileBase is the base name for output file: #Finalize will add .txt for ASCII output + * and .root for ROOT output. "-report" will be also added for the report file (in which + * the content of the zero bins will be saved). outFileBase has to contain the path (otherwise, + * files will be saved in the current directory). + * + * @param actionName The action's name. + * @param outFileBase The output file base name. If "" is given as name, + * no file output will be performed. + * @param bins A vector containing the bins limits. + * @param thresholdCoeff The threshold coefficient for critical rigidity. + */ + RigFillAction(const char *actionName, TString outFileBase, vector &bins, float thresholdCoeff); + /*! @brief Destructor */ ~RigFillAction() { } /*! @brief Fills histogram with the selected event. * - * The current event will be added to the bin corresponding to its rigidity and critical rigidity multiplied - * by the threshold coefficient, eg., to the bin (Rc*threshold, R). + * The current event will be added to the event rigidity bin corresponding to its event rigidity R and to the threshold bin corresponding to the Stoermer cutoff rigidity (S) multiplied by the threshold coefficient. * * @param event The selected event. */ @@ -70,23 +89,36 @@ /*! @brief Returns the histogram. * - * This method returns a SimpleMatrix. Its [i][j] element contain the number of analyzed events - * whose rigidity modulus falls in the i-th rigidity bin and whose threshold rigidity multiplied by the - * threshold falls in the j-th rigidity bin. + * This method returns a SimpleMatrix. Its [i][j] element contains the number of analyzed events + * whose event rigidity modulus falls in the i-th normal rigidity bin and whose threshold rigidity falls in the j-th normal bin. * * @return The rigidity modulus - threshold rigidity 2D histogram. */ - SimpleMatrix &GetHisto() { + SimpleMatrix& GetHistoThreshNormBins() { return _textHisto; } + /*! @brief whose [i] element contains the number of analyzed events whose event rigidity modulus falls in the i-th normal rigidity bin, and whose threshold rigidity falls in any normal bin */ + vector& GetTotalHistoThreshNormBins() { + return _totalTextHisto; + } + + /*! @brief Returns the vector whose [i] element contains the number of analyzed events whose event rigidity modulus falls in the i-th normal rigidity bin, and whose threshold rigidity falls in the inferior bin */ + vector& GetHistoThreshInfBin() { + return _zeroCutoffBins; + } + private: TString _outFileBase; vector _bins; TH2I _rootHisto; SimpleMatrix _textHisto; + vector _zeroCutoffBins; + vector _totalTextHisto; float _thresholdCoeff; + void _InitHistos(vector &bins); + }; #endif /* RIGFILLACTION_H_ */