BOSS 7.0.8
BESIII Offline Software System
Loading...
Searching...
No Matches
MdcDetector Class Reference

#include <MdcDetector.h>

Public Member Functions

 MdcDetector ()
 
 ~MdcDetector ()
 
const MdcSWireWire (unsigned id) const
 
const MdcSWireWire (const Identifier &id) const
 
const MdcSWireWire (unsigned lyrid, unsigned wirid) const
 
const MdcLayerLayer (unsigned id) const
 
const MdcLayerLayer (const Identifier &id) const
 
MdcLayergetMdcLayer (int laynum) const
 
const MdcLayerfirstLayer () const
 
const MdcLayerlastLayer () const
 
const MdcLayernextLayer (int lay) const
 
const MdcLayerprevLayer (int lay) const
 
const MdcLayernextLayer (const MdcLayer *layer) const
 
const MdcLayerprevLayer (const MdcLayer *layer) const
 
const MdcSuperLayerSuperLayer (unsigned id) const
 
const MdcSuperLayerfirstSlay (void) const
 
const MdcSuperLayerlastSlay (void) const
 
const MdcSuperLayerfirstSlayInView (int iview) const
 
const MdcSuperLayerlastSlayInView (int iview) const
 
int nSuper () const
 
int nLayer () const
 
int nAxialSuper (void) const
 
int nStereoSuper (int iview) const
 
void Dump ()
 

Static Public Member Functions

static MdcDetectorinstance (bool doSag)
 
static MdcDetectorinstance ()
 

Detailed Description

Definition at line 19 of file MdcDetector.h.

Constructor & Destructor Documentation

◆ MdcDetector()

MdcDetector::MdcDetector ( )

Definition at line 29 of file MdcDetector.cxx.

30{
31
32 std::cout << " +---------------------------------------------------+\n"
33 << " | Creating Mdc Geometry information |\n"
34 << " +---------------------------------------------------+\n";
35
36 IService* ser;
37 StatusCode sc = Gaudi::svcLocator()->getService("MdcGeomSvc",ser);
38 if (!sc.isSuccess())
39 std::cout <<" MdcDetector::Could not open Geometry Service"<<std::endl;
40 MdcGeomSvc *mdcsvc = dynamic_cast<MdcGeomSvc*> (ser);
41 if(!mdcsvc) std::cout <<"MdcDetector::Could not open Geometry Service"<<std::endl;
42
43 _nSWire = mdcsvc->getWireSize();
44 _nLayer = mdcsvc->getLayerSize();
45 _nSlay = mdcsvc->getSuperLayerSize();
46
47 _senseWire = new MdcSWire* [_nSWire];
48 _dclayer = new MdcLayer* [_nLayer];
49 _slayList = new MdcSuperLayer* [_nSlay];
50
51 // build the sense wires
52 for( int iwire = 0; iwire < _nSWire; iwire++ ) {
53 const MdcGeoWire *geowir = mdcsvc->Wire(iwire);
54 HepPoint3D eastP = geowir->Backward()/10.0;
55 HepPoint3D westP = geowir->Forward() /10.0;
56 //std::cout<< "wire ("<<geowir->Layer()<<","<<geowir->Cell()<<") east "<<eastP <<",west " <<westP << std::endl;//yzhang debug
57 double sag=0.;
58 if(_doSag) sag = geowir->Sag()/10.;//mm->cm
59
60 //std::cout<<"sag = "<<sag<<" "<< geowir->Sag()<<std::endl;
61 _senseWire[iwire] = new MdcSWire(eastP, westP, sag, geowir->Id(), geowir->Cell());
62
63
64 }
65
66 // build sense wire layers
67 for( int ilay = 0; ilay < _nLayer; ilay++ ) {
68 const MdcGeoLayer *geolay = mdcsvc->Layer(ilay);
69 int nwir = geolay->NCell();
70 int firstwir = geolay->Wirst();
71 _dclayer[ilay] = new MdcLayer(ilay, nwir, &_senseWire[firstwir],*this);
72 _wires_in_layer[ilay] = nwir;
73 }
74
75 // build pointers to make navigation faster
76 buildpointers();
77
78 // do superlayers
79 // --------------
80 buildSuperLayers();
81 // set nominal cell height for each layer!!!! check!!!!
82 double rOther;
83 for(int ilay = 0; ilay < _nLayer; ilay++) {
84 if( ilay == 0) {
85 rOther = Layer(ilay + 1)->rMid();
86 } else {
87 rOther = Layer(ilay - 1)->rMid();
88 }
89 double height = fabs(Layer(ilay)->rMid() - rOther);
90 const_cast<MdcLayer*>(Layer(ilay))->setCellHeight(height);
91 }
92}
const MdcLayer * Layer(unsigned id) const
Definition: MdcDetector.h:33
int NCell(void) const
Definition: MdcGeoLayer.h:165
int Wirst(void) const
Definition: MdcGeoLayer.h:157
const double Sag(void) const
Definition: MdcGeoWire.cxx:12
int Cell(void) const
Definition: MdcGeoWire.h:137
HepPoint3D Forward(void) const
Definition: MdcGeoWire.h:129
int Id(void) const
Definition: MdcGeoWire.h:127
HepPoint3D Backward(void) const
Definition: MdcGeoWire.h:128
const MdcGeoWire *const Wire(unsigned id)
Definition: MdcGeomSvc.cxx:768
const int getSuperLayerSize()
Definition: MdcGeomSvc.cxx:679
const MdcGeoLayer *const Layer(unsigned id)
Definition: MdcGeomSvc.cxx:784
const int getWireSize()
Definition: MdcGeomSvc.cxx:669
const int getLayerSize()
Definition: MdcGeomSvc.cxx:674
double rMid(void) const
Definition: MdcLayer.h:36

Referenced by instance().

◆ ~MdcDetector()

MdcDetector::~MdcDetector ( )

Definition at line 96 of file MdcDetector.cxx.

97{
98 for( int iwire = 0; iwire < _nSWire; iwire++ ) {
99 delete _senseWire[iwire];
100 }
101 for( int ilay = 0; ilay < _nLayer; ilay++ ) {
102 delete _dclayer[ilay];
103 }
104 for( int islay =0; islay < _nSlay; islay++ ) {
105 _slayList[islay]->print(std::cout);
106 delete _slayList[islay];
107 }
108
109 delete [] _senseWire;
110 delete [] _dclayer;
111 delete [] _slayList;
112}
void print(std::ostream &o=std::cout) const

Member Function Documentation

◆ Dump()

void MdcDetector::Dump ( )

◆ firstLayer()

const MdcLayer * MdcDetector::firstLayer ( ) const
inline

Definition at line 36 of file MdcDetector.h.

36{ return Layer(0); }

Referenced by MdcTrackList::pickHits().

◆ firstSlay()

const MdcSuperLayer * MdcDetector::firstSlay ( void  ) const
inline

◆ firstSlayInView()

const MdcSuperLayer * MdcDetector::firstSlayInView ( int  iview) const
inline

Definition at line 48 of file MdcDetector.h.

49 {return _firstSlayInView[iview+1];}

◆ getMdcLayer()

MdcLayer * MdcDetector::getMdcLayer ( int  laynum) const
inline

Definition at line 35 of file MdcDetector.h.

35{ return _dclayer[laynum]; }

Referenced by Wire().

◆ instance() [1/2]

MdcDetector * MdcDetector::instance ( )
static

◆ instance() [2/2]

MdcDetector * MdcDetector::instance ( bool  doSag)
static

Definition at line 16 of file MdcDetector.cxx.

16 {
17 _doSag = doSag;
18 return instance();
19}
static MdcDetector * instance()
Definition: MdcDetector.cxx:21

◆ lastLayer()

const MdcLayer * MdcDetector::lastLayer ( ) const
inline

Definition at line 37 of file MdcDetector.h.

37{ return Layer(_nLayer - 1); }

Referenced by MdcTrackList::pickHits().

◆ lastSlay()

const MdcSuperLayer * MdcDetector::lastSlay ( void  ) const
inline

Definition at line 47 of file MdcDetector.h.

47{return _lastSlay;}

◆ lastSlayInView()

const MdcSuperLayer * MdcDetector::lastSlayInView ( int  iview) const
inline

Definition at line 50 of file MdcDetector.h.

51 {return _lastSlayInView[iview+1];}

Referenced by MdcSegList::resetSeed().

◆ Layer() [1/2]

const MdcLayer * MdcDetector::Layer ( const Identifier id) const

Definition at line 260 of file MdcDetector.cxx.

261 {
262 unsigned layerid = MdcID::layer(id);
263 return Layer(layerid);
264 // if (layerid < fLayers.size())
265 // return fLayers[layerid];
266 //
267 // return 0;
268 }
static int layer(const Identifier &id)
Values of different levels (failure returns 0)
Definition: MdcID.cxx:49

◆ Layer() [2/2]

◆ nAxialSuper()

int MdcDetector::nAxialSuper ( void  ) const
inline

Definition at line 55 of file MdcDetector.h.

55{return _nAxSlay;}

◆ nextLayer() [1/2]

const MdcLayer * MdcDetector::nextLayer ( const MdcLayer layer) const
inline

Definition at line 40 of file MdcDetector.h.

41 { return _nextlay[layer->layNum()]; }
int layNum(void) const
Definition: MdcLayer.h:29

◆ nextLayer() [2/2]

const MdcLayer * MdcDetector::nextLayer ( int  lay) const
inline

Definition at line 38 of file MdcDetector.h.

38{ return _nextlay[lay]; }

Referenced by MdcTrackList::pickHits().

◆ nLayer()

int MdcDetector::nLayer ( ) const
inline

Definition at line 54 of file MdcDetector.h.

54{ return _nLayer;}

Referenced by MdcSegData::poisonHits(), and MdcxFindSegs::process().

◆ nStereoSuper()

int MdcDetector::nStereoSuper ( int  iview) const
inline

Definition at line 56 of file MdcDetector.h.

57 { return iview == 0 ? 0 : _nSterSlay[(iview+1)/2]; }

◆ nSuper()

◆ prevLayer() [1/2]

const MdcLayer * MdcDetector::prevLayer ( const MdcLayer layer) const
inline

Definition at line 42 of file MdcDetector.h.

43 { return _prevlay[layer->layNum()]; }

◆ prevLayer() [2/2]

const MdcLayer * MdcDetector::prevLayer ( int  lay) const
inline

Definition at line 39 of file MdcDetector.h.

39{ return _prevlay[lay]; }

Referenced by MdcTrackList::pickHits().

◆ SuperLayer()

const MdcSuperLayer * MdcDetector::SuperLayer ( unsigned  id) const
inline

Definition at line 45 of file MdcDetector.h.

45{ return _slayList[id];}

Referenced by MdcxFindSegs::initWireGroups(), and MdcxFindSegs::process().

◆ Wire() [1/3]

const MdcSWire * MdcDetector::Wire ( const Identifier id) const

Definition at line 245 of file MdcDetector.cxx.

246 {
247 int wire = MdcID::wire(id);
248 int layer= MdcID::layer(id);
249 return Wire(layer, wire);
250 // unsigned wireid= Layer(layer)->Wirst()+wire;
251 // if( wireid < fWires.size()){
252 // return fWires[wireid];
253 // }
254 // else {
255 // return 0;
256 // }
257 }
const MdcSWire * Wire(unsigned id) const
Definition: MdcDetector.h:28
static int wire(const Identifier &id)
Definition: MdcID.cxx:54

◆ Wire() [2/3]

const MdcSWire * MdcDetector::Wire ( unsigned  id) const
inline

Definition at line 28 of file MdcDetector.h.

28{ return _senseWire[id];}

Referenced by HoughHit::HoughHit(), MdcHit::MdcHit(), and Wire().

◆ Wire() [3/3]

const MdcSWire * MdcDetector::Wire ( unsigned  lyrid,
unsigned  wirid 
) const
inline

Definition at line 30 of file MdcDetector.h.

31 { return getMdcLayer(lyrid)->getWire(wirid); }
MdcLayer * getMdcLayer(int laynum) const
Definition: MdcDetector.h:35
MdcSWire * getWire(int wire) const
Definition: MdcLayer.h:52

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