All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | Private Attributes | List of all members
SpaceChargeTools::SpaceChargeTest Class Reference
Inheritance diagram for SpaceChargeTools::SpaceChargeTest:

Public Member Functions

 SpaceChargeTest (fhicl::ParameterSet const &p)
 
virtual ~SpaceChargeTest ()
 
virtual void beginJob () override
 
virtual void endJob () override
 
void analyze (art::Event const &e) override
 

Private Attributes

TH1D * hDx
 
TH1D * hDy
 
TH1D * hDz
 
TH1D * hEx
 
TH1D * hEy
 
TH1D * hEz
 

Detailed Description

Definition at line 29 of file SpaceChargeTest_module.cc.

Constructor & Destructor Documentation

SpaceChargeTools::SpaceChargeTest::SpaceChargeTest ( fhicl::ParameterSet const &  p)
explicit

Definition at line 52 of file SpaceChargeTest_module.cc.

52  : EDAnalyzer(p)
53 {
54 }
pdgs p
Definition: selectors.fcl:22
SpaceChargeTools::SpaceChargeTest::~SpaceChargeTest ( )
virtual

Definition at line 56 of file SpaceChargeTest_module.cc.

56 {}

Member Function Documentation

void SpaceChargeTools::SpaceChargeTest::analyze ( art::Event const &  e)
override

Definition at line 73 of file SpaceChargeTest_module.cc.

74 {
75  int xMin = -206;
76  int xMax = 206;
77  int yMin = -210;
78  int yMax = 210;
79  int zMin = -10;
80  int zMax = 510;
81 
82  auto const* SCE = lar::providerFrom<spacecharge::SpaceChargeService>();
83  cout << "Is Spatial SCE enabled? " << bool(SCE->EnableSimSpatialSCE()) << endl;
84  cout << "Is E-field SCE enabled? " << bool(SCE->EnableSimEfieldSCE()) << endl;
85 
86  int nSkip = 5;
87  for(int iX = xMin; iX <= xMax - nSkip; iX++)
88  {
89  iX = iX + nSkip;
90  for(int iY = yMin; iY <= yMax - nSkip; iY++)
91  {
92  iY = iY + nSkip;
93  for(int iZ = zMin; iZ <= zMax - nSkip; iZ++)
94  {
95  iZ = iZ + nSkip;
96  cout << iX << ", " << iY << ", " << iZ << endl;
97 
98  geo::Point_t point = {double(iX), double(iY), double(iZ)};
99 
100  geo::Vector_t spatialOffsets = SCE->GetPosOffsets(point);
101  if(!((spatialOffsets.X() == spatialOffsets.X()) &&
102  (spatialOffsets.Y() == spatialOffsets.Y()) &&
103  (spatialOffsets.Z() == 0.0)))
104  {
105  hDx->Fill(spatialOffsets.X());
106  hDy->Fill(spatialOffsets.Y());
107  hDz->Fill(spatialOffsets.Z());
108  }
109 
110  geo::Vector_t efieldOffsets = SCE->GetEfieldOffsets(point);
111  if(!((efieldOffsets.X() == efieldOffsets.X()) &&
112  (efieldOffsets.Y() == efieldOffsets.Y()) &&
113  (efieldOffsets.Z() == 0.0)))
114  {
115  hEx->Fill(efieldOffsets.X());
116  hEy->Fill(efieldOffsets.Y());
117  hEz->Fill(efieldOffsets.Z());
118  }
119  }
120  }
121  }
122 }
ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< double >, ROOT::Math::GlobalCoordinateSystemTag > Vector_t
Type for representation of momenta in 3D space.
Definition: geo_vectors.h:164
static constexpr bool
ROOT::Math::PositionVector3D< ROOT::Math::Cartesian3D< double >, ROOT::Math::GlobalCoordinateSystemTag > Point_t
Type for representation of position in physical 3D space.
Definition: geo_vectors.h:184
BEGIN_PROLOG could also be cout
void SpaceChargeTools::SpaceChargeTest::beginJob ( )
overridevirtual

Definition at line 58 of file SpaceChargeTest_module.cc.

59 {
60  // Access ART's TFileService, which will handle creating and writing histograms and n-tuples
61  art::ServiceHandle<art::TFileService> fileServiceHandle;
62 
63  hDx = fileServiceHandle->make<TH1D>("hDx", "", 150, -1.0, 0.6);
64  hDy = fileServiceHandle->make<TH1D>("hDy", "", 150, -6.0, 6.0);
65  hDz = fileServiceHandle->make<TH1D>("hDz", "", 150, -6.0, 6.0);
66  hEx = fileServiceHandle->make<TH1D>("hEx", "", 100, -0.06, 0.06);
67  hEy = fileServiceHandle->make<TH1D>("hEy", "", 100, -0.04, 0.04);
68  hEz = fileServiceHandle->make<TH1D>("hEz", "", 100, -0.04, 0.04);
69 }
void SpaceChargeTools::SpaceChargeTest::endJob ( )
overridevirtual

Definition at line 71 of file SpaceChargeTest_module.cc.

71 {}

Member Data Documentation

TH1D* SpaceChargeTools::SpaceChargeTest::hDx
private

Definition at line 44 of file SpaceChargeTest_module.cc.

TH1D* SpaceChargeTools::SpaceChargeTest::hDy
private

Definition at line 45 of file SpaceChargeTest_module.cc.

TH1D* SpaceChargeTools::SpaceChargeTest::hDz
private

Definition at line 46 of file SpaceChargeTest_module.cc.

TH1D* SpaceChargeTools::SpaceChargeTest::hEx
private

Definition at line 47 of file SpaceChargeTest_module.cc.

TH1D* SpaceChargeTools::SpaceChargeTest::hEy
private

Definition at line 48 of file SpaceChargeTest_module.cc.

TH1D* SpaceChargeTools::SpaceChargeTest::hEz
private

Definition at line 49 of file SpaceChargeTest_module.cc.


The documentation for this class was generated from the following file: