LArSoft  v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
evdb_tool::SpacePoint3DDrawerHitAsymmetry Class Reference
Inheritance diagram for evdb_tool::SpacePoint3DDrawerHitAsymmetry:
evdb_tool::ISpacePoints3D

Public Member Functions

 SpacePoint3DDrawerHitAsymmetry (const fhicl::ParameterSet &)
 
 ~SpacePoint3DDrawerHitAsymmetry ()
 
void Draw (const std::vector< art::Ptr< recob::SpacePoint >> &, evdb::View3D *, int, int, float, const art::FindManyP< recob::Hit > *) const
 

Private Attributes

float fMinAsymmetry
 
float fMaxAsymmetry
 

Detailed Description

Definition at line 21 of file SpacePoint3DDrawerAsymmetry_tool.cc.

Constructor & Destructor Documentation

evdb_tool::SpacePoint3DDrawerHitAsymmetry::SpacePoint3DDrawerHitAsymmetry ( const fhicl::ParameterSet pset)
explicit

Definition at line 42 of file SpacePoint3DDrawerAsymmetry_tool.cc.

References fMaxAsymmetry, fMinAsymmetry, and fhicl::ParameterSet::get().

43  {
44  // fNumPoints = pset.get< int>("NumPoints", 1000);
45  // fFloatBaseline = pset.get<bool>("FloatBaseline", false);
46  // For now only draw cryostat=0.
47  fMinAsymmetry = pset.get<float>("MinAsymmetry", -1.);
48  fMaxAsymmetry = pset.get<float>("MaxAsymmetry", 1.);
49 
50  return;
51  }
T get(std::string const &key) const
Definition: ParameterSet.h:314
evdb_tool::SpacePoint3DDrawerHitAsymmetry::~SpacePoint3DDrawerHitAsymmetry ( )

Definition at line 53 of file SpacePoint3DDrawerAsymmetry_tool.cc.

54  {
55  return;
56  }

Member Function Documentation

void evdb_tool::SpacePoint3DDrawerHitAsymmetry::Draw ( const std::vector< art::Ptr< recob::SpacePoint >> &  hitsVec,
evdb::View3D view,
int  color,
int  marker,
float  size,
const art::FindManyP< recob::Hit > *  hitAssnVec 
) const
virtual

Implements evdb_tool::ISpacePoints3D.

Definition at line 58 of file SpacePoint3DDrawerAsymmetry_tool.cc.

References util::abs(), evdb::View3D::AddPolyMarker3D(), evd::ColorDrawingOptions::CalQ(), DEFINE_ART_CLASS_TOOL, fMaxAsymmetry, fMinAsymmetry, evd::ColorDrawingOptions::fRecoQHigh, evd::ColorDrawingOptions::fRecoQLow, evdb::ColorScale::GetColor(), and geo::kCollection.

64  {
65  // Let's not crash
66  if (hitsVec.empty() || !hitAssnVec) return;
67 
68  // Get services.
70 
71  using HitPosition = std::array<double, 6>;
72  std::map<int, std::vector<HitPosition>> colorToHitMap;
73 
74  // Get the scale factor
75  float asymmetryScale((cst->fRecoQHigh[geo::kCollection] - cst->fRecoQLow[geo::kCollection]) /
77 
78  for (const auto& spacePoint : hitsVec) {
79  float hitAsymmetry = spacePoint->ErrXYZ()[3] - fMinAsymmetry;
80 
81  if (std::abs(hitAsymmetry) <= fMaxAsymmetry - fMinAsymmetry) {
82  float chgFactor = cst->fRecoQLow[geo::kCollection] + asymmetryScale * hitAsymmetry;
83  int chargeColorIdx = cst->CalQ(geo::kCollection).GetColor(chgFactor);
84  const double* pos = spacePoint->XYZ();
85  const double* err = spacePoint->ErrXYZ();
86 
87  colorToHitMap[chargeColorIdx].push_back(
88  HitPosition() = {{pos[0], pos[1], pos[2], err[2], err[2], err[5]}});
89  }
90  }
91 
92  for (auto& hitPair : colorToHitMap) {
93  TPolyMarker3D& pm =
94  view->AddPolyMarker3D(hitPair.second.size(), hitPair.first, kFullDotLarge, 0.25);
95  for (const auto& hit : hitPair.second)
96  pm.SetNextPoint(hit[0], hit[1], hit[2]);
97  }
98 
99  return;
100  }
constexpr auto abs(T v)
Returns the absolute value of the argument.
int GetColor(double x) const
Definition: ColorScale.cxx:126
std::vector< double > fRecoQHigh
high edge of ADC values for drawing raw digits
std::vector< double > fRecoQLow
low edge of ADC values for drawing raw digits
const evdb::ColorScale & CalQ(geo::SigType_t st) const
Detector simulation of raw signals on wires.
TPolyMarker3D & AddPolyMarker3D(int n, int c, int st, double sz)
Definition: View3D.cxx:75
Signal from collection planes.
Definition: geo_types.h:152

Member Data Documentation

float evdb_tool::SpacePoint3DDrawerHitAsymmetry::fMaxAsymmetry
private

Definition at line 37 of file SpacePoint3DDrawerAsymmetry_tool.cc.

Referenced by Draw(), and SpacePoint3DDrawerHitAsymmetry().

float evdb_tool::SpacePoint3DDrawerHitAsymmetry::fMinAsymmetry
private

Definition at line 36 of file SpacePoint3DDrawerAsymmetry_tool.cc.

Referenced by Draw(), and SpacePoint3DDrawerHitAsymmetry().


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