QwGeant4
QweakSimGEM.cc
Go to the documentation of this file.
1 //=============================================================================
2 //
3 // ---------------------------
4 // | Doxygen File Information |
5 // ---------------------------
6 //
7 /**
8 
9  \file QweakSimGEM.cc
10 
11  $Revision: 1.3 $
12  $Date: 2005/12/29 01:00:11 $
13 
14  \author Klaus Hans Grimm
15 
16 */
17 //=============================================================================
18 
19 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
20 
21 #include "QweakSimGEM.hh"
22 
23 // geant4 includes
24 #include "G4ProductionCuts.hh"
25 
26 // user includes
27 #include "QweakSimMaterial.hh"
28 #include "QweakSimGEMMessenger.hh"
29 
30 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
31 
33 {
34 G4cout << G4endl << "###### Calling QweakSimGEM::QweakGEM() " << G4endl << G4endl;
35 
36 
37  //---------------------------------------------------------------------------------------------------
38 
39 //===============================
40 // cuts for G4Region and PAIModel
41 //===============================
42 fGammaCut = 1*mm;
43 fElectronCut = 1*mm;
44 fPositronCut = 1*mm;
45 
46 fRegGasDet = NULL;
47 
48 
49 
50 // initialize pointers
51 
54 
55  //---------------------------------------
59 
62 
63  GEM_Frame_Logical = NULL;
64  GEM_Frame_Physical = NULL;
65 
68 
71 
75 
78 
81 
84 
87 
90  //--------------------------------------------
91 
92  GEM_Messenger = NULL;
93 
94  //---------------------------------------------
97  GEM_Frame_VisAtt = NULL;
98 
102 
106 
109  //---------------------------------------------
110 
111  GEMdriftChamberSD = NULL;
112  GEM_Frame_Solid = NULL;
113 
114  //---------------------------------------------------------------------------------------------------
115 
116  // define target geometry value
117  // Geometry taken from Norm's GEM talk in Vancouver 2005
118 
119  GEMFrame_Thickness = 30*mm; //
120 
121  GEMFrame_InnerLength = 300*mm; // X
122  GEMFrame_InnerWidth = 300*mm; // Y
123 
124  GEMFrame_OuterLength = 350*mm; // X
125  GEMFrame_OuterWidth = 350*mm; // Y
126 
129 
130 
131  GEM_KaptonCathodeFoil_Thickness = 0.050*mm; // 50um
132  GEM_KaptonMiddleFoil_Thickness = 0.050*mm; // 50um
133  GEM_KaptonAnodeFoil_Thickness = 0.050*mm; // 50um
134  GEM_G10AnodeBoard_Thickness = 0.300*mm; // 300um
135  GEM_CopperLayer_Thickness = 0.005*mm; // 5um
136 
137 
138  // Tony Forest did not mention it, but I suppose that the GEM will
139  // sandwiched between 2 alu plates for stability.
140  AluFrame_Thickness = 1.0*cm;
145 
146  GEM_CenterFront_XPos = 0.0*cm;
147  GEM_CenterFront_YPos = 25.0*cm; //15.0*cm;
148  GEM_CenterFront_ZPos = -543.170*cm; // Allena's keepout info
149 
150  GEM_CenterBack_XPos = 0.0*cm;
151  GEM_CenterBack_YPos = 25.0*cm; //17.0*cm;
152  GEM_CenterBack_ZPos = -535.0*cm;
153 
154 
155  // define Rotation matrix for Container orientated in MotherVolume
156  Rotation_FrontChamber_GEM = new G4RotationMatrix();
157  Rotation_BackChamber_GEM = new G4RotationMatrix();
158 
159  GEM_FrontChamber_RotationAngleInPhi = 90.0*degree; // normally 90.0*degree = 12 o'clock = octant 1
160  GEM_BackChamber_RotationAngleInPhi = 90.0*degree; // normally 90.0*degree = 12 o'clock = octant 1
161 
162 
163 
165 
167 }
168 
169 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
171 {
172 
173  // delete pointers
174 
175 
176 
177 
178  //----------------------
182  //
186  //
189  //
193  //----------------------
194 
195  //----------------------
198  //
202  //
205  //----------------------
206  //
207  //----------------------
210  //
213  //
216  //----------------------
217  //
218  //--------------------------------------------
221  //
224  //--------------------------------------------
225  //
226  //---------------------------------------
229  //
232  //
236  //---------------------------------------
237 
240 
241  if (GEM_Frame_Solid) delete GEM_Frame_Solid;
242 
243  if (GEM_Messenger) delete GEM_Messenger;
244 
245  //if (GEMdriftChamberSD) delete GEMdriftChamberSD; // causes crash
246 
247  //---------------------------------------
248 
249 }
250 
251 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
252 
253 void QweakSimGEM::ConstructComponent(G4VPhysicalVolume* MotherVolume)
254 {
255  G4cout << G4endl << "###### Calling QweakSimGEM::ConstructComponent() " << G4endl << G4endl;
256 
257  // definition of a mil = inch/1000
258  //static const G4double mil = 0.001*2.54*cm;
259 
260 
261  // assign material
262  G4Material* GEM_MasterContainer_Material = pMaterial->GetMaterial("Air");
263  G4Material* GEM_SubContainer_Material = pMaterial->GetMaterial("ArCO2");
264  G4Material* GEM_Frame_Material = pMaterial->GetMaterial("NemaG10");
265  G4Material* GEM_Foil_Material = pMaterial->GetMaterial("Kapton");
266  G4Material* GEM_CopperLayer_Material = pMaterial->GetMaterial("Copper");
267 
268 
269  // define solid volume of the drift chamber container
270  G4cout << G4endl << "###### QweakSimGEM: Define GEM_MasterContainer_Solid" << G4endl << G4endl;
271 
272  G4Box* GEM_MasterContainer_Solid = new G4Box("GEM_MasterContainer_Sol",
274  0.5* GEMFrame_OuterWidth,
275  0.5* GEMFrame_Thickness +0.1*mm);
276 
277  // define GEM logical volume of drift chamber container
278  G4cout << G4endl << "###### QweakSimGEM: Define GEM_MasterContainer_Logical " << G4endl << G4endl;
279 
280  GEM_MasterContainer_Logical = new G4LogicalVolume(GEM_MasterContainer_Solid,
281  GEM_MasterContainer_Material,
282  "GEM_MasterContainer_Log",
283  0,0,0);
284 
285  // define GEM MasterContainer positions in MotherVolume
286  G4ThreeVector position_MasterContainerFront = G4ThreeVector(GEM_CenterFront_XPos , GEM_CenterFront_YPos , GEM_CenterFront_ZPos );
287  G4ThreeVector position_MasterContainerBack = G4ThreeVector(GEM_CenterBack_XPos , GEM_CenterBack_YPos , GEM_CenterBack_ZPos );
288 
289 
290  // define GEM Container Orientation in MotherVolume
291  G4double roationAngleInTheta = 0.0*degree;
292  Rotation_FrontChamber_GEM -> rotateX(roationAngleInTheta);
293  Rotation_BackChamber_GEM -> rotateX(roationAngleInTheta);
294 
295  // define GEM physical volume of drift chamber container
296  G4cout << G4endl << "###### QweakSimGEM: Define GEM_MasterContainerFront_Physical" << G4endl << G4endl;
297 
299  position_MasterContainerFront,
300  "GEM_MasterContainerFront_Physical",
302  MotherVolume,
303  false,
304  0,
305  pSurfChk); // copy number for front
306 
307 
308 
309  // define GEM physical volume of drift chamber container
310  G4cout << G4endl << "###### QweakSimGEM: Define GEM_MasterContainerBack_Physical" << G4endl << G4endl;
311 
313  position_MasterContainerBack,
314  "GEM_MasterContainerBack_Physical",
316  MotherVolume,
317  false,
318  1,
319  pSurfChk);// copy number for back
320 
321 
322  //====================================================================
323  // Definition of the GEM Frame ( symbolizes the stack of real frames )
324  //====================================================================
325 
326  // define outer frame solid
327  G4cout << G4endl << "###### QweakSimGEM: Define GEM_OuterFrame_Solid" << G4endl << G4endl;
328 
329  G4Box* GEM_OuterFrame_Solid = new G4Box("GEM_OuterFrame_Sol",
331  0.5* GEMFrame_OuterWidth,
332  0.5* GEMFrame_Thickness);
333 
334  // define inner frame solid
335  G4cout << G4endl << "###### QweakSimGEM: Define GEM_InnerFrame_Solid" << G4endl << G4endl;
336 
337  G4Box* GEM_InnerFrame_Solid = new G4Box("GEM_InnerFrame_Sol",
339  0.5* GEMFrame_InnerWidth,
340  0.5* GEMFrame_Thickness + 0.1*mm);
341 
342 
343  // create frame by subtracting outer framebox from inner framebox
344  G4cout << G4endl << "###### QweakSimGEM: Define GEM_Frame_Solid" << G4endl << G4endl;
345 
346  GEM_Frame_Solid = new G4SubtractionSolid("GEM_Frame",
347  GEM_OuterFrame_Solid,
348  GEM_InnerFrame_Solid);
349 
350 
351  G4cout << G4endl << "###### QweakSimGEM: Define GEM_Frame_Logical" << G4endl << G4endl;
352  GEM_Frame_Logical = new G4LogicalVolume(GEM_Frame_Solid,
353  GEM_Frame_Material,
354  "GEM_Frame_Log",
355  0,0,0);
356 
357 
358  // define the position of the Frame within the GEM Container: put it in the center of GEM container
359  G4ThreeVector position_Frame = G4ThreeVector(0. , 0. , 0.);
360 
361  G4cout << G4endl << "###### QweakSimGEM: Define GEM_Frame_Physical" << G4endl << G4endl;
362 
363  GEM_Frame_Physical = new G4PVPlacement(0, // no rotation matrix needed
364  position_Frame,
366  "GEM_Frame_Physical",
368  0,
369  0,
370  pSurfChk); //copy number: 0
371 
372 
373  //======================================================================================
374  // Definition of the GEM SubContainer holding the stack of foil planes and readout plane
375  //======================================================================================
376 
377 
378  // define outer frame solid
379  G4cout << G4endl << "###### QweakSimGEM: Define GEM_SubContainer_Solid" << G4endl << G4endl;
380 
381  G4Box* GEM_SubContainer_Solid = new G4Box("GEM_OuterFrame_Sol",
382  0.5* GEMFrame_InnerLength, // X
383  0.5* GEMFrame_InnerWidth, // Y
384  0.5* GEMFrame_Thickness); // Z
385 
386  G4cout << G4endl << "###### QweakSimGEM: Define GEM_SubContainer_Logical" << G4endl << G4endl;
387 
388  GEM_SubContainer_Logical = new G4LogicalVolume(GEM_SubContainer_Solid,
389  GEM_SubContainer_Material,
390  "GEM_SubContainer_Log",
391  0,0,0);
392 
393 
394  // define the position of the SubContainer within the GEM Container: put it in the center of GEM container
395  G4ThreeVector position_SubContainer = G4ThreeVector(0. , 0. , 0.);
396 
397  G4cout << G4endl << "###### QweakSimGEM: Define GEM_SubContainer_Physical" << G4endl << G4endl;
398 
399  GEM_SubContainer_Physical = new G4PVPlacement(0, // no rotation matrix needed
400  position_SubContainer,
402  "GEM_SubContainer_Physical",
404  0,
405  0,
406  pSurfChk); //copy number: 0
407 
408 
409 
410  //====================================================================
411  // Definition of the GEM Foils
412  //====================================================================
413 
414 
415  // define a container holding a 50um thick Kapton foil coated with 5um Copper
416  // on each side.
417  // Construction: create 60um thick copper box and insert a 50um thick Kapton box
418 
419  G4cout << G4endl << "###### QweakSimGEM: Define GEM_MiddleFoilContainer_Solid" << G4endl << G4endl;
420 
421  G4Box* GEM_MiddleFoilContainer_Solid = new G4Box("GEM_MiddleFoilContainer_Sol",
423  0.5* GEMFrame_InnerWidth,
425 
426  // define foil logical
427  G4cout << G4endl << "###### QweakSimGEM: Define GEM_MiddleFoilContainer_Logical" << G4endl << G4endl;
428 
429  GEM_MiddleFoilContainer_Logical = new G4LogicalVolume(GEM_MiddleFoilContainer_Solid,
430  GEM_SubContainer_Material,
431  "GEM_MiddleFoilContainer_Log",
432  0,0,0);
433 
434  //==================================
435  // create the 50um thick Kapton foil
436  //==================================
437  G4Box* GEM_KaptonMiddleFoil_Solid = new G4Box("GEM_KaptonMiddleFoil_Sol",
439  0.5* GEMFrame_InnerWidth,
441 
442  // define foil logical
443  G4cout << G4endl << "###### QweakSimGEM: Define GEM_KaptonMiddleFoil_Logical" << G4endl << G4endl;
444 
445  GEM_KaptonMiddleFoil_Logical = new G4LogicalVolume(GEM_KaptonMiddleFoil_Solid,
446  GEM_Foil_Material,
447  "GEM_KaptonMiddleFoil_Log",
448  0,0,0);
449 
450  // place 50um thick Kapton box into the 60um thick Copper box
451  GEM_KaptonMiddleFoil_Physical = new G4PVPlacement(0,
452  G4ThreeVector(0. , 0. , 0. ),
454  "GEM_KaptonMiddleFoil_Physical",
456  0,
457  0,
458  pSurfChk); //copy number 0
459 
460  //=====================================
461  // define 5um thick Middle GEM foil copper layer
462  //====================================
463 
464  // define solid
465  G4cout << G4endl << "###### QweakSimGEM: Define GEM_CopperLayer_Solid" << G4endl << G4endl;
466 
467  G4Box* GEM_CopperLayer_Solid = new G4Box("GEM_CopperLayer_Sol",
469  0.5* GEMFrame_InnerWidth,
471 
472  // define logical
473  G4cout << G4endl << "###### QweakSimGEM: Define GEM_CopperMiddleFoil_Logical" << G4endl << G4endl;
474 
475  GEM_CopperMiddleFoil_Logical = new G4LogicalVolume(GEM_CopperLayer_Solid,
476  GEM_CopperLayer_Material,
477  "GEM_CopperMiddleFoil_Log",
478  0,0,0);
479 
480  // define physical
481  G4cout << G4endl << "###### QweakSimGEM: Define GEM_CopperMiddleFoil_Physical" << G4endl << G4endl;
482 
483  // Z Location of the CopperLayer within GEM_MiddleFoilContainer:
484  // (first go to border of box and go half the copper layer thickness back)
485  G4double _LocalPostionInZ_TopCopperLayer =
487 
488  G4double _LocalPostionInZ_BottomCopperLayer =
490 
491 
492 
493  // place copper top layer
495  new G4PVPlacement(0,
496  G4ThreeVector(0. , 0. , _LocalPostionInZ_TopCopperLayer ),
498  "GEM_TopCopperMiddleFoil_Physical",
500  0,
501  0,
502  pSurfChk); //copy number for top layer
503 
504  // place copper bottom layer
506  new G4PVPlacement(0,
507  G4ThreeVector(0. , 0. , _LocalPostionInZ_BottomCopperLayer ),
509  "GEM_BottomCopperMiddleFoil_Physical",
511  0,
512  0,
513  pSurfChk); //copy number for bottom layer
514 
515 
516 
517  // Z Location of the double sided copper coated Kapton foils in the GEM stack
518  // 0.0*mm: Bottom side of Readout Frame, 30*mm: Top side of window frame
519  G4double GEM_MiddleFoil_PositionInZ[3] = {7*mm, 9*mm, 11*mm};
520 
521  // define foil physical
522  G4cout << G4endl << "###### QweakSimGEM: Define GEM_MiddleFoilContainer_Physical" << G4endl << G4endl;
523 
524  for( G4int index = 0; index < 3; index++){
525 
526  new G4PVPlacement(0,
527  G4ThreeVector(0. , 0. , -1.0*GEM_MiddleFoil_PositionInZ[index] + 0.5*GEMFrame_Thickness),
529  "GEM_MiddleFoilContainer_Physical",
531  0,
532  index,
533  pSurfChk); //copy number
534 
535  } // end for
536 
537  //====================================================================
538  // Definition of the GEM Readout Plane
539  //====================================================================
540 
541  // Readout Plane contains: 300um G10 board (beam downstream)
542  // 50um Kapton,
543  // 5um Copper (beam upstream)
544  //
545  // Construction: create 355um thick Kapton box,
546  // place G10 board inside to bottom side, place copper box inside to to side
547 
548  // define solid
549  G4cout << G4endl << "###### QweakSimGEM: Define GEM_AnodeReadoutPlaneContainer_Solid" << G4endl << G4endl;
550 
551  G4Box* GEM_AnodeReadoutPlaneContainer_Solid =
552  new G4Box("GEM_AnodeReadoutPlaneContainer_Sol",
554  0.5* GEMFrame_InnerWidth,
556 
557  // define logical
558  G4cout << G4endl << "###### QweakSimGEM: Define GEM_AnodeReadoutPlaneContainer_Logical" << G4endl << G4endl;
559 
560  GEM_AnodeReadoutPlaneContainer_Logical = new G4LogicalVolume(GEM_AnodeReadoutPlaneContainer_Solid,
561  GEM_Foil_Material,
562  "GEM_AnodeReadoutPlaneContainer_Log",
563  0,0,0);
564 
565  //=============================
566  // define 300um thick G10 board
567  //=============================
568 
569  // define solid
570  G4cout << G4endl << "###### QweakSimGEM: Define GEM_AnodeReadoutBoard_Solid" << G4endl << G4endl;
571 
572  G4Box* GEM_AnodeReadoutBoard_Solid = new G4Box("GEM_AnodeReadoutBoard_Sol",
574  0.5* GEMFrame_InnerWidth,
576 
577  // define logical
578  G4cout << G4endl << "###### QweakSimGEM: Define GEM_AnodeReadoutBoard_Logical" << G4endl << G4endl;
579 
580  GEM_AnodeReadoutBoard_Logical = new G4LogicalVolume(GEM_AnodeReadoutBoard_Solid,
581  GEM_Frame_Material,
582  "GEM_AnodeReadoutBoard_Log",
583  0,0,0);
584 
585  // define physical
586  G4cout << G4endl << "###### QweakSimGEM: Define GEM_AnodeReadoutBoard_Physical" << G4endl << G4endl;
587 
588  // Z Location of the AnodeReadoutBoard within GEM_AnodeReadoutPlaneContainer: +0.5*355um - 0.5*300um
589  // (first go to border of box and go half the G10 board thickness back)
590 
591  G4double _LocalPostionInZ_AnodeReadoutBoard =
594 
595  GEM_AnodeReadoutBoard_Physical = new G4PVPlacement(0,
596  G4ThreeVector(0. , 0. , _LocalPostionInZ_AnodeReadoutBoard ),
598  "GEM_AnodeReadoutBoard_Physical",
600  0,
601  0,
602  pSurfChk); //copy number
603 
604 
605  //=====================================
606  // define 5um thick Anode copper layer
607  //====================================
608 
609  // define solid
610  G4cout << G4endl << "###### QweakSimGEM: Define GEM_AnodeCopperLayer_Solid" << G4endl << G4endl;
611 
612  G4Box* GEM_AnodeCopperLayer_Solid = new G4Box("GEM_AnodeCopperLayer_Sol",
614  0.5* GEMFrame_InnerWidth,
616 
617  // define logical
618  G4cout << G4endl << "###### QweakSimGEM: Define GEM_AnodeCopperLayer_Logical" << G4endl << G4endl;
619 
620  GEM_AnodeCopperLayer_Logical = new G4LogicalVolume(GEM_AnodeCopperLayer_Solid,
621  GEM_CopperLayer_Material,
622  "GEM_AnodeCopperLayer_Log",
623  0,0,0);
624 
625  // define physical
626  G4cout << G4endl << "###### QweakSimGEM: Define GEM_AnodeCopperLayer_Physical" << G4endl << G4endl;
627 
628  // Z Location of the AnodeCopperLayer within GEM_AnodeReadoutPlaneContainer: -0.5*355um + 0.5*5um
629  // (first go to border of box and go half the (G10 board thickness + copper layer thickness) back
630  // )
631  G4double _LocalPostionInZ_AnodeCopperLayer =
634 
635 
636  GEM_AnodeCopperLayer_Physical = new G4PVPlacement(0,
637  G4ThreeVector(0. , 0. , _LocalPostionInZ_AnodeCopperLayer ),
639  "GEM_AnodeCopperLayer_Physical",
641  0,
642  0,
643  pSurfChk); //copy number
644 
645 
646 
647  //===========================================================
648  // finally place the GEM Readout Plane within the foil stack
649  //===========================================================
650  //
651  // Z Location of the AnodeCopperLayer within GEM_AnodeReadoutPlaneContainer: +0.5*355um - 0.5*5um
652  // (first go to border of box and go half the copper layer thickness back)
653 
654 
655  G4double _LocalPostionInZ_AnodeReadoutPlaneContainer =
656  ( -5*mm
658  + 0.5*GEMFrame_Thickness ;
659 
661  new G4PVPlacement(0,
662  G4ThreeVector(0. , 0. , _LocalPostionInZ_AnodeReadoutPlaneContainer ),
664  "GEM_AnodeReadoutPlaneContainer_Physical",
666  0,
667  0,
668  pSurfChk); //copy number
669 
670 
671  //====================================================================
672  // Definition of the GEM cathode HV Plane
673  //====================================================================
674 
675  // Cathode HV Plane contains: 50um Kapton, (beam upstream)
676  // 5um Copper (beam downstream)
677  //
678  // Construction: create 55um thick Kapton box,
679  // place 5um copper box within touching the downstream border
680 
681  // define solid
682  G4cout << G4endl << "###### QweakSimGEM: Define GEM_CathodeHVPlaneContainer_Solid" << G4endl << G4endl;
683 
684  G4Box* GEM_CathodeHVPlaneContainer_Solid =
685  new G4Box("GEM_CathodeHVPlaneContainer_Sol",
687  0.5* GEMFrame_InnerWidth,
689 
690  // define logical
691  G4cout << G4endl << "###### QweakSimGEM: Define GEM_CathodeHVPlaneContainer_Logical" << G4endl << G4endl;
692 
693  GEM_CathodeHVPlaneContainer_Logical = new G4LogicalVolume(GEM_CathodeHVPlaneContainer_Solid,
694  GEM_Foil_Material,
695  "GEM_CathodeHVPlaneContainer_Log",
696  0,0,0);
697 
698  //========================================
699  // define 5um thick Cathode copper layer
700  //============================--========
701 
702  // define solid
703  G4cout << G4endl << "###### QweakSimGEM: Define GEM_CathodeCopperLayer_Solid" << G4endl << G4endl;
704 
705  G4Box* GEM_CathodeHVCopperLayer_Solid = new G4Box("GEM_CathodeHVCopperLayer_Sol",
707  0.5* GEMFrame_InnerWidth,
709 
710  // define logical
711  G4cout << G4endl << "###### QweakSimGEM: Define GEM_CathodeHVCopperLayer_Logical" << G4endl << G4endl;
712 
713  GEM_CathodeHVCopperLayer_Logical = new G4LogicalVolume(GEM_CathodeHVCopperLayer_Solid,
714  GEM_CopperLayer_Material,
715  "GEM_CathodeHVCopperLayer_Log",
716  0,0,0);
717 
718  // define physical
719  G4cout << G4endl << "###### QweakSimGEM: Define GEM_CathodeCopperLayer_Physical" << G4endl << G4endl;
720 
721  // Z Location of the AnodeCopperLayer within GEM_AnodeReadoutPlaneContainer: +0.5*55um - 0.5*5um
722  // (first go to border of box and go half the copper layer thickness back
723  // )
724  G4double _LocalPostionInZ_CathodeHVCopperLayer =
727 
728  GEM_CathodeHVCopperLayer_Physical = new G4PVPlacement(0,
729  G4ThreeVector(0. , 0. , _LocalPostionInZ_CathodeHVCopperLayer ),
731  "GEM_CathodeHVCopperLayer_Physical",
733  0,
734  0,
735  pSurfChk); //copy number
736 
737 
738 
739  //===========================================================
740  // finally place the GEM Cathode HV Plane within the foil stack
741  //===========================================================
742  //
743  // Z Location of the CathodeHVPlaneLayer within Container:
744  // (first go to border of box and go half the copper layer thickness back)
745 
746 
747  G4double _LocalPostionInZ_CathodeHVPlaneContainer = -14*mm + 0.5*GEMFrame_Thickness ;
748 
750  new G4PVPlacement(0,
751  G4ThreeVector(0. , 0. , _LocalPostionInZ_CathodeHVPlaneContainer ),
753  "GEM_CathodeHVPlaneContainer_Physical",
755  0,
756  0,
757  pSurfChk); //copy number
758 
759 
760 //================================================================================================
761 
762 
763 G4cout << G4endl << "###### QweakSimGEM: Setting Sensitive Detectors " << G4endl << G4endl;
764 
765  // Sensitive detectors
766  //------------------------------------------------
767  // All managed (deleted) by SDManager
768 
769  G4SDManager* SDman = G4SDManager::GetSDMpointer();
770 
771 
772  //#######################################################
773  // define drift chamber elements as sensitiv detectors
774  // "sensitivity" will be handled by class QweakSimGEMSD
775  //#######################################################
776 
777 
778  //***********************************************************
779  GEMdriftChamberSD = new QweakSimGEM_WirePlaneSD("GEMWirePlaneSD");
780  SDman->AddNewDetector(GEMdriftChamberSD);
781 
782  // add wire plane as a sensitiv element
783  GEM_AnodeCopperLayer_Logical->SetSensitiveDetector(GEMdriftChamberSD);
784  //***********************************************************
785 
786 
787 G4cout << G4endl << "###### QweakSimGEM: Setting Attributes " << G4endl << G4endl;
788 
789  G4Colour orange (241/255.,224/255.,0/255.);
790  G4Colour gray (210/255.,213/255.,210/255.);
791 
792  G4Colour red (255/255., 0/255.,0/255.);
793  G4Colour green ( 0/255., 255/255.,0/255.);
794  G4Color green_yellow (173/255., 255/255., 47/255.);
795 
796 
797  GEM_MasterContainer_VisAtt = new G4VisAttributes(orange);
798  GEM_MasterContainer_VisAtt -> SetVisibility(false);
800 
801  GEM_SubContainer_VisAtt = new G4VisAttributes(red);
802  GEM_SubContainer_VisAtt -> SetVisibility(false);
804 
805  GEM_Frame_VisAtt = new G4VisAttributes(green);
806  GEM_Frame_VisAtt -> SetVisibility(true);
807  GEM_Frame_Logical -> SetVisAttributes(GEM_Frame_VisAtt);
808 
809  //------------------------------------------------------------------------------
810  GEM_MiddleFoilContainer_VisAtt = new G4VisAttributes(gray);
811  GEM_MiddleFoilContainer_VisAtt -> SetVisibility(false);
813  //
814  GEM_KaptonMiddleFoil_VisAtt = new G4VisAttributes(gray);
815  GEM_KaptonMiddleFoil_VisAtt -> SetVisibility(true);
817  //
818  GEM_CopperMiddleFoil_VisAtt = new G4VisAttributes(orange);
819  GEM_CopperMiddleFoil_VisAtt -> SetVisibility(true);
821  //------------------------------------------------------------------------------
822  GEM_AnodeReadoutPlaneContainer_VisAtt = new G4VisAttributes(gray);
823  GEM_AnodeReadoutPlaneContainer_VisAtt -> SetVisibility(false);
824  GEM_AnodeReadoutPlaneContainer_VisAtt -> SetForceWireframe(true);
826 
827  GEM_AnodeReadoutBoard_VisAtt = new G4VisAttributes(green_yellow);
828  GEM_AnodeReadoutBoard_VisAtt -> SetVisibility(true);
830 
831  GEM_AnodeCopperLayer_VisAtt = new G4VisAttributes(orange);
832  GEM_AnodeCopperLayer_VisAtt -> SetVisibility(true);
834  //------------------------------------------------------------------------------
835  GEM_CathodeHVPlaneContainer_VisAtt = new G4VisAttributes(gray);
836  GEM_CathodeHVPlaneContainer_VisAtt -> SetVisibility(true);
838 
839  GEM_CathodeHVCopperLayer_VisAtt = new G4VisAttributes(orange);
840  GEM_CathodeHVCopperLayer_VisAtt -> SetVisibility(true);
842 
843 
844  //==========================================================================================
845  //
846  // ------------------------------------------------------
847  // Define a Region which is required for the PAI model
848  // handling a precise energy loss of relativistic charged
849  // particles crossing the drift chamber gas.
850  // ------------------------------------------------------
851 
852  if( fRegGasDet != 0 ) // remove obsolete root logical volume
853  {
854  fRegGasDet->RemoveRootLogicalVolume(GEM_SubContainer_Logical);
855  }
856 
857  G4ProductionCuts* cuts = 0;
858 
859  if( fRegGasDet == 0 ) // First time - instantiate a region and a cut objects
860  {
861  fRegGasDet = new G4Region("DriftCellRegion_GEM");
862  cuts = new G4ProductionCuts();
863  fRegGasDet->SetProductionCuts(cuts);
864 
865  }
866  else // Second time - get a cut object from region
867  {
868  cuts = fRegGasDet->GetProductionCuts();
869  }
870 
871  fRegGasDet->AddRootLogicalVolume(GEM_SubContainer_Logical);
872 
873  cuts->SetProductionCut(fGammaCut,"gamma");
874  cuts->SetProductionCut(fElectronCut,"e-");
875  cuts->SetProductionCut(fPositronCut,"e+");
876 
877 
878 //==========================================================================================
879 
880 
881 
882 
883 
884 G4cout << G4endl << "###### Leaving QweakSimGEM::ConstructComponent() " << G4endl << G4endl;
885 
886 } // end of QweakSimGEM::ConstructComponent()
887 
888 
889 
890 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
892 {
893  // search the material by its name
894  G4Material* pttoMaterial = G4Material::GetMaterial(materialName);
895  if (pttoMaterial)
896  {
897  G4cout << "==== Changing GEM MasterContainer Material: Looking up Material " << G4endl;
898  GEM_MasterContainer_Logical->SetMaterial(pttoMaterial);
899  G4cout << "==== Changing GEM MasterContainer Material: Now the GEM MasterContainer is made of " << materialName << G4endl;
900  }
901  else {
902  G4cerr << "==== ERROR: Changing GEM MasterContainer Material failed" << G4endl;
903  }
904 
905 }
906 
907 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
908 void QweakSimGEM::SetGEM_SubContainerMaterial(G4String materialName)
909 {
910  // search the material by its name
911  G4Material* pttoMaterial = G4Material::GetMaterial(materialName);
912  if (pttoMaterial)
913  {
914  G4cout << "==== Changing GEM SubContainer Material: Looking up Material " << G4endl;
915  GEM_SubContainer_Logical->SetMaterial(pttoMaterial);
916  G4cout << "==== Changing GEM SubContainer Material: Now the GEM SubContainer is made of " << materialName << G4endl;
917  }
918  else {
919  G4cerr << "==== ERROR: Changing GEM SubContainer Material failed" << G4endl;
920  }
921 
922 }
923 
924 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
925 void QweakSimGEM::SetGEM_FrameMaterial(G4String materialName)
926 {
927  // search the material by its name
928  G4Material* pttoMaterial = G4Material::GetMaterial(materialName);
929  if (pttoMaterial)
930  {
931  G4cout << "==== Changing GEM Frame Material: Looking up Material " << G4endl;
932  GEM_Frame_Logical->SetMaterial(pttoMaterial);
933  G4cout << "==== Changing GEM Frame Material: Now the GEM Plane is made of " << materialName << G4endl;
934  }
935  else {
936  G4cerr << "==== ERROR: Changing GEM Frame Material failed" << G4endl;
937  }
938 
939 }
940 
941 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
942 // void QweakSimGEM::SetGEM_FoilMaterial(G4String materialName)
943 // {
944 // // search the material by its name
945 // G4Material* pttoMaterial = G4Material::GetMaterial(materialName);
946 // if (pttoMaterial)
947 // {
948 // G4cout << "==== Changing GEM Foil Material: Looking up Material " << G4endl;
949 // GEM_Foil_Logical->SetMaterial(pttoMaterial);
950 // G4cout << "==== Changing GEM Foil Material: Now the GEM Foil is made of " << materialName << G4endl;
951 // }
952 // else {
953 // G4cerr << "==== ERROR: Changing GEM Foil Material failed" << G4endl;
954 // }
955 //
956 // }
957 //
958 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
959 // void QweakSimGEM::SetGEM_WirePlaneMaterial(G4String materialName)
960 // {
961 // // search the material by its name
962 // G4Material* pttoMaterial = G4Material::GetMaterial(materialName);
963 // if (pttoMaterial)
964 // {
965 // G4cout << "==== Changing GEM WirePlane Material: Looking up Material " << G4endl;
966 // GEM_WirePlane_Logical->SetMaterial(pttoMaterial);
967 // G4cout << "==== Changing GEM WirePlane Material: Now the GEM WirePlane is made of " << materialName << G4endl;
968 // }
969 // else {
970 // G4cerr << "==== ERROR: Changing GEM WirePlane Material failed" << G4endl;
971 // }
972 //
973 // }
974 
975 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
977 {
978 }
979 
980 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
982 {
983  G4cout << G4endl << "###### Calling QweakSimGEM::SetFrontGEM_CenterPositionInX() " << G4endl << G4endl;
984 
985  GEM_CenterFront_XPos = xPos;
986 
987  GEM_MasterContainerFront_Physical->SetTranslation(G4ThreeVector(GEM_CenterFront_XPos,
990 
991  G4cout << G4endl << "###### Leaving QweakSimGEM::SetFrontGEM_CenterPositionInX() " << G4endl << G4endl;
992 }
993 
994 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
996 {
997  G4cout << G4endl << "###### Calling QweakSimGEM::SetFrontGEM_CenterPositionInY() " << G4endl << G4endl;
998 
999  GEM_CenterFront_YPos = yPos;
1000 
1001  GEM_MasterContainerFront_Physical->SetTranslation(G4ThreeVector(GEM_CenterFront_XPos,
1004 
1005  G4cout << G4endl << "###### Leaving QweakSimGEM::SetFrontGEM_CenterPositionInY() " << G4endl << G4endl;
1006 }
1007 
1008 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
1010 {
1011  G4cout << G4endl << "###### Calling QweakSimGEM::SetFrontGEM_CenterPositionInZ() " << G4endl << G4endl;
1012 
1013  GEM_CenterFront_ZPos = zPos;
1014 
1015  GEM_MasterContainerFront_Physical->SetTranslation(G4ThreeVector(GEM_CenterFront_XPos,
1018 
1019  G4cout << G4endl << "###### Leaving QweakSimGEM::SetFrontGEM_CenterPositionInZ() " << G4endl << G4endl;
1020 }
1021 
1022 
1023 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
1025 {
1026  G4cout << G4endl << "###### Calling QweakSimGEM::SetBackGEM_CenterPositionInX() " << G4endl << G4endl;
1027 
1028  GEM_CenterBack_XPos = xPos;
1029 
1030  GEM_MasterContainerBack_Physical->SetTranslation(G4ThreeVector(GEM_CenterBack_XPos,
1033 
1034  G4cout << G4endl << "###### Leaving QweakSimGEM::SetBackGEM_CenterPositionInX() " << G4endl << G4endl;
1035 }
1036 
1037 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
1039 {
1040  G4cout << G4endl << "###### Calling QweakSimGEM::SetBackGEM_CenterPositionInY() " << G4endl << G4endl;
1041 
1042  GEM_CenterBack_YPos = yPos;
1043 
1044  GEM_MasterContainerBack_Physical->SetTranslation(G4ThreeVector(GEM_CenterBack_XPos,
1047 
1048  G4cout << G4endl << "###### Leaving QweakSimGEM::SetBackGEM_CenterPositionInY() " << G4endl << G4endl;
1049 }
1050 
1051 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
1053 {
1054  G4cout << G4endl << "###### Calling QweakSimGEM::SetBackGEM_CenterPositionInZ() " << G4endl << G4endl;
1055 
1056  GEM_CenterBack_ZPos = zPos;
1057 
1058  GEM_MasterContainerBack_Physical->SetTranslation(G4ThreeVector(GEM_CenterBack_XPos,
1061 
1062  G4cout << G4endl << "###### Leaving QweakSimGEM::SetBackGEM_CenterPositionInZ() " << G4endl << G4endl;
1063 }
1064 
1065 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
1067 {
1068  G4cout << G4endl << "###### Calling QweakSimGEM::SetGEM_FrontChamber_RotationAngleInPhi() " << G4endl << G4endl;
1069 
1070  G4ThreeVector Translation_MasterContainerFront;
1071  G4double GEMFront_RadialDistance = sqrt(GEM_CenterFront_XPos*GEM_CenterFront_XPos + GEM_CenterFront_YPos*GEM_CenterFront_YPos);
1072 
1073  Translation_MasterContainerFront.setX(cos(GEM_phiangle)*GEMFront_RadialDistance) ;
1074  Translation_MasterContainerFront.setY(sin(GEM_phiangle)*GEMFront_RadialDistance) ;
1075  Translation_MasterContainerFront.setZ(GEM_CenterFront_ZPos) ;
1076 
1077  // assign new tilting
1078  GEM_FrontChamber_RotationAngleInPhi = GEM_phiangle;
1079 
1082  GEM_MasterContainerFront_Physical -> SetTranslation(Translation_MasterContainerFront);
1083 
1084  G4cout << G4endl << "###### Leaving QweakSimGEM::SetGEM_RotationAngleInPhi() " << G4endl << G4endl;
1085 }
1086 
1087 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
1089 {
1090  G4cout << G4endl << "###### Calling QweakSimGEM::SetGEM_BackChamber_RotationAngleInPhi() " << G4endl << G4endl;
1091 
1092  G4ThreeVector Translation_MasterContainerBack;
1093  G4double GEMBack_RadialDistance = sqrt(GEM_CenterBack_XPos*GEM_CenterBack_XPos + GEM_CenterBack_YPos*GEM_CenterBack_YPos);
1094 
1095  Translation_MasterContainerBack.setX(cos(GEM_phiangle)*GEMBack_RadialDistance) ;
1096  Translation_MasterContainerBack.setY(sin(GEM_phiangle)*GEMBack_RadialDistance) ;
1097  Translation_MasterContainerBack.setZ(GEM_CenterBack_ZPos);
1098 
1099  // assign new tilting
1100  GEM_BackChamber_RotationAngleInPhi = GEM_phiangle;
1101 
1104  GEM_MasterContainerBack_Physical -> SetTranslation(Translation_MasterContainerBack);
1105 
1106  G4cout << G4endl << "###### Leaving QweakSimGEM::SetGEM_BackChamber_RotationAngleInPhi() " << G4endl << G4endl;
1107 }
1108 
1109 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
1110 
G4VisAttributes * GEM_CopperMiddleFoil_VisAtt
Definition: QweakSimGEM.hh:208
G4double GEM_CenterBack_YPos
Definition: QweakSimGEM.hh:198
G4SubtractionSolid * GEM_Frame_Solid
Definition: QweakSimGEM.hh:220
G4double fElectronCut
Definition: QweakSimGEM.hh:225
G4VSensitiveDetector * GEMdriftChamberSD
Definition: QweakSimGEM.hh:218
G4double AluFrame_InnerWidth
Definition: QweakSimGEM.hh:191
G4double fPositronCut
Definition: QweakSimGEM.hh:226
static QweakSimMaterial * GetInstance()
G4VisAttributes * GEM_CathodeHVPlaneContainer_VisAtt
Definition: QweakSimGEM.hh:213
G4VPhysicalVolume * GEM_MasterContainerFront_Physical
Definition: QweakSimGEM.hh:130
G4double GEMFrame_Thickness
Definition: QweakSimGEM.hh:172
G4VisAttributes * GEM_CathodeHVCopperLayer_VisAtt
Definition: QweakSimGEM.hh:214
G4VisAttributes * GEM_MiddleFoilContainer_VisAtt
Definition: QweakSimGEM.hh:206
QweakSimGEMMessenger * GEM_Messenger
Definition: QweakSimGEM.hh:170
G4VisAttributes * GEM_Frame_VisAtt
Definition: QweakSimGEM.hh:204
G4double GEM_CenterFront_ZPos
Definition: QweakSimGEM.hh:195
G4double GEMFrame_BorderWidthInY
Definition: QweakSimGEM.hh:178
G4VisAttributes * GEM_AnodeReadoutPlaneContainer_VisAtt
Definition: QweakSimGEM.hh:210
void SetGEM_MasterContainerMaterial(G4String)
Definition: QweakSimGEM.cc:891
static const G4bool pSurfChk
G4VPhysicalVolume * GEM_MiddleFoilContainer_Physical
Definition: QweakSimGEM.hh:141
G4LogicalVolume * GEM_Frame_Logical
Definition: QweakSimGEM.hh:136
G4double GEM_G10AnodeBoard_Thickness
Definition: QweakSimGEM.hh:184
G4VisAttributes * GEM_KaptonMiddleFoil_VisAtt
Definition: QweakSimGEM.hh:207
void SetFrontGEM_CenterPositionInZ(G4double zPos)
G4LogicalVolume * GEM_MasterContainer_Logical
Definition: QweakSimGEM.hh:129
G4VisAttributes * GEM_AnodeCopperLayer_VisAtt
Definition: QweakSimGEM.hh:212
void SetFrontGEM_CenterPositionInX(G4double xPos)
Definition: QweakSimGEM.cc:981
G4LogicalVolume * GEM_CathodeHVPlaneContainer_Logical
Definition: QweakSimGEM.hh:163
G4double GEM_BackChamber_RotationAngleInPhi
Definition: QweakSimGEM.hh:127
G4LogicalVolume * GEM_AnodeCopperLayer_Logical
Definition: QweakSimGEM.hh:158
G4double AluFrame_Thickness
Definition: QweakSimGEM.hh:187
void SetGEM_FrameMaterial(G4String)
Definition: QweakSimGEM.cc:925
G4VPhysicalVolume * GEM_SubContainer_Physical
Definition: QweakSimGEM.hh:134
G4double GEM_KaptonAnodeFoil_Thickness
Definition: QweakSimGEM.hh:182
G4VisAttributes * GEM_SubContainer_VisAtt
Definition: QweakSimGEM.hh:203
G4double GEM_CenterFront_YPos
Definition: QweakSimGEM.hh:194
G4double GEM_CenterBack_XPos
Definition: QweakSimGEM.hh:197
void SetBackGEM_CenterPositionInZ(G4double zPos)
G4Material * GetMaterial(G4String material)
G4VPhysicalVolume * GEM_CathodeHVCopperLayer_Physical
Definition: QweakSimGEM.hh:167
G4VPhysicalVolume * GEM_BottomCopperMiddleFoil_Physical
Definition: QweakSimGEM.hh:148
G4VPhysicalVolume * GEM_AnodeCopperLayer_Physical
Definition: QweakSimGEM.hh:159
G4double GEMFrame_OuterWidth
Definition: QweakSimGEM.hh:174
G4LogicalVolume * GEM_AnodeReadoutPlaneContainer_Logical
Definition: QweakSimGEM.hh:152
G4RotationMatrix * Rotation_BackChamber_GEM
Definition: QweakSimGEM.hh:124
void DestroyComponent()
Definition: QweakSimGEM.cc:976
G4LogicalVolume * GEM_AnodeReadoutBoard_Logical
Definition: QweakSimGEM.hh:155
G4double GEMFrame_InnerWidth
Definition: QweakSimGEM.hh:176
G4VPhysicalVolume * GEM_MasterContainerBack_Physical
Definition: QweakSimGEM.hh:131
G4VPhysicalVolume * GEM_CathodeHVPlaneContainer_Physical
Definition: QweakSimGEM.hh:164
G4double GEM_CenterFront_XPos
Definition: QweakSimGEM.hh:193
Scans the input file for /GEM/xyz commands.
G4double GEM_CopperLayer_Thickness
Definition: QweakSimGEM.hh:185
QweakSimMaterial * pMaterial
Definition: QweakSimGEM.hh:121
G4double AluFrame_OuterLength
Definition: QweakSimGEM.hh:188
G4double GEMFrame_OuterLength
Definition: QweakSimGEM.hh:173
void ConstructComponent(G4VPhysicalVolume *)
Definition: QweakSimGEM.cc:253
G4double AluFrame_InnerLength
Definition: QweakSimGEM.hh:190
void SetGEM_BackChamber_RotationAngleInPhi(G4double GEM_phiangleBack)
G4double GEM_FrontChamber_RotationAngleInPhi
Definition: QweakSimGEM.hh:126
void SetFrontGEM_CenterPositionInY(G4double yPos)
Definition: QweakSimGEM.cc:995
G4double GEM_KaptonMiddleFoil_Thickness
Definition: QweakSimGEM.hh:181
G4double GEM_KaptonCathodeFoil_Thickness
Definition: QweakSimGEM.hh:180
G4LogicalVolume * GEM_KaptonMiddleFoil_Logical
Definition: QweakSimGEM.hh:143
G4double GEMFrame_InnerLength
Definition: QweakSimGEM.hh:175
void SetBackGEM_CenterPositionInY(G4double yPos)
void SetGEM_SubContainerMaterial(G4String)
Definition: QweakSimGEM.cc:908
void SetGEM_FrontChamber_RotationAngleInPhi(G4double GEM_phiangleFront)
G4double AluFrame_OuterWidth
Definition: QweakSimGEM.hh:189
G4VPhysicalVolume * GEM_AnodeReadoutPlaneContainer_Physical
Definition: QweakSimGEM.hh:153
G4VisAttributes * GEM_AnodeReadoutBoard_VisAtt
Definition: QweakSimGEM.hh:211
Checks for a valid GEM ReadoutPlane hit and stores the hit information (I know there is no wire plane...
G4RotationMatrix * Rotation_FrontChamber_GEM
Definition: QweakSimGEM.hh:123
G4VPhysicalVolume * GEM_AnodeReadoutBoard_Physical
Definition: QweakSimGEM.hh:156
G4VisAttributes * GEM_MasterContainer_VisAtt
Definition: QweakSimGEM.hh:202
void SetBackGEM_CenterPositionInX(G4double xPos)
G4LogicalVolume * GEM_SubContainer_Logical
Definition: QweakSimGEM.hh:133
G4VPhysicalVolume * GEM_TopCopperMiddleFoil_Physical
Definition: QweakSimGEM.hh:147
G4LogicalVolume * GEM_CathodeHVCopperLayer_Logical
Definition: QweakSimGEM.hh:166
G4LogicalVolume * GEM_CopperMiddleFoil_Logical
Definition: QweakSimGEM.hh:146
G4Region * fRegGasDet
Definition: QweakSimGEM.hh:227
G4VPhysicalVolume * GEM_KaptonMiddleFoil_Physical
Definition: QweakSimGEM.hh:144
G4double GEMFrame_BorderWidthInX
Definition: QweakSimGEM.hh:177
G4VPhysicalVolume * GEM_Frame_Physical
Definition: QweakSimGEM.hh:137
G4double fGammaCut
Definition: QweakSimGEM.hh:224
G4double GEM_CenterBack_ZPos
Definition: QweakSimGEM.hh:199
G4LogicalVolume * GEM_MiddleFoilContainer_Logical
Definition: QweakSimGEM.hh:140