/[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.3 by pam-fi, Fri Sep 30 10:16:36 2011 UTC
# Line 17  const float TofDedxHCut::_S31_SA_params[ Line 17  const float TofDedxHCut::_S31_SA_params[
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) :  TofDedxHCut::TofDedxHCut(const char *cutName, unsigned int layer, bool standAlone) :
20    PamCut(cutName), _layer(layer), _standAlone(standAlone), _p(NULL) {      PamCut(cutName), _layer(layer), _standAlone(standAlone), _p(NULL) {
21    
22    switch (_layer) {    switch (_layer) {
23    case S11:    case S11:
# Line 71  int TofDedxHCut::Check(PamLevel2 *event) Line 71  int TofDedxHCut::Check(PamLevel2 *event)
71      if ((auxLayer & 0x1) == 1) {      if ((auxLayer & 0x1) == 1) {
72        dEdx += event->GetToFLevel2()->GetdEdx(trkSeqNo, currLayer, 100);        dEdx += event->GetToFLevel2()->GetdEdx(trkSeqNo, currLayer, 100);
73        nLayers++;        nLayers++;
74          // Patch to exclude S115b
75          if (currLayer == 0) {
76            ToFTrkVar *tofTrk = event->GetToFLevel2()->GetToFTrkVar(trkSeqNo);
77            bool has8 = false, has9 = false;
78            float dedx9 = 0.;
79            for (Int_t ib = 0; ib < tofTrk->npmtadc; ib++) {
80              if (tofTrk->pmtadc[ib] == 8) {
81                has8 = true;
82              }
83              if (tofTrk->pmtadc[ib] == 9) {
84                has9 = true;
85                dedx9 = tofTrk->dedx[ib];
86              }
87            }
88    
89            if (has9) {
90              dEdx -= (dedx9 / ((int) has8 + 1));
91              dEdx *= 2.;
92            }
93          }
94          //End of patch
95      }      }
96      currLayer++;      currLayer++;
97      auxLayer >>= 1;      auxLayer >>= 1;
# Line 78  int TofDedxHCut::Check(PamLevel2 *event) Line 99  int TofDedxHCut::Check(PamLevel2 *event)
99    
100    dEdx /= nLayers;    dEdx /= nLayers;
101    
102    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)
103      return 0;      return 0;
104    
105    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.3

  ViewVC Help
Powered by ViewVC 1.1.23