/* * TofDedxVsBetaHistoAction.h * * Created on: 25-giu-2009 * Author: Nicola Mori */ /*! @file TofDedxVsBetaHistoAction.h The TofDedxVsBetaHistoAction class declaration file. */ #ifndef TOFDEDXVSBETAHISTOACTION_H_ #define TOFDEDXVSBETAHISTOACTION_H_ #include "../CollectionAction/CollectionAction.h" #include /*! @brief An action that fills a TOF dE/dx Vs beta histogram. */ class TofDedxVsBetaHistoAction: public CollectionAction { public: /*! @brief Constructor. * * @param actionName The action's name. * @param outFileName The output file name. * @param layers The layers from which dE/dx is measured. See #TOFLAYERS. If combinations like * S11+S12 are used, the mean dE/dx will be used. * @param mode The mode of ROOT file creation (see documentation of TFile constructor * in ROOT's reference guide). * @param standAlone If true, the standalone TOF track will be used to compute beta; otherwise * the track associated to the physical track will be used. * @param minDedx The lower limit for dE/dx axis (in MIP). * @param maxDedx The upper limit for dE/dx axis (in MIP). * @param nBinsDedx The number of dE/dx bins. * @param minBeta The lower limit for beta axis. * @param maxBeta The upper limit for beta axis. * @param nBinsBeta The number of beta bins. */ TofDedxVsBetaHistoAction(const char *actionName, TString outFileName, unsigned int layers, TString mode = "UPDATE", bool standAlone = true, float minDedx = 0., float maxDedx = 50., unsigned int nBinsDedx = 100, float minBeta = 0., float maxBeta = 2., unsigned int nBinsBeta = 100); /*! @brief Destructor. */ ~TofDedxVsBetaHistoAction() { } /*! @brief Fills histogram with the selected event. * * @param event The selected event. */ void OnGood(PamLevel2 *event); /*! @brief Writes the histogram to the output ROOT file.*/ void Finalize(); /*! Returns the number of bad events. * * Bad events are those events for which no valid dE/dx information (dE/dx > 0 && dE/dx < 4090) * can be found for any layer. */ unsigned int GetNBadEvents() { return _badEvents; } private: TString _outFileName; unsigned int _layers; unsigned int _nLayers; unsigned int _badEvents; TH2F _histo; TString _mode; bool _standAlone; }; #endif /* TOFDEDXVSBETAHISTOACTION_H_ */