AMSDST
myRTI.cxx
Go to the documentation of this file.
1 // Authors: M.Duranti - INFN di Perugia
2 #include "myRTI.h"
3 #include "debug.h"
4 #include "TClass.h"
5 #include <iostream>
6 using namespace std;
7 
8 //--------------------------------------------------------------------
9 
11 #ifdef _WITHGBATCH_
12 ClassImp(myRTIFiller);
13 #endif //#ifdef _WITHGBATCH_
14 //--------------------------------------------------------------------
15 
17 #ifdef PDEBUG
18  printf("In myRTI::myRTI\n");
19 #endif
20  PRINTDEBUG;
21  init();
22  PRINTDEBUG;
23 }
24 
26 #ifdef PDEBUG
27  printf("In myRTI::~myRTI\n");
28 #endif
29  PRINTDEBUG;
30  Clear();
31 }
32 
33 void myRTI::Clear(Option_t* option){
34 #ifdef PDEBUG
35  printf("In myRTI::Clear\n");
36 #endif
37  PRINTDEBUG;
38 
39  run = 999999;
40  evno = 999999;
41  evnol= 999999;
42  lf = -999999;
43  memset(cf, 0, 4*2* sizeof(cf[0][0]));
44  memset(cfi, 0, 4*2* sizeof(cfi[0][0]));
45  memset(nl1l9, 0, 2*2* sizeof(nl1l9[0][0]));
46  memset(dl1l9, 0, 2*3* sizeof(dl1l9[0][0]));
47  /*
48  fill_n(cf, 8, 0);
49  fill_n(cfi, 8, 0);
50  fill_n( nl1l9, 4, 0);
51  fill_n( dl1l9, 6, 0);
52  */
53  mphe = -999999;
54  theta = -999999;
55  phi = -999999;
56  r = -999999;
57  zenith = -999999;
58  glat = -999999;
59  glong = -999999;
60  nev = -999999;
61  nerr = -999999;
62  ntrig = -999999;
63  nhwerr = -999999;
64  npart = -999999;
65  mtrdh = -999999;
66  good = -9999999;
67  utime = 999999;
68  fill_n(usec, 2, 0);
69 
70  PRINTDEBUG;
71 
72  return;
73 }
74 
75 void myRTI::init(){
76 #ifdef PDEBUG
77  printf("In myRTI::init\n");
78 #endif
79  PRINTDEBUG;
80  Clear();
81  PRINTDEBUG;
82  return;
83 }
84 
86 #ifdef PDEBUG
87  printf("In myRTI::TPreSelect\n");
88 #endif
89  PRINTDEBUG;
90 
91  bool cut[10]={0};
92  cut[0]=(ntrig/nev>0.98);
93  cut[1]=(npart/ntrig>0.07/1600*ntrig&&npart/ntrig<0.25);
94  cut[2]=(lf>0.5);
95  cut[3]=(zenith<40);
96  cut[4]=(nerr>=0&&nerr/nev<0.1);
97  cut[5]=(npart>0&&nev<1800);
98  bool tcut=(cut[0]&&cut[1]&&cut[2]&&cut[3]&&cut[4]&&cut[5]);
99  cout<<" 0 "<< cut[0]<<" && "<<cut[1]<<" && "<<cut[2]<<" && "<<cut[3]<<" && "<<cut[4]<<endl;
100  return tcut;
101 }
102 
103 //-------------------------------------------------------------------------
104 
105 #ifdef _WITHGBATCH_
106 
107 myRTIFiller::myRTIFiller(){
108 #ifdef PDEBUG
109  printf("In myRTIFiller::myRTIFiller\n");
110 #endif
111  PRINTDEBUG;
112  init();
113  PRINTDEBUG;
114 }
115 
116 myRTIFiller::~myRTIFiller(){
117 #ifdef PDEBUG
118  printf("In myRTIFiller::~myRTIFiller\n");
119 #endif
120  PRINTDEBUG;
121  Clear();
122 }
123 
124 void myRTIFiller::Clear(Option_t* option){
125 #ifdef PDEBUG
126  printf("In myRTIFiller::Clear\n");
127 #endif
128  PRINTDEBUG;
129  return;
130 }
131 
132 void myRTIFiller::init(){
133 #ifdef PDEBUG
134  printf("In myRTIFiller::init\n");
135 #endif
136  PRINTDEBUG;
137  Clear();
138  PRINTDEBUG;
139 }
140 
141 void myRTIFiller::Fill(AMSSetupR::RTI* ev_RTI){
142 #ifdef PDEBUG
143  printf("In myRTIFiller::Fill\n");
144 #endif
145  PRINTDEBUG;
146 
147  if (ev_RTI) {
148 
149 #if !defined _B524_ && !defined _B530_ && !defined _B538_ && !defined _B550_ && !defined _B572_ && !defined _B580_ && !defined _B584_ && !defined _B594_ && !defined _B598_ && !defined _B610_ && !defined _B620_
150  run = ev_RTI->run;
151  evno = ev_RTI->evno;
152  evnol= ev_RTI->evnol;
153  // printf("myRTIFiller::Fill: %d\n", evno);//only for debug
154  lf = ev_RTI->lf;
155  // printf("myRTIFiller::Fill: %f\n", lf);//only for debug
156  copy_n( ev_RTI->cf[0] , 4*2, cf[0]);
157  copy_n( ev_RTI->cfi[0], 4*2, cfi[0]);
158  mphe = ev_RTI->mphe;
159  theta = ev_RTI->theta;
160  phi = ev_RTI->phi;
161  r = ev_RTI->r;
162  zenith = ev_RTI->zenith;
163  glat = ev_RTI->glat;
164  glong = ev_RTI->glong;
165  nev = ev_RTI->nev;
166  nerr = ev_RTI->nerr;
167  ntrig = ev_RTI->ntrig;
168  nhwerr = ev_RTI->nhwerr;
169  npart = ev_RTI->npart;
170  copy_n( ev_RTI->nl1l9[0], 2*2, nl1l9[0]);
171  copy_n( ev_RTI->dl1l9[0], 2*3, dl1l9[0]);
172  mtrdh = ev_RTI->mtrdh;
173  good = ev_RTI->good;
174  utime = ev_RTI->utime;
175  copy_n(ev_RTI->usec, 2, usec);
176 
177 #endif
178 
179  }
180 
181  return;
182 }
183 
184 #endif