Geant4 Cross Reference

Cross-Referencing   Geant4
Geant4/examples/advanced/lAr_calorimeter/src/FCALTestbeamSetup.cc

Version: [ ReleaseNotes ] [ 1.0 ] [ 1.1 ] [ 2.0 ] [ 3.0 ] [ 3.1 ] [ 3.2 ] [ 4.0 ] [ 4.0.p1 ] [ 4.0.p2 ] [ 4.1 ] [ 4.1.p1 ] [ 5.0 ] [ 5.0.p1 ] [ 5.1 ] [ 5.1.p1 ] [ 5.2 ] [ 5.2.p1 ] [ 5.2.p2 ] [ 6.0 ] [ 6.0.p1 ] [ 6.1 ] [ 6.2 ] [ 6.2.p1 ] [ 6.2.p2 ] [ 7.0 ] [ 7.0.p1 ] [ 7.1 ] [ 7.1.p1 ] [ 8.0 ] [ 8.0.p1 ] [ 8.1 ] [ 8.1.p1 ] [ 8.1.p2 ] [ 8.2 ] [ 8.2.p1 ] [ 8.3 ] [ 8.3.p1 ] [ 8.3.p2 ] [ 9.0 ] [ 9.0.p1 ] [ 9.0.p2 ] [ 9.1 ] [ 9.1.p1 ] [ 9.1.p2 ] [ 9.1.p3 ] [ 9.2 ] [ 9.2.p1 ] [ 9.2.p2 ] [ 9.2.p3 ] [ 9.2.p4 ] [ 9.3 ] [ 9.3.p1 ] [ 9.3.p2 ] [ 9.4 ] [ 9.4.p1 ] [ 9.4.p2 ] [ 9.4.p3 ] [ 9.4.p4 ] [ 9.5 ] [ 9.5.p1 ] [ 9.5.p2 ] [ 9.6 ] [ 9.6.p1 ] [ 9.6.p2 ] [ 9.6.p3 ] [ 9.6.p4 ] [ 10.0 ] [ 10.0.p1 ] [ 10.0.p2 ] [ 10.0.p3 ] [ 10.0.p4 ] [ 10.1 ] [ 10.1.p1 ] [ 10.1.p2 ] [ 10.1.p3 ] [ 10.2 ] [ 10.2.p1 ] [ 10.2.p2 ] [ 10.2.p3 ] [ 10.3 ] [ 10.3.p1 ] [ 10.3.p2 ] [ 10.3.p3 ] [ 10.4 ] [ 10.4.p1 ] [ 10.4.p2 ] [ 10.4.p3 ] [ 10.5 ] [ 10.5.p1 ] [ 10.6 ] [ 10.6.p1 ] [ 10.6.p2 ] [ 10.6.p3 ] [ 10.7 ] [ 10.7.p1 ] [ 10.7.p2 ] [ 10.7.p3 ] [ 10.7.p4 ] [ 11.0 ] [ 11.0.p1 ] [ 11.0.p2 ] [ 11.0.p3, ] [ 11.0.p4 ] [ 11.1 ] [ 11.1.1 ] [ 11.1.2 ] [ 11.1.3 ] [ 11.2 ] [ 11.2.1 ] [ 11.2.2 ] [ 11.3.0 ]

Diff markup

Differences between /examples/advanced/lAr_calorimeter/src/FCALTestbeamSetup.cc (Version 11.3.0) and /examples/advanced/lAr_calorimeter/src/FCALTestbeamSetup.cc (Version 9.6.p2)


  1 //                                                  1 //
  2 // *******************************************      2 // ********************************************************************
  3 // * License and Disclaimer                         3 // * License and Disclaimer                                           *
  4 // *                                                4 // *                                                                  *
  5 // * The  Geant4 software  is  copyright of th      5 // * The  Geant4 software  is  copyright of the Copyright Holders  of *
  6 // * the Geant4 Collaboration.  It is provided      6 // * the Geant4 Collaboration.  It is provided  under  the terms  and *
  7 // * conditions of the Geant4 Software License      7 // * conditions of the Geant4 Software License,  included in the file *
  8 // * LICENSE and available at  http://cern.ch/      8 // * LICENSE and available at  http://cern.ch/geant4/license .  These *
  9 // * include a list of copyright holders.           9 // * include a list of copyright holders.                             *
 10 // *                                               10 // *                                                                  *
 11 // * Neither the authors of this software syst     11 // * Neither the authors of this software system, nor their employing *
 12 // * institutes,nor the agencies providing fin     12 // * institutes,nor the agencies providing financial support for this *
 13 // * work  make  any representation or  warran     13 // * work  make  any representation or  warranty, express or implied, *
 14 // * regarding  this  software system or assum     14 // * regarding  this  software system or assume any liability for its *
 15 // * use.  Please see the license in the file      15 // * use.  Please see the license in the file  LICENSE  and URL above *
 16 // * for the full disclaimer and the limitatio     16 // * for the full disclaimer and the limitation of liability.         *
 17 // *                                               17 // *                                                                  *
 18 // * This  code  implementation is the result      18 // * This  code  implementation is the result of  the  scientific and *
 19 // * technical work of the GEANT4 collaboratio     19 // * technical work of the GEANT4 collaboration.                      *
 20 // * By using,  copying,  modifying or  distri     20 // * By using,  copying,  modifying or  distributing the software (or *
 21 // * any work based  on the software)  you  ag     21 // * any work based  on the software)  you  agree  to acknowledge its *
 22 // * use  in  resulting  scientific  publicati     22 // * use  in  resulting  scientific  publications,  and indicate your *
 23 // * acceptance of all terms of the Geant4 Sof     23 // * acceptance of all terms of the Geant4 Software license.          *
 24 // *******************************************     24 // ********************************************************************
 25 //                                                 25 //
 26 //   Author:            Mathieu Fontaine           26 //   Author:            Mathieu Fontaine           Rachid Mazini
 27 //                      fontaine@lps.umontreal     27 //                      fontaine@lps.umontreal.ca  Rachid.Mazini@cern.ch
 28 //   Language:          C++                        28 //   Language:          C++
 29 //   Tested on:         g++                        29 //   Tested on:         g++
 30 //   Prerequisites:     None                       30 //   Prerequisites:     None
 31 //   Purpose:           Header file for FCALFr     31 //   Purpose:           Header file for FCALFrontVolume.cc, which defines
 32 //                      the  volumes in the te     32 //                      the  volumes in the testbeam front.
 33 //   Developped:        10-March-2000   M.F.       33 //   Developped:        10-March-2000   M.F.
 34 //                                                 34 //
 35 //--------------------------------------------     35 //----------------------------------------------------------------------------
 36                                                    36 
 37                                                    37 
 38 #include "FCALTestbeamSetup.hh"                    38 #include "FCALTestbeamSetup.hh"
 39 #include "FCALTestbeamSetupSD.hh"              << 
 40                                                    39 
 41 #include "FCALMaterialConsultant.hh"               40 #include "FCALMaterialConsultant.hh"
 42 #include "FCALCryostatVolumes.hh"                  41 #include "FCALCryostatVolumes.hh"
 43                                                    42 
 44 #include "FCALTestbeamSetupSD.hh"                  43 #include "FCALTestbeamSetupSD.hh"
 45                                                    44 
 46 #include "G4PhysicalConstants.hh"                  45 #include "G4PhysicalConstants.hh"
 47 #include "G4SystemOfUnits.hh"                      46 #include "G4SystemOfUnits.hh"
 48 #include "G4Box.hh"                                47 #include "G4Box.hh"
 49 #include "G4Tubs.hh"                               48 #include "G4Tubs.hh"
 50 #include "G4SubtractionSolid.hh"                   49 #include "G4SubtractionSolid.hh"
 51 #include "G4Material.hh"                           50 #include "G4Material.hh"
 52 #include "G4LogicalVolume.hh"                      51 #include "G4LogicalVolume.hh"
 53 #include "G4VPhysicalVolume.hh"                    52 #include "G4VPhysicalVolume.hh"
 54 #include "G4PVPlacement.hh"                        53 #include "G4PVPlacement.hh"
 55 #include "G4ThreeVector.hh"                        54 #include "G4ThreeVector.hh"
 56 #include "G4RotationMatrix.hh"                     55 #include "G4RotationMatrix.hh"
 57                                                    56 
 58 #include "G4SDManager.hh"                          57 #include "G4SDManager.hh"
 59 #include "G4RunManager.hh"                         58 #include "G4RunManager.hh"
 60                                                    59 
 61 #include "G4VisAttributes.hh"                      60 #include "G4VisAttributes.hh"
 62 #include "G4Colour.hh"                             61 #include "G4Colour.hh"
 63                                                    62 
 64 #include "G4ios.hh"                                63 #include "G4ios.hh"
 65 #include "G4Threading.hh"                      << 
 66                                                    64 
 67 FCALTestbeamSetup::FCALTestbeamSetup() {       <<  65 FCALTestbeamSetup::FCALTestbeamSetup() : FCALTBSetupSD(0) {
 68 #include "FCALTestbeamSetupParameters.input"       66 #include "FCALTestbeamSetupParameters.input"
 69 }                                                  67 }
 70                                                    68 
 71 FCALTestbeamSetup::~FCALTestbeamSetup() {}         69 FCALTestbeamSetup::~FCALTestbeamSetup() {}
 72                                                    70 
 73 G4VPhysicalVolume * FCALTestbeamSetup::Constru     71 G4VPhysicalVolume * FCALTestbeamSetup::Construct()
 74 {                                                  72 {
 75   G4int i=0;                                   <<  73   G4int i;
 76                                                    74 
 77   //-----------------------------                  75   //-----------------------------
 78   // construction of materials                     76   // construction of materials
 79   //-----------------------------                  77   //-----------------------------
 80   G4cout << "Constructing materials...";       <<  78   
 81   FCALMaterialConsultant*                      <<  79   FCALMaterialConsultant * FCALMaterials = new FCALMaterialConsultant();
 82     FCALMaterials = FCALMaterialConsultant::Ge <<  80   FCALMaterials->construct();
 83   G4cout << "... done" << G4endl;              << 
 84                                                    81 
 85   //-------------------                            82   //-------------------
 86   // Experimental Hall                             83   // Experimental Hall 
 87   //-------------------                            84   //-------------------
 88   G4Box * SolidMother = new G4Box("Mother",Mot     85   G4Box * SolidMother = new G4Box("Mother",MotherSizeX,MotherSizeY,MotherSizeZ);
 89   G4LogicalVolume * LogicalMother =                86   G4LogicalVolume * LogicalMother = 
 90     new G4LogicalVolume(SolidMother,FCALMateri     87     new G4LogicalVolume(SolidMother,FCALMaterials->Material("Air"),"Mother");
 91   G4VPhysicalVolume * PhysicalMother =             88   G4VPhysicalVolume * PhysicalMother =
 92     new G4PVPlacement(0, G4ThreeVector(),"Moth     89     new G4PVPlacement(0, G4ThreeVector(),"Mother", LogicalMother, NULL, 0,0);
 93                                                    90   
 94   LogicalMother->SetVisAttributes(G4VisAttribu <<  91   LogicalMother->SetVisAttributes(G4VisAttributes::Invisible);
 95                                                    92 
 96                                                    93 
 97   //-------------------------------                94   //-------------------------------
 98   //  Scintillators S1, S2 and S3                  95   //  Scintillators S1, S2 and S3
 99   //-------------------------------                96   //-------------------------------
100   G4Box * SolidScintS1andS3 =                      97   G4Box * SolidScintS1andS3 = 
101     new G4Box("ScintS1andS3Solid",ScintS1andS3     98     new G4Box("ScintS1andS3Solid",ScintS1andS3SizeX,  ScintS1andS3SizeY, ScintS1andS3SizeZ);
102   G4Box * SolidScintS2 =                           99   G4Box * SolidScintS2 = 
103     new G4Box("ScintS2Solid", ScintS2SizeX, Sc    100     new G4Box("ScintS2Solid", ScintS2SizeX, ScintS2SizeY, ScintS2SizeZ); 
104                                                   101 
105   G4LogicalVolume * LogicalScintS1andS3 =         102   G4LogicalVolume * LogicalScintS1andS3 = 
106     new G4LogicalVolume(SolidScintS1andS3,FCAL    103     new G4LogicalVolume(SolidScintS1andS3,FCALMaterials->Material("Polystyrene"),
107       "ScintS1andS3Logical");                     104       "ScintS1andS3Logical");  
108   G4LogicalVolume * LogicalScintS2 =              105   G4LogicalVolume * LogicalScintS2 = 
109     new G4LogicalVolume(SolidScintS2, FCALMate    106     new G4LogicalVolume(SolidScintS2, FCALMaterials->Material("Polystyrene"),
110       "ScintS2Logical");                          107       "ScintS2Logical");
111                                                   108 
112   // G4VPhysicalVolume * PhysicalScintS1 =        109   // G4VPhysicalVolume * PhysicalScintS1 = 
113     new G4PVPlacement(0, G4ThreeVector(ScintS1    110     new G4PVPlacement(0, G4ThreeVector(ScintS1_S3PosX, ScintS1_S3PosY, ScintS1PosZ),
114             "ScintS1Physical",LogicalScintS1an    111             "ScintS1Physical",LogicalScintS1andS3,PhysicalMother,0,0);
115   // G4VPhysicalVolume * PhysicalScintS3 =        112   // G4VPhysicalVolume * PhysicalScintS3 = 
116     new G4PVPlacement(0, G4ThreeVector(ScintS1    113     new G4PVPlacement(0, G4ThreeVector(ScintS1_S3PosX, ScintS1_S3PosY, ScintS3PosZ),
117             "ScintS3Physical",LogicalScintS1an    114             "ScintS3Physical",LogicalScintS1andS3,PhysicalMother,0,0);  
118   // G4VPhysicalVolume * PhysicalScintS2 =        115   // G4VPhysicalVolume * PhysicalScintS2 = 
119     new G4PVPlacement(0, G4ThreeVector(ScintS1    116     new G4PVPlacement(0, G4ThreeVector(ScintS1_S3PosX, ScintS1_S3PosY, ScintS2PosZ),
120           "ScintS2Physical", LogicalScintS2, P    117           "ScintS2Physical", LogicalScintS2, PhysicalMother,0,0);
121                                                   118 
122   G4VisAttributes * ColorOfScintillator = new     119   G4VisAttributes * ColorOfScintillator = new G4VisAttributes(G4Colour(0.,0.8,0.));
123   LogicalScintS1andS3->SetVisAttributes(ColorO    120   LogicalScintS1andS3->SetVisAttributes(ColorOfScintillator);
124   LogicalScintS2->SetVisAttributes(ColorOfScin    121   LogicalScintS2->SetVisAttributes(ColorOfScintillator);
125                                                   122   
126                                                   123 
127   //-------------------                           124   //-------------------
128   //      MWPC's                                  125   //      MWPC's
129   //-------------------                           126   //-------------------
130   G4Box* SolidMWPC = new G4Box("MWPCSolid",MWP    127   G4Box* SolidMWPC = new G4Box("MWPCSolid",MWPCSizeX,MWPCSizeY,MWPCSizeZ);
131   G4LogicalVolume * LogicalMWPC =                 128   G4LogicalVolume * LogicalMWPC = 
132     new G4LogicalVolume(SolidMWPC,FCALMaterial    129     new G4LogicalVolume(SolidMWPC,FCALMaterials->Material("MWPCArCO2"),"MWPCLogical");
133   for(i=0; i<5; i++)                              130   for(i=0; i<5; i++) 
134     {                                             131     {
135       // G4VPhysicalVolume * PhysicalMWPC =       132       // G4VPhysicalVolume * PhysicalMWPC = 
136   new G4PVPlacement(0,G4ThreeVector(MWPCPosX,M    133   new G4PVPlacement(0,G4ThreeVector(MWPCPosX,MWPCPosY,MWPCPosZ[i]),
137         "MWPCPhysical", LogicalMWPC, PhysicalM    134         "MWPCPhysical", LogicalMWPC, PhysicalMother,0,i+1);
138     }                                             135     }
139   G4VisAttributes * ColorOfMWPC = new G4VisAtt    136   G4VisAttributes * ColorOfMWPC = new G4VisAttributes(G4Colour(0.,0.,0.5));
140   LogicalMWPC->SetVisAttributes(ColorOfMWPC);     137   LogicalMWPC->SetVisAttributes(ColorOfMWPC);
141                                                   138 
142   //---------------------------------------       139   //---------------------------------------
143   //  Hole Counter (scintillator + Pb + Al        140   //  Hole Counter (scintillator + Pb + Al
144   //---------------------------------------       141   //---------------------------------------
145   // Scintillator Counter                         142   // Scintillator Counter
146   G4Box *  SolidHoleCntrScint =                   143   G4Box *  SolidHoleCntrScint = 
147     new G4Box("ScintSolid", HoleCntrSizeX, Hol    144     new G4Box("ScintSolid", HoleCntrSizeX, HoleCntrSizeY, HoleCntrScintSizeZ);
148   G4LogicalVolume * LogicalHoleCntrScint =        145   G4LogicalVolume * LogicalHoleCntrScint = 
149     new G4LogicalVolume(SolidHoleCntrScint, FC    146     new G4LogicalVolume(SolidHoleCntrScint, FCALMaterials->Material("Polystyrene"),
150       "HoleCntrScintLogical");                    147       "HoleCntrScintLogical");
151   // Hole in scintillator Counter                 148   // Hole in scintillator Counter
152   G4Tubs * SolidHole =                            149   G4Tubs * SolidHole = 
153     new G4Tubs("HoleSolid", ScintHoleRmin, Sci    150     new G4Tubs("HoleSolid", ScintHoleRmin, ScintHoleRmax, ScintHoleLenght,  
154          HoleStartPhi, HoleDPhi);                 151          HoleStartPhi, HoleDPhi);
155   G4LogicalVolume * LogicalHole =                 152   G4LogicalVolume * LogicalHole = 
156     new G4LogicalVolume(SolidHole, FCALMateria    153     new G4LogicalVolume(SolidHole, FCALMaterials->Material("Air"), "HoleLogical");
157   // G4VPhysicalVolume * PhysicalHoleScint =      154   // G4VPhysicalVolume * PhysicalHoleScint = 
158     new G4PVPlacement(0, G4ThreeVector(HolePos    155     new G4PVPlacement(0, G4ThreeVector(HolePosX, HolePosY, HolePosZ), LogicalHole, 
159           "HolePhysicalScint", LogicalHoleCntr    156           "HolePhysicalScint", LogicalHoleCntrScint, 0, 0);
160   // Scintillator Hole counter placement          157   // Scintillator Hole counter placement
161   // G4VPhysicalVolume * PhysicalHoleCntrScint    158   // G4VPhysicalVolume * PhysicalHoleCntrScint =
162     new G4PVPlacement(0,                          159     new G4PVPlacement(0, 
163             G4ThreeVector(HoleCntrScintPosX, H    160             G4ThreeVector(HoleCntrScintPosX, HoleCntrScintPosY, HoleCntrScintPosZ), 
164             "HoleCntrScintPhysical", LogicalHo    161             "HoleCntrScintPhysical", LogicalHoleCntrScint, PhysicalMother, 0, 0);
165                                                   162 
166   // Absorber Lead                                163   // Absorber Lead
167   G4Box * SolidHoleCntrAbsrb =                    164   G4Box * SolidHoleCntrAbsrb = 
168     new G4Box("AbsrbSolid", HoleCntrSizeX, Hol    165     new G4Box("AbsrbSolid", HoleCntrSizeX, HoleCntrSizeY, HoleCntrAbsrbSizeZ);
169   G4LogicalVolume * LogicalHoleCntrPb =           166   G4LogicalVolume * LogicalHoleCntrPb = 
170     new G4LogicalVolume(SolidHoleCntrAbsrb, FC    167     new G4LogicalVolume(SolidHoleCntrAbsrb, FCALMaterials->Material("Lead"),
171       "HoleCntrPbLoghical");                      168       "HoleCntrPbLoghical");
172                                                   169 
173   //hole in ABsorber, both Lead and Al.           170   //hole in ABsorber, both Lead and Al.
174   G4Tubs * SolidHoleAbs =                         171   G4Tubs * SolidHoleAbs = 
175     new G4Tubs("HoleSolidAbs", AbsrbHoleRmin,     172     new G4Tubs("HoleSolidAbs", AbsrbHoleRmin, AbsrbHoleRmax, AbsrbHoleLenght, 
176          HoleStartPhi, HoleDPhi);                 173          HoleStartPhi, HoleDPhi);
177   G4LogicalVolume * LogicalHoleAbs =              174   G4LogicalVolume * LogicalHoleAbs = 
178     new G4LogicalVolume(SolidHoleAbs, FCALMate    175     new G4LogicalVolume(SolidHoleAbs, FCALMaterials->Material("Air"),"HoleAbsLogical");
179   // G4VPhysicalVolume * PhysicalHolePb =         176   // G4VPhysicalVolume * PhysicalHolePb =
180     new G4PVPlacement(0, G4ThreeVector(HolePos    177     new G4PVPlacement(0, G4ThreeVector(HolePosX, HolePosY, HolePosZ), LogicalHoleAbs,
181           "HolePbPhysical", LogicalHoleCntrPb,    178           "HolePbPhysical", LogicalHoleCntrPb, 0, 0);
182                                                   179  
183   // Lead Placement                               180   // Lead Placement
184   // G4VPhysicalVolume * PhysicalHoleCntrPb =     181   // G4VPhysicalVolume * PhysicalHoleCntrPb = 
185     new G4PVPlacement(0, G4ThreeVector(HoleCnt    182     new G4PVPlacement(0, G4ThreeVector(HoleCntrPbPosX, HoleCntrPbPosY, HoleCntrPbPosZ),
186           "HoleCntrPbPhysical", LogicalHoleCnt    183           "HoleCntrPbPhysical", LogicalHoleCntrPb, PhysicalMother, 0, 0);
187                                                   184 
188   // Absorber Al.                                 185   // Absorber Al. 
189   G4LogicalVolume * LogicalHoleCntrAl =           186   G4LogicalVolume * LogicalHoleCntrAl = 
190     new G4LogicalVolume(SolidHoleCntrAbsrb,  F    187     new G4LogicalVolume(SolidHoleCntrAbsrb,  FCALMaterials->Material("Aluminium"),
191       "HoleCntrAlLogical");                    << 188       "HoleCntrAlLoghical");
192   // G4VPhysicalVolume * PhysicalHoleAl =         189   // G4VPhysicalVolume * PhysicalHoleAl =
193     new G4PVPlacement(0, G4ThreeVector(HolePos    190     new G4PVPlacement(0, G4ThreeVector(HolePosX, HolePosY, HolePosZ), LogicalHoleAbs,
194           "HoleAlPhysical", LogicalHoleCntrAl,    191           "HoleAlPhysical", LogicalHoleCntrAl, 0, 0);
195   // G4VPhysicalVolume * PhysicalHoleCntrAl =     192   // G4VPhysicalVolume * PhysicalHoleCntrAl = 
196     new G4PVPlacement(0, G4ThreeVector(HoleCnt    193     new G4PVPlacement(0, G4ThreeVector(HoleCntrAlPosX, HoleCntrAlPosY, HoleCntrAlPosZ),
197           "HoleCntrAlPhysical", LogicalHoleCnt    194           "HoleCntrAlPhysical", LogicalHoleCntrAl, PhysicalMother, 0, 0);
198                                                   195   
199    LogicalHoleCntrScint->SetVisAttributes(Colo    196    LogicalHoleCntrScint->SetVisAttributes(ColorOfScintillator);
200                                                   197 
201    G4VisAttributes * ColorOfLead = new G4VisAt    198    G4VisAttributes * ColorOfLead = new G4VisAttributes(G4Colour(0.5,0.5,0.8));
202    G4VisAttributes * ColorOfAlu = new G4VisAtt    199    G4VisAttributes * ColorOfAlu = new G4VisAttributes(G4Colour(0.5,0.5,0.3));
203    LogicalHoleCntrPb->SetVisAttributes(ColorOf    200    LogicalHoleCntrPb->SetVisAttributes(ColorOfLead);
204    LogicalHoleCntrAl->SetVisAttributes(ColorOf    201    LogicalHoleCntrAl->SetVisAttributes(ColorOfAlu);
205                                                   202 
206    G4VisAttributes * ColorOfAir = new G4VisAtt    203    G4VisAttributes * ColorOfAir = new G4VisAttributes(G4Colour(1.,1.,1.));
207    LogicalHole->SetVisAttributes(ColorOfAir);     204    LogicalHole->SetVisAttributes(ColorOfAir);
208    LogicalHoleAbs->SetVisAttributes(ColorOfAir    205    LogicalHoleAbs->SetVisAttributes(ColorOfAir);
209                                                   206 
210                                                   207 
211    //-------------------                          208    //-------------------
212    //   Lead Wall                                 209    //   Lead Wall
213    //-------------------                          210    //-------------------
214    G4Box * SolidLeadWall =                        211    G4Box * SolidLeadWall = 
215      new G4Box("LeadWallSolid", LeadWallSizeX,    212      new G4Box("LeadWallSolid", LeadWallSizeX, LeadWallSizeY, LeadWallSizeZ);
216    G4LogicalVolume * LogicalLeadWall =            213    G4LogicalVolume * LogicalLeadWall = 
217      new G4LogicalVolume(SolidLeadWall, FCALMa    214      new G4LogicalVolume(SolidLeadWall, FCALMaterials->Material("Lead"), 
218        "LeadWallLogical");                        215        "LeadWallLogical");    
219                                                   216 
220    G4Box * SolidSlitPb = new G4Box("SlitPb", L    217    G4Box * SolidSlitPb = new G4Box("SlitPb", LeadWallSlitSizeX, LeadWallSlitSizeY, 
221          LeadWallSlitSizeZ);                      218          LeadWallSlitSizeZ);
222    G4LogicalVolume * LogicalSlitPb =              219    G4LogicalVolume * LogicalSlitPb = 
223      new G4LogicalVolume(SolidSlitPb, FCALMate    220      new G4LogicalVolume(SolidSlitPb, FCALMaterials->Material("Air"), "SlitPbLogical");
224    // G4VPhysicalVolume * PhysicalSlitPb =        221    // G4VPhysicalVolume * PhysicalSlitPb = 
225      new G4PVPlacement(0, G4ThreeVector(), Log    222      new G4PVPlacement(0, G4ThreeVector(), LogicalSlitPb, "SlitPbPhysical", LogicalLeadWall, 0, 0);
226                                                   223 
227    // G4VPhysicalVolume * PhysicalLeadWall =      224    // G4VPhysicalVolume * PhysicalLeadWall = 
228      new G4PVPlacement(0, G4ThreeVector(LeadWa    225      new G4PVPlacement(0, G4ThreeVector(LeadWallPosX,LeadWallPosY,LeadWallPosZ),
229            "LeadWallPhysical", LogicalLeadWall    226            "LeadWallPhysical", LogicalLeadWall, PhysicalMother, 0, 0);
230                                                   227 
231    LogicalLeadWall->SetVisAttributes(ColorOfLe    228    LogicalLeadWall->SetVisAttributes(ColorOfLead);
232    LogicalSlitPb->SetVisAttributes(ColorOfAir)    229    LogicalSlitPb->SetVisAttributes(ColorOfAir);
233                                                   230 
234                                                   231 
235     //-------------------                         232     //-------------------
236    //   Iron Wall                                 233    //   Iron Wall
237    //-------------------                          234    //-------------------
238    G4Box * SolidIronWall =                        235    G4Box * SolidIronWall = 
239      new G4Box("IronWallSolid", IronWallSizeX,    236      new G4Box("IronWallSolid", IronWallSizeX, IronWallSizeY, IronWallSizeZ);
240    G4LogicalVolume * LogicalIronWall =            237    G4LogicalVolume * LogicalIronWall = 
241      new G4LogicalVolume(SolidIronWall, FCALMa    238      new G4LogicalVolume(SolidIronWall, FCALMaterials->Material("Iron"), 
242        "IronWallLogical");                        239        "IronWallLogical");    
243                                                   240 
244    G4Box * SolidSlitFe = new G4Box("SlitFe", I    241    G4Box * SolidSlitFe = new G4Box("SlitFe", IronWallSlitSizeX, IronWallSlitSizeY, 
245          IronWallSlitSizeZ);                      242          IronWallSlitSizeZ);
246    G4LogicalVolume * LogicalSlitFe =              243    G4LogicalVolume * LogicalSlitFe = 
247      new G4LogicalVolume(SolidSlitFe, FCALMate    244      new G4LogicalVolume(SolidSlitFe, FCALMaterials->Material("Air"), "SlitFeLogical");
248    // G4VPhysicalVolume * PhysicalSlitFe =        245    // G4VPhysicalVolume * PhysicalSlitFe = 
249      new G4PVPlacement(0, G4ThreeVector(), Log    246      new G4PVPlacement(0, G4ThreeVector(), LogicalSlitFe, "SlitFePhysical", LogicalIronWall, 0, 0);
250                                                   247 
251    // G4VPhysicalVolume * PhysicalIronWall =      248    // G4VPhysicalVolume * PhysicalIronWall = 
252      new G4PVPlacement(0, G4ThreeVector(IronWa    249      new G4PVPlacement(0, G4ThreeVector(IronWallPosX,IronWallPosY,IronWallPosZ),
253            "IronWallPhysical", LogicalIronWall    250            "IronWallPhysical", LogicalIronWall, PhysicalMother, 0, 0);
254                                                   251 
255    G4VisAttributes * ColorOfIron = new G4VisAt    252    G4VisAttributes * ColorOfIron = new G4VisAttributes(G4Colour(0.2,0.2,0.2));
256    LogicalIronWall->SetVisAttributes(ColorOfIr    253    LogicalIronWall->SetVisAttributes(ColorOfIron);
257    LogicalSlitFe->SetVisAttributes(ColorOfAir)    254    LogicalSlitFe->SetVisAttributes(ColorOfAir);
258                                                   255 
259    //----------------                             256    //----------------
260    // Tail Catcher                                257    // Tail Catcher
261    //----------------                             258    //----------------
262    G4Box * SolidBigScint =                        259    G4Box * SolidBigScint = 
263      new G4Box("BigSolidScint",BigScintSizeX,     260      new G4Box("BigSolidScint",BigScintSizeX, BigScintSizeY, ScintSizeZ);
264    G4LogicalVolume * LogicalBigScint =            261    G4LogicalVolume * LogicalBigScint =
265      new G4LogicalVolume(SolidBigScint,  FCALM    262      new G4LogicalVolume(SolidBigScint,  FCALMaterials->Material("Polystyrene"),
266        "BigScintLogical");                        263        "BigScintLogical");
267                                                   264    
268    G4Box * SolidSmallScint =                      265    G4Box * SolidSmallScint = 
269      new G4Box("SmallSolidScint",SmallScintSiz    266      new G4Box("SmallSolidScint",SmallScintSizeX, SmallScintSizeY, ScintSizeZ);
270    G4LogicalVolume * LogicalSmallScint =          267    G4LogicalVolume * LogicalSmallScint =
271      new G4LogicalVolume(SolidSmallScint,  FCA    268      new G4LogicalVolume(SolidSmallScint,  FCALMaterials->Material("Polystyrene"),
272        "SmallScintLogical");                      269        "SmallScintLogical");
273                                                   270 
274    for( i=0; i<(NBigScint+NSmallScint); i++)      271    for( i=0; i<(NBigScint+NSmallScint); i++)
275      {                                            272      { 
276        if(i<NBigScint)                            273        if(i<NBigScint)  
277    { // G4VPhysicalVolume * PhysicalBigScint =    274    { // G4VPhysicalVolume * PhysicalBigScint =
278        new G4PVPlacement(0, G4ThreeVector(Scin    275        new G4PVPlacement(0, G4ThreeVector(ScintPosX, ScintPosY, ScintPosZ[i]),
279              "BigScintPhysical", LogicalBigSci    276              "BigScintPhysical", LogicalBigScint, PhysicalMother, 
280              0, i+1);                             277              0, i+1); 
281    }                                              278    }
282        else                                       279        else
283    { // G4VPhysicalVolume * PhysicalSmallScint    280    { // G4VPhysicalVolume * PhysicalSmallScint =
284        new G4PVPlacement(0, G4ThreeVector(Scin    281        new G4PVPlacement(0, G4ThreeVector(ScintPosX, ScintPosY, ScintPosZ[i]),
285              "SmallScintPhysical", LogicalSmal    282              "SmallScintPhysical", LogicalSmallScint, PhysicalMother,
286              0, i+1);                             283              0, i+1);
287    }                                              284    }
288      }                                            285      }
289    LogicalBigScint->SetVisAttributes(ColorOfSc    286    LogicalBigScint->SetVisAttributes(ColorOfScintillator);
290    LogicalSmallScint->SetVisAttributes(ColorOf    287    LogicalSmallScint->SetVisAttributes(ColorOfScintillator);
291                                                   288 
292                                                   289    
293    G4Box * SolidBigIron =                         290    G4Box * SolidBigIron = 
294      new G4Box("BigSolidIron",BigIronSizeX, Bi    291      new G4Box("BigSolidIron",BigIronSizeX, BigIronSizeY, IronSizeZ);
295    G4LogicalVolume * LogicalBigIron =             292    G4LogicalVolume * LogicalBigIron =
296      new G4LogicalVolume(SolidBigIron,  FCALMa    293      new G4LogicalVolume(SolidBigIron,  FCALMaterials->Material("Polystyrene"),
297        "BigIronLogical");                         294        "BigIronLogical");
298                                                   295 
299    G4Box * SolidSmallIron =                       296    G4Box * SolidSmallIron = 
300      new G4Box("SmallSolidIron",SmallIronSizeX    297      new G4Box("SmallSolidIron",SmallIronSizeX, SmallIronSizeY, IronSizeZ);
301    G4LogicalVolume * LogicalSmallIron =           298    G4LogicalVolume * LogicalSmallIron =
302      new G4LogicalVolume(SolidSmallIron,  FCAL    299      new G4LogicalVolume(SolidSmallIron,  FCALMaterials->Material("Iron"),
303        "SmallIronLogical");                       300        "SmallIronLogical");
304                                                   301 
305    for( i=0; i<(NBigIron+NSmallIron); i++)        302    for( i=0; i<(NBigIron+NSmallIron); i++)
306      {                                            303      { 
307        if(i<NBigIron)                             304        if(i<NBigIron)  
308    { // G4VPhysicalVolume * PhysicalBigIron =     305    { // G4VPhysicalVolume * PhysicalBigIron =
309        new G4PVPlacement(0, G4ThreeVector(Iron    306        new G4PVPlacement(0, G4ThreeVector(IronPosX, IronPosY, IronPosZ[i]),
310              "BigIronPhysical", LogicalBigIron    307              "BigIronPhysical", LogicalBigIron, PhysicalMother, 
311              0, i+1);                             308              0, i+1); 
312    }                                              309    }
313        else                                       310        else
314    { // G4VPhysicalVolume * PhysicalSmallIron     311    { // G4VPhysicalVolume * PhysicalSmallIron =
315        new G4PVPlacement(0, G4ThreeVector(Iron    312        new G4PVPlacement(0, G4ThreeVector(IronPosX, IronPosY, IronPosZ[i]),
316              "SmallIronPhysical", LogicalSmall    313              "SmallIronPhysical", LogicalSmallIron, PhysicalMother,
317              0, i+1);                             314              0, i+1);
318    }                                              315    }
319      }                                            316      }
320    LogicalBigIron->SetVisAttributes(ColorOfIro    317    LogicalBigIron->SetVisAttributes(ColorOfIron);
321    LogicalSmallIron->SetVisAttributes(ColorOfI    318    LogicalSmallIron->SetVisAttributes(ColorOfIron);
322                                                   319   
323    //-------------------------                    320    //-------------------------
324    //  Concrete Walls A and B                     321    //  Concrete Walls A and B
325    //-------------------------                    322    //-------------------------
326    G4Box * SolidConcWall =                        323    G4Box * SolidConcWall = 
327      new G4Box("ConcWallSolid", ConcWallSizeX,    324      new G4Box("ConcWallSolid", ConcWallSizeX, ConcWallSizeY, ConcWallSizeZ);
328    G4LogicalVolume * LogicalConcWallA =           325    G4LogicalVolume * LogicalConcWallA =
329      new G4LogicalVolume(SolidConcWall, FCALMa    326      new G4LogicalVolume(SolidConcWall, FCALMaterials->Material("ShieldingConcrete"),
330        "ConcWallALogical");                       327        "ConcWallALogical");
331    G4VPhysicalVolume * PhysicalConcWallA =        328    G4VPhysicalVolume * PhysicalConcWallA = 
332      new G4PVPlacement(0, G4ThreeVector(ConcWa    329      new G4PVPlacement(0, G4ThreeVector(ConcWallPosX, ConcWallPosY, ConcWallAPosZ),
333            "ConcWallAPhysical", LogicalConcWal    330            "ConcWallAPhysical", LogicalConcWallA, PhysicalMother, 0, 0);
334                                                   331 
335    G4LogicalVolume * LogicalConcWallB =           332    G4LogicalVolume * LogicalConcWallB =
336      new G4LogicalVolume(SolidConcWall, FCALMa    333      new G4LogicalVolume(SolidConcWall, FCALMaterials->Material("ShieldingConcrete"),
337        "ConcWallBLogical");                       334        "ConcWallBLogical");
338    // G4VPhysicalVolume * PhysicalConcWallB =     335    // G4VPhysicalVolume * PhysicalConcWallB = 
339      new G4PVPlacement(0, G4ThreeVector(ConcWa    336      new G4PVPlacement(0, G4ThreeVector(ConcWallPosX, ConcWallPosY, ConcWallBPosZ),
340            "ConcWallBPhysical", LogicalConcWal    337            "ConcWallBPhysical", LogicalConcWallB, PhysicalMother, 0, 0);
341                                                   338 
342     G4Box * SolidConcWallIns =                    339     G4Box * SolidConcWallIns = 
343      new G4Box("ConcWallInsSolid", ConcWallIns    340      new G4Box("ConcWallInsSolid", ConcWallInsSizeX,ConcWallInsSizeY,ConcWallInsSizeZ);
344     G4LogicalVolume * LogicalConcWallIns =        341     G4LogicalVolume * LogicalConcWallIns =
345       new G4LogicalVolume(SolidConcWallIns, FC    342       new G4LogicalVolume(SolidConcWallIns, FCALMaterials->Material("Iron"),
346         "LogicalConcWallIns");                    343         "LogicalConcWallIns");
347     // G4VPhysicalVolume * PhysicalConcWallIns    344     // G4VPhysicalVolume * PhysicalConcWallIns =
348       new G4PVPlacement(0, G4ThreeVector(), "C    345       new G4PVPlacement(0, G4ThreeVector(), "ConcWallInsPhysical", LogicalConcWallIns, PhysicalConcWallA, 0, 0);
349                                                   346 
350    G4VisAttributes * ColorOfConcrete = new G4V    347    G4VisAttributes * ColorOfConcrete = new G4VisAttributes(G4Colour(0.,0.,0.));
351    LogicalConcWallA->SetVisAttributes(ColorOfC    348    LogicalConcWallA->SetVisAttributes(ColorOfConcrete);
352    LogicalConcWallB->SetVisAttributes(ColorOfC    349    LogicalConcWallB->SetVisAttributes(ColorOfConcrete);
353    LogicalConcWallIns->SetVisAttributes(ColorO    350    LogicalConcWallIns->SetVisAttributes(ColorOfIron);
354                                                   351 
355    //------------------                           352    //------------------
356    //  Muon Counter                               353    //  Muon Counter
357    //-------------------                          354    //-------------------
358    G4Box * SolidMuContr =                         355    G4Box * SolidMuContr = 
359      new G4Box("MuContrSolid", MuCntrSIzeX, Mu    356      new G4Box("MuContrSolid", MuCntrSIzeX, MuCntrSIzeY, MuCntrSIzeZ);
360    G4LogicalVolume * LogicalMuContr =             357    G4LogicalVolume * LogicalMuContr =
361      new G4LogicalVolume(SolidMuContr, FCALMat    358      new G4LogicalVolume(SolidMuContr, FCALMaterials->Material("Polystyrene"),
362        "MuContrLogical");                         359        "MuContrLogical");
363    // G4VPhysicalVolume * PhysicalMuContr =       360    // G4VPhysicalVolume * PhysicalMuContr =
364      new G4PVPlacement(0, G4ThreeVector(MuCntr    361      new G4PVPlacement(0, G4ThreeVector(MuCntrPosX, MuCntrPosY, MuCntrPosZ),
365            "MuContrPhyiscal", LogicalMuContr,     362            "MuContrPhyiscal", LogicalMuContr, PhysicalMother, 0, 0);
366                                                   363 
367    LogicalMuContr->SetVisAttributes(ColorOfSci    364    LogicalMuContr->SetVisAttributes(ColorOfScintillator);
368                                                   365 
369   //-----------------                             366   //-----------------
370   // cryostat                                     367   // cryostat
371   //-----------------                             368   //-----------------
372                                                   369 
373                                                   370 
374   G4RotationMatrix*  CryostatRotationMatrix =     371   G4RotationMatrix*  CryostatRotationMatrix = 
375     new G4RotationMatrix();                       372     new G4RotationMatrix();
376                                                   373 
377   //    new G4RotationMatrix(1.,0.,0.,0.,0.,-1    374   //    new G4RotationMatrix(1.,0.,0.,0.,0.,-1.,0.,1.,0.);                       
378                                                   375 
379   //  Theta(...)    90.0000  180.0000   90.000    376   //  Theta(...)    90.0000  180.0000   90.0000
380   //  Phi(...)       0.0000    0.0000   90.000    377   //  Phi(...)       0.0000    0.0000   90.0000
381   //                                              378   //
382   //  Matrix(...) |  1.0000  0.0000  0.0000 |     379   //  Matrix(...) |  1.0000  0.0000  0.0000 |
383   //              |  0.0000  0.0000 -1.0000 |     380   //              |  0.0000  0.0000 -1.0000 |
384   //              |  0.0000  1.0000  0.0000 |     381   //              |  0.0000  1.0000  0.0000 |
385   //                                              382   //
386   // How to input?                                383   // How to input?
387                                                   384       
388   CryostatRotationMatrix->rotateX(90*deg);        385   CryostatRotationMatrix->rotateX(90*deg);             
389                                                   386 
390   FCALCryostatVolumes * CryostatVolumes = new     387   FCALCryostatVolumes * CryostatVolumes = new FCALCryostatVolumes();
391                                                   388 
392   G4LogicalVolume * theCryostatVolumes = Cryos    389   G4LogicalVolume * theCryostatVolumes = CryostatVolumes->Construct();
393                                                   390 
394   // G4VPhysicalVolume * PhysiCryostatVolumes     391   // G4VPhysicalVolume * PhysiCryostatVolumes = 
395     new G4PVPlacement(CryostatRotationMatrix,     392     new G4PVPlacement(CryostatRotationMatrix, 
396           G4ThreeVector(CryostatPosX,CryostatP    393           G4ThreeVector(CryostatPosX,CryostatPosY,CryostatPosZ),"CryostatVolumes"
397           , theCryostatVolumes, PhysicalMother    394           , theCryostatVolumes, PhysicalMother, 0,0);
398                                                   395 
399                                                   396 
400   return PhysicalMother;                       << 397   //-----------------------
401                                                << 398   // Senstive detectors
402 }                                              << 399   //-----------------------
403                                                << 400   G4SDManager* SDman = G4SDManager::GetSDMpointer();
404 void FCALTestbeamSetup::ConstructSDandField()  << 401   
405 {                                              << 402   if(!FCALTBSetupSD)
406     //-----------------------                  << 
407     // Senstive detectors                      << 
408     //-----------------------                  << 
409     G4SDManager* SDman = G4SDManager::GetSDMpo << 
410     const G4String detName = "FCALTB/TBSetupSD << 
411     FCALTestbeamSetupSD* FCALTBSetupSD = stati << 
412     if(!FCALTBSetupSD)                         << 
413     {                                             403     {
414         FCALTBSetupSD = new FCALTestbeamSetupS << 404       FCALTBSetupSD = new FCALTestbeamSetupSD("FCALTB/TBSetupSD");
415         SDman->AddNewDetector(FCALTBSetupSD);  << 405       SDman->AddNewDetector(FCALTBSetupSD);
416     }                                             406     }
417     SetSensitiveDetector("ScintS1andS3Logical" << 407       LogicalScintS1andS3->SetSensitiveDetector(FCALTBSetupSD);
418     SetSensitiveDetector("ScintS2Logical",FCAL << 408       LogicalScintS2->SetSensitiveDetector(FCALTBSetupSD);
419     SetSensitiveDetector("MWPCLogical",FCALTBS << 409       LogicalMWPC->SetSensitiveDetector(FCALTBSetupSD);
420     SetSensitiveDetector("HoleCntrScintLogical << 410       LogicalHoleCntrScint->SetSensitiveDetector(FCALTBSetupSD);
421     SetSensitiveDetector("HoleCntrPbLoghical", << 411       LogicalHoleCntrPb->SetSensitiveDetector(FCALTBSetupSD);
422     SetSensitiveDetector("HoleCntrAlLogical",F << 412       LogicalHoleCntrAl->SetSensitiveDetector(FCALTBSetupSD);
423                                                << 
424     SetSensitiveDetector("LeadWallLogical",FCA << 
425     SetSensitiveDetector("IronWallLogical",FCA << 
426     SetSensitiveDetector("BigScintLogical",FCA << 
427     SetSensitiveDetector("SmallScintLogical",F << 
428                                                << 
429     SetSensitiveDetector("BigIronLogical",FCAL << 
430     SetSensitiveDetector("SmallIronLogical",FC << 
431     SetSensitiveDetector("ConcWallALogical",FC << 
432     SetSensitiveDetector("ConcWallBLogical",FC << 
433     SetSensitiveDetector("LogicalConcWallIns", << 
434     SetSensitiveDetector("MuContrLogical",FCAL << 
435 }                                              << 
436                                                   413 
                                                   >> 414 
                                                   >> 415       //     theCryostatVolumes->SetSensitiveDetector(FCALTBSetupSD);
                                                   >> 416 
                                                   >> 417       LogicalLeadWall->SetSensitiveDetector(FCALTBSetupSD);
                                                   >> 418       LogicalIronWall->SetSensitiveDetector(FCALTBSetupSD);
                                                   >> 419       LogicalBigScint->SetSensitiveDetector(FCALTBSetupSD);
                                                   >> 420       LogicalSmallScint->SetSensitiveDetector(FCALTBSetupSD);
                                                   >> 421  
                                                   >> 422       LogicalBigIron->SetSensitiveDetector(FCALTBSetupSD);
                                                   >> 423       LogicalSmallIron->SetSensitiveDetector(FCALTBSetupSD);
                                                   >> 424       LogicalConcWallA->SetSensitiveDetector(FCALTBSetupSD);
                                                   >> 425       LogicalConcWallB->SetSensitiveDetector(FCALTBSetupSD);
                                                   >> 426       LogicalConcWallIns->SetSensitiveDetector(FCALTBSetupSD);
                                                   >> 427 
                                                   >> 428       LogicalMuContr->SetSensitiveDetector(FCALTBSetupSD);
                                                   >> 429       
                                                   >> 430 
                                                   >> 431 
                                                   >> 432   return PhysicalMother;
                                                   >> 433 
                                                   >> 434 }
437                                                   435