/[PAMELA software]/PamCut/CollectionActions/Histo2DActions/TofDedxVsBetaHistoAction/TofDedxVsBetaHistoAction.cpp
ViewVC logotype

Diff of /PamCut/CollectionActions/Histo2DActions/TofDedxVsBetaHistoAction/TofDedxVsBetaHistoAction.cpp

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

revision 1.1.2.1 by pam-fi, Wed Dec 21 18:24:26 2011 UTC revision 1.1.2.2 by pam-fi, Tue Jan 3 08:45:27 2012 UTC
# Line 78  void TofDedxVsBetaHistoAction::OnGood(Pa Line 78  void TofDedxVsBetaHistoAction::OnGood(Pa
78    static unsigned int badLayers;    static unsigned int badLayers;
79    
80    static int trkSeqNo;    static int trkSeqNo;
81      static int idx;
82    if (_standAlone)    if (_standAlone)
83      trkSeqNo = 0;      trkSeqNo = -1;
84    else    else
85      for (int i = 0; i < event->GetToFLevel2()->ntrk(); i++) {      trkSeqNo = event->GetTrack(0)->GetTrkTrack()->GetSeqNo();
86        if (event->GetToFLevel2()->GetToFTrkVar(i)->trkseqno == event->GetTrack(0)->GetTrkTrack()->GetSeqNo())  
87          trkSeqNo = i;    for (int i = 0; i < event->GetToFLevel2()->ntrk(); i++) {
88      }      if (event->GetToFLevel2()->GetToFTrkVar(i)->trkseqno == trkSeqNo)
89          idx = i;
90      }
91    
92    dEdx = 0.;    dEdx = 0.;
93    badLayers = 0;    badLayers = 0;
94    if ((_layers & S11) == S11) {    if ((_layers & S11) == S11) {
95      dEdxLayer = event->GetToFLevel2()->GetdEdx(trkSeqNo, 0, 100);      dEdxLayer = event->GetToFLevel2()->GetdEdx(idx, 0, 100);
96      if (dEdxLayer > 0. && dEdxLayer < 4090)      if (dEdxLayer > 0. && dEdxLayer < 4090)
97        dEdx += dEdxLayer;        dEdx += dEdxLayer;
98      else      else
99        badLayers++;        badLayers++;
100    }    }
101    if ((_layers & S12) == S12) {    if ((_layers & S12) == S12) {
102      dEdxLayer = event->GetToFLevel2()->GetdEdx(trkSeqNo, 1, 100);      dEdxLayer = event->GetToFLevel2()->GetdEdx(idx, 1, 100);
103      if (dEdxLayer > 0. && dEdxLayer < 4090)      if (dEdxLayer > 0. && dEdxLayer < 4090)
104        dEdx += dEdxLayer;        dEdx += dEdxLayer;
105      else      else
106        badLayers++;        badLayers++;
107    }    }
108    if ((_layers & S21) == S21) {    if ((_layers & S21) == S21) {
109      dEdxLayer = event->GetToFLevel2()->GetdEdx(trkSeqNo, 2, 100);      dEdxLayer = event->GetToFLevel2()->GetdEdx(idx, 2, 100);
110      if (dEdxLayer > 0. && dEdxLayer < 4090)      if (dEdxLayer > 0. && dEdxLayer < 4090)
111        dEdx += dEdxLayer;        dEdx += dEdxLayer;
112      else      else
113        badLayers++;        badLayers++;
114    }    }
115    if ((_layers & S22) == S22) {    if ((_layers & S22) == S22) {
116      dEdxLayer = event->GetToFLevel2()->GetdEdx(trkSeqNo, 3, 100);      dEdxLayer = event->GetToFLevel2()->GetdEdx(idx, 3, 100);
117      if (dEdxLayer > 0. && dEdxLayer < 4090)      if (dEdxLayer > 0. && dEdxLayer < 4090)
118        dEdx += dEdxLayer;        dEdx += dEdxLayer;
119      else      else
120        badLayers++;        badLayers++;
121    }    }
122    if ((_layers & S31) == S31) {    if ((_layers & S31) == S31) {
123      dEdxLayer = event->GetToFLevel2()->GetdEdx(trkSeqNo, 4, 100);      dEdxLayer = event->GetToFLevel2()->GetdEdx(idx, 4, 100);
124      if (dEdxLayer > 0. && dEdxLayer < 4090)      if (dEdxLayer > 0. && dEdxLayer < 4090)
125        dEdx += dEdxLayer;        dEdx += dEdxLayer;
126      else      else
127        badLayers++;        badLayers++;
128    }    }
129    if ((_layers & S32) == S32) {    if ((_layers & S32) == S32) {
130      dEdxLayer = event->GetToFLevel2()->GetdEdx(trkSeqNo, 5, 100);      dEdxLayer = event->GetToFLevel2()->GetdEdx(idx, 5, 100);
131      if (dEdxLayer > 0. && dEdxLayer < 4090)      if (dEdxLayer > 0. && dEdxLayer < 4090)
132        dEdx += dEdxLayer;        dEdx += dEdxLayer;
133      else      else
# Line 132  void TofDedxVsBetaHistoAction::OnGood(Pa Line 135  void TofDedxVsBetaHistoAction::OnGood(Pa
135    }    }
136    if (badLayers == 0) {    if (badLayers == 0) {
137      dEdx /= _nLayers - badLayers;      dEdx /= _nLayers - badLayers;
138      Fill(event->GetToFLevel2()->GetToFTrkVar(trkSeqNo)->beta[12], dEdx);      Fill(event->GetToFLevel2()->GetToFTrkVar(idx)->beta[12], dEdx);
139    }    }
140    else    else
141      _badEvents++;      _badEvents++;

Legend:
Removed from v.1.1.2.1  
changed lines
  Added in v.1.1.2.2

  ViewVC Help
Powered by ViewVC 1.1.23