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


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