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

Contents of /PamCut/TofCuts/TofNucleiZCut/TofNucleiZCut.h

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.1.1.1 - (show annotations) (download) (vendor branch)
Wed May 27 13:30:09 2009 UTC (15 years, 6 months ago) by pam-fi
Branch: DEV
CVS Tags: v0r00
Changes since 1.1: +0 -0 lines
File MIME type: text/plain
Error occurred while calculating annotation data.
First import

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

  ViewVC Help
Powered by ViewVC 1.1.23