CGEM BOSS 6.6.5.g
BESIII Offline Software System
Loading...
Searching...
No Matches
MdcLayer.cxx
Go to the documentation of this file.
1#include "MdcGeom/MdcLayer.h"
3#include <iomanip>
4#include <iostream>
5using namespace std;
6
7 // Constructor.
8
9MdcLayer::MdcLayer(int lay, int nwir, MdcSWire** wires, const MdcDetector &theDet)
10 : _mdcDet(theDet), _exist(1), _layer(lay), _nwires(nwir),
11 _wires(wires)
12{
13 if (_nwires == 0) _exist = 0;
14 // set pointer to layer for wires
15 for (int wire=0; wire<_nwires; wire++) {
16 getWire(wire)->setLayerPtr(this);
17// _cells.push_back(buildCell(wire));
18 }
19
20 // get nominal values from wire # 0
21 _rend = wires[0]->rEnd();
22 _rmid = wires[0]->rMid();
23 _stdip = _rend - _rmid;
24 // in the local (DC) system frame
25 _zend = wires[0]->zEndDC();
26 _stereo = wires[0]->stereo();
27 // half twist angle
28 _delphi = wires[0]->dPhiz();
29 // stereo view
30 if((_layer>=0 && _layer<=7)||(_layer>=20&&_layer<=35)){
31 _view = (int)(_stereo/(fabs(_stereo)));
32 } else {
33 _view = 0;
34 }
35 _phiOffset = wires[0]->phiE();
36}
37
38
39
40void
41MdcLayer::print( std::ostream& o ) const
42{
43 o<< setw(3)<<layNum()<<
44 setw(3)<<view()<<
45 setw(4)<<nWires()<<
46 setw(3)<<superLayer()<<
47 setw(3)<<subLayer()<<
48 setw(10)<<stDip()<<
49 setw(10)<<zEnd()<<
50 setw(10)<<rMid()<<
51 setw(10)<<rEnd()<<
52 setw(10)<<rIn()<<
53 setw(10)<<rOut()<<
54 setw(10)<<stereo()<<
55 setw(10)<<dPhiz()<<
56 setw(7)<<zLength()<<
57 setw(10)<<sag()<<
58 setw(10)<<dPhi()<<
59 setw(10)<<phiOffset()<<
60 setw(10)<<phiEPOffset()<<
61 setw(10)<<dPhizDC(0.)<<
62 setw(10)<<radiusDC(0.)<<
63 setw(10)<<phiWireDC(0,0.)<<
64 setw(10)<<phiWire(0)<<
65 setw(10)<<xWire(0)<<
66 setw(10)<<yWire(0)<<
67 setw(10)<<cellWidth()<<
68 setw(10)<<cellWidth(0.)<<
69 std::endl;
70}
71
72
73double
74MdcLayer::phiWireDC(int cell, double z) const
75{
76 if ( cell >= 0 && cell < nWires() ) {
77 return getWire(cell)->phiDC(z);
78 } else {
79 std::cout << "phiWireDC: wrong cell # " << cell << "\n"
80 << " number of cells in this layer is " << nWires()
81 << std::endl;
82 return 0.;
83 }
84}
85
86double
87MdcLayer::phiWire(int cell) const
88{
89 // in the middle of the chamber
90 if ( cell >= 0 && cell < nWires() ) {
91 return getWire(cell)->phi();
92 } else {
93 std::cout << "phiWire: wrong cell # " << cell << "\n"
94 << " number of cells in this layer is " << nWires()
95 << std::endl;
96 return 0.;
97 }
98}
99
100double
101MdcLayer::xWire(int cell) const
102{
103 // in the middle of the chamber
104 if ( cell >= 0 && cell < nWires() ) {
105 return getWire(cell)->xMid();
106 } else {
107 std::cout << "xWire: wrong cell # " << cell << "\n"
108 << " number of cells in this layer is " << nWires()
109 << std::endl;
110 return 0.;
111 }
112}
113
114double
115MdcLayer::yWire(int cell) const
116{
117 // in the middle of the chamber
118 if ( cell >= 0 && cell < nWires() ) {
119 return getWire(cell)->yMid();
120 } else {
121 std::cout << "YWire: wrong cell # " << cell << "\n"
122 << " number of cells in this layer is " << nWires()
123 << std::endl;
124 return 0.;
125 }
126}
127
128
129
130
131const Trajectory*
132MdcLayer::makeHitTrajInGlobalCoords(int wire, double /*z*/) const
133{
134 if ( wire >= 0 && wire < nWires() ) {
135 return getWire(wire)->getTraj();
136 } else {
137 std::cout << "Error In makeHitTrajInGlobalCoords: wrong cell # "<< wire << "\n"
138 <<" number of cells in this layer is " << nWires() << std::endl;
139 return getWire(0)->getTraj();
140 }
141}
const Trajectory * makeHitTrajInGlobalCoords(int wire, double z=0) const
Definition: MdcLayer.cxx:132
double yWire(int cell) const
Definition: MdcLayer.cxx:115
double zEnd(void) const
Definition: MdcLayer.h:35
double rMid(void) const
Definition: MdcLayer.h:36
MdcLayer(int lay, int nwir, MdcSWire **wires, const MdcDetector &theDet)
Definition: MdcLayer.cxx:9
double phiWire(int cell) const
Definition: MdcLayer.cxx:87
MdcSWire * getWire(int wire) const
Definition: MdcLayer.h:52
double phiOffset(void) const
Definition: MdcLayer.h:47
double sag(void) const
Definition: MdcLayer.h:45
double phiWireDC(int cell, double z) const
Definition: MdcLayer.cxx:74
double zLength(void) const
Definition: MdcLayer.h:44
double phiEPOffset(void) const
Definition: MdcLayer.h:49
double radiusDC(double z) const
Definition: MdcLayer.h:51
double stereo(void) const
Definition: MdcLayer.h:42
double cellWidth(void) const
Definition: MdcLayer.h:64
double rEnd(void) const
Definition: MdcLayer.h:37
double stDip(void) const
Definition: MdcLayer.h:34
void print(std::ostream &o) const
Definition: MdcLayer.cxx:41
double dPhizDC(double z) const
Definition: MdcLayer.h:50
int superLayer(void) const
Definition: MdcLayer.h:31
double dPhi(void) const
Definition: MdcLayer.h:61
int nWires(void) const
Definition: MdcLayer.h:30
double rOut(void) const
Definition: MdcLayer.h:39
int view(void) const
Definition: MdcLayer.h:28
double dPhiz(void) const
Definition: MdcLayer.h:43
int subLayer(void) const
Definition: MdcLayer.h:32
int layNum(void) const
Definition: MdcLayer.h:29
double xWire(int cell) const
Definition: MdcLayer.cxx:101
double rIn(void) const
Definition: MdcLayer.h:38
double rEnd(void) const
Definition: MdcSWire.h:43
double phi(void) const
Definition: MdcSWire.h:52
double yMid(void) const
Definition: MdcSWire.h:42
double phiE(void) const
Definition: MdcSWire.h:51
double phiDC(double z) const
Definition: MdcSWire.h:60
double rMid(void) const
Definition: MdcSWire.h:50
double zEndDC(void) const
Definition: MdcSWire.h:49
const MdcSagTraj * getTraj(void) const
Definition: MdcSWire.h:34
double stereo(void) const
Definition: MdcSWire.h:53
void setLayerPtr(const MdcLayer *lay)
Definition: MdcSWire.h:74
double xMid(void) const
Definition: MdcSWire.h:41
double dPhiz(void) const
Definition: MdcSWire.h:48