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.2.p1)


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