Public Member Functions | Private Attributes | List of all members
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
 
- Public Member Functions inherited from evdb_tool::ISpacePoints3D
virtual ~ISpacePoints3D () noexcept=default
 

Private Attributes

float fMinAsymmetry
 
float fMaxAsymmetry
 

Detailed Description

Definition at line 20 of file SpacePoint3DDrawerAsymmetry_tool.cc.

Constructor & Destructor Documentation

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

Definition at line 43 of file SpacePoint3DDrawerAsymmetry_tool.cc.

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

Definition at line 54 of file SpacePoint3DDrawerAsymmetry_tool.cc.

55 {
56  return;
57 }

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 59 of file SpacePoint3DDrawerAsymmetry_tool.cc.

65 {
66  // Let's not crash
67  if (hitsVec.empty() || !hitAssnVec) return;
68 
69  // Get services.
71 
72  using HitPosition = std::array<double,6>;
73  std::map<int,std::vector<HitPosition>> colorToHitMap;
74 
75  // Get the scale factor
76  float asymmetryScale((cst->fRecoQHigh[geo::kCollection] - cst->fRecoQLow[geo::kCollection]) / (fMaxAsymmetry - fMinAsymmetry));
77 
78  for(const auto& spacePoint : hitsVec)
79  {
80  float hitAsymmetry = spacePoint->ErrXYZ()[3] - fMinAsymmetry;
81 
82  if (std::abs(hitAsymmetry) <= fMaxAsymmetry - fMinAsymmetry)
83  {
84  float chgFactor = cst->fRecoQLow[geo::kCollection] + asymmetryScale * hitAsymmetry;
85  int chargeColorIdx = cst->CalQ(geo::kCollection).GetColor(chgFactor);
86  const double* pos = spacePoint->XYZ();
87  const double* err = spacePoint->ErrXYZ();
88 
89  colorToHitMap[chargeColorIdx].push_back(HitPosition()={{pos[0],pos[1],pos[2],err[2],err[2],err[5]}});
90  }
91  }
92 
93  for(auto& hitPair : colorToHitMap)
94  {
95  TPolyMarker3D& pm = view->AddPolyMarker3D(hitPair.second.size(), hitPair.first, kFullDotLarge, 0.25);
96  for (const auto& hit : hitPair.second) pm.SetNextPoint(hit[0],hit[1],hit[2]);
97  }
98 
99  return;
100 }
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
T abs(T value)
const evdb::ColorScale & CalQ(geo::SigType_t st) const
void err(const char *fmt,...)
Definition: message.cpp:226
Detector simulation of raw signals on wires.
Signal from collection planes.
Definition: geo_types.h:146

Member Data Documentation

float evdb_tool::SpacePoint3DDrawerHitAsymmetry::fMaxAsymmetry
private

Definition at line 38 of file SpacePoint3DDrawerAsymmetry_tool.cc.

float evdb_tool::SpacePoint3DDrawerHitAsymmetry::fMinAsymmetry
private

Definition at line 37 of file SpacePoint3DDrawerAsymmetry_tool.cc.


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