All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
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 22 of file SpacePoint3DDrawerAsymmetry_tool.cc.

Constructor & Destructor Documentation

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

Definition at line 45 of file SpacePoint3DDrawerAsymmetry_tool.cc.

46 {
47 // fNumPoints = pset.get< int>("NumPoints", 1000);
48 // fFloatBaseline = pset.get<bool>("FloatBaseline", false);
49  // For now only draw cryostat=0.
50  fMinAsymmetry = pset.get<float>("MinAsymmetry", -1.);
51  fMaxAsymmetry = pset.get<float>("MaxAsymmetry", 1.);
52 
53  return;
54 }
evdb_tool::SpacePoint3DDrawerHitAsymmetry::~SpacePoint3DDrawerHitAsymmetry ( )

Definition at line 56 of file SpacePoint3DDrawerAsymmetry_tool.cc.

57 {
58  return;
59 }

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

67 {
68  // Let's not crash
69  if (hitsVec.empty() || !hitAssnVec) return;
70 
71  // Get services.
72  art::ServiceHandle<evd::ColorDrawingOptions const> cst;
73 
74  using HitPosition = std::array<double,6>;
75  std::map<int,std::vector<HitPosition>> colorToHitMap;
76 
77  // Get the scale factor
78  float asymmetryScale((cst->fRecoQHigh[geo::kCollection] - cst->fRecoQLow[geo::kCollection]) / (fMaxAsymmetry - fMinAsymmetry));
79 
80  for(const auto& spacePoint : hitsVec)
81  {
82  float hitAsymmetry = spacePoint->ErrXYZ()[3] - fMinAsymmetry;
83 
84  if (std::abs(hitAsymmetry) <= fMaxAsymmetry - fMinAsymmetry)
85  {
86  float chgFactor = cst->fRecoQLow[geo::kCollection] + asymmetryScale * hitAsymmetry;
87  int chargeColorIdx = cst->CalQ(geo::kCollection).GetColor(chgFactor);
88  const double* pos = spacePoint->XYZ();
89  const double* err = spacePoint->ErrXYZ();
90 
91  colorToHitMap[chargeColorIdx].push_back(HitPosition()={{pos[0],pos[1],pos[2],err[2],err[2],err[5]}});
92  }
93  }
94 
95  for(auto& hitPair : colorToHitMap)
96  {
97  TPolyMarker3D& pm = view->AddPolyMarker3D(hitPair.second.size(), hitPair.first, kFullDotLarge, 0.25);
98  for (const auto& hit : hitPair.second) pm.SetNextPoint(hit[0],hit[1],hit[2]);
99  }
100 
101  return;
102 }
EResult err(const char *call)
process_name hit
Definition: cheaterreco.fcl:51
T abs(T value)
Signal from collection planes.
Definition: geo_types.h:146

Member Data Documentation

float evdb_tool::SpacePoint3DDrawerHitAsymmetry::fMaxAsymmetry
private

Definition at line 40 of file SpacePoint3DDrawerAsymmetry_tool.cc.

float evdb_tool::SpacePoint3DDrawerHitAsymmetry::fMinAsymmetry
private

Definition at line 39 of file SpacePoint3DDrawerAsymmetry_tool.cc.


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