/[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.2 by pam-fi, Tue Jan 3 08:45:27 2012 UTC revision 1.2 by pam-fi, Thu Aug 12 15:11:33 2010 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), _badEvents(    Histo2DAction<Int_t> (actionName, title, outFileBase, mode, outRoot, outText), _layers(layers), _nLayers(0),
15          0), _standAlone(standAlone) {        _badEvents(0), _standAlone(standAlone) {
16    
   bool buildTitle = false;  
17    if (title == "") {    if (title == "") {
     buildTitle = true;  
18      title = "TOF dE/dx (";      title = "TOF dE/dx (";
19    }    }
20    if ((_layers & S11) == S11) {    if ((_layers & S11) == S11) {
21      if (buildTitle)      title += "S11";
       title += "S11";  
22      _nLayers++;      _nLayers++;
23    }    }
24    if ((_layers & S12) == S12) {    if ((_layers & S12) == S12) {
25      if (buildTitle) {      if (_nLayers > 0)
26        if (_nLayers > 0)        title += ",";
27          title += ",";      title += "S12";
       title += "S12";  
     }  
28      _nLayers++;      _nLayers++;
29    }    }
30    if ((_layers & S21) == S21) {    if ((_layers & S21) == S21) {
31      if (buildTitle) {      if (_nLayers > 0)
32        if (_nLayers > 0)        title += ",";
33          title += ",";      title += "S21";
       title += "S21";  
     }  
34      _nLayers++;      _nLayers++;
35    }    }
36    if ((_layers & S22) == S22) {    if ((_layers & S22) == S22) {
37      if (buildTitle) {      if (_nLayers > 0)
38        if (_nLayers > 0)        title += ",";
39          title += ",";      title += "S22";
       title += "S22";  
     }  
40      _nLayers++;      _nLayers++;
41    }    }
42    if ((_layers & S31) == S31) {    if ((_layers & S31) == S31) {
43      if (buildTitle) {      if (_nLayers > 0)
44        if (_nLayers > 0)        title += ",";
45          title += ",";      title += "S31";
       title += "S31";  
     }  
46      _nLayers++;      _nLayers++;
47    }    }
48    if ((_layers & S32) == S32) {    if ((_layers & S32) == S32) {
49      if (buildTitle) {      if (_nLayers > 0)
50        if (_nLayers > 0)        title += ",";
51          title += ",";      title += "S32";
       title += "S32";  
     }  
52      _nLayers++;      _nLayers++;
53    }    }
54    if (buildTitle)    title += ") Vs Beta";
     title += ") Vs Beta";  
55    
56      cout << _layers << "  " << _nLayers << endl;
57    SetTitle(title);    SetTitle(title);
58    
59  }  }
# Line 78  void TofDedxVsBetaHistoAction::OnGood(Pa Line 65  void TofDedxVsBetaHistoAction::OnGood(Pa
65    static unsigned int badLayers;    static unsigned int badLayers;
66    
67    static int trkSeqNo;    static int trkSeqNo;
   static int idx;  
68    if (_standAlone)    if (_standAlone)
69      trkSeqNo = -1;      trkSeqNo = 0;
70    else    else
71      trkSeqNo = event->GetTrack(0)->GetTrkTrack()->GetSeqNo();      for (int i = 0; i < event->GetToFLevel2()->ntrk(); i++) {
72          if (event->GetToFLevel2()->GetToFTrkVar(i)->trkseqno == event->GetTrack(0)->GetTrkTrack()->GetSeqNo())
73    for (int i = 0; i < event->GetToFLevel2()->ntrk(); i++) {          trkSeqNo = i;
74      if (event->GetToFLevel2()->GetToFTrkVar(i)->trkseqno == trkSeqNo)      }
       idx = i;  
   }  
75    
76    dEdx = 0.;    dEdx = 0.;
77    badLayers = 0;    badLayers = 0;
78    if ((_layers & S11) == S11) {    if ((_layers & S11) == S11) {
79      dEdxLayer = event->GetToFLevel2()->GetdEdx(idx, 0, 100);      dEdxLayer = event->GetToFLevel2()->GetdEdx(trkSeqNo, 0, 100);
80      if (dEdxLayer > 0. && dEdxLayer < 4090)      if (dEdxLayer > 0. && dEdxLayer < 4090)
81        dEdx += dEdxLayer;        dEdx += dEdxLayer;
82      else      else
83        badLayers++;        badLayers++;
84    }    }
85    if ((_layers & S12) == S12) {    if ((_layers & S12) == S12) {
86      dEdxLayer = event->GetToFLevel2()->GetdEdx(idx, 1, 100);      dEdxLayer = event->GetToFLevel2()->GetdEdx(trkSeqNo, 1, 100);
87      if (dEdxLayer > 0. && dEdxLayer < 4090)      if (dEdxLayer > 0. && dEdxLayer < 4090)
88        dEdx += dEdxLayer;        dEdx += dEdxLayer;
89      else      else
90        badLayers++;        badLayers++;
91    }    }
92    if ((_layers & S21) == S21) {    if ((_layers & S21) == S21) {
93      dEdxLayer = event->GetToFLevel2()->GetdEdx(idx, 2, 100);      dEdxLayer = event->GetToFLevel2()->GetdEdx(trkSeqNo, 2, 100);
94      if (dEdxLayer > 0. && dEdxLayer < 4090)      if (dEdxLayer > 0. && dEdxLayer < 4090)
95        dEdx += dEdxLayer;        dEdx += dEdxLayer;
96      else      else
97        badLayers++;        badLayers++;
98    }    }
99    if ((_layers & S22) == S22) {    if ((_layers & S22) == S22) {
100      dEdxLayer = event->GetToFLevel2()->GetdEdx(idx, 3, 100);      dEdxLayer = event->GetToFLevel2()->GetdEdx(trkSeqNo, 3, 100);
101      if (dEdxLayer > 0. && dEdxLayer < 4090)      if (dEdxLayer > 0. && dEdxLayer < 4090)
102        dEdx += dEdxLayer;        dEdx += dEdxLayer;
103      else      else
104        badLayers++;        badLayers++;
105    }    }
106    if ((_layers & S31) == S31) {    if ((_layers & S31) == S31) {
107      dEdxLayer = event->GetToFLevel2()->GetdEdx(idx, 4, 100);      dEdxLayer = event->GetToFLevel2()->GetdEdx(trkSeqNo, 4, 100);
108      if (dEdxLayer > 0. && dEdxLayer < 4090)      if (dEdxLayer > 0. && dEdxLayer < 4090)
109        dEdx += dEdxLayer;        dEdx += dEdxLayer;
110      else      else
111        badLayers++;        badLayers++;
112    }    }
113    if ((_layers & S32) == S32) {    if ((_layers & S32) == S32) {
114      dEdxLayer = event->GetToFLevel2()->GetdEdx(idx, 5, 100);      dEdxLayer = event->GetToFLevel2()->GetdEdx(trkSeqNo, 5, 100);
115      if (dEdxLayer > 0. && dEdxLayer < 4090)      if (dEdxLayer > 0. && dEdxLayer < 4090)
116        dEdx += dEdxLayer;        dEdx += dEdxLayer;
117      else      else
118        badLayers++;        badLayers++;
119    }    }
120    if (badLayers == 0) {    if (badLayers == 0) {
121      dEdx /= _nLayers - badLayers;      dEdx /= _nLayers;
122      Fill(event->GetToFLevel2()->GetToFTrkVar(idx)->beta[12], dEdx);      cout << _nLayers << "  " << dEdx << endl;
123        Fill(event->GetToFLevel2()->GetToFTrkVar(trkSeqNo)->beta[12], dEdx);
124    }    }
125    else    else
126      _badEvents++;      _badEvents++;

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

  ViewVC Help
Powered by ViewVC 1.1.23