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

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

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

revision 1.1 by pam-fi, Thu Jul 28 13:27:46 2011 UTC revision 1.1.2.3 by pam-fi, Tue Jan 3 08:45:27 2012 UTC
# Line 77  void TofDedxVsRigHistoAction::OnGood(Pam Line 77  void TofDedxVsRigHistoAction::OnGood(Pam
77    static float dEdxLayer;    static float dEdxLayer;
78    static unsigned int badLayers;    static unsigned int badLayers;
79    
80    int trkSeqNo = 0;    static int trkSeqNo;
81      static int idx;
82      trkSeqNo = event->GetTrack(0)->GetTrkTrack()->GetSeqNo();
83    for (int i = 0; i < event->GetToFLevel2()->ntrk(); i++) {    for (int i = 0; i < event->GetToFLevel2()->ntrk(); i++) {
84      if (event->GetToFLevel2()->GetToFTrkVar(i)->trkseqno == event->GetTrack(0)->GetTrkTrack()->GetSeqNo())      if (event->GetToFLevel2()->GetToFTrkVar(i)->trkseqno == trkSeqNo)
85        trkSeqNo = i;        idx = i;
86    }    }
87    
88    dEdx = 0.;    dEdx = 0.;
89    badLayers = 0;    badLayers = 0;
90    if ((_layers & S11) == S11) {    if ((_layers & S11) == S11) {
91      dEdxLayer = event->GetToFLevel2()->GetdEdx(trkSeqNo, 0, 100);      dEdxLayer = event->GetToFLevel2()->GetdEdx(idx, 0, 100);
92      if (dEdxLayer > 0. && dEdxLayer < 4090)      if (dEdxLayer > 0. && dEdxLayer < 4090)
93        dEdx += dEdxLayer;        dEdx += dEdxLayer;
94      else      else
95        badLayers++;        badLayers++;
96    }    }
97    if ((_layers & S12) == S12) {    if ((_layers & S12) == S12) {
98      dEdxLayer = event->GetToFLevel2()->GetdEdx(trkSeqNo, 1, 100);      dEdxLayer = event->GetToFLevel2()->GetdEdx(idx, 1, 100);
99      if (dEdxLayer > 0. && dEdxLayer < 4090)      if (dEdxLayer > 0. && dEdxLayer < 4090)
100        dEdx += dEdxLayer;        dEdx += dEdxLayer;
101      else      else
102        badLayers++;        badLayers++;
103    }    }
104    if ((_layers & S21) == S21) {    if ((_layers & S21) == S21) {
105      dEdxLayer = event->GetToFLevel2()->GetdEdx(trkSeqNo, 2, 100);      dEdxLayer = event->GetToFLevel2()->GetdEdx(idx, 2, 100);
106      if (dEdxLayer > 0. && dEdxLayer < 4090)      if (dEdxLayer > 0. && dEdxLayer < 4090)
107        dEdx += dEdxLayer;        dEdx += dEdxLayer;
108      else      else
109        badLayers++;        badLayers++;
110    }    }
111    if ((_layers & S22) == S22) {    if ((_layers & S22) == S22) {
112      dEdxLayer = event->GetToFLevel2()->GetdEdx(trkSeqNo, 3, 100);      dEdxLayer = event->GetToFLevel2()->GetdEdx(idx, 3, 100);
113      if (dEdxLayer > 0. && dEdxLayer < 4090)      if (dEdxLayer > 0. && dEdxLayer < 4090)
114        dEdx += dEdxLayer;        dEdx += dEdxLayer;
115      else      else
116        badLayers++;        badLayers++;
117    }    }
118    if ((_layers & S31) == S31) {    if ((_layers & S31) == S31) {
119      dEdxLayer = event->GetToFLevel2()->GetdEdx(trkSeqNo, 4, 100);      dEdxLayer = event->GetToFLevel2()->GetdEdx(idx, 4, 100);
120      if (dEdxLayer > 0. && dEdxLayer < 4090)      if (dEdxLayer > 0. && dEdxLayer < 4090)
121        dEdx += dEdxLayer;        dEdx += dEdxLayer;
122      else      else
123        badLayers++;        badLayers++;
124    }    }
125    if ((_layers & S32) == S32) {    if ((_layers & S32) == S32) {
126      dEdxLayer = event->GetToFLevel2()->GetdEdx(trkSeqNo, 5, 100);      dEdxLayer = event->GetToFLevel2()->GetdEdx(idx, 5, 100);
127      if (dEdxLayer > 0. && dEdxLayer < 4090)      if (dEdxLayer > 0. && dEdxLayer < 4090)
128        dEdx += dEdxLayer;        dEdx += dEdxLayer;
129      else      else
130        badLayers++;        badLayers++;
131    }    }
132    if (badLayers != _nLayers) {    if (badLayers == 0) {
133      dEdx /= _nLayers - badLayers;      dEdx /= _nLayers;
134      Fill(event->GetTrack(0)->GetTrkTrack()->GetRigidity(), dEdx);      Fill(event->GetTrack(0)->GetTrkTrack()->GetRigidity(), dEdx);
135    }    }
136    else    else

Legend:
Removed from v.1.1  
changed lines
  Added in v.1.1.2.3

  ViewVC Help
Powered by ViewVC 1.1.23