CGEM BOSS 6.6.5.f
BESIII Offline Software System
Loading...
Searching...
No Matches
BesMdcGeoParameter Class Reference

#include <BesMdcGeoParameter.hh>

Public Member Functions

 BesMdcGeoParameter (void)
 
 ~BesMdcGeoParameter (void)
 
void InitFromFile (void)
 
void InitFromSvc (void)
 
void Dump (void)
 
double SignalWireR ()
 
double FieldWireR ()
 
int Signal2Global (int x)
 
BesMdcWire Wire (int)
 
BesMdcWire SignalWire (int, int)
 
int LayerNo (void)
 
int SignalLayerNo (void)
 
const BesMdcLayerLayer (int) const
 
const BesMdcLayerSignalLayer (int) const
 
int SegmentNo (void)
 
BesMdcMember Segment (int x)
 
 BesMdcGeoParameter (void)
 
 ~BesMdcGeoParameter (void)
 
void InitFromFile (void)
 
void InitFromSvc (void)
 
void Dump (void)
 
double SignalWireR ()
 
double FieldWireR ()
 
int Signal2Global (int x)
 
BesMdcWire Wire (int)
 
BesMdcWire SignalWire (int, int)
 
int LayerNo (void)
 
int SignalLayerNo (void)
 
const BesMdcLayerLayer (int) const
 
const BesMdcLayerSignalLayer (int) const
 
int SegmentNo (void)
 
BesMdcMember Segment (int x)
 

Static Public Member Functions

static BesMdcGeoParameterGetGeo (void)
 
static BesMdcGeoParameterGetGeo (void)
 

Detailed Description

Constructor & Destructor Documentation

◆ BesMdcGeoParameter() [1/2]

BesMdcGeoParameter::BesMdcGeoParameter ( void  )

Definition at line 78 of file BesMdcGeoParameter.cc.

78 {
79 ISvcLocator* svcLocator = Gaudi::svcLocator();
80 IG4Svc* tmpSvc;
81 G4Svc* m_G4Svc;
82 StatusCode sc=svcLocator->service("G4Svc", tmpSvc);
83 m_G4Svc=dynamic_cast<G4Svc *>(tmpSvc);
84 if (!sc.isSuccess())
85 std::cout<<"BesMdcGeoParameter::Could not open G4 Service"<<std::endl;
86 if(m_G4Svc->GetMdcDataInput()== 0){
87 cout<<"------- get BesMdcGeoParameter from file --------"<<endl;
89 }
90 if(m_G4Svc->GetMdcDataInput()== 1) {
91 cout<<"=======get BesMdcGeoParameter from MdcGeomSvc======="<<endl;
92 InitFromSvc();
93 }
94
95 //Dump();
96 if(fPointer)
97 { G4Exception("BesMdcGeoParameter constructed twice."); }
98 fPointer=this;
99}

Referenced by GetGeo().

◆ ~BesMdcGeoParameter() [1/2]

BesMdcGeoParameter::~BesMdcGeoParameter ( void  )
inline

◆ BesMdcGeoParameter() [2/2]

BesMdcGeoParameter::BesMdcGeoParameter ( void  )

◆ ~BesMdcGeoParameter() [2/2]

BesMdcGeoParameter::~BesMdcGeoParameter ( void  )
inline

Member Function Documentation

◆ Dump() [1/2]

void BesMdcGeoParameter::Dump ( void  )

Definition at line 309 of file BesMdcGeoParameter.cc.

309 {
310 //cout<<"------BesMdcGeoParameter info :--------"<<endl;
311 cout<<" fLayerNo: "<<fLayerNo<<endl;
312 cout<<" fWireNo: "<<fWireNo<<endl;
313 cout<<" fSignalLayerNo: "<<fSignalLayerNo<<endl;
314 cout<<" fSignalWireR: "<<fSignalWireR<<endl;
315 cout<<" fFieldWireR: "<<fFieldWireR<<endl;
316
317 cout<<"fSingalLayer:"<<endl;
318 for(int i=0; i<fSignalLayerNo; i++){
319 cout<<fSignalLayer[i]+1<<' '; }
320 cout<<endl;
321
322 for(int i=0;i<fLayerNo;i++){
323 cout<<"Layer["<<i<<"]: "
324 <<" name:"<<fLayer[i].Name() <<" wireNo:"<<fLayer[i].WireNo()
325 <<" length: "<<fLayer[i].Length() <<" r: "<<fLayer[i].R();
326 if (i<75) cout<<" phi:"<<fLayer[i].Phi()*180/pi;
327 else cout<<" phi:"<<(fLayer[i].Phi()-fLayer[i].ShiftPhi())*180/pi;
328 cout<<" firstWire: "<<fLayer[i].FirstWire()
329 <<" rotateCell: "<<fLayer[i].RotateCell()<<endl;
330 }
331
332 cout<<"fSegmentNo:"<<fSegmentNo<<endl;
333 for(int j=0;j<fSegmentNo;j++){
334 cout<<"length:"<<fMdcSegment[j].Length()
335 <<" innerR:"<<fMdcSegment[j].InnerR()
336 <<" outR:"<<fMdcSegment[j].OutR()
337 <<" z:"<<fMdcSegment[j].Z()
338 <<" name:"<<fMdcSegment[j].Name()<<endl;
339 }
340
341}

◆ Dump() [2/2]

void BesMdcGeoParameter::Dump ( void  )

◆ FieldWireR() [1/2]

double BesMdcGeoParameter::FieldWireR ( )
inline

Definition at line 124 of file InstallArea/include/MdcSim/MdcSim/BesMdcGeoParameter.hh.

124{return fFieldWireR;}

Referenced by BesMdcConstruction::Construct().

◆ FieldWireR() [2/2]

double BesMdcGeoParameter::FieldWireR ( )
inline

Definition at line 124 of file Simulation/BOOST/MdcSim/MdcSim-00-04-05/MdcSim/BesMdcGeoParameter.hh.

124{return fFieldWireR;}

◆ GetGeo() [1/2]

BesMdcGeoParameter * BesMdcGeoParameter::GetGeo ( void  )
static

Definition at line 34 of file BesMdcGeoParameter.cc.

34 {
35 if (! fPointer) fPointer = new BesMdcGeoParameter();
36 return fPointer;
37}

Referenced by BesMdcConstruction::BesMdcConstruction(), BesMdcDigitizer::BesMdcDigitizer(), BesMdcSD::BesMdcSD(), and BesRawDataWriter::BesRawDataWriter().

◆ GetGeo() [2/2]

static BesMdcGeoParameter * BesMdcGeoParameter::GetGeo ( void  )
static

◆ InitFromFile() [1/2]

void BesMdcGeoParameter::InitFromFile ( void  )

Definition at line 148 of file BesMdcGeoParameter.cc.

148 {
149 int wireNo, firstWire;
150 double length, phi, r, rotateCell,rotateAngle;
151 double innerR, outR, z;
152 string name, line;
153
154 G4String geoPath = ReadBoostRoot::GetBoostRoot();
155 if(!geoPath){
156 G4Exception("BOOST environment not set!");
157 }
158 if(ReadBoostRoot::GetCgem()!=0){
159 geoPath += "/dat/Mdc_cgem.txt";
160 G4cout << "use CGEM" << endl;
161 } else{
162 geoPath += "/dat/Mdc.txt";
163 }
164 G4cout << "Read Mdc geometry file: " << geoPath << endl;
165
166 ifstream inFile(geoPath);
167 if(!inFile.good()){
168 cout<<"Error, mdc parameters file not exist"<<endl;
169 return;
170 }
171
172 getline(inFile, line);
173 inFile>>fLayerNo>>fWireNo>>fSignalLayerNo>>fSignalWireR>>fFieldWireR;
174
175 inFile.seekg(1,ios::cur);
176 getline(inFile, line);
177 int i,signalLayer;
178 for(i=0; i<fSignalLayerNo; i++){
179 inFile>>signalLayer;
180 fSignalLayer[i]=signalLayer-1;
181 }
182
183 inFile.seekg(1,ios::cur);
184 getline(inFile, line);
185 getline(inFile, line);
186 for( i=0; i<fLayerNo; i++){
187 inFile>>name>>wireNo>>length>>r>>phi>>firstWire>>rotateCell;
188 getline(inFile, line);
189
190 rotateAngle=2*pi*rotateCell/wireNo;
191
192 fLayer[i].SetName(name);fLayer[i].SetRadius(r);
193 fLayer[i].SetLength(length); fLayer[i].SetRotateCell(rotateCell);
194 fLayer[i].SetRotateAngle(rotateAngle); fLayer[i].SetWireNo(wireNo);
195 fLayer[i].SetShiftPhi(twopi/wireNo); fLayer[i].SetFirstWire(firstWire);
196
197 phi*=(pi/180);
198 if(phi<0)phi += fLayer[i].ShiftPhi();
199 fLayer[i].SetPhi(phi);
200
201 if(i==0){
202 fLayer[i].SetSumWireNo(wireNo); fLayer[i].SetBeginWireNo(0);
203 }else{
204 fLayer[i].SetBeginWireNo(fLayer[i-1].SumWireNo());
205 fLayer[i].SetSumWireNo(fLayer[i-1].SumWireNo()+wireNo);
206 }
207
208 for(int j=0; j<wireNo; j++){
209 fWirePhi[fLayer[i].BeginWireNo()+j]=j*fLayer[i].ShiftPhi()+phi;
210 }
211 }
212
213 if(fLayer[fLayerNo-1].SumWireNo()!= fWireNo){
214 cout<<"Total wire number is not consistant!"<<endl;
215 }
216
217 getline(inFile, line);
218 inFile>>fSegmentNo;
219 inFile.seekg(1,ios::cur);
220 getline(inFile, line);
221 getline(inFile, line);
222
223 for(i=0; i<fSegmentNo; i++){
224 inFile>>length>>innerR>>outR>>z>>name;
225 getline(inFile,line);
226
227 fMdcSegment[i].SetLength(length); fMdcSegment[i].SetInnerR(innerR);
228 fMdcSegment[i].SetOutR(outR); fMdcSegment[i].SetZ(z);
229 fMdcSegment[i].SetName(name);
230 }
231
232}
const int wireNo

Referenced by BesMdcGeoParameter().

◆ InitFromFile() [2/2]

void BesMdcGeoParameter::InitFromFile ( void  )

◆ InitFromSvc() [1/2]

void BesMdcGeoParameter::InitFromSvc ( void  )

Definition at line 235 of file BesMdcGeoParameter.cc.

235 {
236 ISvcLocator* svcLocator = Gaudi::svcLocator();
237 IMdcGeomSvc* ISvc;
238 MdcGeomSvc* mdcGeomSvc;
239 StatusCode sc=svcLocator->service("MdcGeomSvc", ISvc);
240 mdcGeomSvc=dynamic_cast<MdcGeomSvc *>(ISvc);
241 if (!sc.isSuccess())
242 std::cout<<"BesMdcGeoParameter::Could not open Geometry Service"<<std::endl;
243
244 fLayerNo= mdcGeomSvc->Misc()->LayerNo();
245 fWireNo=mdcGeomSvc->Misc()->WireNo();
246 fSignalLayerNo=mdcGeomSvc->Misc()->SLayerNo();
247 fSignalWireR=mdcGeomSvc->Misc()->SWireR();
248 fFieldWireR=mdcGeomSvc->Misc()->FWireR();
249
250 int i,signalLayer;
251 for(i=0; i<fSignalLayerNo; i++){
252 signalLayer=mdcGeomSvc->Layer(i)->SLayer();
253 fSignalLayer[i]=signalLayer-1;
254 }
255
256 string name;
257 int wireNo,firstWire;
258 double length, r, phi,rotateCell,rotateAngle;
259 for(i=0;i<fLayerNo;i++){
260 name=mdcGeomSvc->GeneralLayer(i)->LayerName();
261 wireNo=mdcGeomSvc->GeneralLayer(i)->NCell()*2;
262 length= mdcGeomSvc->GeneralLayer(i)->Length();
263 r= mdcGeomSvc->GeneralLayer(i)->Radius();
264 phi=mdcGeomSvc->GeneralLayer(i)->nomPhi();
265 firstWire=mdcGeomSvc->GeneralLayer(i)->First();
266 rotateCell= mdcGeomSvc->GeneralLayer(i)->nomShift();
267
268 rotateAngle=2*pi*rotateCell/wireNo;
269
270 fLayer[i].SetName(name);fLayer[i].SetRadius(r);
271 fLayer[i].SetLength(length); fLayer[i].SetRotateCell(rotateCell);
272 fLayer[i].SetRotateAngle(rotateAngle); fLayer[i].SetWireNo(wireNo);
273 fLayer[i].SetShiftPhi(twopi/wireNo); fLayer[i].SetFirstWire(firstWire);
274 fLayer[i].SetPhi(phi);
275
276 if(i==0){
277 fLayer[i].SetSumWireNo(wireNo); fLayer[i].SetBeginWireNo(0);
278 }else{
279 fLayer[i].SetBeginWireNo(fLayer[i-1].SumWireNo());
280 fLayer[i].SetSumWireNo(fLayer[i-1].SumWireNo()+wireNo);
281 }
282
283 for(int j=0; j<wireNo; j++){
284 fWirePhi[fLayer[i].BeginWireNo()+j]=j*fLayer[i].ShiftPhi()+phi;
285 }
286 }
287
288 if(fLayer[fLayerNo-1].SumWireNo()!= fWireNo){
289 cout<<"Total wire number is not consistant!"<<endl;
290 }
291
292
293 double innerR,outR,z;
294 fSegmentNo=mdcGeomSvc->getSegmentNo();
295 for(i=0;i<fSegmentNo;i++){
296 length=mdcGeomSvc->End(i)->Length();
297 innerR=mdcGeomSvc->End(i)->InnerR();
298 outR=mdcGeomSvc->End(i)->OutR();
299 z=mdcGeomSvc->End(i)->Z();
300 name=mdcGeomSvc->End(i)->Name();
301
302 fMdcSegment[i].SetLength(length); fMdcSegment[i].SetInnerR(innerR);
303 fMdcSegment[i].SetOutR(outR); fMdcSegment[i].SetZ(z);
304 fMdcSegment[i].SetName(name);
305 }
306
307}
const MdcGeoGeneral *const GeneralLayer(unsigned id)
Definition: MdcGeomSvc.cxx:802
const MdcGeoEnd *const End(unsigned id)
Definition: MdcGeomSvc.cxx:815
const MdcGeoLayer *const Layer(unsigned id)
Definition: MdcGeomSvc.cxx:786
const int getSegmentNo()
Definition: MdcGeomSvc.cxx:691
const MdcGeoMisc *const Misc(void)
Definition: MdcGeomSvc.cxx:810

Referenced by BesMdcGeoParameter().

◆ InitFromSvc() [2/2]

void BesMdcGeoParameter::InitFromSvc ( void  )

◆ Layer() [1/2]

const BesMdcLayer & BesMdcGeoParameter::Layer ( int  layerNumber) const

Definition at line 133 of file BesMdcGeoParameter.cc.

133 {
134 if(layerNumber<0 || layerNumber>89){
135 cout<<"Error: Wrong layerNo: "<<layerNumber<<endl;
136 }
137 return fLayer[layerNumber];
138}

Referenced by BesMdcConstruction::Construct().

◆ Layer() [2/2]

const BesMdcLayer & BesMdcGeoParameter::Layer ( int  ) const

◆ LayerNo() [1/2]

int BesMdcGeoParameter::LayerNo ( void  )
inline

Definition at line 130 of file InstallArea/include/MdcSim/MdcSim/BesMdcGeoParameter.hh.

130{return fLayerNo;}

◆ LayerNo() [2/2]

int BesMdcGeoParameter::LayerNo ( void  )
inline

Definition at line 130 of file Simulation/BOOST/MdcSim/MdcSim-00-04-05/MdcSim/BesMdcGeoParameter.hh.

130{return fLayerNo;}

◆ Segment() [1/2]

BesMdcMember BesMdcGeoParameter::Segment ( int  x)
inline

Definition at line 136 of file InstallArea/include/MdcSim/MdcSim/BesMdcGeoParameter.hh.

136{return fMdcSegment[x];}
Double_t x[10]

Referenced by BesMdcConstruction::Construct().

◆ Segment() [2/2]

BesMdcMember BesMdcGeoParameter::Segment ( int  x)
inline

Definition at line 136 of file Simulation/BOOST/MdcSim/MdcSim-00-04-05/MdcSim/BesMdcGeoParameter.hh.

136{return fMdcSegment[x];}

◆ SegmentNo() [1/2]

int BesMdcGeoParameter::SegmentNo ( void  )
inline

Definition at line 135 of file InstallArea/include/MdcSim/MdcSim/BesMdcGeoParameter.hh.

135{return fSegmentNo;}

Referenced by BesMdcConstruction::Construct().

◆ SegmentNo() [2/2]

int BesMdcGeoParameter::SegmentNo ( void  )
inline

Definition at line 135 of file Simulation/BOOST/MdcSim/MdcSim-00-04-05/MdcSim/BesMdcGeoParameter.hh.

135{return fSegmentNo;}

◆ Signal2Global() [1/2]

int BesMdcGeoParameter::Signal2Global ( int  x)
inline

Definition at line 125 of file InstallArea/include/MdcSim/MdcSim/BesMdcGeoParameter.hh.

125{return fSignalLayer[x];}

Referenced by BesMdcConstruction::Construct().

◆ Signal2Global() [2/2]

int BesMdcGeoParameter::Signal2Global ( int  x)
inline

Definition at line 125 of file Simulation/BOOST/MdcSim/MdcSim-00-04-05/MdcSim/BesMdcGeoParameter.hh.

125{return fSignalLayer[x];}

◆ SignalLayer() [1/2]

const BesMdcLayer & BesMdcGeoParameter::SignalLayer ( int  layerNumber) const

Definition at line 140 of file BesMdcGeoParameter.cc.

140 {
141 if(layerNumber<0 || layerNumber>42){
142 cout<<"Error: Wrong SignallayerNo: "<<layerNumber<<endl;
143 }
144 return fLayer[fSignalLayer[layerNumber]];
145}

◆ SignalLayer() [2/2]

const BesMdcLayer & BesMdcGeoParameter::SignalLayer ( int  ) const

◆ SignalLayerNo() [1/2]

int BesMdcGeoParameter::SignalLayerNo ( void  )
inline

Definition at line 131 of file InstallArea/include/MdcSim/MdcSim/BesMdcGeoParameter.hh.

131{return fSignalLayerNo;}

Referenced by BesMdcDigitizer::Digitize().

◆ SignalLayerNo() [2/2]

int BesMdcGeoParameter::SignalLayerNo ( void  )
inline

Definition at line 131 of file Simulation/BOOST/MdcSim/MdcSim-00-04-05/MdcSim/BesMdcGeoParameter.hh.

131{return fSignalLayerNo;}

◆ SignalWire() [1/2]

BesMdcWire BesMdcGeoParameter::SignalWire ( int  signalLayerNo,
int  wireNo 
)

Definition at line 118 of file BesMdcGeoParameter.cc.

119{
120
121 int i=fSignalLayer[signalLayerNo];
122 int wireNoInLayer=2*wireNo+1-fLayer[i].FirstWire();//FirstWire():0,field;1,signal
123 double phi=fLayer[i].Phi();
124 double shiftPhi=fLayer[i].ShiftPhi();
125 double wirePhi;
126 wirePhi= wireNoInLayer*shiftPhi+phi;
127
128 BesMdcWire temp(fLayer[i].Length(), fWirePhi[fLayer[i].BeginWireNo()+wireNoInLayer], fLayer[i].R(),fLayer[i].RotateAngle());
129 return temp;
130}
complex_t R(double Q2, double M2, double G, double Mp2, double Mm2)
Definition: TUtil.h:27

Referenced by BesMdcSD::ProcessHits().

◆ SignalWire() [2/2]

BesMdcWire BesMdcGeoParameter::SignalWire ( int  ,
int   
)

◆ SignalWireR() [1/2]

double BesMdcGeoParameter::SignalWireR ( )
inline

Definition at line 123 of file InstallArea/include/MdcSim/MdcSim/BesMdcGeoParameter.hh.

123{return fSignalWireR;}

Referenced by BesMdcConstruction::Construct().

◆ SignalWireR() [2/2]

double BesMdcGeoParameter::SignalWireR ( )
inline

Definition at line 123 of file Simulation/BOOST/MdcSim/MdcSim-00-04-05/MdcSim/BesMdcGeoParameter.hh.

123{return fSignalWireR;}

◆ Wire() [1/2]

BesMdcWire BesMdcGeoParameter::Wire ( int  wireNo)

Definition at line 102 of file BesMdcGeoParameter.cc.

102 {
103
104 int i;
105 for(i=0; i<fLayerNo; i++){
106 if(fLayer[i].BeginWireNo()<=wireNo && wireNo<fLayer[i].SumWireNo()){
107
108 break;
109 }
110 }
111
112 BesMdcWire temp(fLayer[i].Length(), fWirePhi[wireNo], fLayer[i].R(), fLayer[i].RotateAngle());
113 return temp;
114}

◆ Wire() [2/2]

BesMdcWire BesMdcGeoParameter::Wire ( int  )

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