Back to home page

EIC code displayed by LXR

 
 

    


Warning, file /geant4/examples/advanced/air_shower/src/UltraFresnelLensParameterisation.cc was not indexed or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).

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 // --------------------------------------------------------------
0028 //                 GEANT 4 - ULTRA experiment example
0029 // --------------------------------------------------------------
0030 //
0031 // Code developed by:
0032 // B. Tome, M.C. Espirito-Santo, A. Trindade, P. Rodrigues
0033 //
0034 //    ****************************************************
0035 //    *      UltraFresnelLensParameterisation.cc
0036 //    ****************************************************
0037 //
0038 //    Class derived from G4VPVParameterisation and used to define a Fresnel lens geometry
0039 //    through a parameterised replication of G4Cons volumes. These volumes are frustra
0040 //    of cones describing the lens grooves.
0041 //    An  UltraFresnelLensParameterisation object is created in the UltraFresnelLens class
0042 //
0043 #include <cmath>
0044 
0045 #include "UltraFresnelLensParameterisation.hh"
0046 #include "UltraFresnelLens.hh"
0047 
0048 #include "G4SystemOfUnits.hh"
0049 #include "G4VPhysicalVolume.hh"
0050 #include "G4ThreeVector.hh"
0051 #include "G4Cons.hh"
0052 
0053 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0054 
0055 UltraFresnelLensParameterisation::UltraFresnelLensParameterisation(UltraFresnelLens* Lens)
0056 {
0057 
0058    FresnelLens     = Lens ;
0059    GrooveWidth     = Lens->GetGrooveWidth() ;
0060    NumberOfGrooves = Lens->GetNumberOfGrooves() ;
0061 
0062    dZOffset = Lens->GetSagita((NumberOfGrooves-0)*(GrooveWidth)) -
0063               Lens->GetSagita((NumberOfGrooves-1)*(GrooveWidth)) ;
0064 }
0065 
0066 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0067 
0068 UltraFresnelLensParameterisation::~UltraFresnelLensParameterisation()
0069 {;}
0070 
0071 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0072 
0073 void UltraFresnelLensParameterisation::ComputeTransformation
0074 (const G4int GrooveNo, G4VPhysicalVolume* physVol) const
0075 {
0076 
0077   auto  Rmin1 = (GrooveNo+0)*(GrooveWidth) ;
0078   auto  Rmax1 = (GrooveNo+1)*(GrooveWidth) ;
0079 
0080   auto     dZ = FresnelLens->GetSagita(Rmax1) - FresnelLens->GetSagita(Rmin1) ;
0081 
0082   if (dZ <= 0.0){
0083     G4Exception("UltraFresnelLensParameterisation::ComputeTransformation()",
0084         "AirSh003",FatalException,
0085         "UltraFresnelLensParameterisation::ComputeTransformation: Groove depth<0 !");
0086   }
0087 
0088   G4ThreeVector origin(0,0,(dZ-dZOffset)/2.);
0089   physVol->SetTranslation(origin);
0090   physVol->SetRotation(0);
0091 }
0092 
0093 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0094 
0095 void UltraFresnelLensParameterisation::ComputeDimensions
0096 (G4Cons& Groove, const G4int GrooveNo, const G4VPhysicalVolume*) const
0097 {
0098   auto  Rmin1 = (GrooveNo+0)*(GrooveWidth) ;
0099   auto  Rmax1 = (GrooveNo+1)*(GrooveWidth) ;
0100 
0101   auto  Rmin2 = Rmin1 ;
0102   auto  Rmax2 = Rmin2+0.0001*mm ;
0103 
0104   auto  dZ = FresnelLens->GetSagita(Rmax1) - FresnelLens->GetSagita(Rmin1) ;
0105 
0106   if (dZ <= 0.0){
0107     G4Exception("UltraFresnelLensParameterisation::ComputeDimensions()",
0108         "AirSh004",FatalException,
0109         "UltraFresnelLensParameterisation::ComputeDimensions: Groove depth<0 !");
0110   }
0111 
0112 
0113   Groove.SetInnerRadiusMinusZ(Rmin1) ;
0114   Groove.SetOuterRadiusMinusZ(Rmax1) ;
0115 
0116   Groove.SetInnerRadiusPlusZ(Rmin2) ;
0117   Groove.SetOuterRadiusPlusZ(Rmax2) ;
0118 
0119   Groove.SetZHalfLength(dZ/2.) ;
0120 
0121 #ifdef ULTRA_VERBOSE
0122 
0123 G4cout << "UltraFresnelLensParameterisation: GrooveNo " << GrooveNo+1 <<
0124 " Rmin1, Rmax1(mm): " << Rmin1/mm <<" "<<  Rmax1/mm << " dZ(mm) " << dZ/mm << G4endl ;
0125 #endif
0126 
0127 
0128 
0129 }