AnalysisBaseDrawer.cxx
Go to the documentation of this file.
1 /// \file AnalysisBaseDrawer.cxx
2 /// \brief Class to aid in the rendering of AnalysisBase objects
3 /// \author msoderbe@syr.edu
4 #include "TMarker.h"
5 #include "TBox.h"
6 #include "TLine.h"
7 #include "TPolyLine.h"
8 #include "TPolyLine3D.h"
9 #include "TPolyMarker.h"
10 #include "TPolyMarker3D.h"
11 #include "TVector3.h"
12 #include "TLatex.h"
13 
14 #include "nuevdb/EventDisplayBase/View2D.h"
16 #include "EventDisplay/EVD/Style.h"
22 #include "Utilities/AssociationUtil.h"
23 
28 #include "canvas/Persistency/Common/FindMany.h"
30 
31 #include <math.h>
32 
33 /* unused function
34 namespace {
35  // Utility function to make uniform error messages.
36  void writeErrMsg(const char* fcn,
37  cet::exception const& e)
38  {
39  mf::LogWarning("AnalysisBaseDrawer") << "AnalysisBaseDrawer::" << fcn
40  << " failed with message:\n"
41  << e;
42  }
43 }
44 */
45 
46 namespace gar {
47 namespace evd{
48 
49  //......................................................................
51  {
52 
53  }
54 
55  //......................................................................
57  {
58 
59  }
60 
61  //......................................................................
63  evdb::View2D* ) // view)
64  {
67 
68  for(size_t imod = 0; imod < recoOpt->fTrackLabels.size(); ++imod) {
69 
70  //Get Track collection
71  std::string which = recoOpt->fTrackLabels[imod];
72  auto trackListHandle = evt.getValidHandle<std::vector<rec::Track> >(which);
73  std::vector<art::Ptr<rec::Track> > tracklist;
74  art::fill_ptr_vector(tracklist, trackListHandle);
75 
76  }
77  }
78 
79  //......................................................................
81  evdb::View2D* view)
82  {
85 
86  //add some legend-like labels with appropriate grayscale
87  TLatex& proton_tex = view->AddLatex(2.0, 180.0, "proton");
88  TLatex& kaon_tex = view->AddLatex(2.0, 165.0, "kaon" );
89  TLatex& pion_tex = view->AddLatex(2.0, 150.0, "pion" );
90  TLatex& muon_tex = view->AddLatex(2.0, 135.0, "muon" );
91  proton_tex.SetTextColor(kBlack);
92  kaon_tex .SetTextColor(kGray+2);
93  pion_tex .SetTextColor(kGray+1);
94  muon_tex .SetTextColor(kGray);
95  proton_tex.SetTextSize (0.075);
96  kaon_tex .SetTextSize (0.075);
97  pion_tex .SetTextSize (0.075);
98  muon_tex .SetTextSize (0.075);
99 
100  //int color = 1;
101 
102  //now get the actual data
103  for(size_t imod = 0; imod < recoOpt->fTrackLabels.size(); ++imod) {
104  //Get Track collection
105  std::string which = recoOpt->fTrackLabels[imod];
106  auto trackListHandle = evt.getValidHandle<std::vector<rec::Track> >(which);
107  std::vector<art::Ptr<rec::Track> > tracklist;
108  art::fill_ptr_vector(tracklist, trackListHandle);
109 
110  //Loop over Tracks
111  //for(size_t trkIter = 0; trkIter < tracklist.size(); ++trkIter){
112  // color = trkIter%evd::kNCOLS;
113  //}
114  }
115 
116  }
117 }
118 }// namespace
119 ////////////////////////////////////////////////////////////////////////
std::vector< art::InputTag > fTrackLabels
module labels that produced tracks
std::string string
Definition: nybbler.cc:12
LArSoft includes.
Definition: InfoTransfer.h:33
void DrawDeDx(const art::Event &evt, evdb::View2D *view)
ValidHandle< PROD > getValidHandle(InputTag const &tag) const
Definition: DataViewImpl.h:441
void DrawKineticEnergy(const art::Event &evt, evdb::View2D *view)
General GArSoft Utilities.
TCEvent evt
Definition: DataStructs.cxx:7
void fill_ptr_vector(std::vector< Ptr< T >> &ptrs, H const &h)
Definition: Ptr.h:297