AMSDST
myBetaPlus.cxx
Go to the documentation of this file.
1 // Authors: M.Duranti - INFN di Perugia
2 #include "myBetaPlus.h"
3 #include "debug.h"
4 #include "TClass.h"
5 
6 using namespace std;
7 
8 //--------------------------------------------------------------------
9 
11 #ifdef _WITHGBATCH_
12 ClassImp(myBetaPlusFiller);
13 #endif //#ifdef _WITHGBATCH_
14 
15 //--------------------------------------------------------------------
16 
18 #ifdef PDEBUG
19  printf("In myBetaPlus::myBetaPlus\n");
20 #endif
21  PRINTDEBUG;
22  init();
23  PRINTDEBUG;
24 }
25 
27 #ifdef PDEBUG
28  printf("In myBetaPlus::~myBetaPlus\n");
29 #endif
30  PRINTDEBUG;
31  Clear();
32 }
33 
34 void myBetaPlus::Clear(Option_t* option){
35 #ifdef PDEBUG
36  printf("In myBetaPlus::Clear\n");
37 #endif
38  PRINTDEBUG;
39  TofTrackBeta = -999999;
40  TofTrackPattern = 999999;
41  TofTrackRelErr = 0;
42  TofTrackNPoints = 999999;
43  fill_n(TofTrackChargeLayer, 4, 0);
44  TofTrackChargePlaneUpper = 0;
45  TofTrackChargePlaneLower = 0;
46  PRINTDEBUG;
47  return;
48 }
49 
51 #ifdef PDEBUG
52  printf("In myBetaPlus::init\n");
53 #endif
54  PRINTDEBUG;
55  Clear();
56  PRINTDEBUG;
57  return;
58 }
59 
60 //------------------------------------------------------------------
61 
62 #ifdef _WITHGBATCH_
63 
64 myBetaPlusFiller::myBetaPlusFiller(){
65 #ifdef PDEBUG
66  printf("In myBetaPlusFiller::myBetaPlusFiller\n");
67 #endif
68  PRINTDEBUG;
69  init();
70  PRINTDEBUG;
71 }
72 
73 myBetaPlusFiller::~myBetaPlusFiller(){
74 #ifdef PDEBUG
75  printf("In myBetaPlusFiller::~myBetaPlusFiller\n");
76 #endif
77  PRINTDEBUG;
78  Clear();
79 }
80 
81 void myBetaPlusFiller::Clear(Option_t* option){
82 #ifdef PDEBUG
83  printf("In myBetaPlusFiller::Clear\n");
84 #endif
85  PRINTDEBUG;
86  beta=0;
87  PRINTDEBUG;
88  return;
89 }
90 
91 void myBetaPlusFiller::init(){
92 #ifdef PDEBUG
93  printf("In myBetaPlusFiller::init\n");
94 #endif
95  PRINTDEBUG;
96  Clear();
97  PRINTDEBUG;
98  return;
99 }
100 
101 void myBetaPlusFiller::Fill(BetaR* _beta, TrTrackR* track, int kDef){
102 #ifdef PDEBUG
103  printf("In myBeta::Fill\n");
104 #endif
105  PRINTDEBUG;
106 
107  beta = _beta;
108 
109  if (beta && track) {
110 
111  TofTrack tof_track(beta, track, kDef);
112  TofTrackBeta = tof_track.GetBeta();
113  TofTrackPattern = tof_track.GetPattern();
114  TofTrackQ = tof_track.GetQ();
115  TofTrackNPoints = tof_track.GetNPoints();
116  TofTrackRelErr = tof_track.GetRelErr();
117  for (int ii=0; ii<4; ii++) {
118  TofTrackChargeLayer[ii] = tof_track.GetChargeLayer(ii+1, TofTrack::kMix);
119  }
120  TofTrackChargePlaneUpper = tof_track.GetChargePlane(TofTrack::kUpper);
121  TofTrackChargePlaneLower = tof_track.GetChargePlane(TofTrack::kLower);
122 
123  }
124 
125  PRINTDEBUG;
126 
127  return;
128 }
129 
130 #endif