BOSS 7.0.9
BESIII Offline Software System
Loading...
Searching...
No Matches
TMDCWire Class Reference

A class to represent a wire in MDC. More...

#include <TMDCWire.h>

Public Member Functions

 TMDCWire (const MdcGeoWire *, TMDCLayer *)
 Constructor.
 
virtual ~TMDCWire ()
 Destructor.
 
unsigned id (void) const
 returns id.
 
unsigned localId (void) const
 returns local id in a wire layer.
 
unsigned layerId (void) const
 returns layer id.
 
unsigned localLayerId (void) const
 returns local layer id in a super layer.
 
unsigned superLayerId (void) const
 returns super layer id.
 
unsigned axialStereoLayerId (void) const
 returns id of axial or stereo id.
 
const MdcGeoWiregeocdc (void) const
 returns a pointer to GEOMDC_WIR.
 
const TMDCLayer *const layer (void) const
 returns a pointer to a layer.
 
const TMDCWireHit *const hit (void) const
 returns a pointer to a TMDCWireHit.
 
const TMDCTsf *const tsf (void) const
 returns a pointer to a TMDCTsf.
 
unsigned state (void) const
 returns state.
 
bool axial (void) const
 returns true if this wire is in an axial layer.
 
bool stereo (void) const
 returns true if this wire is in a stereo layer.
 
bool innerPart (void) const
 returns true if this wire is in the inner part.
 
bool mainPart (void) const
 returns true if this wire is in the main part.
 
const TMDCWire *const neighbor (unsigned) const
 returns a pointer to a neighbor wire.
 
bool consective (const TMDCWire &) const
 returns true if a given wire is consective in a layer.
 
bool adjacent (const TMDCWire &) const
 returns true if a given wire is adjacent.
 
int localIdForPlus (void) const
 returns localId but if maxLocalId, return -1.
 
int localIdForMinus (void) const
 returns localId but if 0, return maxLocalId + 1.
 
const HepPoint3DforwardPosition (void) const
 returns position in forward endplate.
 
const HepPoint3DbackwardPosition (void) const
 returns position in backward endplate.
 
double * backwardPosition (double p[3]) const
 
const double & tension (void) const
 
const HepPoint3DxyPosition (void) const
 returns middle position of a wire. z componet is 0.
 
double * xyPosition (double p[3]) const
 
const HepPoint3D xyPosition (double z) const
 
const HepVector3Ddirection (void) const
 returns direction vector of the wire.
 
void wirePosition (float zPosition, HepPoint3D &xyPosition, HepPoint3D &backwardPosition, HepVector3D &direction) const
 calculates position and direction vector with sag correction.
 
float cellSize (void) const
 returns cell size in phi.
 
int localIdDifference (const TMDCWire &) const
 returns local id difference.
 
std::string name (void) const
 returns name.
 
void dump (const std::string &message=std::string(""), const std::string &prefix=std::string("")) const
 dumps debug information.
 
const TMDCWireHit *const hit (const TMDCWireHit *const)
 sets a pointer to TMDCWireHit.
 
const TMDCWireHitMC *const hit (TMDCWireHitMC *const)
 appends a pointer to TMDCWireHitMC.
 
TMDCTsftsf (TMDCTsf *)
 sets a pointer of TMDCTsf.
 
unsigned state (unsigned newState)
 sets state.
 
void clear (void)
 clears information.
 

Detailed Description

A class to represent a wire in MDC.

Definition at line 55 of file TMDCWire.h.

Constructor & Destructor Documentation

◆ TMDCWire()

TMDCWire::TMDCWire ( const MdcGeoWire w,
TMDCLayer l 
)

Constructor.

Definition at line 32 of file TMDCWire.cxx.

33: _forwardPosition(w->Backward()*0.1),
34 _backwardPosition(w->Forward()*0.1),
35 _tension(w->Tension()),
36 _direction(w->Backward() -w->Forward()) {
37//: _forwardPosition(w->Forward()*0.1),
38// _backwardPosition(w->Backward()*0.1),
39// _direction(w->Forward() - w->Backward()) {
40 _state = 0;
41 _geo = w;
42 _id = w->Id();
43 _localId = w->Cell();
44 _layerId = w->Layer();
45 _layer = l;
46 _tsf = 0;
47 _hit = 0;
48 _xyPosition = 0.5 * (_forwardPosition + _backwardPosition);
49 _xyPosition.setZ(0.);
50 _direction = _direction.unit();
51}

◆ ~TMDCWire()

TMDCWire::~TMDCWire ( )
virtual

Destructor.

Definition at line 53 of file TMDCWire.cxx.

53 {
54}

Member Function Documentation

◆ adjacent()

bool TMDCWire::adjacent ( const TMDCWire w) const
inline

returns true if a given wire is adjacent.

Definition at line 403 of file TMDCWire.h.

403 {
404 for (unsigned i = 0; i < 6; i++)
405 if (neighbor(i) == & w)
406 return true;
407 return false;
408}
const TMDCWire *const neighbor(unsigned) const
returns a pointer to a neighbor wire.
Definition: TMDCWire.cxx:95

◆ axial()

bool TMDCWire::axial ( void  ) const
inline

returns true if this wire is in an axial layer.

Definition at line 348 of file TMDCWire.h.

348 {
349 return _layer->axial();
350}
bool axial(void) const
returns true if this is an axial layer.
Definition: TMDCLayer.h:145

Referenced by name().

◆ axialStereoLayerId()

unsigned TMDCWire::axialStereoLayerId ( void  ) const
inline

returns id of axial or stereo id.

Definition at line 360 of file TMDCWire.h.

360 {
361 return _layer->axialStereoLayerId();
362}
unsigned axialStereoLayerId(void) const
returns id of axial or stereo id.
Definition: TMDCLayer.h:163

Referenced by TConformalFinder0::findSegments().

◆ backwardPosition() [1/2]

double * TMDCWire::backwardPosition ( double  p[3]) const
inline

Definition at line 318 of file TMDCWire.h.

318 {
319 p[0] = _backwardPosition.x();
320 p[1] = _backwardPosition.y();
321 p[2] = _backwardPosition.z();
322 return p;
323}

◆ backwardPosition() [2/2]

const HepPoint3D & TMDCWire::backwardPosition ( void  ) const
inline

returns position in backward endplate.

Definition at line 306 of file TMDCWire.h.

306 {
307 return _backwardPosition;
308}

Referenced by TBuilder::initialLine(), TBuilder::initialLineOld(), TTrack::stereoHitForCurl(), and TTrack::szPosition().

◆ cellSize()

float TMDCWire::cellSize ( void  ) const
inline

returns cell size in phi.

Definition at line 380 of file TMDCWire.h.

380 {
381 if (_layer) {
382 return _layer->cellSize();
383 }
384 else {
385#ifdef TRKRECO_DEBUG
386 std::cout << "TMDCWire::cellSize !!! can't return cell size";
387 std::cout << " because no pointer to a layer" << std::endl;
388#endif
389 return 0.;
390 }
391}
float cellSize(void) const
returns cell size.
Definition: TMDCLayer.h:169

◆ clear()

void TMDCWire::clear ( void  )
inline

clears information.

Definition at line 273 of file TMDCWire.h.

273 {
274 _state = 0;
275 _hit = 0;
276 _mcHits.removeAll();
277}

◆ consective()

bool TMDCWire::consective ( const TMDCWire w) const
inline

returns true if a given wire is consective in a layer.

Definition at line 395 of file TMDCWire.h.

395 {
396 if (neighbor(2) == & w) return true;
397 else if (neighbor(3) == & w) return true;
398 return false;
399}

◆ direction()

const HepVector3D & TMDCWire::direction ( void  ) const
inline

returns direction vector of the wire.

Definition at line 342 of file TMDCWire.h.

342 {
343 return _direction;
344}

Referenced by TCosmicFitter::fit(), TTrack::stereoHitForCurl(), and TTrack::szPosition().

◆ dump()

void TMDCWire::dump ( const std::string &  message = std::string(""),
const std::string &  prefix = std::string("") 
) const

dumps debug information.

Definition at line 57 of file TMDCWire.cxx.

57 {
58 std::cout << pre;
59 std::cout << "w " << _id;
60 std::cout << ",local " << _localId;
61 std::cout << ",layer " << _layerId;
62 std::cout << ",super layer " << superLayerId();
63 std::cout << ",local layer " << localLayerId();
64 std::cout << std::endl;
65 if (msg.find("neighbor") != std::string::npos || msg.find("detail") != std::string::npos) {
66 for (unsigned i = 0; i < 6; i++)
67 if (neighbor(i))
68 neighbor(i)->dump("", pre + itostring(i) + " ");
69 }
70 if (msg.find("tsf") != std::string::npos || msg.find("detail") != std::string::npos) {
71 if (_tsf) _tsf->dump("", pre + " ");
72 }
73}
void dump(const std::string &message=std::string(""), const std::string &prefix=std::string("")) const
dumps debug information.
Definition: TMDCTsf.cxx:72
unsigned localLayerId(void) const
returns local layer id in a super layer.
Definition: TMDCWire.h:231
unsigned superLayerId(void) const
returns super layer id.
Definition: TMDCWire.h:225
void dump(const std::string &message=std::string(""), const std::string &prefix=std::string("")) const
dumps debug information.
Definition: TMDCWire.cxx:57

Referenced by dump().

◆ forwardPosition()

const HepPoint3D & TMDCWire::forwardPosition ( void  ) const
inline

returns position in forward endplate.

Definition at line 300 of file TMDCWire.h.

300 {
301 return _forwardPosition;
302}

Referenced by TBuilder::initialLine(), TBuilder::initialLineOld(), TTrack::stereoHitForCurl(), and TTrack::szPosition().

◆ geocdc()

const MdcGeoWire * TMDCWire::geocdc ( void  ) const
inline

returns a pointer to GEOMDC_WIR.

Definition at line 237 of file TMDCWire.h.

237 {
238 return _geo;
239}

◆ hit() [1/3]

const TMDCWireHit *const TMDCWire::hit ( const TMDCWireHit * const  h)
inline

sets a pointer to TMDCWireHit.

Definition at line 281 of file TMDCWire.h.

281 {
282 return _hit = h;
283}

◆ hit() [2/3]

const TMDCWireHitMC *const TMDCWire::hit ( TMDCWireHitMC * const  a)
inline

appends a pointer to TMDCWireHitMC.

Definition at line 293 of file TMDCWire.h.

293 {
294 _mcHits.append(a);
295 return a;
296}

◆ hit() [3/3]

const TMDCWireHit *const TMDCWire::hit ( void  ) const
inline

returns a pointer to a TMDCWireHit.

Definition at line 287 of file TMDCWire.h.

287 {
288 return _hit;
289}

Referenced by TMDC::classification().

◆ id()

unsigned TMDCWire::id ( void  ) const
inline

returns id.

Definition at line 207 of file TMDCWire.h.

207 {
208 return _id;
209}

Referenced by TBuilderCurl::buildStereo(), TMDC::driftDistance(), TRungeFitter::fit(), TMDC::updateMC(), and wirePosition().

◆ innerPart()

bool TMDCWire::innerPart ( void  ) const
inline

returns true if this wire is in the inner part.

Definition at line 366 of file TMDCWire.h.

366 {
367 if (_layerId < 14) return true;
368 return false;
369}

◆ layer()

const TMDCLayer *const TMDCWire::layer ( void  ) const
inline

returns a pointer to a layer.

Definition at line 243 of file TMDCWire.h.

243 {
244 return _layer;
245}

Referenced by TBuilder0::buildStereo(), and localIdDifference().

◆ layerId()

◆ localId()

◆ localIdDifference()

int TMDCWire::localIdDifference ( const TMDCWire a) const

returns local id difference.

Definition at line 577 of file TMDCWire.cxx.

577 {
578
579#ifdef TRKRECO_DEBUG_DETAIL
580 if (superLayerId() != a.superLayerId()) {
581 std::cout << "TMDCWire::localIdDifference !!!";
582 std::cout << "super layer assumption violation" << std::endl;
583 }
584#endif
585
586 int diff = int(a.localId()) - int(localId());
587 unsigned nWires = layer()->nWires();
588 if (diff > 0) {
589 int difR = nWires - diff;
590 if (diff < difR) return diff;
591 else return - difR;
592 }
593 else {
594 int difR = nWires + diff;
595 if (- diff < difR) return diff;
596 else return difR;
597 }
598}
unsigned nWires(void) const
returns # of wires.
Definition: TMDCLayer.h:139
const TMDCLayer *const layer(void) const
returns a pointer to a layer.
Definition: TMDCWire.h:243
unsigned localId(void) const
returns local id in a wire layer.
Definition: TMDCWire.h:213

◆ localIdForMinus()

int TMDCWire::localIdForMinus ( void  ) const

returns localId but if 0, return maxLocalId + 1.

Definition at line 355 of file TMDCWire.cxx.

355 {
356/*
357 if(_layerId >= 0 && _layerId <= 5){
358 if(_localId == 0)
359 return 64;
360 else return _localId;
361 }
362
363 if(_layerId >= 6 && _layerId <= 8){
364 if(_localId == 0)
365 return 80;
366 else return _localId;
367 }
368
369 if(_layerId >= 9 && _layerId <= 14){
370 if(_localId == 0)
371 return 96;
372 else return _localId;
373 }
374
375 if(_layerId >= 15 && _layerId <= 17){
376 if(_localId == 0)
377 return 128;
378 else return _localId;
379 }
380
381 if(_layerId >= 18 && _layerId <= 22){
382 if(_localId == 0)
383 return 144;
384 else return _localId;
385 }
386
387 if(_layerId >= 23 && _layerId <= 26){
388 if(_localId == 0)
389 return 160;
390 else return _localId;
391 }
392
393 if(_layerId >= 27 && _layerId <= 31){
394 if(_localId == 0)
395 return 192;
396 else return _localId;
397 }
398
399 if(_layerId >= 32 && _layerId <= 35){
400 if(_localId == 0)
401 return 208;
402 else return _localId;
403 }
404
405 if(_layerId >= 36 && _layerId <= 40){
406 if(_localId == 0)
407 return 240;
408 else return _localId;
409 }
410
411 if(_layerId >= 41 && _layerId <= 44){
412 if(_localId == 0)
413 return 256;
414 else return _localId;
415 }
416
417 if(_layerId >= 45){
418 if(_localId == 0)
419 return 288;
420 else return _localId;
421 }
422*/
423//Liuqg 060915
424 if(_layerId == 0){
425 if(_localId == 0)
426 return 40;
427 else return _localId;
428 }
429
430 if(_layerId == 1){
431 if(_localId == 0)
432 return 44;
433 else return _localId;
434 }
435
436 if(_layerId == 2){
437 if(_localId == 0)
438 return 48;
439 else return _localId;
440 }
441
442 if(_layerId == 3){
443 if(_localId == 0)
444 return 56;
445 else return _localId;
446 }
447
448 if(_layerId == 4){
449 if(_localId == 0)
450 return 64;
451 else return _localId;
452 }
453
454 if(_layerId == 5){
455 if(_localId == 0)
456 return 72;
457 else return _localId;
458 }
459
460 if(_layerId == 6 || _layerId == 7){
461 if(_localId == 0)
462 return 80;
463 else return _localId;
464 }
465
466 if(_layerId == 8 || _layerId == 9){
467 if(_localId == 0)
468 return 76;
469 else return _localId;
470 }
471
472 if(_layerId == 10 || _layerId == 11){
473 if(_localId == 0)
474 return 88;
475 else return _localId;
476 }
477
478 if(_layerId == 12 || _layerId == 13){
479 if(_localId == 0)
480 return 100;
481 else return _localId;
482 }
483
484 if(_layerId == 14 || _layerId == 15){
485 if(_localId == 0)
486 return 112;
487 else return _localId;
488 }
489
490 if(_layerId == 16 || _layerId == 17){
491 if(_localId == 0)
492 return 128;
493 else return _localId;
494 }
495
496 if(_layerId == 18 || _layerId == 19){
497 if(_localId == 0)
498 return 140;
499 else return _localId;
500 }
501
502 if(_layerId >= 20 && _layerId <= 23){
503 if(_localId == 0)
504 return 160;
505 else return _localId;
506 }
507
508 if(_layerId >= 24 && _layerId <= 27){
509 if(_localId == 0)
510 return 176;
511 else return _localId;
512 }
513
514 if(_layerId >= 28 && _layerId <= 31){
515 if(_localId == 0)
516 return 208;
517 else return _localId;
518 }
519
520 if(_layerId >= 32 && _layerId <= 35){
521 if(_localId == 0)
522 return 240;
523 else return _localId;
524 }
525
526 if(_layerId >= 36 && _layerId <= 39){
527 if(_localId == 0)
528 return 256;
529 else return _localId;
530 }
531
532 if(_layerId >= 40 && _layerId <= 42){
533 if(_localId == 0)
534 return 288;
535 else return _localId;
536 }
537 return -1;
538}

◆ localIdForPlus()

int TMDCWire::localIdForPlus ( void  ) const

returns localId but if maxLocalId, return -1.

Definition at line 166 of file TMDCWire.cxx.

166 {
167/*
168 if(_layerId >= 0 && _layerId <= 5){
169 if(_localId == 63)
170 return -1;
171 else return _localId;
172 }
173
174 if(_layerId >= 6 && _layerId <= 8){
175 if(_localId == 79)
176 return -1;
177 else return _localId;
178 }
179
180 if(_layerId >= 9 && _layerId <= 14){
181 if(_localId == 95)
182 return -1;
183 else return _localId;
184 }
185
186 if(_layerId >= 15 && _layerId <= 17){
187 if(_localId == 127)
188 return -1;
189 else return _localId;
190 }
191
192 if(_layerId >= 18 && _layerId <= 22){
193 if(_localId == 143)
194 return -1;
195 else return _localId;
196 }
197
198 if(_layerId >= 23 && _layerId <= 26){
199 if(_localId == 159)
200 return -1;
201 else return _localId;
202 }
203
204 if(_layerId >= 27 && _layerId <= 31){
205 if(_localId == 175)
206 return -1;
207 else return _localId;
208 }
209
210 if(_layerId >= 32 && _layerId <= 35){
211 if(_localId == 207)
212 return -1;
213 else return _localId;
214 }
215
216 if(_layerId >= 36 && _layerId <= 40){
217 if(_localId == 239)
218 return -1;
219 else return _localId;
220 }
221
222 if(_layerId >= 41 && _layerId <= 44){
223 if(_localId == 255)
224 return -1;
225 else return _localId;
226 }
227
228 if(_layerId >= 45){
229 if(_localId == 287)
230 return -1;
231 else return _localId;
232 }
233
234 return -1;
235*/
236//Liuqg 060915
237 if(_layerId == 0){
238 if(_localId == 39)
239 return -1;
240 else return _localId;
241 }
242
243 if(_layerId == 1){
244 if(_localId == 43)
245 return -1;
246 else return _localId;
247 }
248
249 if(_layerId == 2){
250 if(_localId == 47)
251 return -1;
252 else return _localId;
253 }
254
255 if(_layerId == 3){
256 if(_localId == 55)
257 return -1;
258 else return _localId;
259 }
260
261 if(_layerId == 4){
262 if(_localId == 63)
263 return -1;
264 else return _localId;
265 }
266
267 if(_layerId == 5){
268 if(_localId == 71)
269 return -1;
270 else return _localId;
271 }
272
273 if(_layerId == 6 || _layerId == 7){
274 if(_localId == 79)
275 return -1;
276 else return _localId;
277 }
278
279 if(_layerId == 8 || _layerId == 9){
280 if(_localId == 75)
281 return -1;
282 else return _localId;
283 }
284
285 if(_layerId == 10 || _layerId == 11){
286 if(_localId == 87)
287 return -1;
288 else return _localId;
289 }
290
291 if(_layerId == 12 || _layerId == 13){
292 if(_localId == 99)
293 return -1;
294 else return _localId;
295 }
296
297 if(_layerId == 14 || _layerId == 15){
298 if(_localId == 111)
299 return -1;
300 else return _localId;
301 }
302
303 if(_layerId == 16 || _layerId == 17){
304 if(_localId == 127)
305 return -1;
306 else return _localId;
307 }
308
309 if(_layerId == 18 || _layerId == 19){
310 if(_localId == 139)
311 return -1;
312 else return _localId;
313 }
314
315 if(_layerId >= 20 && _layerId <= 23){
316 if(_localId == 159)
317 return -1;
318 else return _localId;
319 }
320
321 if(_layerId >= 24 && _layerId <= 27){
322 if(_localId == 175)
323 return -1;
324 else return _localId;
325 }
326
327 if(_layerId >= 28 && _layerId <= 31){
328 if(_localId == 207)
329 return -1;
330 else return _localId;
331 }
332
333 if(_layerId >= 32 && _layerId <= 35){
334 if(_localId == 239)
335 return -1;
336 else return _localId;
337 }
338
339 if(_layerId >= 36 && _layerId <= 39){
340 if(_localId == 255)
341 return -1;
342 else return _localId;
343 }
344
345 if(_layerId >= 40 && _layerId <= 42){
346 if(_localId == 287)
347 return -1;
348 else return _localId;
349 }
350
351 return -1;
352}

◆ localLayerId()

unsigned TMDCWire::localLayerId ( void  ) const
inline

returns local layer id in a super layer.

Definition at line 231 of file TMDCWire.h.

231 {
232 return _layer->localLayerId();
233}
unsigned localLayerId(void) const
returns local layer id in a super layer.
Definition: TMDCLayer.h:121

Referenced by TSegmentCurl::append(), TMDCTsf::createTsf(), dump(), TSegmentCurl::remove(), and TSegment::splitTsf().

◆ mainPart()

bool TMDCWire::mainPart ( void  ) const
inline

returns true if this wire is in the main part.

Definition at line 373 of file TMDCWire.h.

373 {
374 if (_layerId > 13) return true;
375 return false;
376}

◆ name()

std::string TMDCWire::name ( void  ) const
inline

returns name.

Definition at line 412 of file TMDCWire.h.

412 {
413 if (axial())
414 return itostring(_layerId) + std::string("-") + itostring(_localId);
415 return itostring(_layerId) + std::string("=") + itostring(_localId);
416}
bool axial(void) const
returns true if this wire is in an axial layer.
Definition: TMDCWire.h:348

Referenced by TTrackBase::append(), TTrack::assign(), TBuilder0::buildRphi(), TBuilder0::buildStereo(), TTrackManager::divide(), Dump(), TMDCWireHit::dump(), TTrackManager::salvage(), and TTrackManager::salvageAssociateHits().

◆ neighbor()

const TMDCWire *const TMDCWire::neighbor ( unsigned  i) const

returns a pointer to a neighbor wire.

Definition at line 95 of file TMDCWire.cxx.

95 {
96 if (_cdc == 0) _cdc = TMDC::getTMDC();
97 static const unsigned nLayers = _cdc->nLayers();
98
99 //...Expensive...
100 unsigned l = layerId();
101 int local = (int) localId();
102 float phi0 = _cdc->layer(l)->offset();
103 int nWir = (int) _cdc->layer(l)->nWires();
104 float phi = phi0 + local*2*pi/nWir;
105 unsigned s = superLayerId();
106// cout<<"i:"<<i<<" layerId:"<<l<<" local:"<<local<<" nWire:"<<nWir<<" superLyrId:"<<s<<endl;
107
108 if (i == WireInnerLeft || i == WireInnerRight) {
109 if (l == 0) return 0;
110 --l;
111 if (_cdc->layer(l)->superLayerId() != s) return 0;
112 phi0 = _cdc->layer(l)->offset();
113 nWir = _cdc->layer(l)->nWires();
114 local = (int)((phi-phi0)/(2*pi/nWir));
115
116// cout<<"inner local"<<local<<", "<<local+1<<endl;
117
118// cout<<(phi-phi0)/(2*pi/nWir)<<" local:"<<local<<endl;
119// cout<<"InnerLeft phi:"<<phi0 + local*2*pi/nWir
120// <<" InnerRight phi:"<<phi0 + (local+1)*2*pi/nWir
121// <<" phi:"<<phi<<endl;
122// if(local<0 || local+1>nWir-1)
123// cout<<"TMDCWire::neighbor()---Pay attation the cellNo !!!"<<endl
124// <<l+1<<"th layer: InnerLeftRight, local:"<<local<<" local+1:"<<local+1<<endl;
125// LR changed to bes3
126 if (i == WireInnerLeft) return _cdc->wire(l, local);
127 else return _cdc->wire(l, local + 1);
128// if (i == WireInnerRight) return _cdc->wire(l, local);
129// else return _cdc->wire(l, local + 1);
130
131 }
132 else if (i == WireLeft || i == WireRight) {
133// cout<<"Left phi:"<<phi0 + (local-1)*2*pi/nWir
134// <<" Right phi:"<<phi0 + (local+1)*2*pi/nWir
135// <<" phi:"<<phi<<endl;
136// if(local-1<0 || local+1>nWir-1)
137// cout<<"TMDCWire::neighbor()---Pay attation the Cell No !!!"<<endl
138// <<l<<"th layer: LeftRight, local-1:"<<local-1<<" local+1:"<<local+1<<endl;
139 if (i == WireLeft) return _cdc->wire(l, local - 1);
140 else return _cdc->wire(l, local + 1);
141 }
142 else if (i == WireOuterLeft || i == WireOuterRight) {
143 if (l == nLayers - 1) return 0;
144 ++l;
145 if (_cdc->layer(l)->superLayerId() != s) return 0;
146 phi0 = _cdc->layer(l)->offset();
147 nWir = _cdc->layer(l)->nWires();
148 local = (int)((phi-phi0)/(2*pi/nWir));
149
150// cout<<"outer local"<<local<<", "<<local+1<<endl;
151
152// cout<<(phi-phi0)/(2*pi/nWir)<<" local:"<<local<<endl;
153// cout<<"OuterLeft phi:"<<phi0 + local*2*pi/nWir
154// <<" OuterRight phi:"<<phi0 + (local+1)*2*pi/nWir
155// <<" phi:"<<phi<<endl;
156// if(local<0 || local+1>nWir-1)
157// cout<<"TMDCWire::neighbor()---Pay attation the Cell No !!!"<<endl
158// <<l-1<<"th layer: OuterLeftRight, local:"<<local<<" local+1:"<<local+1<<endl;
159 if (i == WireOuterLeft) return _cdc->wire(l, local);
160 else return _cdc->wire(l, local + 1);
161 }
162 return 0;
163}
XmlRpcServer s
Definition: HelloServer.cpp:11
#define WireInnerRight
Definition: TMDCWire.h:41
#define WireLeft
Definition: TMDCWire.h:42
#define WireRight
Definition: TMDCWire.h:43
#define WireInnerLeft
Definition: TMDCWire.h:40
#define WireOuterRight
Definition: TMDCWire.h:45
#define WireOuterLeft
Definition: TMDCWire.h:44
unsigned superLayerId(void) const
returns super layer id.
Definition: TMDCLayer.h:115
float offset(void) const
returns offset.
Definition: TMDCLayer.h:133
unsigned layerId(void) const
returns layer id.
Definition: TMDCWire.h:219
const TMDCWire *const wire(unsigned wireId) const
returns a pointer to a wire. 0 will be returned if 'wireId' is invalid.
Definition: TMDC.h:277
unsigned nLayers(void) const
Definition: TMDC.h:322
static TMDC * getTMDC(void)
Definition: TMDC.cxx:95
const TMDCLayer *const layer(unsigned id) const
returns a pointer to a layer. 0 will be returned if 'id' is invalid.
Definition: TMDC.h:259
const float pi
Definition: vector3.h:133

Referenced by adjacent(), TMDC::classification(), consective(), and dump().

◆ state() [1/2]

unsigned TMDCWire::state ( unsigned  newState)
inline

sets state.

Definition at line 267 of file TMDCWire.h.

267 {
268 return _state = a;
269}

◆ state() [2/2]

unsigned TMDCWire::state ( void  ) const
inline

returns state.

Definition at line 261 of file TMDCWire.h.

261 {
262 return _state;
263}

◆ stereo()

bool TMDCWire::stereo ( void  ) const
inline

returns true if this wire is in a stereo layer.

Definition at line 354 of file TMDCWire.h.

354 {
355 return _layer->stereo();
356}
bool stereo(void) const
returns true if this is a stereo layer.
Definition: TMDCLayer.h:154

Referenced by TCosmicFitter::fit(), and TTrackManager::makeTds().

◆ superLayerId()

unsigned TMDCWire::superLayerId ( void  ) const
inline

returns super layer id.

Definition at line 225 of file TMDCWire.h.

225 {
226 return _layer->superLayerId();
227}

Referenced by TLine0::appendByszdistance(), TMLine::appendByszdistance(), dump(), TLine0::fit2(), TMLine::fit2(), TLine0::fit2p(), TMLine::fit2p(), localIdDifference(), neighbor(), and SameSuperLayer().

◆ tension()

const double & TMDCWire::tension ( void  ) const
inline

Definition at line 312 of file TMDCWire.h.

312 {
313 return _tension;
314}

◆ tsf() [1/2]

TMDCTsf * TMDCWire::tsf ( TMDCTsf t)
inline

sets a pointer of TMDCTsf.

Definition at line 255 of file TMDCWire.h.

255 {
256 return _tsf = t;
257}
TTree * t
Definition: binning.cxx:23

◆ tsf() [2/2]

const TMDCTsf *const TMDCWire::tsf ( void  ) const
inline

returns a pointer to a TMDCTsf.

Definition at line 249 of file TMDCWire.h.

249 {
250 return _tsf;
251}

◆ wirePosition()

void TMDCWire::wirePosition ( float  zPosition,
HepPoint3D xyPosition,
HepPoint3D backwardPosition,
HepVector3D direction 
) const

calculates position and direction vector with sag correction.

Definition at line 541 of file TMDCWire.cxx.

544 {
545 back = _backwardPosition;
546
547 //...Check z position...
548 if (! (z > _backwardPosition.z() && z < _forwardPosition.z())) {
549 xy = _xyPosition;
550 dir = _direction;
551 }
552
553 //...Setup...
554 int wireID = id();
555 float wirePosition[3] = {0., 0., 0.};
556 float dydz = 0;
557 float ybSag = 0;
558 float yfSag = 0;
559
560 //...Get corrections...
561//zsl calcdc_sag3_(& wireID, & z, wirePosition, & dydz, & ybSag, & yfSag);
562
563 //...Wire position...
564 xy.setX((double) wirePosition[0]);
565 xy.setY((double) wirePosition[1]);
566 xy.setZ((double) wirePosition[2]);
567 back.setY((double) ybSag);
568 HepVector3D v_aux(_forwardPosition.x() - _backwardPosition.x(),
569 yfSag - ybSag,
570 _forwardPosition.z() - _backwardPosition.z());
571 dir = v_aux.unit();
572
573 return;
574}
unsigned id(void) const
returns id.
Definition: TMDCWire.h:207
void wirePosition(float zPosition, HepPoint3D &xyPosition, HepPoint3D &backwardPosition, HepVector3D &direction) const
calculates position and direction vector with sag correction.
Definition: TMDCWire.cxx:541

Referenced by TRunge::SetFlightLength(), and wirePosition().

◆ xyPosition() [1/3]

double * TMDCWire::xyPosition ( double  p[3]) const
inline

Definition at line 333 of file TMDCWire.h.

333 {
334 a[0] = _xyPosition.x();
335 a[1] = _xyPosition.y();
336 a[2] = 0.;
337 return a;
338}

◆ xyPosition() [2/3]

const HepPoint3D TMDCWire::xyPosition ( double  z) const

Definition at line 76 of file TMDCWire.cxx.

76 {
77 double A=47.35E-6/_tension;
78 HepPoint3D x0 =(z - _backwardPosition.z()) /_direction.z() * _direction + _backwardPosition;
79
80 double zinit = x0.z();
81 HepVector3D wire;
82 wire.setX(_forwardPosition.x()-_backwardPosition.x());
83 wire.setY(_forwardPosition.y()-_backwardPosition.y());
84 wire.setZ(_forwardPosition.z()-_backwardPosition.z());
85 double lxz=sqrt(wire.z()*wire.z()+wire.x()*wire.x());
86 double Zp = (zinit - _backwardPosition.z())*lxz/wire.z();
87 double x=_direction.x()*(zinit-_backwardPosition.z())/_direction.z() + _backwardPosition.x();
88 double y=(A*(Zp-lxz)+wire.y()/lxz)*Zp+_backwardPosition.y();
89 x0.setX(x);
90 x0.setY(y);
91 return x0;
92}
Double_t x[10]
double y[1000]

◆ xyPosition() [3/3]

const HepPoint3D & TMDCWire::xyPosition ( void  ) const
inline

returns middle position of a wire. z componet is 0.

Definition at line 327 of file TMDCWire.h.

327 {
328 return _xyPosition;
329}

Referenced by calVirtualCircle(), TPerfectFinder::doit(), TTrack::fit2D(), TTrackManager::salvageAssociateHits(), and TMLink::xyPosition().


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