/[PAMELA software]/PamCut/TofCuts/TofNucleiZCut/TofNucleiZCut.h
ViewVC logotype

Annotation of /PamCut/TofCuts/TofNucleiZCut/TofNucleiZCut.h

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.3 - (hide annotations) (download)
Wed Aug 5 14:05:34 2009 UTC (15 years, 3 months 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.2: +1 -12 lines
File MIME type: text/plain
Layers' codes now are taken from CommonDefs.h

1 pam-fi 1.1 /*
2     * TofNucleiZCut.h
3     *
4     * Created on: 21-apr-2009
5     * Author: Nicola Mori
6     */
7    
8     /*! @file TofNucleiZCut.h The TofNucleiZCut class definition file */
9    
10     #ifndef NO_TOFNUCLEI
11    
12     #ifndef TOFNUCLEIZCUT_H_
13     #define TOFNUCLEIZCUT_H_
14    
15     #include "../../PamCutBase/PamCutBase.h"
16     #include <ToFNuclei.h>
17    
18     #ifdef DEBUGPAMCUT
19     #include <TH2F.h>
20     #endif
21    
22     /*! @enum TofNucleiZ_Return Return values for rejected events. */
23     enum TofNucleiZ_Return {
24     TOFNUCLEIZ_OUTOFBOUNDS, ///< Discarded because charge is out of bounds in a layer.
25     TOFNUCLEIZ_TOOFEWLAYERS, ///< Discarded because charge can be measured in too few layers.
26     TOFNUCLEIZ_ILLEGALZ
27     ///< Discarded because charge is not between 1 and 8
28     };
29    
30     /*! @brief The TofNuclei charge cut.
31     *
32     * This cut uses the TofNuclei library to cut events depending on particle's charge value.
33     *
34     */
35    
36     class TofNucleiZCut: public PamCut {
37    
38     public:
39     /*! @brief Constructor.
40     *
41     * The charge to look for is passed to the TofNucleiZCut object as Z. For each charge, there is an associated distribution of
42     * events, with mean Zmean and standard deviation sigmaZ. These values will be used to check the events.
43     *
44     * @param cutName The cut's name.
45     * @param Z The charge value.
46     * @param lowerLimit The lower bound (in units of sigmaZ) of the desired charge range, defined as Zmean - lowerBound*sigmaZ.
47     * @param upperLimit The upper bound (in units of sigmaZ) of the desired charge range, defined as Zmean + upperBound*sigmaZ.
48     * @param minLayers The minimum number of layers for which Z must have been measured.
49 pam-fi 1.3 * @param layersMask The masked layers (see #TOFLAYERS). These will be ignored throughout all the TofNucleiZCut analysis.
50 pam-fi 1.1 * @see Check
51     */
52     TofNucleiZCut(const char *cutName, unsigned int Z, float lowerLimit, float upperLimit, unsigned int minLayers = 6,
53     unsigned int layersMask = 0);
54    
55     /*! @brief Destructor. */
56     ~TofNucleiZCut() {
57     delete _tofNuclei;
58    
59     #ifdef DEBUGPAMCUT
60    
61     for (UInt_t j = 0; j < 12; j++) {
62     h_tof_z_beta[j]->Write();
63     }
64    
65     #endif
66    
67     }
68    
69     /*! @brief The TofNucleiZ check.
70     *
71     * The routine selects events whose value of Zmean obtained from the ToF is in the range [Zmean - sigma*lowerBound, Zmean + sigma*upperBound].
72     * Zmean and sigma are defined respectively as the mean and the standard deviation of the charge distributions obtained using ToFNuclei.
73 pam-fi 1.2 * The calibration values used in this routine (for all energies) are:
74 pam-fi 1.1 *
75     * Z=1 | Zmean sigma
76     * ------------------------
77     * S11 | 0.987 0.11
78     * S12 | 0.988 0.12
79     * S21 | 0.961 0.083
80     * S22 | 0.966 0.10
81     * S31 | 0.981 0.092
82     * S32 | 0.979 0.095
83     *
84     * Z=2 | Zmean sigma
85     * ------------------------
86     * S11 | 1.96 0.12
87     * S12 | 1.95 0.14
88     * S21 | 1.95 0.13
89     * S22 | 1.96 0.14
90     * S31 | 1.99 0.14
91     * S32 | 2.00 0.15
92     *
93 pam-fi 1.2 * In current implementation, heavier nuclei up to oxygen are partially calibrated; means are taken equal to the particle's charge (Zmean = Z)
94 pam-fi 1.1 * and a single sigma is used for all ToF layers:
95     *
96     * Z | sigma
97     * -----------
98     * 3 | 0.20
99     * 4 | 0.25
100     * 5 | 0.32
101     * 6 | 0.40
102     * 7 | 0.45
103     * 8 | 0.50
104     *
105 pam-fi 1.2 * The charge of the particle is detrmined by calling ToFNuclei::Get_Charge_ToF_std_layer().
106 pam-fi 1.1 * First of all, the number of non-masked layers giving a valid charge information is checked to be greater than minLayers; then the bound
107     * on the charge value is checked for all valid planes. If at least one of the valid, non-masked planes gives a charge outside the bounds
108     * the routine will return #TOFNUCLEIZ_OUTOFBOUNDS. Note that this happens even if more than minLayers give a charge inside boundaries;
109     * for example, if minLayers = 5 and we have 6 good charge measurement of which only 5 are inside the boundaries, the check will fail.
110     * Notice that masking a layer has the net effect of reducing the number of layers: asking minLayers = 5 and masking two planes
111     * will result in return value of #TOFNUCLEIZ_TOOFEWLAYERS for all events, since the "effective ToF" has only 4 layers.
112     *
113     * @param event The event to analyze.
114     * @return #CUTOK if the charge obtained from TofNuclei is in the range [Z - sigma*lowerBound, Z + sigma*upperBound] in at least minLayers
115     * (apart from eventual masked layers).
116     * @return #TOFNUCLEIZ_OUTOFBOUNDS if charge is out of bounds in at least one non-masked layer.
117     * @return #TOFNUCLEIZ_TOOFEWLAYERS if charge information is available for a number of layers lesser than minLayers.
118     * @return #TRKNUCLEIZ_OUTOFBOUNDS if Z < 1 or Z > 8.
119     */
120     int Check(PamLevel2 *event);
121    
122     private:
123    
124     #ifdef DEBUGPAMCUT
125    
126     TH2F* h_tof_z_beta[12];
127    
128     #endif
129    
130     unsigned int _Z;
131     SimpleMatrix<float> _mean; // Index structure: [Z-1][layer]
132     SimpleMatrix<float> _sigma; // Index structure: [Z-1][layer]
133     static const float _sigmaZdefault[8];
134    
135     float _lowerLimit;
136     float _upperLimit;
137     unsigned int _minLayers;
138     unsigned int _layersMask;
139    
140     ToFNuclei *_tofNuclei;
141     static const unsigned int _maskArray[6];
142    
143     };
144    
145     #endif /* TOFNUCLEIZCUT_H_ */
146    
147     #endif /* NO_TOFNUCLEI */

  ViewVC Help
Powered by ViewVC 1.1.23