BOSS 8.0.0
BESIII Offline Software System
Loading...
Searching...
No Matches
Reconstruction/MdcPatRec/MdcGeom/include/MdcGeom/MdcDetector.h
Go to the documentation of this file.
1// $Id: MdcDetector.h,v 1.2 2009/05/31 11:50:46 zhangy Exp $ // -*-c++-*-
2// header file for a class called "MdcDetector"
3#ifndef MDCDETECTOR_H
4#define MDCDETECTOR_H
5
6#include <CLHEP/Geometry/Point3D.h>
7#include <CLHEP/Units/PhysicalConstants.h>
8#include <iostream>
9#include <vector>
10
11#include "Identifier/Identifier.h"
12#include "MdcGeom/MdcLayer.h"
13#include "MdcGeom/MdcSWire.h"
14#include "MdcGeom/MdcSuperLayer.h"
15
16using namespace std;
17
18class MdcDetector {
19public:
20 // Constructors and destructors
23 static MdcDetector* instance( bool doSag );
25
26 const MdcSWire* Wire( unsigned id ) const { return _senseWire[id]; }
27 const MdcSWire* Wire( const Identifier& id ) const;
28 const MdcSWire* Wire( unsigned lyrid, unsigned wirid ) const {
29 return getMdcLayer( lyrid )->getWire( wirid );
30 }
31
32 const MdcLayer* Layer( unsigned id ) const { return _dclayer[id]; }
33 const MdcLayer* Layer( const Identifier& id ) const;
34 MdcLayer* getMdcLayer( int laynum ) const { return _dclayer[laynum]; }
35 const MdcLayer* firstLayer() const { return Layer( 0 ); }
36 const MdcLayer* lastLayer() const { return Layer( _nLayer - 1 ); }
37 const MdcLayer* nextLayer( int lay ) const { return _nextlay[lay]; }
38 const MdcLayer* prevLayer( int lay ) const { return _prevlay[lay]; }
39 const MdcLayer* nextLayer( const MdcLayer* layer ) const {
40 return _nextlay[layer->layNum()];
41 }
42 const MdcLayer* prevLayer( const MdcLayer* layer ) const {
43 return _prevlay[layer->layNum()];
44 }
45
46 const MdcSuperLayer* SuperLayer( unsigned id ) const { return _slayList[id]; }
47 const MdcSuperLayer* firstSlay( void ) const { return _firstSlay; }
48 const MdcSuperLayer* lastSlay( void ) const { return _lastSlay; }
49 const MdcSuperLayer* firstSlayInView( int iview ) const {
50 return _firstSlayInView[iview + 1];
51 }
52 const MdcSuperLayer* lastSlayInView( int iview ) const { return _lastSlayInView[iview + 1]; }
53
54 int nSuper() const { return _nSlay; }
55 int nLayer() const { return _nLayer; }
56 int nAxialSuper( void ) const { return _nAxSlay; }
57 int nStereoSuper( int iview ) const {
58 return iview == 0 ? 0 : _nSterSlay[( iview + 1 ) / 2];
59 }
60
61 void Dump();
62
63private:
64 static MdcDetector* _myself;
65 static bool _doSag;
66 void buildpointers( void ); // make the Layer & sLayer pointers
67 void buildSuperLayers( void ); // build super-layers
68
69 MdcSWire** _senseWire; // pointer to all the sense wires
70 MdcLayer** _dclayer; // 40 layers for chamber
71 int _wires_in_layer[43]; // # of wires per layer
72 const MdcLayer* _nextlay[43]; // pointer to next layer
73 const MdcLayer* _nextlayinvw[43]; // pointer to next layer in same view
74 const MdcLayer* _prevlay[43]; // pointer to previous layer in view
75 const MdcLayer* _prevlayinvw[43]; // pointer to previous layer in same view
76 MdcSuperLayer** _slayList; // array of pointers to slayers
77 const MdcSuperLayer* _firstSlayInView[3];
78 const MdcSuperLayer* _lastSlayInView[3];
79 const MdcSuperLayer* _firstSlay;
80 const MdcSuperLayer* _lastSlay;
81
82 // description
83 int _version;
84 bool _debug;
85 int _firstLayer;
86 int _nSWire; // total number of sense wires
87 int _nLayer; // total number of layers
88 int _firstSlayNum;
89 int _lastSlayNum;
90 int _nSlay; // number of super layers
91 int _nAxSlay; // number of axial super layers
92 int _nSterSlay[2]; // number of stero super layers(U V)
93};
94
95#endif /* MDCDETECTOR_H */
const MdcLayer * nextLayer(const MdcLayer *layer) const
static MdcDetector * instance()
const MdcSuperLayer * SuperLayer(unsigned id) const
static MdcDetector * instance(bool doSag)
const MdcSWire * Wire(const Identifier &id) const
const MdcLayer * prevLayer(const MdcLayer *layer) const
const MdcSWire * Wire(unsigned lyrid, unsigned wirid) const
const MdcSuperLayer * lastSlayInView(int iview) const
const MdcLayer * Layer(const Identifier &id) const
const MdcSuperLayer * firstSlayInView(int iview) const