/[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.2 by pam-fi, Thu Aug 12 15:11:33 2010 UTC revision 1.4 by pam-fi, Tue Dec 20 17:41:49 2011 UTC
# Line 11  Line 11 
11    
12  TofDedxVsBetaHistoAction::TofDedxVsBetaHistoAction(const char *actionName, unsigned int layers, bool standAlone,  TofDedxVsBetaHistoAction::TofDedxVsBetaHistoAction(const char *actionName, unsigned int layers, bool standAlone,
13      TString outFileBase, TString mode, bool outRoot, bool outText, TString title) :      TString outFileBase, TString mode, bool outRoot, bool outText, TString title) :
14    Histo2DAction<Int_t> (actionName, title, outFileBase, mode, outRoot, outText), _layers(layers), _nLayers(0),      Histo2DAction<Int_t>(actionName, title, outFileBase, mode, outRoot, outText), _layers(layers), _nLayers(0), _badEvents(
15        _badEvents(0), _standAlone(standAlone) {          0), _standAlone(standAlone) {
16    
17      bool buildTitle = false;
18    if (title == "") {    if (title == "") {
19        buildTitle = true;
20      title = "TOF dE/dx (";      title = "TOF dE/dx (";
21    }    }
22    if ((_layers & S11) == S11) {    if ((_layers & S11) == S11) {
23      title += "S11";      if (buildTitle)
24          title += "S11";
25      _nLayers++;      _nLayers++;
26    }    }
27    if ((_layers & S12) == S12) {    if ((_layers & S12) == S12) {
28      if (_nLayers > 0)      if (buildTitle) {
29        title += ",";        if (_nLayers > 0)
30      title += "S12";          title += ",";
31          title += "S12";
32        }
33      _nLayers++;      _nLayers++;
34    }    }
35    if ((_layers & S21) == S21) {    if ((_layers & S21) == S21) {
36      if (_nLayers > 0)      if (buildTitle) {
37        title += ",";        if (_nLayers > 0)
38      title += "S21";          title += ",";
39          title += "S21";
40        }
41      _nLayers++;      _nLayers++;
42    }    }
43    if ((_layers & S22) == S22) {    if ((_layers & S22) == S22) {
44      if (_nLayers > 0)      if (buildTitle) {
45        title += ",";        if (_nLayers > 0)
46      title += "S22";          title += ",";
47          title += "S22";
48        }
49      _nLayers++;      _nLayers++;
50    }    }
51    if ((_layers & S31) == S31) {    if ((_layers & S31) == S31) {
52      if (_nLayers > 0)      if (buildTitle) {
53        title += ",";        if (_nLayers > 0)
54      title += "S31";          title += ",";
55          title += "S31";
56        }
57      _nLayers++;      _nLayers++;
58    }    }
59    if ((_layers & S32) == S32) {    if ((_layers & S32) == S32) {
60      if (_nLayers > 0)      if (buildTitle) {
61        title += ",";        if (_nLayers > 0)
62      title += "S32";          title += ",";
63          title += "S32";
64        }
65      _nLayers++;      _nLayers++;
66    }    }
67    title += ") Vs Beta";    if (buildTitle)
68        title += ") Vs Beta";
69    
   cout << _layers << "  " << _nLayers << endl;  
70    SetTitle(title);    SetTitle(title);
71    
72  }  }
# Line 77  void TofDedxVsBetaHistoAction::OnGood(Pa Line 90  void TofDedxVsBetaHistoAction::OnGood(Pa
90    badLayers = 0;    badLayers = 0;
91    if ((_layers & S11) == S11) {    if ((_layers & S11) == S11) {
92      dEdxLayer = event->GetToFLevel2()->GetdEdx(trkSeqNo, 0, 100);      dEdxLayer = event->GetToFLevel2()->GetdEdx(trkSeqNo, 0, 100);
93        // Patch to exclude S115b
94        ToFTrkVar *tofTrk = event->GetToFLevel2()->GetToFTrkVar(trkSeqNo);
95        bool has8 = false, has9 = false;
96        float dedx9 = 0.;
97        for (Int_t ib = 0; ib < tofTrk->npmtadc; ib++) {
98          if (tofTrk->pmtadc[ib] == 8) {
99            has8 = true;
100          }
101          if (tofTrk->pmtadc[ib] == 9) {
102            has9 = true;
103            dedx9 = tofTrk->dedx[ib];
104          }
105        }
106    
107        if (has9) {
108          dEdxLayer -= (dedx9 / ((int) has8 + 1));
109          dEdxLayer *= 2.;
110        }
111        //End of patch
112      if (dEdxLayer > 0. && dEdxLayer < 4090)      if (dEdxLayer > 0. && dEdxLayer < 4090)
113        dEdx += dEdxLayer;        dEdx += dEdxLayer;
114      else      else
# Line 119  void TofDedxVsBetaHistoAction::OnGood(Pa Line 151  void TofDedxVsBetaHistoAction::OnGood(Pa
151    }    }
152    if (badLayers == 0) {    if (badLayers == 0) {
153      dEdx /= _nLayers;      dEdx /= _nLayers;
     cout << _nLayers << "  " << dEdx << endl;  
154      Fill(event->GetToFLevel2()->GetToFTrkVar(trkSeqNo)->beta[12], dEdx);      Fill(event->GetToFLevel2()->GetToFTrkVar(trkSeqNo)->beta[12], dEdx);
155    }    }
156    else    else

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

  ViewVC Help
Powered by ViewVC 1.1.23