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