1#include "GaudiKernel/Algorithm.h"
2#include "CgemGeomSvc/CgemGeomSvc.h"
3#include "GaudiKernel/Kernel.h"
4#include "GaudiKernel/IIncidentSvc.h"
5#include "GaudiKernel/Incident.h"
6#include "GaudiKernel/IIncidentListener.h"
7#include "GaudiKernel/IInterface.h"
8#include "GaudiKernel/StatusCode.h"
9#include "GaudiKernel/SvcFactory.h"
10#include "GaudiKernel/PropertyMgr.h"
11#include "GaudiKernel/SmartDataPtr.h"
12#include "CalibData/CalibModel.h"
13#include "GaudiKernel/MsgStream.h"
14#include "EventModel/EventHeader.h"
15#include "EventModel/Event.h"
16#include "GaudiKernel/ISvcLocator.h"
17#include "GaudiKernel/IDataProviderSvc.h"
18#include "GaudiKernel/Bootstrap.h"
27 :Service(name,pSvcLocator)
29 declareProperty(
"UseIniGeomFile", m_iFile = 4);
30 declareProperty(
"PrintDebugInfo", m_debugCout =
false);
31 declareProperty(
"TestReadoutPlane", m_testReadoutPlane =
false);
32 declareProperty(
"AlignFile", m_alignFile);
33 declareProperty(
"UseEffectiveDensity", m_effDensity =
false);
37 for(
int i=0; i<m_N_CgemLayer; i++){
38 for(
int j=0; j < m_N_GemFoil; j++)
delete m_foil[i][j];
40 for(
int j=0; j<nSheet; j++)
delete m_ReadoutPlane[i][j];
41 delete m_CgemLayer[i];
43 delete m_CgemSeparator;
51 if ( IID_ICgemGeomSvc.versionMatch(riid) ) {
54 return Service::queryInterface(riid, ppvInterface) ;
56 return StatusCode::SUCCESS;
61 MsgStream log(
msgSvc(), name());
62 log << MSG::INFO <<
"initializing......" << endreq;
64 StatusCode sc = Service::initialize();
65 if ( sc.isFailure() )
return sc;
70 for(
int layer=0; layer<m_N_CgemLayer; layer++){
75 cout <<
"alignfile: " << m_alignFile <<
" --------------------------------------" << endl;
79 for(
int layer=0; layer<m_N_CgemLayer; layer++){
82 double r = (rInner + rOuter)*0.5;
83 m_midDrift->
setR(layer, r);
86 for(
int i=0; i<nSheet; i++){
94 if(m_testReadoutPlane) TestReadoutPlane();
96 return StatusCode::SUCCESS;
102 MsgStream log(
msgSvc(),name());
104 log<<MSG::INFO <<
"finalizing.... "<<endreq;
106 log<<MSG::INFO <<
"End of Run "<<endreq;
107 return StatusCode::SUCCESS;
112 MsgStream log( messageService(), name() );
113 log << MSG::DEBUG <<
"handle: " << inc.type() << endreq;
115 IDataProviderSvc* m_eventSvc;
116 Gaudi::svcLocator()->service(
"EventDataSvc", m_eventSvc,
true);
117 SmartDataPtr<Event::EventHeader> eventHeader(m_eventSvc,
"/Event/EventHeader");
119 log << MSG::FATAL <<
"Could not find Event Header" << endreq;
145 string geoFilePath = getenv(
"CGEMGEOMSVCROOT");
147 cout <<
"IFILE " << m_iFile << endl;
151 geoFilePath +=
"/dat/cgem_model_1_default.txt";
154 geoFilePath +=
"/dat/cgem_model_2_default.txt";
157 geoFilePath +=
"/dat/cgem_model_3_default.txt";
160 geoFilePath +=
"/dat/cgem_model_4_default.txt";
163 cout <<
"Warning in CgemGeomSvc::initGeom(): The geometry will be constructed through default model!" << endl;
164 geoFilePath +=
"/dat/cgem_model_4_default.txt";
167 cout <<
"INFO in CgemGeomSvc::initGeom(): Geometry will be constructed through File: "
168 << geoFilePath << endl;
171 ifstream fin(geoFilePath.c_str(), ios::in);
174 cout <<
"Error in CgemGeomSvc::initGeom(): Fail to open geomtry file: " << endl;
175 cout << geoFilePath << endl;
181 cout << left <<
"=======get BesMdcGeoParameter from CgemGeomSvc=======" << endl;
184 std::getline(fin, strcom);
185 std::getline(fin, strcom);
188 cout <<
"N_CgemLayer : " << left << setw(8) << m_N_CgemLayer
189 <<
"N_GemFoil : " << left << setw(8) << m_N_GemFoil << endl;
190 std::getline(fin, strcom);
191 std::getline(fin, strcom);
192 std::getline(fin, strcom);
193 double rLayer, lenLayer, numSheet, wSheet, aStereo, wPitchX, wPitchV, wStripX, wStripV, nChannelX, nChannelV;
194 double phi_start[3][2], dX_start_strip[3][2], dV_start_strip[3][2];
195 for (
int i=0; i < m_N_CgemLayer; i++)
197 fin >> rLayer >> lenLayer >> numSheet >> wSheet >> aStereo >> wPitchX >> wPitchV
198 >> wStripX >> wStripV >> nChannelX >> nChannelV
199 >> phi_start[i][0] >> phi_start[i][1]
200 >> dX_start_strip[i][0] >> dX_start_strip[i][1]
201 >> dV_start_strip[i][0] >> dV_start_strip[i][1]
202 >> m_T_Gap_D[i] >> m_Orientation;
220 std::getline(fin, strcom);
224 std::getline(fin, strcom);
225 std::getline(fin, strcom);
226 fin >> m_N_Cathode_Materials
227 >> m_T_Cathode_Kapton1 >> m_T_Cathode_Epoxy1 >> m_T_Cathode_Rohacell1 >> m_T_Cathode_Epoxy2
228 >> m_T_Cathode_Kapton2 >> m_T_Cathode_Epoxy3 >> m_T_Cathode_Rohacell2 >> m_T_Cathode_Epoxy4
229 >> m_T_Cathode_Kapton3 >> m_T_Cathode_Cu;
232 cout <<
"Error : CgemGeomSvc::initGeom(), Number of materials in Cathode is wrong!" << endl;
233 cout <<
"It must be less than " <<
N_MATERIAL_MAX <<
" and is " << m_N_Cathode_Materials << endl;
234 cout <<
"please, either increase N_MATERIAL_MAX or decrease m_N_Cathode_Materials" << endl;
238 m_T_Cathode = m_T_Cathode_Kapton1 + m_T_Cathode_Epoxy1 + m_T_Cathode_Rohacell1 + m_T_Cathode_Epoxy2 + m_T_Cathode_Kapton2 + m_T_Cathode_Epoxy3 + m_T_Cathode_Rohacell2 + m_T_Cathode_Epoxy4 + m_T_Cathode_Kapton3 + m_T_Cathode_Cu;
241 std::getline(fin, strcom);
242 std::getline(fin, strcom);
243 std::getline(fin, strcom);
244 fin >> m_T_Gap_T1 >> m_T_Gap_T2 >> m_T_Gap_I;
247 std::getline(fin, strcom);
248 std::getline(fin, strcom);
249 std::getline(fin, strcom);
250 fin >> m_N_GemFoil_Materials
251 >> m_T_GemFoil_Cu1 >> m_T_GemFoil_Kapton >> m_T_GemFoil_Cu2
252 >> m_R_i_GemFoil_Hole >> m_R_o_GemFoil_Hole >> m_L_GemFoil_Hole;
255 cout <<
"Error : CgemGeomSvc::initGeom(), Number of materials in GemFoil is wrong!" << endl;
256 cout <<
"It must be less than " <<
N_MATERIAL_MAX <<
" and is " << m_N_GemFoil_Materials << endl;
257 cout <<
"please, either increase N_MATERIAL_MAX or decrease m_N_GemFoil_Materials" << endl;
261 m_T_GemFoil = m_T_GemFoil_Cu1 + m_T_GemFoil_Kapton + m_T_GemFoil_Cu2;
264 std::getline(fin, strcom);
265 std::getline(fin, strcom);
266 std::getline(fin, strcom);
268 fin >> m_N_Anode_Materials
269 >> m_T_Anode_Cu1 >> m_T_Anode_Kapton1 >> m_T_Anode_Cu2 >> m_T_Anode_Epoxy1
270 >> m_T_Anode_Kapton2 >> m_T_Anode_Epoxy2 >> m_T_Anode_Rohacell1
271 >> m_T_Anode_Epoxy3 >> m_T_Anode_Kapton3 >> m_T_Anode_Epoxy4
272 >> m_T_Anode_Rohacell2 >> m_T_Anode_Epoxy5 >> m_T_Anode_Cu3 >> m_T_Anode_Kapton4 >> m_B_strip_x_on >> m_B_strip_v_on;
275 cout <<
"Error : CgemGeomSvc::initGeom(), Number of materials in Anode is wrong!" << endl;
276 cout <<
"It must be less than " <<
N_MATERIAL_MAX <<
" and is " << m_N_Anode_Materials << endl;
277 cout <<
"please, either increase N_MATERIAL_MAX or decrease m_N_Anode_Materials" << endl;
281 m_T_Anode = m_T_Anode_Cu1 + m_T_Anode_Kapton1 + m_T_Anode_Cu2 + m_T_Anode_Epoxy1
282 + m_T_Anode_Kapton2 + m_T_Anode_Epoxy2 + m_T_Anode_Rohacell1
283 + m_T_Anode_Epoxy3 + m_T_Anode_Kapton3 + m_T_Anode_Epoxy4
284 + m_T_Anode_Rohacell2 + m_T_Anode_Epoxy5 + m_T_Anode_Cu3 + m_T_Anode_Kapton4;
287 cout <<
"thickness: cathode " << m_T_Cathode <<
" gem " << m_T_GemFoil <<
" anode " << m_T_Anode << endl;
290 std::getline(fin, strcom);
291 std::getline(fin, strcom);
293 cout <<
"cable density " << m_Rho_Cable << endl;
296 std::getline(fin, strcom);
297 std::getline(fin, strcom);
298 std::getline(fin, strcom);
300 fin >> m_R_in_Separator >> m_R_out_Separator >> m_L_Separator;
302 std::getline(fin, strcom);
303 std::getline(fin, strcom);
304 fin >> m_T_Separator_Al1 >> m_T_Separator_CarFib >> m_T_Separator_Al2;
307 m_CgemSeparator->
setInnerR(m_R_in_Separator);
308 m_CgemSeparator->
setOuterR(m_R_out_Separator);
309 m_CgemSeparator->
setLength(m_L_Separator);
316 std::getline(fin, strcom);
317 std::getline(fin, strcom);
318 std::getline(fin, strcom);
319 fin >> m_R_i_Cgem >> m_R_o_Cgem >> m_L_Cgem;
321 std::getline(fin, strcom);
322 std::getline(fin, strcom);
323 std::getline(fin, strcom);
326 cout <<
"Cgem passive elements are switched " << m_passive << endl;
328 for (
int i=0; i < m_N_CgemLayer; i++) {
330 m_T_CgemLayer[i] = m_T_Cathode + m_T_Gap_D[i] + m_T_Gap_T1 + m_T_Gap_T2 + m_T_Gap_I
331 + m_T_GemFoil*3 + m_T_Anode;
334 cout << left <<
"R_CgemLayer " << left <<
"L_CgemLayer "
335 << left <<
"N_Sheet " << left <<
"W_Sheet "
336 << left <<
"A_Stereo " << left <<
"W_Pitch_X "
337 << left <<
"W_Pitch_V "<< left <<
"W_Strip_X "
338 << left <<
"W_Strip_V "<< left <<
"N_Channel_Phi "
339 << left <<
"N_Channel_V " << left <<
"Orientation " << endl;
353 cout << left <<
"T_Cathode " << left <<
"T_GemFoil " << left <<
"T_Anode "
354 << left <<
"T_CgemLayer " << endl;
355 cout << left << setw(10) << m_T_Cathode << left << setw(10) << m_T_GemFoil
356 << left << setw(8) << m_T_Anode << left << setw(9) << m_T_CgemLayer[i] << endl;
360 cout <<
"thickness " << m_T_CgemLayer[i] << endl;
364 for (
int i=0; i < m_N_CgemLayer; i++) {
369 m_CgemLayer[i]->
setOuterROfCgemLayer(m_CgemLayer[i]->getInnerROfCgemLayer() + m_T_CgemLayer[i]);
373 if(fReversed ==
false) {
375 m_CgemLayer[i]->
setOuterROfCathode( m_CgemLayer[i]->getInnerROfCgemLayer() + m_T_Cathode);
378 m_CgemLayer[i]->
setInnerROfCathode( m_CgemLayer[i]->getOuterROfCgemLayer() - m_T_Cathode);
385 double m_t_cathode_list[
N_MATERIAL_MAX] = {m_T_Cathode_Kapton1, m_T_Cathode_Epoxy1, m_T_Cathode_Rohacell1, m_T_Cathode_Epoxy2, m_T_Cathode_Kapton2, m_T_Cathode_Epoxy3, m_T_Cathode_Rohacell2, m_T_Cathode_Epoxy4, m_T_Cathode_Kapton3, m_T_Cathode_Cu};
389 if(fReversed ==
true) counter = m_N_Cathode_Materials - 1;
391 for(
int imat = 0; imat < m_N_Cathode_Materials; imat++) {
392 outer_r_cathode[imat] = inner_r_cathode[imat] + m_t_cathode_list[counter];
435 cout <<
" CATHODE CU INNER " << inner_r_cathode[imat] <<
" OUTER " << outer_r_cathode[imat] << endl;
443 if(imat == m_N_Cathode_Materials - 1) {
444 cout <<
"breaking" << endl;
447 inner_r_cathode[imat + 1] = outer_r_cathode[imat];
448 if(fReversed ==
false) counter++;
453 cout <<
"T_cathode: " << setw(15) << m_T_Cathode << setw(15)
454 << m_T_Cathode_Kapton1 << setw(15) << m_T_Cathode_Epoxy1
455 << setw(15) << m_T_Cathode_Rohacell1 << setw(15) << m_T_Cathode_Epoxy2
456 << setw(15) << m_T_Cathode_Kapton2 << setw(15) << m_T_Cathode_Epoxy3
457 << setw(15) << m_T_Cathode_Rohacell2 << setw(15) << m_T_Cathode_Epoxy4
458 << setw(15) << m_T_Cathode_Kapton3 << setw(15) << m_T_Cathode_Cu << endl;
485 if(fReversed ==
false) {
486 if (fabs((m_CgemLayer[i]->getOuterROfCathode() / m_CgemLayer[i]->getOuterROfCathodeCu()) - 1) > FLT_EPSILON){
487 cout << fabs(m_CgemLayer[i]->getOuterROfCathode() - m_CgemLayer[i]->getOuterROfCathodeCu()) << endl;
490 <<
", FLT_EPSILON = " << FLT_EPSILON << endl;
491 cout <<
"Error : CgemGeomSvc::initGeom(), Cathode size is wrong!" << endl;
496 if (fabs((m_CgemLayer[i]->getInnerROfCathode() / m_CgemLayer[i]->getInnerROfCathodeCu()) - 1) > FLT_EPSILON){
497 cout << fabs(m_CgemLayer[i]->getInnerROfCathode() - m_CgemLayer[i]->getInnerROfCathodeCu()) << endl;
500 <<
", FLT_EPSILON = " << FLT_EPSILON << endl;
501 cout <<
"Error : CgemGeomSvc::initGeom(), Cathode size is wrong!" << endl;
507 if(fReversed ==
false) {
508 m_CgemLayer[i]->
setInnerROfGapD( m_CgemLayer[i]->getOuterROfCathode() );
509 m_CgemLayer[i]->
setOuterROfGapD( m_CgemLayer[i]->getOuterROfCathode() + m_T_Gap_D[i] );
510 m_CgemLayer[i]->
setInnerROfGapT1( m_CgemLayer[i]->getOuterROfGapD() + m_T_GemFoil );
511 m_CgemLayer[i]->
setOuterROfGapT1( m_CgemLayer[i]->getInnerROfGapT1() + m_T_Gap_T1 );
512 m_CgemLayer[i]->
setInnerROfGapT2( m_CgemLayer[i]->getOuterROfGapT1() + m_T_GemFoil );
513 m_CgemLayer[i]->
setOuterROfGapT2( m_CgemLayer[i]->getInnerROfGapT2() + m_T_Gap_T2 );
514 m_CgemLayer[i]->
setInnerROfGapI( m_CgemLayer[i]->getOuterROfGapT2() + m_T_GemFoil );
515 m_CgemLayer[i]->
setOuterROfGapI( m_CgemLayer[i]->getInnerROfGapI() + m_T_Gap_I );
518 m_CgemLayer[i]->
setOuterROfGapD( m_CgemLayer[i]->getInnerROfCathode() );
519 m_CgemLayer[i]->
setInnerROfGapD( m_CgemLayer[i]->getInnerROfCathode() - m_T_Gap_D[i] );
520 m_CgemLayer[i]->
setOuterROfGapT1( m_CgemLayer[i]->getInnerROfGapD() - m_T_GemFoil );
521 m_CgemLayer[i]->
setInnerROfGapT1( m_CgemLayer[i]->getOuterROfGapT1() - m_T_Gap_T1 );
522 m_CgemLayer[i]->
setOuterROfGapT2( m_CgemLayer[i]->getInnerROfGapT1() - m_T_GemFoil );
523 m_CgemLayer[i]->
setInnerROfGapT2( m_CgemLayer[i]->getOuterROfGapT2() - m_T_Gap_T2 );
524 m_CgemLayer[i]->
setOuterROfGapI( m_CgemLayer[i]->getInnerROfGapT2() - m_T_GemFoil );
525 m_CgemLayer[i]->
setInnerROfGapI( m_CgemLayer[i]->getOuterROfGapI() - m_T_Gap_I );
528 cout <<
"Geom foil&gap " << setw(15) << m_T_Gap_D[i] << setw(15)
529 << m_T_GemFoil << setw(15) << m_T_Gap_T1
530 << setw(15) << m_T_Gap_T2 << setw(15) << m_T_Gap_I << endl;
532 cout <<
"gaps: -----------------------------" << endl;
543 if (m_N_GemFoil != 3){
544 cout <<
"Error : CgemGeomSvc::initGeom(), GemFoil number in code is 3! If m_N_GemFoil != 3,you should modify the code,especially the gap information!" << endl;
548 double R_i_GemFoil[3] = {0};
549 if(fReversed ==
false) {
560 for(
int j=0; j < m_N_GemFoil; j++){
568 double m_t_foil_list[
N_MATERIAL_MAX] = {m_T_GemFoil_Cu1, m_T_GemFoil_Kapton, m_T_GemFoil_Cu2};
570 inner_r_foil[0] = R_i_GemFoil[j];
572 if(fReversed ==
true) counter = m_N_GemFoil_Materials - 1;
575 for(
int imat = 0; imat < m_N_GemFoil_Materials; imat++) {
576 outer_r_foil[imat] = inner_r_foil[imat] + m_t_foil_list[counter];
596 if(imat == m_N_GemFoil_Materials - 1) {
597 cout <<
"breaking" << endl;
600 inner_r_foil[imat + 1] = outer_r_foil[imat];
601 if(fReversed ==
false) counter++;
610 cout <<
"Geom foil: layer " << i <<
" " << j << endl;
611 cout << setw(15) << m_T_GemFoil_Cu1 << setw(15)
612 << m_T_GemFoil_Kapton << setw(15) << m_T_GemFoil_Cu2 << endl;
627 cout <<
"GEM" << endl;
637 cout <<
"GEM" << endl;
648 if(fReversed ==
false) {
650 m_CgemLayer[i]->
setOuterROfAnode( m_CgemLayer[i]->getOuterROfGapI() + m_T_Anode );
653 m_CgemLayer[i]->
setInnerROfAnode( m_CgemLayer[i]->getInnerROfGapI() - m_T_Anode);
662 double m_t_anode_list[
N_MATERIAL_MAX] = {m_T_Anode_Cu1, m_T_Anode_Kapton1, m_T_Anode_Cu2, m_T_Anode_Epoxy1, m_T_Anode_Kapton2, m_T_Anode_Epoxy2, m_T_Anode_Rohacell1, m_T_Anode_Epoxy3, m_T_Anode_Kapton3, m_T_Anode_Epoxy4, m_T_Anode_Rohacell2, m_T_Anode_Epoxy4, m_T_Anode_Cu3, m_T_Anode_Kapton4};
665 if(fReversed ==
true) counter = m_N_Anode_Materials - 1;
668 for(
int imat = 0; imat < m_N_Anode_Materials; imat++) {
669 outer_r_anode[imat] = inner_r_anode[imat] + m_t_anode_list[counter];
733 if(imat == m_N_Anode_Materials - 1) {
734 cout <<
"breaking" << endl;
737 inner_r_anode[imat + 1] = outer_r_anode[imat];
738 if(fReversed ==
false) counter++;
742 cout <<
"ANODE: " << endl;
773 cout <<
"X strip description is " << m_B_strip_x_on <<
" and V strip description is " << m_B_strip_v_on << endl;
776 if(fReversed ==
false) {
777 if(fabs((m_CgemLayer[i]->getOuterROfAnode() / m_CgemLayer[i]->getOuterROfCgemLayer())-1) > FLT_EPSILON){
778 cout << fabs(m_CgemLayer[i]->getOuterROfAnode() - m_CgemLayer[i]->getOuterROfCgemLayer()) << endl;
779 cout << FLT_EPSILON << endl;
780 cout <<
"Error : CgemLayer size is wrong!" << endl;
785 if(fabs((m_CgemLayer[i]->getInnerROfAnode() / m_CgemLayer[i]->getInnerROfCgemLayer())-1) > FLT_EPSILON){
786 cout << fabs(m_CgemLayer[i]->getInnerROfAnode() - m_CgemLayer[i]->getInnerROfCgemLayer()) << endl;
787 cout << FLT_EPSILON << endl;
788 cout <<
"Error : CgemLayer size is wrong!" << endl;
794 m_CgemLayer[i]->
print();
804 double width_sheet=rXstrips*CLHEP::twopi/nSheet;
805 cout<<
"construct CgemReadoutPlanes: "<<endl;
809 for(
int j=0; j<nSheet; j++){
810 cout<<
"------ layer "<<i<<
", sheet "<<j<<
" ------ "<<endl;
811 double rStrips = 0.5*(rXstrips+rVstrips);
815 phi_start[i][j], dX_start_strip[i][j],
816 dV_start_strip[i][j],
818 -0.5*m_CgemLayer[i]->getLengthOfCgemLayer(),
819 m_CgemLayer[i]->getLengthOfCgemLayer(),
820 m_CgemLayer[i]->getNumberOfChannelX()/nSheet,
821 m_CgemLayer[i]->getNumberOfChannelV()/nSheet,
822 m_CgemLayer[i]->getWidthOfPitchX(),
823 m_CgemLayer[i]->getWidthOfStripX(),
824 m_CgemLayer[i]->getWidthOfPitchV(),
825 m_CgemLayer[i]->getWidthOfStripV(),
826 m_CgemLayer[i]->getAngleOfStereo(),
827 m_CgemLayer[i]->getMiddleROfGapD(),
828 m_CgemLayer[i]->getOuterROfGapD()
834 cout <<
"INFO : CgemGeomSvc::initGeom(), Successfully input geometry parameters!" << endl;
841 cout <<
"====================CGEM Information=========================" << endl;
842 cout <<
"R_i_Cgem " <<
"R_o_Cgem " <<
"L_Cgem" << endl;
843 cout << left << setw(10) << m_R_i_Cgem
844 << left << setw(10) << m_R_o_Cgem
845 << left << setw(10) << m_L_Cgem << endl;
846 cout <<
"====================CGEM Information End!====================" << endl;
850 cout <<
"************************ FINAL CHECK OF THE DIMENSIONS" << endl;
851 for(
int ilayer = 0; ilayer < 3; ilayer++) {
854 cout <<
"inner global radius of layer" << ilayer <<
": " << m_CgemLayer[ilayer]->
getInnerROfCgemLayer()
859 for(
int ifoil = 0; ifoil < 3; ifoil++) {
860 cout <<
"inner radius of gem" << ifoil <<
": " << m_foil[ilayer][ifoil]->
getInnerROfCgemFoil()
864 cout <<
"inner radius of anode: " << m_CgemLayer[ilayer]->
getInnerROfAnode()
873void CgemGeomSvc::TestReadoutPlane() {
874 const int nSheet[3]={1,2,2};
878 const double phimin(0.), phimax(7.);
879 const int nphi=20000;
880 const double zmin(-850), zmax(850);
883 double phi(0.), z(-423.5),
v(0.);
894 double X[3][2], dX2[3][2], dX3[3][2], PHI[3][2],
895 V[3][2], dV2[3][2], dV3[3][2],
899 cout<<setiosflags(ios::left)
900 <<setw(14)<<
"phi" <<setw(2)<<
" "
901 <<setw(14)<<
"z" <<setw(2)<<
" "
902 <<setw( 6)<<
"layer" <<setw(2)<<
" "
903 <<setw( 6)<<
"sheet" <<setw(2)<<
" "
904 <<setw( 6)<<
"onIt" <<setw(2)<<
" "
905 <<setw(14)<<
"X" <<setw(2)<<
" "
906 <<setw( 6)<<
"Xid" <<setw(2)<<
" "
907 <<setw( 6)<<
"Xid2" <<setw(2)<<
" "
908 <<setw( 6)<<
"Xid3" <<setw(2)<<
" "
909 <<setw(18)<<
"dX2" <<setw(2)<<
" "
910 <<setw(18)<<
"dX3" <<setw(2)<<
" "
911 <<setw(18)<<
"PHI" <<setw(2)<<
" "
912 <<setw(18)<<
"V" <<setw(2)<<
" "
913 <<setw( 6)<<
"Vid" <<setw(2)<<
" "
914 <<setw( 6)<<
"Vid2" <<setw(2)<<
" "
915 <<setw( 6)<<
"Vid3" <<setw(2)<<
" "
916 <<setw(18)<<
"dV2" <<setw(2)<<
" "
917 <<setw(18)<<
"dV3" <<setw(2)<<
" "
918 <<setw(18)<<
"zCross" <<setw(2)<<
" "
919 <<setw(18)<<
"Vnext" <<setw(2)<<
" "
923 for(
int ii=0; ii<nphi; ii++)
925 phi= phimin+(ii+0.5)*(phimax-phimin)/nphi;
928 for(
int i=0; i<m_N_CgemLayer; i++)
931 for(
int j=0; j<nSheet[i]; j++)
936 X[i][j] =anode->
getX(phi);
942 G4ThreeVector pos(
cos(phi),
sin(phi),z);
948 int iSheetNext= (j+1)%nSheet[i];
951 double phimin_next = anodeNext->
getPhimin();
955 cout<<setiosflags(ios::left)
956 <<setw(14)<<phi <<setw(2)<<
" "
957 <<setw(14)<<z <<setw(2)<<
" "
958 <<setw( 6)<<i <<setw(2)<<
" "
959 <<setw( 6)<<j <<setw(2)<<
" "
960 <<setw( 6)<<int(onPlane[i][j]) <<setw(2)<<
" "
961 <<setw(14)<<X[i][j] <<setw(2)<<
" "
962 <<setw( 6)<<Xid[i][j] <<setw(2)<<
" "
963 <<setw( 6)<<Xid2[i][j] <<setw(2)<<
" "
964 <<setw( 6)<<Xid3[i][j] <<setw(2)<<
" "
965 <<setw(18)<<dX2[i][j] <<setw(2)<<
" "
966 <<setw(18)<<dX3[i][j] <<setw(2)<<
" "
968 <<setw(18)<<PHI[i][j] <<setw(2)<<
" "
969 <<setw(18)<<V[i][j] <<setw(2)<<
" "
970 <<setw( 6)<<Vid[i][j] <<setw(2)<<
" "
971 <<setw( 6)<<Vid2[i][j] <<setw(2)<<
" "
972 <<setw( 6)<<Vid3[i][j] <<setw(2)<<
" "
973 <<setw(18)<<dV2[i][j] <<setw(2)<<
" "
974 <<setw(18)<<dV3[i][j] <<setw(2)<<
" "
975 <<setw(18)<<zCross[i][j] <<setw(2)<<
" "
976 <<setw(18)<<Vnext <<setw(2)<<
" "
double sin(const BesAngle a)
double cos(const BesAngle a)
**********Class see also m_nmax DOUBLE PRECISION m_amel DOUBLE PRECISION m_x2 DOUBLE PRECISION m_alfinv DOUBLE PRECISION m_Xenph INTEGER m_KeyWtm INTEGER m_idyfs DOUBLE PRECISION m_zini DOUBLE PRECISION m_q2 DOUBLE PRECISION m_Wt_KF DOUBLE PRECISION m_WtCut INTEGER m_KFfin *COMMON c_KarLud $ !Input CMS energy[GeV] $ !CMS energy after beam spread beam strahlung[GeV] $ !Beam energy spread[GeV] $ !z boost due to beam spread $ !electron beam mass *ff pair spectrum $ !minimum v
void setLayerR(int layer, double r)
void initAlignPar(std::string alignFile)
double getOuterROfCgemFoilCu1() const
double getInnerROfCgemFoilCu2() const
void setIDOfCgemFoil(int id)
void setInnerROfCgemFoilKapton(double r)
void setOuterROfCgemFoilCu1(double r)
double getOuterROfCgemFoilKapton() const
void setInnerROfCgemFoilCu1(double r)
double getInnerROfCgemFoil() const
double getInnerROfCgemFoilCu1() const
void setOuterROfCgemFoilCu2(double r)
int getIDOfCgemFoil() const
void setInnerROfCgemFoilCu2(double r)
void setOuterROfCgemFoilKapton(double r)
double getInnerROfCgemFoilKapton() const
void setOuterROfCgemFoil(double r)
void setInnerROfCgemFoil(double r)
double getOuterROfCgemFoilCu2() const
double getOuterROfCgemFoil() const
void setWidthOfPitchV(double w)
void setWidthOfStripX(double w)
double getOuterROfAnodeCu1() const
void setInnerROfCathodeEpoxy3(double r)
void setAngleOfStereo(double a)
void setIDOfCgemLayer(int id)
void setOuterROfAnodeKapton4(double r)
void setInnerROfCathodeEpoxy4(double r)
double getInnerROfCathode() const
void setInnerROfCathodeCu(double r)
double getInnerROfAnodeEpoxy4() const
double getInnerROfAnodeEpoxy1() const
void setInnerROfAnodeRohacell2(double r)
void setOuterROfCathodeKapton3(double r)
double getInnerROfCathodeKapton2() const
void setOuterROfAnodeCu3(double r)
void setOuterROfAnodeKapton1(double r)
double getWidthOfPitchV() const
void setOuterROfAnodeRohacell2(double r)
double getOuterROfCathodeEpoxy4() const
double getInnerROfGapI() const
void setOuterROfAnode(double r)
void setOuterROfCathodeCu(double r)
double getWidthOfStripV() const
double getOuterROfGapD() const
void setOuterROfAnodeEpoxy5(double r)
void setOuterROfCathodeRohacell2(double r)
double getInnerROfCathodeKapton3() const
double getOuterROfAnodeEpoxy2() const
double getInnerROfGapT1() const
double getLengthOfCgemLayer() const
void setInnerROfAnodeCu2(double r)
double getOuterROfCathodeEpoxy1() const
void setOuterROfAnodeEpoxy3(double r)
double getInnerROfCathodeEpoxy2() const
double getOuterROfCathodeKapton1() const
double getInnerROfCathodeCu() const
void setOuterROfCathodeKapton2(double r)
void setInnerROfCathodeKapton2(double r)
void setOuterROfAnodeEpoxy1(double r)
double getOuterROfAnodeKapton2() const
double getInnerROfCathodeEpoxy4() const
double getOuterROfAnodeKapton1() const
void setInnerROfAnodeEpoxy5(double r)
double getInnerROfAnodeCu1() const
double getInnerROfAnodeKapton2() const
void setInnerROfGapD(double r)
void setOuterROfGapI(double r)
double getInnerROfCgemLayer() const
double getOuterROfCathodeEpoxy3() const
void setNumberOfChannelV(int n)
double getInnerROfAnode() const
double getInnerROfGapT2() const
void setCgemFoil(int i, CgemGeoFoil *pFoil)
double getWidthOfStripX() const
double getOuterROfAnodeRohacell1() const
void setInnerROfAnodeEpoxy2(double r)
void setOuterROfAnodeKapton2(double r)
double getOuterROfGapT1() const
void setOuterROfGapT2(double r)
double getOuterROfCathodeRohacell2() const
void setOuterROfCathodeKapton1(double r)
double getOuterROfGapT2() const
double getInnerROfAnodeCu3() const
int getNumberOfSheet() const
void setInnerROfAnodeKapton1(double r)
double getOuterROfAnodeCu3() const
double getInnerROfCathodeEpoxy3() const
void setOuterROfAnodeKapton3(double r)
double getOuterROfAnodeKapton3() const
void setInnerROfCgemLayer(double innerR)
double getOuterROfAnode() const
double getOuterROfCathodeCu() const
void setInnerROfAnodeCu1(double r)
void setInnerROfGapT1(double r)
void setInnerROfGapI(double r)
double getOuterROfCathodeKapton3() const
int getNumberOfChannelX() const
double getInnerROfAnodeRohacell1() const
void setNumberOfSheet(int n)
void setInnerROfAnodeCu3(double r)
void setInnerROfAnode(double r)
int getNumberOfChannelV() const
void setInnerROfGapT2(double r)
double getOuterROfCathode() const
double getOuterROfAnodeEpoxy1() const
double getWidthOfSheet() const
double getInnerROfAnodeEpoxy2() const
void setOuterROfCathodeEpoxy4(double r)
double getOuterROfCathodeRohacell1() const
double getOuterROfAnodeEpoxy4() const
void setInnerROfCathodeRohacell1(double r)
void setOuterROfAnodeEpoxy2(double r)
void setInnerROfAnodeRohacell1(double r)
void setOuterROfGapT1(double r)
double getOuterROfGapI() const
void setOrientation(bool o)
void setOuterROfAnodeCu2(double r)
double getInnerROfAnodeRohacell2() const
void setInnerROfCathodeRohacell2(double r)
double getOuterROfCgemLayer() const
void setOuterROfCathodeRohacell1(double r)
void setInnerROfAnodeKapton4(double r)
void setInnerROfCathodeEpoxy1(double r)
double getAngleOfStereo() const
void setOuterROfCathodeEpoxy1(double r)
void setNumberOfChannelX(int n)
double getInnerROfAnodeEpoxy3() const
void setOuterROfCgemLayer(double outerR)
double getOuterROfAnodeEpoxy5() const
double getInnerROfCathodeKapton1() const
double getWidthOfPitchX() const
void setWidthOfStripV(double w)
double getInnerROfAnodeKapton3() const
double getInnerROfCathodeEpoxy1() const
double getInnerROfAnodeKapton4() const
void setOuterROfCathodeEpoxy2(double r)
bool getOrientation() const
void setInnerROfCathodeKapton1(double r)
void setLengthOfCgemLayer(double length)
void setInnerROfCathodeKapton3(double r)
void setInnerROfAnodeEpoxy1(double r)
void setInnerROfCathode(double r)
double getInnerROfAnodeEpoxy5() const
double getOuterROfAnodeCu2() const
double getInnerROfGapD() const
void setInnerROfAnodeKapton3(double r)
double getOuterROfAnodeEpoxy3() const
double getInnerROfAnodeKapton1() const
void setInnerROfCathodeEpoxy2(double r)
double getOuterROfCathodeEpoxy2() const
double getInnerROfAnodeCu2() const
void setOuterROfCathodeEpoxy3(double r)
double getOuterROfCathodeKapton2() const
double getOuterROfAnodeKapton4() const
void setInnerROfAnodeEpoxy3(double r)
double getInnerROfCathodeRohacell1() const
void setOuterROfGapD(double r)
void setOuterROfAnodeCu1(double r)
void setWidthOfSheet(double w)
void setOuterROfAnodeRohacell1(double r)
double getInnerROfCathodeRohacell2() const
void setWidthOfPitchX(double w)
void setInnerROfAnodeEpoxy4(double r)
void setOuterROfAnodeEpoxy4(double r)
double getOuterROfAnodeRohacell2() const
void setInnerROfAnodeKapton2(double r)
void setOuterROfCathode(double r)
double getZFromPhiV(double phi, double V, int checkXRange=1) const
double getPhiFromXID(int X_ID) const
double getDist2ClosestXStripCenter(double phi, int &id)
int getClosestXStripID(double phi, double &dist)
int getXStripID(double phi) const
bool OnThePlane(double phi, double z) const
int getVIDFromV(double V) const
double getVFromPhiZ(double phi, double z) const
double getX(double phi) const
double getVInNextSheetFromV(double v, double phiminNext) const
int getClosestVStripID(G4ThreeVector pos, double &dist) const
void getStripID(G4ThreeVector pos, int &X_ID, int &V_ID) const
double getDist2ClosestVStripCenter(G4ThreeVector pos, int &id)
void setInnerR(double innerR)
void setOuterR(double outerR)
void setLength(double length)
void setThickOfOuterAluminum(double thick)
void setThickOfCarbonFiber(double thick)
void setThickOfInnerAluminum(double thick)
virtual StatusCode queryInterface(const InterfaceID &riid, void **ppvUnknown)
void handle(const Incident &inc)
virtual StatusCode finalize()
CgemGeomSvc(const std::string &name, ISvcLocator *pSvcLocator)
CgemGeoReadoutPlane * getReadoutPlane(int iLayer, int iSheet) const
virtual StatusCode initialize()
static const int N_MATERIAL_MAX
void setAlignment(CgemGeoAlign *alignPtr)
void setR(int layer, double r)
void setReadoutPlane(int layer, int sheet, CgemGeoReadoutPlane *readoutPtr)