Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-30 10:26:16

0001 #ifndef VECGEOM_VOLUMES_BOOLEANSTRUCT_H_
0002 #define VECGEOM_VOLUMES_BOOLEANSTRUCT_H_
0003 #include "VecGeom/base/Global.h"
0004 
0005 namespace vecgeom {
0006 
0007 // Declare types shared by cxx and cuda.
0008 enum BooleanOperation { kUnion, kIntersection, kSubtraction };
0009 
0010 inline namespace VECGEOM_IMPL_NAMESPACE {
0011 
0012 /**
0013  * A class representing a simple UNPLACED boolean volume A-B
0014  * It takes two template arguments:
0015  * 1.: the mother (or left) volume A in unplaced form
0016  * 2.: the (or right) volume B in placed form, acting on A with a boolean operation;
0017  * the placement is with respect to the left volume
0018  */
0019 struct BooleanStruct {
0020   VPlacedVolume const *fLeftVolume;
0021   VPlacedVolume const *fRightVolume;
0022   BooleanOperation const fOp;
0023   mutable Precision fCapacity    = -1;
0024   mutable Precision fSurfaceArea = -1;
0025 
0026   VECCORE_ATT_HOST_DEVICE
0027   BooleanStruct(BooleanOperation op, VPlacedVolume const *left, VPlacedVolume const *right)
0028       : fLeftVolume(left), fRightVolume(right), fOp(op)
0029   {
0030   }
0031 }; // End struct
0032 
0033 } // namespace VECGEOM_IMPL_NAMESPACE
0034 
0035 } // namespace vecgeom
0036 
0037 #endif /* VECGEOM_VOLUMES_BOOLEANSTRUCT_H_ */