1 |
pam-fi |
1.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_ILLEGALZ |
25 |
|
|
///< Discarded because charge is not between 1 and 8 |
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_DEFL, |
32 |
|
|
///< Tracker standalon e: dE/dx Vs. deflection |
33 |
|
|
}; |
34 |
|
|
|
35 |
|
|
/*! @enum TrkNucleiZ_CheckMean Handy aliases to set check mean */ |
36 |
|
|
enum TrkNucleiZ_CheckMean { |
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 passed to the TrkNucleiZCut object as Z. For each charge, there is an associated distribution of |
54 |
|
|
* events, with mean Zmean and standard deviation sigmaZ. These values will be used to check the events. |
55 |
|
|
* |
56 |
|
|
* @param cutName The cut's name. |
57 |
|
|
* @param Z The charge value. |
58 |
|
|
* @param lowerLimit The lower bound (in units of sigma_Z) of the desired charge range, defined as Zmean - lowerBound*sigmaZ. |
59 |
|
|
* @param upperLimit The upper bound (in units of sigma_Z) of the desired charge range, defined as Zmean + upperBound*sigmaZ. |
60 |
|
|
* @param minLayers The minimum required number of layers which give a valid charge information. |
61 |
|
|
* @param checkMean Flag to set the check method (see #Check and #TrkNucleiZ_CheckMean). |
62 |
|
|
* @param method The method to use to measure the particle's charge (see #TrkNucleiZ_method). |
63 |
|
|
* @return |
64 |
|
|
*/ |
65 |
|
|
TrkNucleiZCut(const char *cutName, unsigned int Z, float lowerLimit, float upperLimit, unsigned int minLayers = 1, |
66 |
|
|
unsigned int howToCheck = TRKNUCLEIZ_CHECKMEAN, unsigned int method = TRKNUCLEIZ_DEFL) : |
67 |
|
|
PamCut(cutName), _Z(Z), _lowerLimit(lowerLimit), _upperLimit(upperLimit), _trkNuclei(NULL), _minLayers(minLayers), |
68 |
|
|
_howToCheck(howToCheck), _method(method) { |
69 |
|
|
|
70 |
|
|
} |
71 |
|
|
/*! @brief Destructor. */ |
72 |
|
|
~TrkNucleiZCut() { |
73 |
|
|
delete _trkNuclei; |
74 |
|
|
} |
75 |
|
|
|
76 |
|
|
/*! @brief The TrkNucleiZ check. |
77 |
|
|
* |
78 |
|
|
* The routine selects events whose value of Zmean obtained from the TrkNuclei Class is in the range [Zmean - sigma*lowerBound, Zmean + sigma*upperBound]. |
79 |
|
|
* Zmean and sigma are defined respectively as the mean and the standard deviation of the charge distributions obtained using TrkNuclei. |
80 |
|
|
* In current implementation, means are taken to be equal to the charge value (Zmean = Z) and sigmas are: |
81 |
|
|
* |
82 |
|
|
* Z | sigma |
83 |
|
|
* ----------- |
84 |
|
|
* 1 | 0.09 |
85 |
|
|
* 2 | 0.10 |
86 |
|
|
* 3 | 0.17 |
87 |
|
|
* 4 | 0.34 |
88 |
|
|
* 5 | 0.44 |
89 |
|
|
* 6 | 0.59 |
90 |
|
|
* |
91 |
|
|
* independent of the method used. The TofNuclei calibrations used are the standard ones (from Wolfgang, see TrkNuclei.cpp). |
92 |
|
|
* First of all, the number of layers giving a valid charge information is checked to be greater than minLayers; if it's not so, |
93 |
|
|
* the routine will return #TRKNUCLEIZ_TOOFEWLAYERS. Next, it will check if the charge obtained considering the mean dE/dx in the tracker's |
94 |
|
|
* layers is in the validity range if the constructor's flag howToCheckMean was set to TRKNUCLEIZ_CHECKMEAN; otherwise, it will check each |
95 |
|
|
* 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 |
96 |
|
|
* 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 |
97 |
|
|
* the value of minLayers. |
98 |
|
|
* |
99 |
|
|
* @param event The event to analyze. |
100 |
|
|
* @return #CUTOK if the charge from mean dE/dx(if howToCheck == #TRKNUCLEIZ_CHECKMEAN) or all the single layer charges |
101 |
|
|
* (if howToCheck == #TRKNUCLEIZ_CHECKSINGLEVALUES) obtained from TrkNuclei are in the range [Z - sigma*lowerBound, Z + sigma*upperBound]. |
102 |
|
|
* @return #TRKNUCLEIZ_OUTOFBOUNDS if the charge from mean dE/dx(if howToCheck == #TRKNUCLEIZ_CHECKMEAN) or at least one valid single layer |
103 |
|
|
* charge (if howToCheck == #TRKNUCLEIZ_CHECKSINGLEVALUES) is out of bounds. |
104 |
|
|
* @return #TRKNUCLEIZ_TOOFEWLAYERS if charge information is available for a number of layers lesser than minLayers. |
105 |
|
|
* @return #TRKNUCLEIZ_OUTOFBOUNDS if Z < 1 or Z > 6. |
106 |
|
|
* |
107 |
|
|
*/ |
108 |
|
|
int Check(PamLevel2 *event); |
109 |
|
|
|
110 |
|
|
private: |
111 |
|
|
|
112 |
|
|
unsigned int _Z; |
113 |
|
|
static const float _sigmaZ[]; |
114 |
|
|
|
115 |
|
|
float _lowerLimit; |
116 |
|
|
float _upperLimit; |
117 |
|
|
TrkNuclei *_trkNuclei; |
118 |
|
|
unsigned int _minLayers; |
119 |
|
|
unsigned int _howToCheck; |
120 |
|
|
unsigned int _method; |
121 |
|
|
}; |
122 |
|
|
#endif /* TRKNUCLEIZCUT_H_ */ |
123 |
|
|
|
124 |
|
|
#endif /* NO_TRKNUCLEI */ |