File: Wedge.cpp

package info (click to toggle)
vecgeom 1.2.1%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 23,928 kB
  • sloc: cpp: 88,717; ansic: 6,894; python: 1,035; sh: 582; sql: 538; makefile: 29
file content (33 lines) | stat: -rw-r--r-- 866 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
/*
 * Wedge.cpp
 *
 *  Created on: 28.03.2015
 *      Author: swenzel
 */
#include "VecGeom/base/Global.h"
#include "VecGeom/volumes/Wedge.h"
#include <iostream>
#include <iomanip>

namespace vecgeom {
inline namespace VECGEOM_IMPL_NAMESPACE {

VECCORE_ATT_HOST_DEVICE
Wedge::Wedge(Precision angle, Precision zeroangle) : fSPhi(zeroangle), fDPhi(angle), fAlongVector1(), fAlongVector2()
{
  // check input
  assert(angle > 0.0 && angle <= kTwoPi);

  // initialize angles
  fAlongVector1.x() = std::cos(fSPhi);
  fAlongVector1.y() = std::sin(fSPhi);
  fAlongVector2.x() = std::cos(fSPhi + fDPhi);
  fAlongVector2.y() = std::sin(fSPhi + fDPhi);

  fNormalVector1.x() = -std::sin(fSPhi);
  fNormalVector1.y() = std::cos(fSPhi); // not the + sign
  fNormalVector2.x() = std::sin(fSPhi + fDPhi);
  fNormalVector2.y() = -std::cos(fSPhi + fDPhi); // note the - sign
}
}
}