BOSS 7.0.3
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 ()
 
 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 ()
 
static MdcDetectorinstance (bool doSag)
 
static MdcDetectorinstance ()
 

Detailed Description

Constructor & Destructor Documentation

◆ MdcDetector() [1/2]

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
const double Sag(void) const
Definition: MdcGeoWire.cxx:12
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

Referenced by instance().

◆ ~MdcDetector() [1/2]

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

◆ MdcDetector() [2/2]

MdcDetector::MdcDetector ( )

◆ ~MdcDetector() [2/2]

MdcDetector::~MdcDetector ( )

Member Function Documentation

◆ Dump() [1/2]

void MdcDetector::Dump ( )

◆ Dump() [2/2]

void MdcDetector::Dump ( )

◆ firstLayer() [1/2]

const MdcLayer * MdcDetector::firstLayer ( ) const
inline

Definition at line 36 of file InstallArea/include/MdcGeom/MdcGeom/MdcDetector.h.

36{ return Layer(0); }

Referenced by MdcTrackList::pickHits().

◆ firstLayer() [2/2]

const MdcLayer * MdcDetector::firstLayer ( ) const
inline

◆ firstSlay() [1/2]

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

◆ firstSlay() [2/2]

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

Definition at line 46 of file Reconstruction/MdcPatRec/MdcGeom/MdcGeom-00-01-17/MdcGeom/MdcDetector.h.

46{return _firstSlay;}

◆ firstSlayInView() [1/2]

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

Definition at line 48 of file InstallArea/include/MdcGeom/MdcGeom/MdcDetector.h.

49 {return _firstSlayInView[iview+1];}

◆ firstSlayInView() [2/2]

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

Definition at line 48 of file Reconstruction/MdcPatRec/MdcGeom/MdcGeom-00-01-17/MdcGeom/MdcDetector.h.

49 {return _firstSlayInView[iview+1];}

◆ getMdcLayer() [1/2]

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

Definition at line 35 of file InstallArea/include/MdcGeom/MdcGeom/MdcDetector.h.

35{ return _dclayer[laynum]; }

Referenced by Wire().

◆ getMdcLayer() [2/2]

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

Definition at line 35 of file Reconstruction/MdcPatRec/MdcGeom/MdcGeom-00-01-17/MdcGeom/MdcDetector.h.

35{ return _dclayer[laynum]; }

◆ instance() [1/4]

MdcDetector * MdcDetector::instance ( )
static

◆ instance() [2/4]

static MdcDetector * MdcDetector::instance ( )
static

◆ instance() [3/4]

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

◆ instance() [4/4]

static MdcDetector * MdcDetector::instance ( bool  doSag)
static

◆ lastLayer() [1/2]

const MdcLayer * MdcDetector::lastLayer ( ) const
inline

Definition at line 37 of file InstallArea/include/MdcGeom/MdcGeom/MdcDetector.h.

37{ return Layer(_nLayer - 1); }

Referenced by MdcTrackList::pickHits().

◆ lastLayer() [2/2]

const MdcLayer * MdcDetector::lastLayer ( ) const
inline

Definition at line 37 of file Reconstruction/MdcPatRec/MdcGeom/MdcGeom-00-01-17/MdcGeom/MdcDetector.h.

37{ return Layer(_nLayer - 1); }

◆ lastSlay() [1/2]

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

Definition at line 47 of file InstallArea/include/MdcGeom/MdcGeom/MdcDetector.h.

47{return _lastSlay;}

◆ lastSlay() [2/2]

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

Definition at line 47 of file Reconstruction/MdcPatRec/MdcGeom/MdcGeom-00-01-17/MdcGeom/MdcDetector.h.

47{return _lastSlay;}

◆ lastSlayInView() [1/2]

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

Definition at line 50 of file InstallArea/include/MdcGeom/MdcGeom/MdcDetector.h.

51 {return _lastSlayInView[iview+1];}

Referenced by MdcSegList::resetSeed().

◆ lastSlayInView() [2/2]

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

Definition at line 50 of file Reconstruction/MdcPatRec/MdcGeom/MdcGeom-00-01-17/MdcGeom/MdcDetector.h.

51 {return _lastSlayInView[iview+1];}

◆ Layer() [1/4]

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/4]

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

◆ Layer() [3/4]

◆ Layer() [4/4]

const MdcLayer * MdcDetector::Layer ( unsigned  id) const
inline

Definition at line 33 of file Reconstruction/MdcPatRec/MdcGeom/MdcGeom-00-01-17/MdcGeom/MdcDetector.h.

33{ return _dclayer[id]; }

◆ nAxialSuper() [1/2]

int MdcDetector::nAxialSuper ( void  ) const
inline

Definition at line 55 of file InstallArea/include/MdcGeom/MdcGeom/MdcDetector.h.

55{return _nAxSlay;}

◆ nAxialSuper() [2/2]

int MdcDetector::nAxialSuper ( void  ) const
inline

Definition at line 55 of file Reconstruction/MdcPatRec/MdcGeom/MdcGeom-00-01-17/MdcGeom/MdcDetector.h.

55{return _nAxSlay;}

◆ nextLayer() [1/4]

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

Definition at line 40 of file InstallArea/include/MdcGeom/MdcGeom/MdcDetector.h.

41 { return _nextlay[layer->layNum()]; }

◆ nextLayer() [2/4]

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

Definition at line 40 of file Reconstruction/MdcPatRec/MdcGeom/MdcGeom-00-01-17/MdcGeom/MdcDetector.h.

41 { return _nextlay[layer->layNum()]; }

◆ nextLayer() [3/4]

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

Definition at line 38 of file InstallArea/include/MdcGeom/MdcGeom/MdcDetector.h.

38{ return _nextlay[lay]; }

Referenced by MdcTrackList::pickHits().

◆ nextLayer() [4/4]

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

Definition at line 38 of file Reconstruction/MdcPatRec/MdcGeom/MdcGeom-00-01-17/MdcGeom/MdcDetector.h.

38{ return _nextlay[lay]; }

◆ nLayer() [1/2]

int MdcDetector::nLayer ( ) const
inline

Definition at line 54 of file InstallArea/include/MdcGeom/MdcGeom/MdcDetector.h.

54{ return _nLayer;}

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

◆ nLayer() [2/2]

int MdcDetector::nLayer ( ) const
inline

Definition at line 54 of file Reconstruction/MdcPatRec/MdcGeom/MdcGeom-00-01-17/MdcGeom/MdcDetector.h.

54{ return _nLayer;}

◆ nStereoSuper() [1/2]

int MdcDetector::nStereoSuper ( int  iview) const
inline

Definition at line 56 of file InstallArea/include/MdcGeom/MdcGeom/MdcDetector.h.

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

◆ nStereoSuper() [2/2]

int MdcDetector::nStereoSuper ( int  iview) const
inline

Definition at line 56 of file Reconstruction/MdcPatRec/MdcGeom/MdcGeom-00-01-17/MdcGeom/MdcDetector.h.

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

◆ nSuper() [1/2]

◆ nSuper() [2/2]

int MdcDetector::nSuper ( ) const
inline

Definition at line 53 of file Reconstruction/MdcPatRec/MdcGeom/MdcGeom-00-01-17/MdcGeom/MdcDetector.h.

53{ return _nSlay; }

◆ prevLayer() [1/4]

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

Definition at line 42 of file InstallArea/include/MdcGeom/MdcGeom/MdcDetector.h.

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

◆ prevLayer() [2/4]

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

Definition at line 42 of file Reconstruction/MdcPatRec/MdcGeom/MdcGeom-00-01-17/MdcGeom/MdcDetector.h.

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

◆ prevLayer() [3/4]

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

Definition at line 39 of file InstallArea/include/MdcGeom/MdcGeom/MdcDetector.h.

39{ return _prevlay[lay]; }

Referenced by MdcTrackList::pickHits().

◆ prevLayer() [4/4]

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

Definition at line 39 of file Reconstruction/MdcPatRec/MdcGeom/MdcGeom-00-01-17/MdcGeom/MdcDetector.h.

39{ return _prevlay[lay]; }

◆ SuperLayer() [1/2]

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

Definition at line 45 of file InstallArea/include/MdcGeom/MdcGeom/MdcDetector.h.

45{ return _slayList[id];}

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

◆ SuperLayer() [2/2]

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

Definition at line 45 of file Reconstruction/MdcPatRec/MdcGeom/MdcGeom-00-01-17/MdcGeom/MdcDetector.h.

45{ return _slayList[id];}

◆ Wire() [1/6]

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
static int wire(const Identifier &id)
Definition: MdcID.cxx:54

◆ Wire() [2/6]

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

◆ Wire() [3/6]

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

Definition at line 28 of file InstallArea/include/MdcGeom/MdcGeom/MdcDetector.h.

28{ return _senseWire[id];}

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

◆ Wire() [4/6]

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

Definition at line 28 of file Reconstruction/MdcPatRec/MdcGeom/MdcGeom-00-01-17/MdcGeom/MdcDetector.h.

28{ return _senseWire[id];}

◆ Wire() [5/6]

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

Definition at line 30 of file InstallArea/include/MdcGeom/MdcGeom/MdcDetector.h.

31 { return getMdcLayer(lyrid)->getWire(wirid); }
MdcLayer * getMdcLayer(int laynum) const
MdcSWire * getWire(int wire) const

◆ Wire() [6/6]

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

Definition at line 30 of file Reconstruction/MdcPatRec/MdcGeom/MdcGeom-00-01-17/MdcGeom/MdcDetector.h.

31 { return getMdcLayer(lyrid)->getWire(wirid); }

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