BOSS 8.0.0
BESIII Offline Software System
Loading...
Searching...
No Matches
TMDCLayer.cxx
Go to the documentation of this file.
1//-----------------------------------------------------------------------------
2// $Id: TMDCLayer.cxx,v 1.5 2010/03/31 09:58:59 liucy Exp $
3//-----------------------------------------------------------------------------
4// Filename : TMDCLayer.cc
5// Section : Tracking MDC
6// Owner : Yoshi Iwasaki
7// Email : yoshihito.iwasaki@kek.jp
8//-----------------------------------------------------------------------------
9// Description : A class to represent a wire layer.
10// See http://bsunsrv1.kek.jp/~yiwasaki/tracking/
11//-----------------------------------------------------------------------------
12
13#define TMDCLayer_INLINE_DEFINE_HERE
14// #include "panther/panther.h"
15// #include MDC_H
16// #include "MdcRecGeo/MdcGeoLayer.h"
17#include "TrkReco/TMDCLayer.h"
18#include "MdcGeomSvc/MdcGeoLayer.h"
19#include "TrkReco/TMDC.h"
20#include "TrkReco/TMDCUtil.h"
21
23 _geo = l;
24 _id = l->Id();
25 _superLayerId = TMDC::superLayerId( l );
26 _localLayerId = TMDC::localLayerId( l );
27 // liucy&jialk origin uses slant to judge type now directly uses superLayerId to judge
28 if ( _id >= 36 || ( _id >= 8 && _id <= 19 ) ) _type = 0;
29 else _type = 1;
30 // _offset = l->Offset();
31 // _cellSize = l->PCSiz();
32 // Unit from rad to cell for _offset; and from mm to cm for cellSize
33 // _offset = l->Offset()/(2. * M_PI/l->NCell());
34 // unit of offset is rad, which is diff from belle
35 _offset = l->Offset();
36 _cellSize = l->PCSiz() / 10;
37
38 _nWires = (unsigned)l->NCell();
39 _axialStereoLayerId = TMDC::axialStereoLayerId( l );
40}
41
43
44void TMDCLayer::dump( const std::string& msg, const std::string& pre ) const {
45 std::cout << pre;
46 std::cout << "layer " << _id;
47 std::cout << ", super layer " << _superLayerId;
48 std::cout << ", local layer " << _localLayerId;
49 if ( axial() ) std::cout << ", axial ";
50 else std::cout << ", stereo ";
51 std::cout << _axialStereoLayerId;
52 std::cout << ", " << _nWires << " wires";
53 std::cout << std::endl;
54}
55
56const TMDCWire* const TMDCLayer::wire( int id ) const {
57 if ( _nWires == 0 ) return 0;
58
59 if ( id < 0 )
60 while ( id < 0 ) id += _nWires;
61
62 if ( id >= _nWires ) id %= _nWires;
63
64 return ( *this )[id];
65}
void dump(const std::string &message=std::string(""), const std::string &prefix=std::string("")) const
dumps debug information.
Definition TMDCLayer.cxx:44
virtual ~TMDCLayer()
Destructor.
Definition TMDCLayer.cxx:42
const TMDCWire *const wire(int id) const
returns a pointer to a wire. 'id' can be negative or 'id' can be greater than 'nWires()'.
Definition TMDCLayer.cxx:56
TMDCLayer(const MdcGeoLayer *)
Constructor.
Definition TMDCLayer.cxx:22
bool axial(void) const
returns true if this is an axial layer.
static unsigned axialStereoLayerId(const MdcGeoLayer *const)
Definition TMDC.cxx:939
static unsigned superLayerId(unsigned wireId)
Definition TMDC.cxx:719
static unsigned localLayerId(unsigned wireId)
Definition TMDC.cxx:784