~ryan-bayes/nufactory/trunk

« back to all changes in this revision

Viewing changes to mindG4/src/MindPieceParam.cc

  • Committer: Ryan Bayes
  • Date: 2013-03-04 13:01:19 UTC
  • Revision ID: ryan.bayes@glasgow.ac.uk-20130304130119-c0da69osprzt5p9y
Inital commit of simulation package

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
//Parameterisation of mind piece positions.
 
2
#include "MindPieceParam.hh"
 
3
 
 
4
#include "G4VPhysicalVolume.hh"
 
5
#include "G4ThreeVector.hh"
 
6
 
 
7
MindPieceParam::MindPieceParam(G4int npieces, G4double pieceLen)
 
8
{
 
9
  y.resize( npieces );
 
10
  
 
11
  for ( unsigned int i = 0; i < npieces; ++i )
 
12
    y[i] = ( (double)i - (double)npieces / 2.0 ) * pieceLen + pieceLen / 2.0;
 
13
  
 
14
}
 
15
 
 
16
MindPieceParam::~MindPieceParam()
 
17
{
 
18
}
 
19
 
 
20
void    MindPieceParam::ComputeTransformation( const G4int copyNo, G4VPhysicalVolume* physVol ) const
 
21
{
 
22
  physVol->SetTranslation( G4ThreeVector( 0.0, 0.0, y[ copyNo ] ) );
 
23
}