QwGeant4
QweakSimHDC.cc
Go to the documentation of this file.
1 //=============================================================================
2 //
3 // ---------------------------
4 // | Doxygen File Information |
5 // ---------------------------
6 //
7 /**
8 
9  \file QweakSimHDC.cc
10 
11  $Revision: 1.2 $
12  $Date: 2005/12/27 19:10:29 $
13 
14  \author Klaus Hans Grimm
15 
16 */
17 //=============================================================================
18 
19 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
20 
21 #include "QweakSimHDC.hh"
22 
23 // geant4 includes
24 #include "G4VisAttributes.hh"
25 
26 // user includes
27 #include "QweakSimMaterial.hh"
28 #include "QweakSimHDCMessenger.hh"
29 
30 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
31 //===================================================================
32 // Qweak Geometry Conventions:
33 // The origin is at the center of the main toroidal magnet with
34 // the z-axis pointing along the beam direction, the x-axis
35 // pointing toward the ceiling, and the y-axis pointing toward
36 // beam-right so as to form a right-handed coordinate system.
37 // Octants are numbered from 1 to 8, clockwise with #1 at the
38 // 12 o-clock position.
39 //===================================================================
40 
41 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
42 
44 {
45  G4cout << G4endl << "###### Calling QweakSimHDC::QweakHDC() " << G4endl << G4endl;
46 
47  // initialize pointers
49  //HDC_MasterContainerFront_Physical = NULL;
50  //HDC_MasterContainerBack_Physical = NULL;
51 
54 
55 // Rotation_HDC = NULL;
56 
57  HDC_Frame_Logical = NULL;
58  HDC_Frame_Physical = NULL;
59 
60  HDC_Foil_Logical = NULL;
61  HDC_Foil_Physical = NULL;
62 
63  HDC_WirePlane_Logical = NULL;
65 
66 
69  HDC_Frame_VisAtt = NULL;
70  HDC_Foil_VisAtt = NULL;
71  HDC_WirePlane_VisAtt = NULL;
72 
73 
74  // define target geometry value
75  // Geometry taken from Norm's HDC talk in Vancouver 2005
76 
77  HDC_DriftCell_TotalThickness = 19.8*mm; // Distance: 2*(HVplane to WirePlane)
78  // updated 2012-04-09 wdconinc based on input Mark Pitt
79 
80  HDCFrame_Thickness = 17.20*cm; // Allena's keepout info
81 
82  HDCFrame_InnerLength = 30.00*cm; // X
83  HDCFrame_InnerWidth = 45.09*cm; // Y
84 
85  HDCFrame_OuterLength = 43.97*cm; // X
86  HDCFrame_OuterWidth = 59.06*cm; // Y
87 
90 
91 
92  // Norm did not mention it, but I suppose that the HDC will
93  // sandwiched between 2 alu plates for stability.
94  AluFrame_Thickness = 1.0*cm;
99 
100  HDC_CenterFront_XPos.resize(2,0);
101  HDC_CenterFront_YPos.resize(2,0);
102  HDC_CenterFront_ZPos.resize(2,0);
103 
104  HDC_CenterBack_XPos.resize(2,0);
105  HDC_CenterBack_YPos.resize(2,0);
106  HDC_CenterBack_ZPos.resize(2,0);
107 
108  for(int i = 0; i < 2; i++){ //temporary loop, setting both HDC packages to same coordinates, but pkg2 will be rotated.
109  HDC_CenterFront_XPos[i] = 0.0*cm;
110  HDC_CenterFront_YPos[i] = 51.0*cm;
111  HDC_CenterFront_ZPos[i] = -337.355*cm; //-325.459*cm; // Allena's keepout info
112  // updated 2012-04-09 wdconinc based on input Mark Pitt
113 
114  HDC_CenterBack_XPos[i] = 0.0*cm;
115  HDC_CenterBack_YPos[i] = 54.9*cm;
116  HDC_CenterBack_ZPos[i] = -294.655*cm;
117  // updated 2012-04-09 wdconinc based on input Mark Pitt
118 
119  HDC_RotationAngleInPhi[i] = 90.0*degree; // normally 0.0*degree = 12 o'clock = octant 1
120 
121  if(i==1)
122  {
123  HDC_CenterFront_XPos[i] = 0.0*cm;
124  HDC_CenterFront_YPos[i] = -51.0*cm;
125 
126  HDC_CenterBack_XPos[i] = 0.0*cm;
127  HDC_CenterBack_YPos[i] = -54.9*cm;
128 
129  HDC_RotationAngleInPhi[i] = 270.0*degree; // normally 0.0*degree = 12 o'clock = octant 1
130  }
131 
132  }
133 
134  // define Rotation matrix for Container orientated in MotherVolume
135 // Rotation_HDC = new G4RotationMatrix();
136 
137 
139 
140  //Resizing vectors and setting values to 0
143  Rotation_HDC.resize(2,0);
144  HDC_Messenger.resize(2,0);
145 
146  // Creates a messenger for each VDC package (0 for Package 1 and 1 for Package 2)
147  for(size_t i = 0; i < HDC_Messenger.size(); i++)
148  HDC_Messenger[i] = new QweakSimHDCMessenger(this, i);
149 
150 }
151 
152 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
154 {
155 
156  //if (HdriftChamberSD) delete HdriftChamberSD;
157 
160  if (HDC_Foil_VisAtt) delete HDC_Foil_VisAtt;
163 
166 
169 
171  if (HDC_Frame_Logical) delete HDC_Frame_Logical ;
172 
175 
176  //if (HDC_MasterContainerFront_Physical) delete HDC_MasterContainerFront_Physical ;
177  //if (HDC_MasterContainerBack_Physical) delete HDC_MasterContainerBack_Physical;
179 
180  if (HDC_Frame_Solid) delete HDC_Frame_Solid;
181 
182  //if (Rotation_HDC) delete Rotation_HDC ;
183 }
184 
185 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
186 
187 void QweakSimHDC::ConstructComponent(G4VPhysicalVolume* MotherVolume)
188 {
189  G4cout << G4endl << "###### Calling QweakSimHDC::ConstructComponent() " << G4endl << G4endl;
190 
191  theMotherPV = MotherVolume;
192 
193  // assign material
194  G4Material* HDC_MasterContainer_Material = pMaterial->GetMaterial("Air");
195  G4Material* HDC_SubContainer_Material = pMaterial->GetMaterial("ArCO2");
196  G4Material* HDC_Frame_Material = pMaterial->GetMaterial("NemaG10");
197  G4Material* HDC_Foil_Material = pMaterial->GetMaterial("Mylar");
198  G4Material* HDC_WirePlane_Material = pMaterial->GetMaterial("ArCO2");
199 
200 
201 
202 
203  // define solid volume of the drift chamber container
204  G4cout << G4endl << "###### QweakSimHDC: Define HDC_MasterContainer_Solid" << G4endl << G4endl;
205 
206  G4Box* HDC_MasterContainer_Solid = new G4Box("HDC_MasterContainer_Sol",
208  0.5* HDCFrame_OuterWidth,
209  0.5* HDCFrame_Thickness + 1.0*mm);
210 
211  // define HDC logical volume of drift chamber container
212  G4cout << G4endl << "###### QweakSimHDC: Define HDC_MasterContainer_Logical " << G4endl << G4endl;
213 
214  HDC_MasterContainer_Logical = new G4LogicalVolume(HDC_MasterContainer_Solid,
215  HDC_MasterContainer_Material,
216  "HDC_MasterContainer_Log",
217  0,0,0);
218 
219 
221 
222 
223  //====================================================================
224  // Definition of the HDC Frame ( symbolizes the stack of real frames )
225  //====================================================================
226 
227  // define outer frame solid
228  G4cout << G4endl << "###### QweakSimHDC: Define HDC_OuterFrame_Solid" << G4endl << G4endl;
229 
230  G4Box* HDC_OuterFrame_Solid = new G4Box("HDC_OuterFrame_Sol",
232  0.5* HDCFrame_OuterWidth,
233  0.5* HDCFrame_Thickness);
234 
235  // define inner frame solid
236  G4cout << G4endl << "###### QweakSimHDC: Define HDC_InnerFrame_Solid" << G4endl << G4endl;
237 
238  G4Box* HDC_InnerFrame_Solid = new G4Box("HDC_InnerFrame_Sol",
240  0.5* HDCFrame_InnerWidth,
241  0.5* HDCFrame_Thickness + 0.1*mm);
242 
243 
244  // create frame by subtracting outer framebox from inner framebox
245  G4cout << G4endl << "###### QweakSimHDC: Define HDC_Frame_Solid" << G4endl << G4endl;
246 
247  HDC_Frame_Solid = new G4SubtractionSolid("HDC_Frame",
248  HDC_OuterFrame_Solid,
249  HDC_InnerFrame_Solid);
250 
251 
252  G4cout << G4endl << "###### QweakSimHDC: Define HDC_Frame_Logical" << G4endl << G4endl;
253  HDC_Frame_Logical = new G4LogicalVolume(HDC_Frame_Solid,
254  HDC_Frame_Material,
255  "HDC_Frame_Log",
256  0,0,0);
257 
258 
259  // define the position of the Frame within the HDC Container: put it in the center of HDC container
260  G4ThreeVector position_Frame = G4ThreeVector(0. , 0. , 0.);
261 
262  G4cout << G4endl << "###### QweakSimHDC: Define HDC_Frame_Physical" << G4endl << G4endl;
263 
264  HDC_Frame_Physical = new G4PVPlacement(0, // no rotation matrix needed
265  position_Frame,
267  "HDC_Frame_Physical",
269  0,
270  0,
271  pSurfChk); //copy number: 0
272 
273 
274  //====================================================================================
275  // Definition of the HDC SubContainer holding the stack of foil planes and wire planes
276  //====================================================================================
277 
278 
279  // define outer frame solid
280  G4cout << G4endl << "###### QweakSimHDC: Define HDC_SubContainer_Solid" << G4endl << G4endl;
281 
282  G4Box* HDC_SubContainer_Solid = new G4Box("HDC_OuterFrame_Sol",
283  0.5* HDCFrame_InnerLength, // X
284  0.5* HDCFrame_InnerWidth, // Y
285  0.5* HDCFrame_Thickness); // Z
286 
287  G4cout << G4endl << "###### QweakSimHDC: Define HDC_SubContainer_Logical" << G4endl << G4endl;
288 
289  HDC_SubContainer_Logical = new G4LogicalVolume(HDC_SubContainer_Solid,
290  HDC_SubContainer_Material,
291  "HDC_SubContainer_Log",
292  0,0,0);
293 
294 
295  // define the position of the SubContainer within the HDC Container: put it in the center of HDC container
296  G4ThreeVector position_SubContainer = G4ThreeVector(0. , 0. , 0.);
297 
298  G4cout << G4endl << "###### QweakSimHDC: Define HDC_SubContainer_Physical" << G4endl << G4endl;
299 
300  HDC_SubContainer_Physical = new G4PVPlacement(0, // no rotation matrix needed
301  position_SubContainer,
303  "HDC_SubContainer_Physical",
305  0,
306  0,
307  pSurfChk); //copy number: 0
308 
309 
310 
311  //====================================================================
312  // Definition of the HDC Foil plane ( for gas window and HV plane )
313  //====================================================================
314 
315 
316  // define foil solid
317  G4cout << G4endl << "###### QweakSimHDC: Define HDC_Foil_Solid" << G4endl << G4endl;
318 
319  G4Box* HDC_Foil_Solid = new G4Box("HDC_OuterFrame_Sol",
321  0.5* HDCFrame_InnerWidth,
322  0.5* 0.5*mil);
323 
324  // define foil logical
325  G4cout << G4endl << "###### QweakSimHDC: Define HDC_Foil_Logical" << G4endl << G4endl;
326 
327  HDC_Foil_Logical = new G4LogicalVolume(HDC_Foil_Solid,
328  HDC_Foil_Material,
329  "HDC_Foil_Log",
330  0,0,0);
331 
332  // Z Location of the foils in the HDC stack in units of a quarter full drift cell height (=1.9mm /4)
333  //G4double HDC_Foil_PositionIndexInZ[10] = { -17.0 , -13.0 , -9.0 , -5.0 , -1.0 , 1.0 , 5.0 , 9.0 , 13.0 , 17.0 };
334  // updated 2012-04-09 wdconinc based on input Mark Pitt
335  G4double HDC_Foil_PositionIndexInZ[9] = { -14.0 , -12.0 , -8.0 , -4.0 , 0.0 , 4.0 , 8.0 , 12.0 , 14.0 };
336 
337  // define foil physical
338  G4cout << G4endl << "###### QweakSimHDC: Define HDC_Foil_Physical" << G4endl << G4endl;
339 
340  for( G4int index = 0; index < 9; index++){
341 
342  new G4PVPlacement(0,
343  G4ThreeVector(0. , 0. , HDC_Foil_PositionIndexInZ[index]*1/4*HDC_DriftCell_TotalThickness ),
345  "HDC_Foil_Physical",
347  0,
348  index,
349  pSurfChk); //copy number
350 
351  } // end for
352 
353  //====================================================================
354  // Definition of the HDC Wire Plane
355  //====================================================================
356 
357  // define wire plane solid
358  G4cout << G4endl << "###### QweakSimHDC: Define HDC_WirePlane_Solid" << G4endl << G4endl;
359 
360  G4Box* HDC_WirePlane_Solid = new G4Box("HDC_WirePlane_Sol",
362  0.5* HDCFrame_InnerWidth,
363  0.5* 1.0*mil);
364 
365  // define wire plane logical
366  G4cout << G4endl << "###### QweakSimHDC: Define HDC_WirePlane_Logical" << G4endl << G4endl;
367 
368  HDC_WirePlane_Logical = new G4LogicalVolume(HDC_WirePlane_Solid,
369  HDC_WirePlane_Material,
370  "HDC_WirePlane_Log",
371  0,0,0);
372 
373  // Z Location of the wire planes in the HDC stack in units of a quarter full drift cell height (=1.9mm /4)
374  //G4double HDC_WirePlane_PositionIndexInZ[6] = { -11.0 , -7.0 , -3.0 , 3.0 , 7.0 , 11.0 };
375  // updated 2012-04-09 wdconinc based on input Mark Pitt
376  G4double HDC_WirePlane_PositionIndexInZ[6] = { -10.0 , -6.0 , -2.0 , 2.0 , 6.0 , 10.0 };
377 
378  // define wire planes physical
379  G4cout << G4endl << "###### QweakSimHDC: Define HDC_WirePlane_Physical" << G4endl << G4endl;
380 
381  for( G4int index = 0; index < 6; index++){
382 
383  new G4PVPlacement(0,
384  G4ThreeVector(0. , 0. , HDC_WirePlane_PositionIndexInZ[index]*1/4*HDC_DriftCell_TotalThickness ),
386  "HDC_WirePlane_Physical",
388  0,
389  index,
390  pSurfChk); //copy number
391  } // end for
392 
393 //================================================================================================
394 
395 
396 G4cout << G4endl << "###### QweakSimHDC: Setting Sensitive Detectors " << G4endl << G4endl;
397 
398  // Sensitive detectors
399  //------------------------------------------------
400  // All managed (deleted) by SDManager
401 
402  G4SDManager* SDman = G4SDManager::GetSDMpointer();
403 
404 
405  //#######################################################
406  // define drift chamber elements as sensitiv detectors
407  // "sensitivity" will be handled by class QweakSimHDCSD
408  //#######################################################
409 
410 
411  //***********************************************************
412  HdriftChamberSD = new QweakSimHDC_WirePlaneSD("/HDCWirePlaneSD");
413  SDman->AddNewDetector(HdriftChamberSD);
414 
415  // add wire plane as a sensitiv element
416  HDC_WirePlane_Logical->SetSensitiveDetector(HdriftChamberSD);
417  //***********************************************************
418 
419 
420 G4cout << G4endl << "###### QweakSimHDC: Setting Attributes " << G4endl << G4endl;
421 
422  G4Colour orange (241/255.,224/255.,0/255.);
423  G4Colour gray (210/255.,213/255.,210/255.);
424 
425  G4Colour red (255/255., 0/255.,0/255.);
426  G4Colour green ( 0/255., 255/255.,0/255.);
427 
428  HDC_MasterContainer_VisAtt = new G4VisAttributes(orange);
429  HDC_MasterContainer_VisAtt -> SetVisibility(false);
431 
432  HDC_SubContainer_VisAtt = new G4VisAttributes(red);
433  HDC_SubContainer_VisAtt -> SetVisibility(false);
435 
436  HDC_Frame_VisAtt = new G4VisAttributes(green);
437  HDC_Frame_VisAtt -> SetVisibility(true);
438  HDC_Frame_Logical -> SetVisAttributes(HDC_Frame_VisAtt);
439 
440  HDC_Foil_VisAtt = new G4VisAttributes(orange);
441  HDC_Foil_VisAtt -> SetVisibility(true);
442  HDC_Foil_Logical -> SetVisAttributes(HDC_Foil_VisAtt);
443 
444  HDC_WirePlane_VisAtt = new G4VisAttributes(gray);
445  HDC_WirePlane_VisAtt -> SetVisibility(true);
446  HDC_WirePlane_Logical -> SetVisAttributes(HDC_WirePlane_VisAtt);
447 
448 
449 G4cout << G4endl << "###### Leaving QweakSimHDC::ConstructComponent() " << G4endl << G4endl;
450 
451 } // end of QweakSimHDC::ConstructComponent()
452 
453 
454 
455 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
457 {
458  // search the material by its name
459  G4Material* pttoMaterial = G4Material::GetMaterial(materialName);
460  if (pttoMaterial)
461  {
462  G4cout << "==== Changing HDC MasterContainer Material: Looking up Material " << G4endl;
463  HDC_MasterContainer_Logical->SetMaterial(pttoMaterial);
464  G4cout << "==== Changing HDC MasterContainer Material: Now the HDC MasterContainer is made of " << materialName << G4endl;
465  }
466  else {
467  G4cerr << "==== ERROR: Changing HDC MasterContainer Material failed" << G4endl;
468  }
469 
470 }
471 
472 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
473 void QweakSimHDC::SetHDC_SubContainerMaterial(G4String materialName)
474 {
475  // search the material by its name
476  G4Material* pttoMaterial = G4Material::GetMaterial(materialName);
477  if (pttoMaterial)
478  {
479  G4cout << "==== Changing HDC SubContainer Material: Looking up Material " << G4endl;
480  HDC_SubContainer_Logical->SetMaterial(pttoMaterial);
481  G4cout << "==== Changing HDC SubContainer Material: Now the HDC SubContainer is made of " << materialName << G4endl;
482  }
483  else {
484  G4cerr << "==== ERROR: Changing HDC SubContainer Material failed" << G4endl;
485  }
486 
487 }
488 
489 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
490 void QweakSimHDC::SetHDC_FrameMaterial(G4String materialName)
491 {
492  // search the material by its name
493  G4Material* pttoMaterial = G4Material::GetMaterial(materialName);
494  if (pttoMaterial)
495  {
496  G4cout << "==== Changing HDC Frame Material: Looking up Material " << G4endl;
497  HDC_Frame_Logical->SetMaterial(pttoMaterial);
498  G4cout << "==== Changing HDC Frame Material: Now the HDC Plane is made of " << materialName << G4endl;
499  }
500  else {
501  G4cerr << "==== ERROR: Changing HDC Frame Material failed" << G4endl;
502  }
503 
504 }
505 
506 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
507 void QweakSimHDC::SetHDC_FoilMaterial(G4String materialName)
508 {
509  // search the material by its name
510  G4Material* pttoMaterial = G4Material::GetMaterial(materialName);
511  if (pttoMaterial)
512  {
513  G4cout << "==== Changing HDC Foil Material: Looking up Material " << G4endl;
514  HDC_Foil_Logical->SetMaterial(pttoMaterial);
515  G4cout << "==== Changing HDC Foil Material: Now the HDC Foil is made of " << materialName << G4endl;
516  }
517  else {
518  G4cerr << "==== ERROR: Changing HDC Foil Material failed" << G4endl;
519  }
520 
521 }
522 
523 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
524 void QweakSimHDC::SetHDC_WirePlaneMaterial(G4String materialName)
525 {
526  // search the material by its name
527  G4Material* pttoMaterial = G4Material::GetMaterial(materialName);
528  if (pttoMaterial)
529  {
530  G4cout << "==== Changing HDC WirePlane Material: Looking up Material " << G4endl;
531  HDC_WirePlane_Logical->SetMaterial(pttoMaterial);
532  G4cout << "==== Changing HDC WirePlane Material: Now the HDC WirePlane is made of " << materialName << G4endl;
533  }
534  else {
535  G4cerr << "==== ERROR: Changing HDC WirePlane Material failed" << G4endl;
536  }
537 
538 }
539 
540 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
542 {
543 }
544 
545 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
546 void QweakSimHDC::SetFrontHDC_CenterPositionInX(G4double xPos, G4int pkg)
547 {
548  G4cout << G4endl << "###### Calling QweakSimHDC::SetFrontHDC_CenterPositionInX() " << G4endl << G4endl;
549 
550  HDC_CenterFront_XPos[pkg] = xPos;
551 
552  HDC_MasterContainerFront_Physical[pkg]->SetTranslation(G4ThreeVector(HDC_CenterFront_XPos[pkg],
555 
556  G4cout << G4endl << "###### Leaving QweakSimHDC::SetFrontHDC_CenterPositionInX() " << G4endl << G4endl;
557 }
558 
559 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
560 void QweakSimHDC::SetFrontHDC_CenterPositionInY(G4double yPos, G4int pkg)
561 {
562  G4cout << G4endl << "###### Calling QweakSimHDC::SetFrontHDC_CenterPositionInY() " << G4endl << G4endl;
563 
564  HDC_CenterFront_YPos[pkg] = yPos;
565 
566  HDC_MasterContainerFront_Physical[pkg]->SetTranslation(G4ThreeVector(HDC_CenterFront_XPos[pkg],
569 
570  G4cout << G4endl << "###### Leaving QweakSimHDC::SetFrontHDC_CenterPositionInY() " << G4endl << G4endl;
571 }
572 
573 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
574 void QweakSimHDC::SetFrontHDC_CenterPositionInZ(G4double zPos, G4int pkg)
575 {
576  G4cout << G4endl << "###### Calling QweakSimHDC::SetFrontHDC_CenterPositionInZ() " << G4endl << G4endl;
577 
578  HDC_CenterFront_ZPos[pkg] = zPos;
579 
580  HDC_MasterContainerFront_Physical[pkg]->SetTranslation(G4ThreeVector(HDC_CenterFront_XPos[pkg],
583 
584  G4cout << G4endl << "###### Leaving QweakSimHDC::SetFrontHDC_CenterPositionInZ() " << G4endl << G4endl;
585 }
586 
587 
588 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
589 void QweakSimHDC::SetBackHDC_CenterPositionInX(G4double xPos, G4int pkg)
590 {
591  G4cout << G4endl << "###### Calling QweakSimHDC::SetBackHDC_CenterPositionInX() " << G4endl << G4endl;
592 
593  HDC_CenterBack_XPos[pkg] = xPos;
594 
595  HDC_MasterContainerBack_Physical[pkg]->SetTranslation(G4ThreeVector(HDC_CenterBack_XPos[pkg],
596  HDC_CenterBack_YPos[pkg],
598 
599  G4cout << G4endl << "###### Leaving QweakSimHDC::SetBackHDC_CenterPositionInX() " << G4endl << G4endl;
600 }
601 
602 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
603 void QweakSimHDC::SetBackHDC_CenterPositionInY(G4double yPos, G4int pkg)
604 {
605  G4cout << G4endl << "###### Calling QweakSimHDC::SetBackHDC_CenterPositionInY() " << G4endl << G4endl;
606 
607  HDC_CenterBack_YPos[pkg] = yPos;
608 
609  HDC_MasterContainerBack_Physical[pkg]->SetTranslation(G4ThreeVector(HDC_CenterBack_XPos[pkg],
610  HDC_CenterBack_YPos[pkg],
612 
613  G4cout << G4endl << "###### Leaving QweakSimHDC::SetBackHDC_CenterPositionInY() " << G4endl << G4endl;
614 }
615 
616 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
617 void QweakSimHDC::SetBackHDC_CenterPositionInZ(G4double zPos, G4int pkg)
618 {
619  G4cout << G4endl << "###### Calling QweakSimHDC::SetBackHDC_CenterPositionInZ() " << G4endl << G4endl;
620 
621  HDC_CenterBack_ZPos[pkg] = zPos;
622  HDC_MasterContainerBack_Physical[pkg]->SetTranslation(G4ThreeVector(HDC_CenterBack_XPos[pkg],
623  HDC_CenterBack_YPos[pkg],
625 
626  G4cout << G4endl << "###### Leaving QweakSimHDC::SetBackHDC_CenterPositionInZ() " << G4endl << G4endl;
627 }
628 
629 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
630 void QweakSimHDC::SetHDC_RotationAngleInPhi(G4double HDC_phiangle, G4int pkg)
631 {
632  G4cout << G4endl << "###### Calling QweakSimHDC::SetHDC_RotationAngleInPhi() " << G4endl << G4endl;
633 
634  // assign new azimuthal angle
635  G4double kAngle_GlobalRotation = HDC_phiangle -90.0*degree;
636 
637  if(pkg==1)
638  kAngle_GlobalRotation += 180*degree;
639 
640  G4RotationMatrix* Rotation_HDCPackageContainer = new G4RotationMatrix();
641  Rotation_HDCPackageContainer->setPhi(kAngle_GlobalRotation);
642  HDC_PackageContainer_Physical->SetRotation(Rotation_HDCPackageContainer);
643 
644  G4cout << G4endl << "###### Leaving QweakSimHDC::SetHDC_RotationAngleInPhi() " << G4endl << G4endl;
645 }
646 
647 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
649 {
650  G4Box* HDC_PackageContainer_Solid = new G4Box("HDC_PackageContainer_Solid",
651  0.5 * (3.0*m),
652  0.5 * (7.0*m),
653  0.5 * (0.7*m));
654 
655  G4LogicalVolume* HDC_PackageContainer_Logical = new G4LogicalVolume( HDC_PackageContainer_Solid,
656  pMaterial->GetMaterial("Air"),
657  "HDC_PackageContainer_Logical",
658  0,
659  0,0);
660 
661  G4Colour aluminum ( 169/255. , 172/255. , 182/255.);
662  G4VisAttributes* HDC_PackageContainer_VisAtt = new G4VisAttributes(aluminum);
663  HDC_PackageContainer_VisAtt->SetForceWireframe(true);
664  HDC_PackageContainer_VisAtt->SetVisibility(false);
665  HDC_PackageContainer_Logical->SetVisAttributes(HDC_PackageContainer_VisAtt);
666 
667  // Place the physical volume into theMotherVolume
668 
670  G4ThreeVector Translation_HDC_PackageContainer;
671  Translation_HDC_PackageContainer.setZ(HDC_CenterPositionInZ);
672 
673  G4RotationMatrix* Rotation_HDC_PackageContainer = new G4RotationMatrix();
674  //Rotation_HDC_PackageContainer->rotateZ(-90.0*deg);
675 
676  HDC_PackageContainer_Physical = new G4PVPlacement(Rotation_HDC_PackageContainer,
677  Translation_HDC_PackageContainer,
678  "HDC_PackageContainer_Physical",
679  HDC_PackageContainer_Logical,
680  theMotherPV,
681  false,
682  0,
683  pSurfChk);
684 
685 
686  for (size_t i=0; i< HDC_MasterContainerFront_Physical.size();i++) {
687 
688  Rotation_HDC[i] = new G4RotationMatrix();
689  //Rotation_HDC[i]->setPhi(HDC_RotationAngleInPhi[i]-90.0*deg);
690 
691  // define HDC MasterContainer positions in MotherVolume
692  G4ThreeVector position_MasterContainerFront(HDC_CenterFront_XPos[i],
695 
696  G4ThreeVector position_MasterContainerBack(HDC_CenterBack_XPos[i],
699 
700  // define HDC physical volume of drift chamber container
701  G4cout << G4endl << "###### QweakSimHDC: Define HDC_MasterContainerFront_Physical" << G4endl << G4endl;
702 
703  HDC_MasterContainerFront_Physical[i] = new G4PVPlacement(Rotation_HDC[i],
704  position_MasterContainerFront,
705  Form("HDC_MasterContainerFront_Physical%ld",i),
708  false,
709  2*i,
710  pSurfChk); // copy number for front
711 
712 
713 
714  // define HDC physical volume of drift chamber container
715 
716  HDC_MasterContainerBack_Physical[i] = new G4PVPlacement(Rotation_HDC[i],
717  position_MasterContainerBack,
718  Form("HDC_MasterContainerBack_Physical%ld",i),
721  false,
722  2*i+1,
723  pSurfChk);// copy number for back
724 
725  }
726 
727 
728 }
G4double HDCFrame_BorderWidthInY
Definition: QweakSimHDC.hh:157
QweakSimMaterial * pMaterial
Definition: QweakSimHDC.hh:124
G4double HDCFrame_OuterWidth
Definition: QweakSimHDC.hh:153
G4double HDC_CenterPositionInZ
Definition: QweakSimHDC.hh:167
G4double HDCFrame_BorderWidthInX
Definition: QweakSimHDC.hh:156
static QweakSimMaterial * GetInstance()
void DestroyComponent()
Definition: QweakSimHDC.cc:541
G4double AluFrame_Thickness
Definition: QweakSimHDC.hh:161
std::vector< G4VPhysicalVolume * > HDC_MasterContainerBack_Physical
Definition: QweakSimHDC.hh:135
Checks for a valid HDC WirePlane hit and stores the hit information (Up to now I only activated only ...
void SetBackHDC_CenterPositionInZ(G4double zPos, G4int pkg)
Definition: QweakSimHDC.cc:617
G4LogicalVolume * HDC_Foil_Logical
Definition: QweakSimHDC.hh:143
void PlaceHDC_MasterContainers()
Definition: QweakSimHDC.cc:648
void SetHDC_RotationAngleInPhi(G4double HDC_phiangle, G4int pkg)
Definition: QweakSimHDC.cc:630
G4double HDCFrame_Thickness
Definition: QweakSimHDC.hh:151
std::vector< G4double > HDC_CenterFront_YPos
Definition: QweakSimHDC.hh:170
G4double AluFrame_OuterLength
Definition: QweakSimHDC.hh:162
G4VPhysicalVolume * HDC_SubContainer_Physical
Definition: QweakSimHDC.hh:138
void SetHDC_SubContainerMaterial(G4String)
Definition: QweakSimHDC.cc:473
void SetFrontHDC_CenterPositionInZ(G4double zPos, G4int pkg)
Definition: QweakSimHDC.cc:574
G4double AluFrame_InnerLength
Definition: QweakSimHDC.hh:164
std::vector< QweakSimHDCMessenger * > HDC_Messenger
Definition: QweakSimHDC.hh:149
static const G4bool pSurfChk
G4VPhysicalVolume * theMotherPV
Definition: QweakSimHDC.hh:126
G4LogicalVolume * HDC_SubContainer_Logical
Definition: QweakSimHDC.hh:137
G4double AluFrame_InnerWidth
Definition: QweakSimHDC.hh:165
std::vector< G4VPhysicalVolume * > HDC_MasterContainerFront_Physical
Definition: QweakSimHDC.hh:134
G4double HDC_DriftCell_TotalThickness
Definition: QweakSimHDC.hh:159
void SetBackHDC_CenterPositionInY(G4double yPos, G4int pkg)
Definition: QweakSimHDC.cc:603
G4VPhysicalVolume * HDC_Foil_Physical
Definition: QweakSimHDC.hh:144
G4VPhysicalVolume * HDC_WirePlane_Physical
Definition: QweakSimHDC.hh:147
static const G4double mil
std::vector< G4double > HDC_CenterBack_ZPos
Definition: QweakSimHDC.hh:175
G4double AluFrame_OuterWidth
Definition: QweakSimHDC.hh:163
void SetHDC_MasterContainerMaterial(G4String)
Definition: QweakSimHDC.cc:456
G4VisAttributes * HDC_MasterContainer_VisAtt
Definition: QweakSimHDC.hh:178
G4LogicalVolume * HDC_Frame_Logical
Definition: QweakSimHDC.hh:140
void SetHDC_WirePlaneMaterial(G4String)
Definition: QweakSimHDC.cc:524
void SetHDC_FrameMaterial(G4String)
Definition: QweakSimHDC.cc:490
G4Material * GetMaterial(G4String material)
G4VisAttributes * HDC_SubContainer_VisAtt
Definition: QweakSimHDC.hh:179
std::vector< G4double > HDC_CenterBack_XPos
Definition: QweakSimHDC.hh:173
std::vector< G4double > HDC_CenterFront_XPos
Definition: QweakSimHDC.hh:169
std::vector< G4double > HDC_CenterFront_ZPos
Definition: QweakSimHDC.hh:171
void SetFrontHDC_CenterPositionInY(G4double yPos, G4int pkg)
Definition: QweakSimHDC.cc:560
G4VPhysicalVolume * HDC_Frame_Physical
Definition: QweakSimHDC.hh:141
G4double HDC_RotationAngleInPhi[2]
Definition: QweakSimHDC.hh:131
G4VSensitiveDetector * HdriftChamberSD
Definition: QweakSimHDC.hh:185
G4VisAttributes * HDC_WirePlane_VisAtt
Definition: QweakSimHDC.hh:182
G4VPhysicalVolume * HDC_PackageContainer_Physical
Definition: QweakSimHDC.hh:128
void ConstructComponent(G4VPhysicalVolume *)
Definition: QweakSimHDC.cc:187
G4LogicalVolume * HDC_WirePlane_Logical
Definition: QweakSimHDC.hh:146
G4double HDCFrame_InnerLength
Definition: QweakSimHDC.hh:154
std::vector< G4RotationMatrix * > Rotation_HDC
Definition: QweakSimHDC.hh:130
Scans the input file for /HDC/xyz commands.
void SetFrontHDC_CenterPositionInX(G4double xPos, G4int pkg)
Definition: QweakSimHDC.cc:546
G4double HDCFrame_InnerWidth
Definition: QweakSimHDC.hh:155
G4double HDCFrame_OuterLength
Definition: QweakSimHDC.hh:152
G4VisAttributes * HDC_Foil_VisAtt
Definition: QweakSimHDC.hh:181
G4VisAttributes * HDC_Frame_VisAtt
Definition: QweakSimHDC.hh:180
G4SubtractionSolid * HDC_Frame_Solid
Definition: QweakSimHDC.hh:187
void SetHDC_FoilMaterial(G4String)
Definition: QweakSimHDC.cc:507
std::vector< G4double > HDC_CenterBack_YPos
Definition: QweakSimHDC.hh:174
G4LogicalVolume * HDC_MasterContainer_Logical
Definition: QweakSimHDC.hh:133
void SetBackHDC_CenterPositionInX(G4double xPos, G4int pkg)
Definition: QweakSimHDC.cc:589