Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-02-23 09:19:38

0001 //
0002 // ********************************************************************
0003 // * License and Disclaimer                                           *
0004 // *                                                                  *
0005 // * The  Geant4 software  is  copyright of the Copyright Holders  of *
0006 // * the Geant4 Collaboration.  It is provided  under  the terms  and *
0007 // * conditions of the Geant4 Software License,  included in the file *
0008 // * LICENSE and available at  http://cern.ch/geant4/license .  These *
0009 // * include a list of copyright holders.                             *
0010 // *                                                                  *
0011 // * Neither the authors of this software system, nor their employing *
0012 // * institutes,nor the agencies providing financial support for this *
0013 // * work  make  any representation or  warranty, express or implied, *
0014 // * regarding  this  software system or assume any liability for its *
0015 // * use.  Please see the license in the file  LICENSE  and URL above *
0016 // * for the full disclaimer and the limitation of liability.         *
0017 // *                                                                  *
0018 // * This  code  implementation is the result of  the  scientific and *
0019 // * technical work of the GEANT4 collaboration.                      *
0020 // * By using,  copying,  modifying or  distributing the software (or *
0021 // * any work based  on the software)  you  agree  to acknowledge its *
0022 // * use  in  resulting  scientific  publications,  and indicate your *
0023 // * acceptance of all terms of the Geant4 Software license.          *
0024 // ********************************************************************
0025 //
0026 ///////////////////////////////////////////////////////////////////////////////
0027 // File: CCalEcal.cc
0028 // Description: CCalEcal Geometry factory class for crystal matrix
0029 ///////////////////////////////////////////////////////////////////////////////
0030 #include "CCalEcal.hh"
0031 
0032 #include <fstream>
0033 #include "CCalutils.hh"
0034 #include "G4SystemOfUnits.hh"
0035 
0036 //#define debug
0037 
0038 CCalEcal::~CCalEcal() {}
0039 
0040 G4int CCalEcal::readFile() {
0041   ///////////////////////////////////////////////////////////////
0042   //Let's open the file
0043   G4cout << " ==> Opening file " << File() << " to read elements..."
0044        << G4endl;
0045 
0046   std::ifstream is;
0047   G4bool ok = openGeomFile(is, pathName, File());
0048   if (!ok)
0049     return 0;
0050 
0051   // Find *DO CrystalMatrix 
0052   findDO(is, G4String("CrystalMatrix"));
0053 
0054   //Let's read overall box dimensions and positions
0055   readName(is,genMat);
0056   is >> widBox >> lengBox >> xpos >> ypos >> zpos >> thetaX >> phiX
0057      >> thetaY >> phiY >> thetaZ >> phiZ >> jump;
0058 #ifdef debug
0059   G4cout << tab << "General material: " << genMat << "\tBox dimensions "
0060        << widBox << ", " << lengBox << G4endl;
0061   G4cout << tab << "Positioned at (" << xpos << ", " << ypos << ", " << zpos
0062        << ") with rotation (" << thetaX << ", " << phiX << ", " << thetaY
0063        << ", " << phiY << ", " << thetaZ << ", " << phiZ << ")" << G4endl;
0064 #endif
0065 
0066   //Then the layer positions
0067   G4int i=0;
0068   readName(is,layMat);
0069   is >> layNum >> layRadius >> layAngle >> lengFront;
0070   for (i=0; i<5; i++) 
0071     is >> layPar[i];
0072 #ifdef debug
0073   G4cout << tab << "Layer material: " << layMat << " Number " << layNum
0074        << " Radius " << layRadius << " Angle " << layAngle/deg 
0075        << " front dist " << lengFront << " Parameters ";
0076   for (i=0; i<5; i++)
0077     G4cout << layPar[i] << " ";
0078   G4cout << G4endl;
0079 #endif
0080 
0081   //Then the crystal positions
0082   readName(is,crystMat);
0083   is >> crystNum >> crystLength >> crystTol;
0084   for (i=0; i<5; i++) 
0085     is >> crystPar[i];
0086 #ifdef debug
0087   G4cout << tab << "Crystal material: " << crystMat << " Number " << crystNum
0088        << " Length " << crystLength << " Tolerance " << crystTol
0089        << " Parameters ";
0090   for (i=0; i<5; i++)
0091     G4cout << crystPar[i] << " ";
0092   G4cout << G4endl;
0093 #endif
0094 
0095   //Then the support material
0096   readName(is,suppMat);
0097   is >> dxSupp >> dySupp >> dzSupp >> distSupp >> jump;
0098 #ifdef debug
0099   G4cout << tab << "Support material: " << suppMat << " Dimensions " << dxSupp
0100        << ", " << dySupp << ", " << dzSupp << " Distance " << distSupp << G4endl;
0101 #endif
0102    
0103   ///////////////////////////////////////////////////////////////
0104   // Close the file
0105   G4cout << " ==> Closing file " << File() << G4endl;
0106   is.close();
0107 
0108   return 1;
0109 
0110 }
0111 
0112 void CCalEcal::constructDaughters() {}