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

#include <FTSuperLayer.h>

Public Member Functions

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

Static Public Attributes

static MdcParameterparam = MdcParameter::instance()
static const std::array< float, 11 > _maxDphi

Detailed Description

Definition at line 16 of file FTSuperLayer.h.

Constructor & Destructor Documentation

◆ FTSuperLayer()

FTSuperLayer::FTSuperLayer ( const int superLayerID,
const int firstLayerID,
const int firstWireID,
const int Nlayer,
const int NWire )

Constructors and destructor.

Definition at line 16 of file FTSuperLayer.cxx.

18 : _superLayerId( superLayerID )
19 , _complicated_segments( 0 )
20 , _wireHits( 0 )
21 , _singleHits( 0 )
22 , _segments( 0 )
23 , _firstLayerId( firstLayerID )
24 , _firstWireId( firstWireID )
25 , _Nlayer( Nlayer )
26 , _Nwire( NWire ) {}

◆ ~FTSuperLayer()

FTSuperLayer::~FTSuperLayer ( )
inline

Definition at line 21 of file FTSuperLayer.h.

21{ clear(); }
void clear()
clear object

Member Function Documentation

◆ appendHit()

void FTSuperLayer::appendHit ( FTWire * h)

append wireHit to the list of hits

Definition at line 36 of file FTSuperLayer.cxx.

36{ _wireHits.push_back( h ); }

◆ clear()

void FTSuperLayer::clear ( )

clear object

Definition at line 47 of file FTSuperLayer.cxx.

47 {
48 for ( auto w : _wireHits ) { w->state( FTWireHitInvalid ); }
49 _wireHits.clear();
50
51 _singleHits.clear();
52
53 // for ( auto s : _segments ) { delete s; }
54 _segments.clear();
55
56 for ( auto s : _complicated_segments ) { delete s; }
57 _complicated_segments.clear();
58}
double w
#define FTWireHitInvalid
Definition FTWire.h:4
XmlRpcServer s

Referenced by ~FTSuperLayer().

◆ complecated_segments()

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

returns complecated segments

Definition at line 35 of file FTSuperLayer.cxx.

35{ return _complicated_segments; }

◆ layerMaxId()

const int FTSuperLayer::layerMaxId ( ) const

returns layer max ID

Definition at line 32 of file FTSuperLayer.cxx.

32{ return ( _Nlayer - 1 ); }

◆ localMaxId()

const int FTSuperLayer::localMaxId ( ) const

returns local max ID

Definition at line 31 of file FTSuperLayer.cxx.

31{ return ( _Nwire - 1 ); }

◆ mkSegmentList()

void FTSuperLayer::mkSegmentList ( )

create segment lists

Definition at line 60 of file FTSuperLayer.cxx.

60 {
61 clustering();
62
63 FTList<FTSegment*> inner_short;
64 FTList<FTSegment*> outer_short;
65 FTList<FTSegment*> mid_short;
66
67 for ( auto it = _segments.begin(); it != _segments.end(); )
68 {
69 FTSegment* s = *it;
70
71 switch ( s->examine() )
72 {
73
74 case 0: // long simple
75 it++;
76 break;
77
78 case 1: // inner short
79 inner_short.push_back( s );
80 it = _segments.erase( it ); // "it" updated
81 break;
82
83 case 2: // outer short
84 outer_short.push_back( s );
85 it = _segments.erase( it ); // "it" updated
86 break;
87
88 case 3: // to be divided
89 _complicated_segments.push_back( s );
90 it = _segments.erase( it ); // "it" updated
91 break;
92
93 default:
94 mid_short.push_back( s );
95 it = _segments.erase( it ); // "it" updated
96 break;
97 }
98
99 // make sure that "it" has been updated
100 }
101
102 connect_short_segments( inner_short, outer_short );
103 connect_singleHit( inner_short );
104 connect_singleHit( outer_short );
105 connect_singleHit( mid_short );
106
107 for ( auto i : _segments )
108 {
109 i->update();
110
111#ifndef OnlineMode
112 i->printout();
113#endif
114 }
115}
std::vector< T >::iterator erase(typename std::vector< T >::iterator it)
Definition FTList.h:10

◆ nLayer()

const int FTSuperLayer::nLayer ( ) const

returns number of layers

Definition at line 30 of file FTSuperLayer.cxx.

30{ return _Nlayer; }

◆ nWire()

const int FTSuperLayer::nWire ( ) const

returns number of wires

Definition at line 29 of file FTSuperLayer.cxx.

29{ return _Nwire; }

◆ reAppendSalvage()

void FTSuperLayer::reAppendSalvage ( )

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

Definition at line 424 of file FTSuperLayer.cxx.

424 {
425 for ( auto it = _segments.begin(); it != _segments.end(); )
426 {
427 if ( ( *it )->track() ) it++;
428 else
429 {
430 _complicated_segments.push_back( *it );
431 it = _segments.erase( it );
432 }
433 }
434}

◆ reduce_noise()

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

calculate t0 and Chi2 from segment-fit in every superlayer

Definition at line 117 of file FTSuperLayer.cxx.

117 {
118 if ( _superLayerId > 9 ) return;
119 if ( _segments.size() > 30 ) return;
120
121 float tdc[30][4] = { 0 };
122 float r[4] = { 0 };
123 float phi[4] = { 0 };
124 int wireId[4] = { 0 };
125
126 IMdcGeomSvc* mdcGeomSvc;
127 StatusCode sc = Gaudi::svcLocator()->service( "MdcGeomSvc", mdcGeomSvc );
128
129 float T1 = 0.5 * 0.1 * ( mdcGeomSvc->Layer( 4 * _superLayerId + 0 )->PCSiz() ) / 0.004;
130 float T2 = 0.5 * 0.1 * ( mdcGeomSvc->Layer( 4 * _superLayerId + 1 )->PCSiz() ) / 0.004;
131 float T3 = 0.5 * 0.1 * ( mdcGeomSvc->Layer( 4 * _superLayerId + 2 )->PCSiz() ) / 0.004;
132 float T4 = 0.5 * 0.1 * ( mdcGeomSvc->Layer( 4 * _superLayerId + 3 )->PCSiz() ) / 0.004;
133
134 auto seg_it = _segments.begin();
135 for ( int i = 0; seg_it != _segments.end(); seg_it++, i++ )
136 {
137 float chi2 = -99;
138 float t0c = 0;
139
140 FTList<FTWire*>& hits = ( *seg_it )->wireHits();
141
142 for ( auto h : hits )
143 {
144
145 const int layerId = h->layer()->layerId();
146
147 wireId[layerId % 4] = h->localId();
148 phi[layerId % 4] = h->phi();
149
150 tdc[i][layerId % 4] = h->time();
151 r[layerId % 4] = h->layer()->r();
152 }
153
154 if ( tdc[i][0] != 0 && tdc[i][1] != 0 && tdc[i][2] != 0 && tdc[i][3] != 0 &&
155 ( wireId[0] == wireId[1] && wireId[0] == wireId[2] && wireId[0] == wireId[3] ||
156 wireId[0] == wireId[1] - 1 && wireId[0] == wireId[2] && wireId[1] == wireId[3] ) )
157 {
158 float r0 = r[0] - r[1] - ( r[2] - r[1] ) / 2;
159 float r1 = -( r[2] - r[1] ) / 2;
160 float r2 = ( r[2] - r[1] ) / 2;
161 float r3 = r[3] - r[2] + ( r[2] - r[1] ) / 2;
162
163 float t_i = tdc[i][0] + tdc[i][2];
164 float t_j = tdc[i][1] + tdc[i][3];
165 float l_j = T2 + T4;
166 float r_i = r0 + r2;
167 float r_j = r1 + r3;
168 float r_2k = r0 * r0 + r1 * r1 + r2 * r2 + r3 * r3;
169 float rt_i = r0 * tdc[i][0] + r2 * tdc[i][2];
170 float rt_j = r1 * tdc[i][1] + r3 * tdc[i][3];
171 float rl_j = r1 * T2 + r3 * T4;
172
173 float deno = 4 * r_2k - 2 * ( r_i * r_i + r_j * r_j );
174
175 if ( deno != 0 )
176 {
177 float Pa = ( 4 * ( rt_i - rt_j + rl_j ) - ( t_i + t_j - l_j ) * ( r_i - r_j ) -
178 ( t_i - t_j + l_j ) * ( r_i + r_j ) ) /
179 deno;
180 float Pb = 0.25 * ( t_i - t_j + l_j - ( r_i + r_j ) * Pa );
181 float Ang = fabs( 90. - fabs( atan( Pa ) * 180. / 3.141593 ) );
182
183 t0c = -0.25 * ( ( r_i - r_j ) * Pa - t_i - t_j + l_j );
184
185 float pa1 = ( tdc[i][0] - tdc[i][2] ) / ( r0 - r2 );
186 float pa2 = ( T4 - T2 - tdc[i][3] + tdc[i][1] ) / ( r3 - r1 );
187
188 chi2 =
189 ( tdc[i][0] - t0c - r0 * Pa - Pb ) * ( tdc[i][0] - t0c - r0 * Pa - Pb ) +
190 ( T2 - tdc[i][1] + t0c - r1 * Pa - Pb ) * ( T2 - tdc[i][1] + t0c - r1 * Pa - Pb ) +
191 ( tdc[i][2] - t0c - r2 * Pa - Pb ) * ( tdc[i][2] - t0c - r2 * Pa - Pb ) +
192 ( T4 - tdc[i][3] + t0c - r3 * Pa - Pb ) * ( T4 - tdc[i][3] + t0c - r3 * Pa - Pb );
193 }
194 }
195
196 if ( chi2 < ( param->_chi2_segfit ) && _superLayerId > 4 && chi2 > -1 )
197 { Estime[_superLayerId].push_back( t0c ); }
198
199 // continue; // FIXME
200 // _complicated_segments.push_back( _segments[i] );
201 // for ( int k = 0; k < 4; k++ ) { tdc[i][k] = 0; }
202 // n = _segments.remove( i );
203 }
204}
static MdcParameter * param
virtual const MdcGeoLayer *const Layer(unsigned id)=0

◆ segments()

FTList< FTSegment * > & FTSuperLayer::segments ( )

returns segement list

Definition at line 33 of file FTSuperLayer.cxx.

33{ return _segments; }

◆ superLayerId()

const int FTSuperLayer::superLayerId ( ) const

returns super-layer ID

Definition at line 34 of file FTSuperLayer.cxx.

34{ return _superLayerId; }

◆ wireHits()

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

returns wirehit list

Definition at line 28 of file FTSuperLayer.cxx.

28{ return _wireHits; }

Member Data Documentation

◆ _maxDphi

const std::array< float, 11 > 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 44 of file FTSuperLayer.h.

Referenced by FTSegment::examine().

◆ param

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

Definition at line 64 of file FTSuperLayer.h.

Referenced by reduce_noise().


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