/[PAMELA software]/PamCut/TofCuts/TofDedxHCut/TofDedxHCut.cpp
ViewVC logotype

Diff of /PamCut/TofCuts/TofDedxHCut/TofDedxHCut.cpp

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.2 by pam-fi, Wed Apr 6 15:43:12 2011 UTC revision 1.4 by pam-fi, Tue Nov 29 10:20:16 2011 UTC
# Line 16  const float TofDedxHCut::_S22_SA_params[ Line 16  const float TofDedxHCut::_S22_SA_params[
16  const float TofDedxHCut::_S31_SA_params[] = { 1.6, 1.2, -0.15, -2., 0.8, 1.6, 1.2, -0.2, 0., 0.8 };  const float TofDedxHCut::_S31_SA_params[] = { 1.6, 1.2, -0.15, -2., 0.8, 1.6, 1.2, -0.2, 0., 0.8 };
17  const float TofDedxHCut::_S32_SA_params[] = { 1.6, 1.2, -0.15, -2., 0.8, 1.6, 1.2, -0.2, 0., 0.8 };  const float TofDedxHCut::_S32_SA_params[] = { 1.6, 1.2, -0.15, -2., 0.8, 1.6, 1.2, -0.2, 0., 0.8 };
18    
19  TofDedxHCut::TofDedxHCut(const char *cutName, unsigned int layer, bool standAlone) :  const float TofDedxHCut::_S11_SA_params_strict[] = { 1.5, 1.2, -0.15, -1.7, 0.8, 1.6, 1.2, -0.2, -0.8, 0.8 };
20    PamCut(cutName), _layer(layer), _standAlone(standAlone), _p(NULL) {  const float TofDedxHCut::_S12_SA_params_strict[] = { 1.5, 1.2, -0.15, -1.7, 0.8, 1.6, 1.2, -0.2, -0.8, 0.8 };
21    const float TofDedxHCut::_S21_SA_params_strict[] = { 1.6, 1.2, -0.15, -1.7, 0.8, 1.6, 1.2, -0.2, -0.8, 0.8 };
22    switch (_layer) {  const float TofDedxHCut::_S22_SA_params_strict[] = { 1.6, 1.2, -0.15, -1.7, 0.8, 1.6, 1.2, -0.2, -0.8, 0.8 };
23    case S11:  const float TofDedxHCut::_S31_SA_params_strict[] = { 1.6, 1.2, -0.15, -1.7, 0.8, 1.6, 1.2, -0.2, -0.8, 0.8 };
24      _p = _S11_SA_params;  const float TofDedxHCut::_S32_SA_params_strict[] = { 1.6, 1.2, -0.15, -1.7, 0.8, 1.6, 1.2, -0.2, -0.8, 0.8 };
25      break;  
26    case S12:  TofDedxHCut::TofDedxHCut(const char *cutName, unsigned int layer, bool standAlone, bool strict) :
27      _p = _S12_SA_params;      PamCut(cutName), _layer(layer), _standAlone(standAlone), _p(NULL) {
28      break;  
29    case S21:    if (strict) {
30      _p = _S21_SA_params;      switch (_layer) {
31      break;      case S11:
32    case S22:        _p = _S11_SA_params_strict;
33      _p = _S22_SA_params;        break;
34      break;      case S12:
35    case S31:        _p = _S12_SA_params_strict;
36      _p = _S31_SA_params;        break;
37      break;      case S21:
38    case S32:        _p = _S21_SA_params_strict;
39      _p = _S32_SA_params;        break;
40      break;      case S22:
41    default:        _p = _S22_SA_params_strict;
42      _p = _S21_SA_params;        break;
43        case S31:
44          _p = _S31_SA_params_strict;
45          break;
46        case S32:
47          _p = _S32_SA_params_strict;
48          break;
49        default:
50          _p = _S21_SA_params_strict;
51        }
52      }
53      else {
54        switch (_layer) {
55        case S11:
56          _p = _S11_SA_params;
57          break;
58        case S12:
59          _p = _S12_SA_params;
60          break;
61        case S21:
62          _p = _S21_SA_params;
63          break;
64        case S22:
65          _p = _S22_SA_params;
66          break;
67        case S31:
68          _p = _S31_SA_params;
69          break;
70        case S32:
71          _p = _S32_SA_params;
72          break;
73        default:
74          _p = _S21_SA_params;
75        }
76    }    }
   
77  }  }
78    
79  int TofDedxHCut::Check(PamLevel2 *event) {  int TofDedxHCut::Check(PamLevel2 *event) {
# Line 71  int TofDedxHCut::Check(PamLevel2 *event) Line 103  int TofDedxHCut::Check(PamLevel2 *event)
103      if ((auxLayer & 0x1) == 1) {      if ((auxLayer & 0x1) == 1) {
104        dEdx += event->GetToFLevel2()->GetdEdx(trkSeqNo, currLayer, 100);        dEdx += event->GetToFLevel2()->GetdEdx(trkSeqNo, currLayer, 100);
105        nLayers++;        nLayers++;
106          // Patch to exclude S115b
107          if (currLayer == 0) {
108            ToFTrkVar *tofTrk = event->GetToFLevel2()->GetToFTrkVar(trkSeqNo);
109            bool has8 = false, has9 = false;
110            float dedx9 = 0.;
111            for (Int_t ib = 0; ib < tofTrk->npmtadc; ib++) {
112              if (tofTrk->pmtadc[ib] == 8) {
113                has8 = true;
114              }
115              if (tofTrk->pmtadc[ib] == 9) {
116                has9 = true;
117                dedx9 = tofTrk->dedx[ib];
118              }
119            }
120    
121            if (has9) {
122              dEdx -= (dedx9 / ((int) has8 + 1));
123              dEdx *= 2.;
124            }
125          }
126          //End of patch
127      }      }
128      currLayer++;      currLayer++;
129      auxLayer >>= 1;      auxLayer >>= 1;
# Line 78  int TofDedxHCut::Check(PamLevel2 *event) Line 131  int TofDedxHCut::Check(PamLevel2 *event)
131    
132    dEdx /= nLayers;    dEdx /= nLayers;
133    
134    if (dEdx < _p[0]/ (_p[1] * beta + _p[2]) +  _p[3] + _p[4] * beta)    if (dEdx < _p[0] / (_p[1] * beta + _p[2]) + _p[3] + _p[4] * beta)
135      return 0;      return 0;
136    
137    if (dEdx > _p[5] / (_p[6] * beta + _p[7]) + _p[8] + _p[9] * beta)    if (dEdx > _p[5] / (_p[6] * beta + _p[7]) + _p[8] + _p[9] * beta)

Legend:
Removed from v.1.2  
changed lines
  Added in v.1.4

  ViewVC Help
Powered by ViewVC 1.1.23