BOSS 7.0.6
BESIII Offline Software System
Loading...
Searching...
No Matches
FTSuperLayer Class Reference

#include <FTSuperLayer.h>

Public Member Functions

 FTSuperLayer (const int firstWireID, const int NWire, const int firstLayerID, const int NLayer, const int superLayerID)
 Constructors and destructor.
 
 ~FTSuperLayer ()
 
void clear (void)
 clear object
 
void mkSegmentList (void)
 create segment lists
 
void appendHit (FTWire *)
 append wireHit to the list of hits
 
void reAppendSalvage (void)
 append segments which are not used for tracks to the list for salvage
 
void reduce_noise (FTList< float >(&Estime)[10])
 calculate t0 and Chi2 from segment-fit in every superlayer
 
FTList< FTWire * > & wireHits (void) const
 returns wirehit list
 
FTList< FTSegment * > & segments (void) const
 returns segement list
 
const int nWire (void) const
 returns number of wires
 
const int nLayer (void) const
 returns number of layers
 
const int layerMaxId (void) const
 returns layer max ID
 
const int localMaxId (void) const
 returns local max ID
 
const int superLayerId (void) const
 returns super-layer ID
 
FTList< FTSegment * > & complecated_segments (void)
 returns complecated segments
 

Static Public Attributes

static MdcParameterparam = MdcParameter::instance()
 
static const float _maxDphi [11]
 

Detailed Description

Definition at line 65 of file FTSuperLayer.h.

Constructor & Destructor Documentation

◆ FTSuperLayer()

FTSuperLayer::FTSuperLayer ( const int  firstWireID,
const int  NWire,
const int  firstLayerID,
const int  NLayer,
const int  superLayerID 
)
inline

Constructors and destructor.

Definition at line 157 of file FTSuperLayer.h.

160 : _superLayerId(superLayerID),
161 _firstLayerId(firstLayerID),
162 _firstWireId(firstWireID),
163 _Nlayer(NLayer),
164 _Nwire(NWire),
165 //_complecated_segments((superLayerID) ? NULL: new FTList<FTSegment *>(20)),
166 _complecated_segments(new FTList<FTSegment *>(20)),
167 _wireHits(*(new FTList<FTWire *>(500))),
168 _singleHits(*(new FTList<FTWire *>(100))),
169 _segments(*(new FTList<FTSegment *>(20)))
170{
171}
Definition: FTList.h:16

◆ ~FTSuperLayer()

FTSuperLayer::~FTSuperLayer ( )
inline

Definition at line 174 of file FTSuperLayer.h.

175{
176 clear();
177 delete &_wireHits;
178 delete &_singleHits;
179 delete &_segments;
180 if (_complecated_segments) delete _complecated_segments;
181}
void clear(void)
clear object

Member Function Documentation

◆ appendHit()

void FTSuperLayer::appendHit ( FTWire h)
inline

append wireHit to the list of hits

Definition at line 233 of file FTSuperLayer.h.

233 {
234 _wireHits.append(h);
235}
int append(const T &x)
append an object into the end of the list
Definition: FTList.h:127

◆ clear()

void FTSuperLayer::clear ( void  )

clear object

Definition at line 37 of file FTSuperLayer.cxx.

38{
39 if (_wireHits.length()){
40 register FTWire ** hptr = _wireHits.firstPtr();
41 FTWire ** const last = _wireHits.lastPtr();
42 do{(**hptr).state(FTWireHitInvalid);}while((hptr++)!=last);
43 _wireHits.clear();
44 }
45 _singleHits.clear();
46 if (_segments.length()) _segments.deleteAll();
47 if (_complecated_segments) _complecated_segments->deleteAll();
48}
#define FTWireHitInvalid
Definition: FTWire.h:13
void deleteAll(void)
delete all object and clear(allocated memory remains same)
Definition: FTList.h:266
void clear(void)
clear lists but the allocated memory remains same
Definition: FTList.h:182
T * lastPtr(void) const
returns the pointer of last object
Definition: FTList.h:238
int length(void) const
returns the length of the list
Definition: FTList.h:245
T * firstPtr(void) const
returns the pointer of first object
Definition: FTList.h:231
Definition: FTWire.h:43
unsigned state(void) const
returns state
Definition: FTWire.h:480

Referenced by ~FTSuperLayer().

◆ complecated_segments()

FTList< FTSegment * > & FTSuperLayer::complecated_segments ( void  )
inline

returns complecated segments

Definition at line 227 of file FTSuperLayer.h.

227 {
228 return *_complecated_segments;
229}

Referenced by FTTrack::r_phiFit().

◆ layerMaxId()

const int FTSuperLayer::layerMaxId ( void  ) const
inline

returns layer max ID

Definition at line 209 of file FTSuperLayer.h.

209 {
210 return (_Nlayer - 1);
211}

◆ localMaxId()

const int FTSuperLayer::localMaxId ( void  ) const
inline

returns local max ID

Definition at line 203 of file FTSuperLayer.h.

203 {
204 return (_Nwire - 1);
205}

◆ mkSegmentList()

void FTSuperLayer::mkSegmentList ( void  )

create segment lists

Definition at line 52 of file FTSuperLayer.cxx.

53{
54 clustering();
55 FTList<FTSegment *> inner_short(10);
56 FTList<FTSegment *> outer_short(10);
57 FTList<FTSegment *> mid_short(10);
58 int n = _segments.length();
59 for (int i = 0; i^n; i++){
60 FTSegment * s = _segments[i];
61#ifndef OnlineMode
62 // s->printout();
63#endif
64 int stat = s->examine();
65 switch(stat){
66 case 0:
67 // simple
68 break;
69 case 1:
70 // inner short simple
71 inner_short.append(s);
72 n = _segments.remove(i);
73 break;
74 case 2:
75 // outer short simple
76 outer_short.append(s);
77 n = _segments.remove(i);
78 break;
79 case 3:
80 // to be divided
81 //if (!_superLayerId) _complecated_segments->append(s);
82 //else delete s;
83 _complecated_segments->append(s);
84 n = _segments.remove(i);
85 break;
86 default:
87 mid_short.append(s);
88 n = _segments.remove(i);
89 break;
90 }
91 }
92 connect_short_segments(inner_short,outer_short);
93 connect_singleHit(inner_short);
94 connect_singleHit(outer_short);
95 connect_singleHit(mid_short);
96 //if (!(_superLayerId&1)){
97 n = _segments.length();
98 for (int i = 0; i^n; i++){
99 _segments[i]->update();
100#ifndef OnlineMode
101 _segments[i]->printout();
102#endif
103 }
104}
XmlRpcServer s
Definition: HelloServer.cpp:11
int remove(int &)
remove objects by index and returns decremented index and length
Definition: FTList.h:140

◆ nLayer()

const int FTSuperLayer::nLayer ( void  ) const
inline

returns number of layers

Definition at line 197 of file FTSuperLayer.h.

197 {
198 return _Nlayer;
199}

Referenced by FTSegment::examine().

◆ nWire()

const int FTSuperLayer::nWire ( void  ) const
inline

returns number of wires

Definition at line 191 of file FTSuperLayer.h.

191 {
192 return _Nwire;
193}

◆ reAppendSalvage()

void FTSuperLayer::reAppendSalvage ( void  )

append segments which are not used for tracks to the list for salvage

Definition at line 440 of file FTSuperLayer.cxx.

441{
442 int n = _segments.length();
443 for (int i = 0; i^n; i++){
444 if (_segments[i]->track()) continue;
445 _complecated_segments->append(_segments[i]);
446 n = _segments.remove(i);
447 }
448}

◆ reduce_noise()

void FTSuperLayer::reduce_noise ( FTList< float >(&)  Estime[10])

calculate t0 and Chi2 from segment-fit in every superlayer

Definition at line 107 of file FTSuperLayer.cxx.

108{
109 // if(_superLayerId<5 || _superLayerId>9 ) return;
110 if( _superLayerId>9 ) return; // no need for the most outer SL
111
112 int n = _segments.length();
113 if(n>30) return;
114
115 float tdc[30][4]={0.},r[4]={0.},phi[4]={0.};
116 int wireId[4]={0};
117
118 IMdcGeomSvc* mdcGeomSvc;
119 StatusCode sc = Gaudi::svcLocator()->service("MdcGeomSvc", mdcGeomSvc);
120 // float size = mdcGeomSvc->Layer(0)->PCSiz();
121 float T1=0.5*0.1*(mdcGeomSvc->Layer(4*_superLayerId+0)->PCSiz())/0.004;
122 float T2=0.5*0.1*(mdcGeomSvc->Layer(4*_superLayerId+1)->PCSiz())/0.004;
123 float T3=0.5*0.1*(mdcGeomSvc->Layer(4*_superLayerId+2)->PCSiz())/0.004;
124 float T4=0.5*0.1*(mdcGeomSvc->Layer(4*_superLayerId+3)->PCSiz())/0.004;
125
126 for (int i = 0; i^n; i++){
127
128 float chi2=-99;
129 float t0c=0;
130
131 //float in_layerId=_segments[i]->innerBoundHits().first()->layer().layerId();
132 // float out_layerId=_segments[i]->outerBoundHits().first()->layer().layerId();
133 FTList<FTWire *>& hits=_segments[i]->wireHits();
134 // if(hits.length()>4) continue;
135
136 for(int j=0;j<hits.length();j++){
137 FTWire & h = *hits[j];
138
139 int layerId=h.layer().layerId();
140
141 /* if(wireId[layerId%4] == (h.localId()-1)||wireId[layerId%4]==(h.localId()+1)) {
142 tdc[i][layerId%4]=0;
143 break;
144 }*/
145
146 wireId[layerId%4]=h.localId();
147 phi[layerId%4]=h.phi();
148
149 // if(tdc[i][layerId%4] != (h.time())) continue;
150
151 tdc[i][layerId%4]=h.time();
152 r[layerId%4]=h.layer().r();
153 }
154 //// 4 cell
155
156 if(tdc[i][0]!=0 && tdc[i][1]!=0 && tdc[i][2]!=0 && tdc[i][3]!=0 && (wireId[0]==wireId[1]&& wireId[0]==wireId[2] && wireId[0]==wireId[3] || wireId[0]==wireId[1]-1 && wireId[0]==wireId[2]&& wireId[1]==wireId[3])){
157 // if(tdc[i][0]!=0 && tdc[i][1]!=0 && tdc[i][2]!=0 && tdc[i][3]!=0 &&( phi[0]<phi[1]&&phi[1]>phi[2]&&phi[2]<phi[3]||phi[0]>phi[1] && phi[1]<phi[2] && phi[2]>phi[3])){
158
159 float r0=r[0]-r[1]-(r[2]-r[1])/2;
160 float r1=-(r[2]-r[1])/2;
161 float r2=(r[2]-r[1])/2;
162 float r3=r[3]-r[2]+(r[2]-r[1])/2;
163
164 float t_i = tdc[i][0]+tdc[i][2];
165 float t_j = tdc[i][1]+tdc[i][3];
166 float l_j = T2+T4;
167 float r_i = r0+r2;
168 float r_j = r1+r3;
169 float r_2k= r0*r0+r1*r1+r2*r2+r3*r3;
170 float rt_i = r0*tdc[i][0]+r2*tdc[i][2];
171 float rt_j = r1*tdc[i][1]+r3*tdc[i][3];
172 float rl_j = r1*T2+r3*T4;
173
174 float deno= 4*r_2k-2*(r_i*r_i+r_j*r_j);
175
176 if (deno!=0){
177 float Pa=(4*(rt_i-rt_j+rl_j)-(t_i+t_j-l_j)*(r_i-r_j)-(t_i-t_j+l_j)*(r_i+r_j))/deno;
178 float Pb= 0.25*(t_i-t_j+l_j-(r_i+r_j) * Pa);
179 float Ang=fabs(90.-fabs(atan(Pa)*180./3.141593));
180
181 t0c = -0.25*((r_i-r_j)*Pa-t_i-t_j+l_j);
182
183 float pa1=(tdc[i][0]-tdc[i][2])/(r0-r2);
184 float pa2=(T4-T2-tdc[i][3]+tdc[i][1])/(r3-r1);
185
186 //// cout<<"t0c1: "<<-(tdc[i][0]-r0 *pa1 - 0.25*(t_i-t_j+l_j-(r_i+r_j)*pa1))<<endl;
187 //// cout<<"t0c2: "<<T2-tdc[i][1]-r1 *pa2 - 0.25*(t_i-t_j+l_j-(r_i+r_j)*pa2)<<endl;
188 //// cout<<"t0c3: "<<-(tdc[i][2]-r2 *pa1 - 0.25*(t_i-t_j+l_j-(r_i+r_j)*pa1))<<endl;
189 //// cout<<"t0c4: "<<T4-tdc[i][3]-r3 *pa2 - 0.25*(t_i-t_j+l_j-(r_i+r_j)*pa2)<<endl;
190
191 //// cout<<"t0c1,2,3,4: "<<-(tdc[i][0]-r0 * Pa-Pb)<<","<<(T2-tdc[i][1]-r1 * Pa-Pb)<<","<<-(tdc[i][2]-r2 * Pa-Pb)<<","<<(T4-tdc[i][3]-r3 * Pa-Pb)<<endl;
192
193 chi2=(tdc[i][0]-t0c-r0 * Pa-Pb)*(tdc[i][0]-t0c-r0 * Pa-Pb)+(T2-tdc[i][1]+t0c-r1 * Pa-Pb)*(T2-tdc[i][1]+t0c-r1 * Pa-Pb)+(tdc[i][2]-t0c-r2 * Pa-Pb)*(tdc[i][2]-t0c-r2 * Pa-Pb) + (T4-tdc[i][3]+t0c-r3 * Pa-Pb)*(T4-tdc[i][3]+t0c-r3 * Pa-Pb);
194
195 }
196 }
197 ////3 cell
198
199 /* else if(tdc[i][0]!=0 && tdc[i][1]!=0 && tdc[i][2]!=0 && (wireId[0]==wireId[1]-1||wireId[0]==wireId[1]) && wireId[2]==wireId[0]) {
200
201 //// else if(tdc[i][0]!=0 && tdc[i][1]!=0 && tdc[i][2]!=0 &&(phi[0]<phi[1] && phi[2]<phi[1] ||phi[0]>phi[1] && phi[2]>phi[1])){
202
203 float pa=-((r[0]+r[2]-2*r[1])*(tdc[i][0]+tdc[i][2])-2*(r[0]-r[1])*tdc[i][0]-2*(r[2]-r[1])*tdc[i][2])/((r[0]-r[2])*(r[0]-r[2]));
204 //float pa=(tdc[i][2]-tdc[i][0])/(r[2]-r[0]);
205 float pb=0.25*(tdc[i][0]-2*tdc[i][1]+tdc[i][2]+2.*T2-(r[0]+r[2]-2*r[1])*pa);
206 float Ang=fabs(90.-fabs(atan(pa)*180./3.141593));
207
208 t0c=-((r[0]+r[2]-2*r[1])*pa + 3.*pb - tdc[i][0]+tdc[i][1]-tdc[i][2]-T2);
209 //t0c=0.5*(tdc[i][1]+tdc[i][2]-(r[1]-r[2])*pa-T2);
210 chi2=(tdc[i][0]-t0c-pa*(r[0]-r[1])-pb)*(tdc[i][0]-t0c-pa*(r[0]-r[1])-pb)+(T2-tdc[i][1]+t0c-pb)*(T2-tdc[i][1]+t0c-pb)+(tdc[i][2]-t0c-pa*(r[2]-r[1])-pb)*(tdc[i][2]-t0c-pa*(r[2]-r[1])-pb);
211 }
212
213 else if(tdc[i][1]!=0 && tdc[i][2]!=0 && tdc[i][3]!=0 && (wireId[1]==wireId[2]||wireId[1]==wireId[2]+1) && wireId[3]==wireId[1]){
214 //// else if(tdc[i][1]!=0 && tdc[i][2]!=0 && tdc[i][3]!=0 &&(phi[1]<phi[2] && phi[3]<phi[2] ||phi[1]>phi[2] && phi[3]>phi[2])){
215
216 float pa=-((r[1]+r[3]-2*r[2])*(tdc[i][1]+tdc[i][3])-2*(r[1]-r[2])*tdc[i][1]-2*(r[3]-r[2])*tdc[i][3])/((r[1]-r[3])*(r[1]-r[3]));
217 float pb=0.25*(tdc[i][1]-2*tdc[i][2]+tdc[i][3]+2.*T3-(r[1]+r[3]-2*r[2])*pa);
218
219 t0c=-((r[1]+r[3]-2*r[2])*pa + 3.*pb - tdc[i][1]+tdc[i][2]-tdc[i][3]-T3);
220 chi2=(tdc[i][1]-t0c-pa*(r[1]-r[2])-pb)*(tdc[i][1]-t0c-pa*(r[1]-r[2])-pb)+(T3-tdc[i][2]+t0c-pb)*(T3-tdc[i][2]+t0c-pb)+(tdc[i][3]-t0c-pa*(r[3]-r[2])-pb)*(tdc[i][3]-t0c-pa*(r[3]-r[2])-pb);
221
222 }
223 */
224
225 // g_segmentchi2[_superLayerId][i]=chi2;
226 // g_t0c[_superLayerId][i]=t0c;
227
228 // if(_superLayerId>4 && chi2>0){
229 //cout<<"superLayer,t0c,chi2: "<<_superLayerId<<"["<<i<<"] : "<<t0c<<" , "<<chi2<<endl;
230 // }
231 // if(chi2<700 && _superLayerId>4 && chi2>-1){
232 if(chi2<(param->_chi2_segfit) && _superLayerId>4 && chi2>-1){
233 Estime[_superLayerId].append(t0c);
234 }
235 // if(chi2>0 && chi2<2000) continue;
236 // if (chi2<1000) continue;
237 continue;
238
239 _complecated_segments->append(_segments[i]);
240 for(int k=0;k<4;k++){
241 tdc[i][k]=0;
242 }
243 n = _segments.remove(i);
244 }
245}
const float r(void) const
returns r form origin
Definition: FTLayer.h:141
const int layerId(void) const
returns layer ID
Definition: FTLayer.h:112
static MdcParameter * param
Definition: FTSuperLayer.h:114
float phi(void) const
returns phi
Definition: FTWire.h:394
const FTLayer & layer(void) const
returns layer
Definition: FTWire.h:359
const int localId(void) const
returns local ID
Definition: FTWire.h:380
float time(void) const
rerurns TDC time(after t0 subtraction)
Definition: FTWire.h:457
virtual const MdcGeoLayer *const Layer(unsigned id)=0
double PCSiz(void) const
Definition: MdcGeoLayer.h:164
const float _chi2_segfit
Definition: MdcParameter.h:79

◆ segments()

FTList< FTSegment * > & FTSuperLayer::segments ( void  ) const
inline

returns segement list

Definition at line 215 of file FTSuperLayer.h.

215 {
216 return _segments;
217}

◆ superLayerId()

const int FTSuperLayer::superLayerId ( void  ) const
inline

returns super-layer ID

Definition at line 221 of file FTSuperLayer.h.

221 {
222 return _superLayerId;
223}

Referenced by FTSegment::examine().

◆ wireHits()

FTList< FTWire * > & FTSuperLayer::wireHits ( void  ) const
inline

returns wirehit list

Definition at line 185 of file FTSuperLayer.h.

185 {
186 return _wireHits;
187}

Member Data Documentation

◆ _maxDphi

const float FTSuperLayer::_maxDphi
static
Initial value:
=
{11.9, 9.72, 6.26, 4.86, 3.81, 2.37, 2.08, 1.76, 1.53, 2.33, 1.88}

Definition at line 116 of file FTSuperLayer.h.

Referenced by FTSegment::examine().

◆ param

MdcParameter * FTSuperLayer::param = MdcParameter::instance()
static

Definition at line 114 of file FTSuperLayer.h.

Referenced by reduce_noise().


The documentation for this class was generated from the following files: