--- PamCut/CollectionActions/LiveTimeAction/LiveTimeAction.h 2009/07/17 08:22:47 1.1 +++ PamCut/CollectionActions/LiveTimeAction/LiveTimeAction.h 2009/08/05 17:04:18 1.2 @@ -30,19 +30,36 @@ /*! @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 bin 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 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 rigidity coefficient. */ LiveTimeAction(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 rigidity coefficient. + */ + LiveTimeAction(const char *actionName, TString outFileBase, vector &bins, float thresholdCoeff); + /*! @brief Destructor */ ~LiveTimeAction() { } @@ -65,6 +82,19 @@ */ void Finalize(); + /*! @brief Returns the histogram. + * + * This method returns a vector filled with the LT (in seconds) corresponding to each + * threshold rigidity bin (in GV) defined in the binning argument of the constructor. + * Element 0 is the total LT for events whose threshold rigidity lies in the + * lowest bin and so on. + * + * @return The LT histogram binned in threshold rigidity. + */ + std::vector &GetHisto() { + return _textHisto; + } + /*! @brief Returns the live time spent at rigidities below the lower limit (the "zero bin"). */ float GetZeroBin() { return _zeroBin; @@ -86,6 +116,8 @@ float _total; float _zeroBin; + void _InitHistos(vector &bins); + #ifdef DEBUGPAMCUT int _outUp, _outDown; #endif