1 |
/* |
2 |
* TrkNucleiZCut.h |
3 |
* |
4 |
* Created on: 10-mag-2009 |
5 |
* Author: Nicola Mori |
6 |
*/ |
7 |
|
8 |
/*! @file TrkNucleiZCut.h The TofNucleiZCut class definition file */ |
9 |
|
10 |
#ifndef NO_TRKNUCLEI |
11 |
|
12 |
#ifndef TRKNUCLEIZCUT_H_ |
13 |
#define TRKNUCLEIZCUT_H_ |
14 |
|
15 |
#include "../../PamCutBase/PamCutBase.h" |
16 |
#include <TrkNuclei.h> |
17 |
|
18 |
#include <TH2F.h> |
19 |
|
20 |
/*! @enum TrkNucleiZ_Return Return values for rejected events */ |
21 |
enum TrkNucleiZ_Return { |
22 |
TRKNUCLEIZ_OUTOFBOUNDS, ///< Discarded because charge is out of bounds |
23 |
TRKNUCLEIZ_TOOFEWLAYERS, ///< Discarded because charge can be measured in too few layers. |
24 |
TRKNUCLEIZ_ILLEGALLOWZ, ///< Discarded because charge is not between 1 and 6 |
25 |
TRKNUCLEIZ_ILLEGALHIGHZ ///< Discarded because higher charge is not higher than lowZ and it is not -1 (default value) |
26 |
}; |
27 |
|
28 |
/*! @enum TrkNucleiZ_method Method to use to measure Z. */ |
29 |
enum TrkNucleiZ_method { |
30 |
TRKNUCLEIZ_BETA, ///< Tracker dE/dx Vs. ToF beta |
31 |
TRKNUCLEIZ_RIG, |
32 |
///< Tracker standalon e: dE/dx Vs. rigidity |
33 |
}; |
34 |
|
35 |
/*! @enum TrkNucleiZ_Check Handy aliases to set check mean */ |
36 |
enum TrkNucleiZ_Check { |
37 |
TRKNUCLEIZ_CHECKMEAN, ///< Check the mean value. |
38 |
TRKNUCLEIZ_CHECKSINGLEVALUES |
39 |
///< Check each single charge from each layer. |
40 |
}; |
41 |
|
42 |
/*! @brief The TrkNuclei charge cut. |
43 |
* |
44 |
* This cut uses the TrkNuclei library to cut events depending on particle's charge value. |
45 |
* |
46 |
*/ |
47 |
|
48 |
class TrkNucleiZCut: public PamCut { |
49 |
|
50 |
public: |
51 |
/*! @brief Constructor. |
52 |
* |
53 |
* The charge to look for is Z. For each charge, there is an associated distribution of |
54 |
* events, with mean Zmean(Z) and standard deviation sigma(Z). These values will be used to check the events. |
55 |
* If highZ is different from default (-1), the routine will select nuclei with charge in the range |
56 |
* [Zmean(lowZ) - lowerBound*sigma(lowZ), Zmean(highZ) + upperBound*sigma(highZ)]; otherwise, it will select nuclei in the range |
57 |
* [Zmean(lowZ) - lowerBound*sigma(lowZ), Zmean(lowZ) + upperBound*sigma(lowZ)], eg., it will look for a single charge defined by lowZ. |
58 |
* |
59 |
* @param cutName The cut's name. |
60 |
* @param lowZ The charge value. |
61 |
* @param highZ The upper charge value. |
62 |
* @param lowerLimit The lower bound (in units of sigma(Z)) of the desired charge range, defined as Zmean - lowerBound*sigma(Z). |
63 |
* @param upperLimit The upper bound (in units of sigma(Z)) of the desired charge range, defined as Zmean + upperBound*sigma(Z). |
64 |
* @param minLayers The minimum required number of layers which give a valid charge information. |
65 |
* @param howToCheck Flag to set the check by mean release or by release in single planes (see #TrkNucleiZ_Check). |
66 |
* @param method The method to use to measure the particle's charge (see #TrkNucleiZ_method). |
67 |
* @return |
68 |
*/ |
69 |
TrkNucleiZCut(const char *cutName, unsigned int lowZ, int highZ = -1, float lowerLimit = 1., float upperLimit = 1., unsigned int minLayers = 1, |
70 |
unsigned int howToCheck = TRKNUCLEIZ_CHECKMEAN, unsigned int method = TRKNUCLEIZ_RIG) : |
71 |
PamCut(cutName), _lowZ(lowZ), _highZ(highZ), _lowerLimit(lowerLimit), _upperLimit(upperLimit), _trkNuclei(NULL), _minLayers(minLayers), |
72 |
_howToCheck(howToCheck), _method(method) { |
73 |
|
74 |
} |
75 |
/*! @brief Destructor. */ |
76 |
~TrkNucleiZCut() { |
77 |
delete _trkNuclei; |
78 |
} |
79 |
|
80 |
/*! @brief The TrkNucleiZ check. |
81 |
* The selection procedure depends on the value of highZ. If highZ = -1, the routine will look for a single charge lowZ, eg., for those |
82 |
* events whose value of Zmean(lowZ) obtained from the TrkNuclei class is in the range |
83 |
* [Zmean(lowZ) - sigma(Z)*lowerBound, Zmean(lowZ) + sigma(lowZ)*upperBound]. If instead highZ is grater than lowZ, the routine |
84 |
* will select all the nuclei with charges in the range [lowZ, highZ]; in practice, an event will survive the selection if |
85 |
* its charge as obtained from TrkNuclei is in the range [Zmean(lowZ) - sigma(Z)*lowerBound, Zmean(highZ) + sigma(highZ)*upperBound]. |
86 |
* |
87 |
* Zmean and sigma are defined respectively as the mean and the standard deviation of the charge distributions obtained using TrkNuclei. |
88 |
* In current implementation, calibrations for Z=1 and Z=2 for mean dE/dx Vs. rigidity are: |
89 |
* |
90 |
* Z=1 | mean sigma |
91 |
* ------------------------ |
92 |
* | 0.992 0.06 |
93 |
* |
94 |
* |
95 |
* Z=2 | mean sigma |
96 |
* ------------------------ |
97 |
* | 1.99 0.1 |
98 |
* |
99 |
* For all other cases (Z>2 or single plane releases or dE/dx Vs. beta), means are taken to be equal to the charge value (Zmean = Z) and sigmas are: |
100 |
* |
101 |
* Z | sigma |
102 |
* ----------- |
103 |
* 1 | 0.09 |
104 |
* 2 | 0.10 |
105 |
* 3 | 0.17 |
106 |
* 4 | 0.34 |
107 |
* 5 | 0.44 |
108 |
* 6 | 0.59 |
109 |
* |
110 |
* The TofNuclei calibrations used are the standard ones (from Wolfgang, see TrkNuclei.cpp). |
111 |
* First of all, the number of layers giving a valid charge information is checked to be greater than minLayers; if it's not so, |
112 |
* the routine will return #TRKNUCLEIZ_TOOFEWLAYERS. Next, it will check if the charge obtained considering the mean dE/dx in the tracker's |
113 |
* layers is in the validity range if the constructor's flag howToCheckMean was set to TRKNUCLEIZ_CHECKMEAN; otherwise, it will check each |
114 |
* single valid charge value (mean for X and Y views) obtained from each layer. In the latter case, it will return #CUTOK only if all |
115 |
* valid layers (ie., those tagged as good for both X and Y in traccker level 2 routines) give a charge inside the bounds, regardless of |
116 |
* the value of minLayers. |
117 |
* |
118 |
* @param event The event to analyze. |
119 |
* @return #CUTOK if the charge from mean dE/dx(if howToCheck == #TRKNUCLEIZ_CHECKMEAN) or all the single layer charges |
120 |
* (if howToCheck == #TRKNUCLEIZ_CHECKSINGLEVALUES) obtained from TrkNuclei are in the range [Zmean(lowZ) - sigma(Z)*lowerBound, Zmean(lowZ) + sigma(lowZ)*upperBound] |
121 |
* (for single charge selection) or in the range [Zmean(lowZ) - sigma(Z)*lowerBound, Zmean(highZ) + sigma(highZ)*upperBound] (for charge range selection). |
122 |
* @return #TRKNUCLEIZ_ILLEGALLOWZ if lowZ is less than 1 or greater than 6. |
123 |
* @return #TRKNUCLEIZ_ILLEGALHIGHZ if highZ is less than lowZ and not the default value (-1), or if it is greater than 6. |
124 |
* @return #TRKNUCLEIZ_OUTOFBOUNDS if the charge from mean dE/dx(if howToCheck == #TRKNUCLEIZ_CHECKMEAN) or at least one valid single layer |
125 |
* charge (if howToCheck == #TRKNUCLEIZ_CHECKSINGLEVALUES) is out of bounds. |
126 |
* @return #TRKNUCLEIZ_TOOFEWLAYERS if charge information is available for a number of layers lesser than minLayers. |
127 |
* @return #TRKNUCLEIZ_OUTOFBOUNDS if Z < 1 or Z > 6. |
128 |
* |
129 |
*/ |
130 |
int Check(PamLevel2 *event); |
131 |
|
132 |
private: |
133 |
|
134 |
unsigned int _lowZ; |
135 |
int _highZ; |
136 |
|
137 |
static const float _meanRigMean[]; //Means for mean dE/dx Vs. rigidity |
138 |
static const float _sigmaRigMean[];//Sigmas for mean dE/dx Vs. rigidity |
139 |
static const float _meanBetaMean[]; //Means for mean dE/dx Vs. beta |
140 |
static const float _sigmaBetaMean[];//Sigmas for mean dE/dx Vs. beta |
141 |
|
142 |
float _lowerLimit; |
143 |
float _upperLimit; |
144 |
TrkNuclei *_trkNuclei; |
145 |
unsigned int _minLayers; |
146 |
unsigned int _howToCheck; |
147 |
unsigned int _method; |
148 |
}; |
149 |
#endif /* TRKNUCLEIZCUT_H_ */ |
150 |
|
151 |
#endif /* NO_TRKNUCLEI */ |