/[PAMELA software]/PamCut/CollectionActions/LiveTimeAction/LiveTimeAction.h
ViewVC logotype

Diff of /PamCut/CollectionActions/LiveTimeAction/LiveTimeAction.h

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.1 by pam-fi, Fri Jul 17 08:22:47 2009 UTC revision 1.3 by pam-fi, Wed Aug 26 16:34:14 2009 UTC
# Line 20  Line 20 
20   * The live time corresponding to each event will contribute to the bin corresponding to the cutoff rigidity   * The live time corresponding to each event will contribute to the bin corresponding to the cutoff rigidity
21   * of the event, eg., the lowest bin whose lower limit is greater than the cutoff rigidity of the event times   * of the event, eg., the lowest bin whose lower limit is greater than the cutoff rigidity of the event times
22   * a coefficient (threshold coefficient, see constructor). If threshold*cutoff is lower than the   * a coefficient (threshold coefficient, see constructor). If threshold*cutoff is lower than the
23   * lower limit of the rigidity axis, then the live time will be added to the "zero bin", eg., a special bin   * lower limit of the rigidity axis, then the live time will be added to the "inferior bin", eg., a special bin
24   * ranging from 0 to the lower limit. This special bin will be saved in a separate file.   * ranging from 0 to the lower limit. This special bin will be saved in a separate file.
25   *   *
26   */   */
# Line 30  public: Line 30  public:
30    /*! @brief Constructor.    /*! @brief Constructor.
31     *     *
32     * outFileBase is the base name for output file: #Finalize will add .txt for ASCII output     * outFileBase is the base name for output file: #Finalize will add .txt for ASCII output
33     * and .root for ROOT output. outFileBase has to contain the path (otherwise, files will be     * and .root for ROOT output. "-report" will be also added for the report file (in which
34     * saved in the current directory).     * the content of the inferior bin will be saved). outFileBase has to contain the path (otherwise,
35       * files will be saved in the current directory).
36     * The file containing the rigidity bins must be a text file. It must contain both the     * The file containing the rigidity bins must be a text file. It must contain both the
37     * lower and upper limits of the rigidity axis, so that if it contains N values it     * lower and upper limits of the rigidity axis, so that if it contains N values it
38     * defines a set of N-1 bins.     * defines a set of N-1 bins.
39     *     *
40     * @param actionName The action's name.     * @param actionName The action's name.
41     * @param outFileBase The output file base name.     * @param outFileBase The output file base name. If "" is given as name,
42       *                    no file output will be performed.
43     * @param rigBinsFile The file containing the rigidity bins.     * @param rigBinsFile The file containing the rigidity bins.
44     * @param thresholdCoeff The threshold rigidity coefficient.     * @param thresholdCoeff The threshold rigidity coefficient.
45     */     */
46    LiveTimeAction(const char *actionName, TString outFileBase, TString rigBinsFile, float thresholdCoeff);    LiveTimeAction(const char *actionName, TString outFileBase, TString rigBinsFile, float thresholdCoeff);
47    
48      /*! @brief Constructor.
49       *
50       * outFileBase is the base name for output file: #Finalize will add .txt for ASCII output
51       * and .root for ROOT output. "-report" will be also added for the report file (in which
52       * the content of the inferior bin will be saved). outFileBase has to contain the path (otherwise,
53       * files will be saved in the current directory).
54       *
55       * @param actionName The action's name.
56       * @param outFileBase The output file base name. If "" is given as name,
57       *                    no file output will be performed.
58       * @param bins A vector containing the bins limits.
59       * @param thresholdCoeff The threshold rigidity coefficient.
60       */
61      LiveTimeAction(const char *actionName, TString outFileBase, vector<float> &bins, float thresholdCoeff);
62    
63    /*! @brief Destructor */    /*! @brief Destructor */
64    ~LiveTimeAction() {    ~LiveTimeAction() {
65    }    }
# Line 51  public: Line 68  public:
68     *     *
69     * The live time of the current event will be added to the lowest bin whose lower limit is greater than     * The live time of the current event will be added to the lowest bin whose lower limit is greater than
70     * the cutoff rigidity multiplied by the threshold coefficient. If threshold*cutoff is lower than the     * the cutoff rigidity multiplied by the threshold coefficient. If threshold*cutoff is lower than the
71     * lower limit, the live time will be added to the "zero bin".     * lower limit, the live time will be added to the "inferior bin".
72     *     *
73     * @param event The selected event.     * @param event The selected event.
74     */     */
# Line 60  public: Line 77  public:
77    /*! @brief Writes the histogram to the output files (ASCII and ROOT).    /*! @brief Writes the histogram to the output files (ASCII and ROOT).
78     *     *
79     * The output consists of a text file and of a ROOT file where the 1-dimensional rigidity     * The output consists of a text file and of a ROOT file where the 1-dimensional rigidity
80     * histogram (TH1F) is saved. Additionally, another text file will store the content of the "zero bin"     * histogram (TH1F) is saved. Additionally, another text file will store the content of the "inferior bin"
81     * and the total live time.     * and the total live time for all the "normal" bins.
82     */     */
83    void Finalize();    void Finalize();
84    
85    /*! @brief Returns the live time spent at rigidities below the lower limit (the "zero bin"). */    /*! @brief Returns the histogram for normal bins.
86    float GetZeroBin() {     *
87      return _zeroBin;     * This method returns a vector filled with the LT (in seconds) corresponding to each
88       * threshold rigidity bin (in GV) defined in the binning argument of the constructor.
89       * Element 0 is the total LT for events whose threshold rigidity lies in the
90       * lowest bin and so on.
91       *
92       * @return The LT histogram binned in threshold rigidity.
93       */
94      std::vector<double> &GetHisto() {
95        return _textHisto;
96      }
97    
98      /*! @brief Returns the total live time (s) spent at threshold rigidities within all "normal" bins (excluding the "inferior bin") */
99      double GetTotalLTHisto() {
100        return _totalNorm;
101    }    }
102    
103    /*! @brief Returns the total live time. */    /*! @brief Returns the live time (s) spent at threshold rigidities within the "inferior bin". */
104    float GetTotalLT() {    double GetLTInfBin() {
105      return _total;      return _infBin;
106      }
107    
108      /*! @brief Returns the number of events at threshold rigidities within all "normal" bins (excluding the "inferior bin") */
109      UInt_t GetNGoodHisto() {
110        return _nGoodHisto;
111      }
112    
113      /*! @brief Returns the number of events within the "inferior bin" */
114      UInt_t GetNGoodInfBin() {
115        return _nGoodInfBin;
116    }    }
117    
118  private:  private:
# Line 80  private: Line 120  private:
120    TString _outFileBase;    TString _outFileBase;
121    vector<float> _bins;    vector<float> _bins;
122    TH1F _rootHisto;    TH1F _rootHisto;
123    vector<float> _textHisto;    vector<double> _textHisto;
124    float _thresholdCoeff;    float _thresholdCoeff;
125    
126    float _total;    double _totalNorm;
127    float _zeroBin;    double _infBin;
128    
129      void _InitHistos(vector<float> &bins);
130    
131      UInt_t _nGoodHisto;
132      UInt_t _nGoodInfBin;
133      
134  #ifdef DEBUGPAMCUT  #ifdef DEBUGPAMCUT
135    int _outUp, _outDown;    int _outUp, _outDown;
136  #endif  #endif

Legend:
Removed from v.1.1  
changed lines
  Added in v.1.3

  ViewVC Help
Powered by ViewVC 1.1.23