/[PAMELA software]/PamCut/MiscCuts/LTQualCut/LTQualCut.h
ViewVC logotype

Annotation of /PamCut/MiscCuts/LTQualCut/LTQualCut.h

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.2 - (hide annotations) (download)
Tue Nov 24 14:49:37 2009 UTC (15 years ago) by pam-fi
Branch: MAIN
CVS Tags: Root_V8, MergedToHEAD_1, nuclei_reproc, MergedFromV8_1, BeforeMergingFromV8_1, V9, HEAD
Branch point for: V8
Changes since 1.1: +7 -5 lines
File MIME type: text/plain
Now the first events of the runs are not discarded.

1 pam-fi 1.1 /*
2     * LTQualCut.h
3     *
4     * Created on: 10-mar-2009
5     * Author: Nicola Mori, S. Ricciarini
6     */
7    
8     /*! @file LTQualCut.h The LTQualCut class definition file */
9    
10     #ifndef LTQUALCUT_H_
11     #define LTQUALCUT_H_
12    
13     #include "../../PamCutBase/PamCutBase.h"
14    
15     /*! @enum LT_Return Return values for rejected events */
16     enum LT_Return {
17 pam-fi 1.2 //LT_NEWRUN, ///< Discarded because it is the first event of the run.
18 pam-fi 1.1 LT_INVALID
19     ///< Discarded because the LT is greater than timeout.
20     };
21    
22 pam-fi 1.2 /*! @brief The live-time data quality cut: rejects events with LT greater
23     * than an upper threshold (or with LT smaller than 0).
24 pam-fi 1.1 */
25     class LTQualCut: public PamCut {
26    
27     public:
28     /*! @brief Constructor.
29     *
30     * @param cutName The cut's name.
31     * @param threshold The live time maximum accepted value in ms. It is the value above which a live time is
32     * considered invalid. It must be less than the trigger timeout on IDAQ board, which
33     * is ~ 4600 ms. Default is 4500 (use of different values must be justified).
34     */
35 pam-fi 1.2 LTQualCut(const char* cutName, float threshold = 4500) :
36 pam-fi 1.1 PamCut(cutName), _previousRun(numeric_limits<UInt_t>::max()), _LT(-1.), _timeout(threshold) {
37     }
38     /*! @brief Destructor. */
39     ~LTQualCut() {
40     }
41    
42     /*! @brief The live time quality check.
43     *
44     * @param event The event to analyze.
45     * @return #CUTOK if LT < timeout.
46     * @return #LT_INVALID if LT > timeout.
47     */
48     int Check(PamLevel2 *event);
49    
50     /*! @brief Returns the live time of the last examined event.
51     *
52     * @return The live time of the last examined event in ms (-1 -> first event of the run).
53     */
54 pam-fi 1.2 float GetLT() {
55     return _LT;
56     }
57 pam-fi 1.1
58     private:
59     unsigned int _previousRun;
60     float _LT;
61     float _timeout;
62     };
63    
64     #endif /* LTQUALCUT_H_ */

  ViewVC Help
Powered by ViewVC 1.1.23