8#include <tracking/trackFindingCDC/findlets/minimal/TrackInspector.h>
10#include <tracking/trackFindingCDC/eventdata/tracks/CDCTrack.h>
12#include <framework/core/ModuleParamList.templateDetails.h>
13#include <tracking/trackFindingCDC/utilities/StringManipulation.h>
15#include <TMultiGraph.h>
22using namespace TrackFindingCDC;
26 return "Findlet for printing out CDCtracks";
31 moduleParamList->
addParameter(prefixed(prefix,
"debugDraw"),
33 "Draw found hit positions of the track",
41 if (tracks.size() == 0) {
46 TCanvas canvA(
"axialCanvas",
"CDC axial hits in an event", 0, 0, 1440, 1080);
47 TCanvas canvS(
"stereoCanvas",
"CDC stereo hits in an event", 0, 0, 1440, 1080);
48 TMultiGraph* mgA =
new TMultiGraph(
"axialTracks",
"CDC axial tracks in the event;X, cm;Y, cm");
49 TMultiGraph* mgS =
new TMultiGraph(
"stereoTracks",
"CDC stereo tracks in the event;Z, cm;R, cm");
51 TGraph* grA =
new TGraph();
52 TGraph* grS =
new TGraph();
59 const double R = std::sqrt(pos.x() * pos.x() + pos.y() * pos.y());
60 const double X = pos.x();
61 const double Y = pos.y();
62 const double Z = pos.z();
63 if (Z == 0 and hit.isAxial()) {
64 grA->SetPoint(grA->GetN(), X, Y);
66 grS->SetPoint(grS->GetN(), Z,
R);
78 if (mgA->GetXaxis()) {
79 mgA->GetXaxis()->SetLimits(-120, 120);
80 mgA->GetYaxis()->SetRangeUser(-120, 120);
81 canvA.SaveAs(Form(
"CDCaxialTracks_%i.png", nevent));
83 if (mgS->GetXaxis()) {
84 mgS->GetXaxis()->SetLimits(-180, 180);
85 mgS->GetYaxis()->SetRangeUser(0, 120);
86 canvS.SaveAs(Form(
"CDCstereoTracks_%i.png", nevent));
93 for (
auto it = tracks.begin(); it != tracks.end();) {
94 bool stereoHitsPresent =
97 if (not hit.isAxial()) stereoHitsPresent =
true;
99 if (not stereoHitsPresent) {
100 it = tracks.erase(it);
The Module parameter list class.
Class representing a three dimensional reconstructed hit.
Class representing a sequence of three dimensional reconstructed hits.
void apply(std::vector< CDCTrack > &tracks) final
Print the tracks.
std::string getDescription() final
Short description of the findlet.
void exposeParameters(ModuleParamList *moduleParamList, const std::string &prefix) final
Access parameters.
void removeIncompleteTracks(std::vector< CDCTrack > &tracks)
Remove tracks with no stereo hits.
bool m_param_debugDraw
Flag to draw the CDCTrack (true) or not (false)
A three dimensional vector.
void addParameter(const std::string &name, T ¶mVariable, const std::string &description, const T &defaultValue)
Adds a new parameter to the module list.
Abstract base class for different kinds of events.