23 #include "TPolyMarker.h" 40 for (
size_t imod = 0; imod < recoOpt->
fTrackLabels.size(); ++imod) {
46 std::vector<art::Ptr<recob::Track>> tracklist;
54 if (!fmcal.isValid())
continue;
60 if (!fmpid.isValid())
continue;
64 for (
size_t trkIter = 0; trkIter < tracklist.size(); ++trkIter) {
65 if (anaOpt->
fTrackID >= 0 and tracklist[trkIter]->ID() != anaOpt->
fTrackID)
continue;
68 std::vector<const anab::Calorimetry*> calos = fmcal.at(trkIter);
69 std::vector<const anab::ParticleID*> pids = fmpid.at(trkIter);
70 if (!calos.size())
continue;
71 if (calos.size() != pids.size())
continue;
75 for (
size_t icalo = 0; icalo < calos.size(); ++icalo) {
76 if (calos[icalo]->
dEdx().size() > nmaxhits) {
77 nmaxhits = calos[icalo]->dEdx().size();
78 bestplane = calos[icalo]->PlaneID().Plane;
82 for (
size_t icalo = 0; icalo < calos.size(); ++icalo) {
84 calos[icalo]->dEdx().size())
85 bestplane = calos[icalo]->
PlaneID().Plane;
89 for (
size_t icalo = 0; icalo < calos.size(); ++icalo) {
90 if (calos[icalo]->
PlaneID().Plane == bestplane) { calopl = icalo; }
95 for (
size_t h = 0; h < calos[calopl]->dEdx().size(); ++h) {
96 double xvalue = calos[calopl]->ResidualRange().at(h);
97 double yvalue = calos[calopl]->dEdx().at(h);
98 pm.SetPoint(h, xvalue, yvalue);
100 double error = yvalue * (0.04231 + 0.0001783 * (yvalue * yvalue));
101 TLine& l = view->
AddLine(xvalue, yvalue - error, xvalue, yvalue + error);
110 "Track #%d: K.E. = %.1f MeV , Range = %.1f cm",
111 int(tracklist[trkIter].key()),
112 calos[calopl]->KineticEnergy(),
113 calos[calopl]->Range());
115 double offset = (ntracks - 1) * 10.0;
116 TLatex& track_tex = view->
AddLatex(13.0, (46.0) - offset, trackinfo);
117 TLatex& pida_tex = view->
AddLatex(13.0, (46.0 - 2.5) - offset, pida);
118 TLatex& proton_tex = view->
AddLatex(13.0, (46.0 - 5.0) - offset, proton);
119 TLatex& pion_tex = view->
AddLatex(13.0, (46.0 - 7.5) - offset, pion);
124 track_tex.SetTextSize(0.05);
125 proton_tex.SetTextSize(0.05);
126 pion_tex.SetTextSize(0.05);
127 pida_tex.SetTextSize(0.05);
145 sprintf(proton,
"proton");
146 sprintf(kaon,
"kaon");
147 sprintf(pion,
"pion");
148 sprintf(muon,
"muon");
149 TLatex& proton_tex = view->
AddLatex(2.0, 180.0, proton);
150 TLatex& kaon_tex = view->
AddLatex(2.0, 165.0, kaon);
151 TLatex& pion_tex = view->
AddLatex(2.0, 150.0, pion);
152 TLatex& muon_tex = view->
AddLatex(2.0, 135.0, muon);
153 proton_tex.SetTextColor(kBlack);
154 kaon_tex.SetTextColor(kGray + 2);
155 pion_tex.SetTextColor(kGray + 1);
156 muon_tex.SetTextColor(kGray);
157 proton_tex.SetTextSize(0.075);
158 kaon_tex.SetTextSize(0.075);
159 pion_tex.SetTextSize(0.075);
160 muon_tex.SetTextSize(0.075);
163 for (
size_t imod = 0; imod < recoOpt->
fTrackLabels.size(); ++imod) {
168 std::vector<art::Ptr<recob::Track>> tracklist;
176 if (!fmcal.isValid())
continue;
183 if (!fmpid.isValid())
continue;
186 for (
size_t trkIter = 0; trkIter < tracklist.size(); ++trkIter) {
187 if (anaOpt->
fTrackID >= 0 and tracklist[trkIter]->ID() != anaOpt->
fTrackID)
continue;
190 std::vector<const anab::Calorimetry*> calos = fmcal.at(trkIter);
191 if (!calos.size())
continue;
192 size_t bestplane = 0;
194 for (
size_t icalo = 0; icalo < calos.size(); ++icalo) {
195 if (calos[icalo]->
dEdx().size() > nmaxhits) {
196 nmaxhits = calos[icalo]->dEdx().size();
201 for (
size_t i = 0; i < wireReadoutGeom.Nplanes(); ++i) {
206 double xvalue = calos[bestplane]->Range();
207 double yvalue = calos[bestplane]->KineticEnergy();
210 double error = yvalue * (0.6064 / std::sqrt(yvalue));
211 TLine& l = view->
AddLine(xvalue, yvalue - error, xvalue, yvalue + error);
226 for (
size_t imod = 0; imod < recoOpt->
fShowerLabels.size(); ++imod) {
232 std::vector<art::Ptr<anab::Calorimetry>> calolist;
241 for (
size_t shwIter = 0; shwIter < calolist.size(); ++shwIter) {
246 for (
size_t h = 0; h < (*calolist.at(shwIter)).
dEdx().size(); ++h) {
248 (*calolist.at(shwIter)).ResidualRange().at(h),
249 (*calolist.at(shwIter)).
dEdx().at(h));
258 sprintf(mip,
"1 MIP");
259 sprintf(mip2,
"2 MIP");
263 TLine& Line1Mip = view->
AddLine(0, MIP, 100, MIP);
264 TLine& Line2Mip = view->
AddLine(0, 2 * MIP, 100, 2 * MIP);
266 TLatex& mip_tex = view->
AddLatex(40.0, (23.0 - 20.0) - offset, mip);
267 TLatex& mip2_tex = view->
AddLatex(40.0, (23.0 - 18.0) - offset, mip2);
269 mip_tex.SetTextColor(kGray + 3);
270 mip2_tex.SetTextColor(kGray + 2);
271 mip_tex.SetTextSize(0.02);
272 mip2_tex.SetTextSize(0.02);
274 Line1Mip.SetLineStyle(kDashed);
275 Line1Mip.SetLineColor(kGray + 3);
276 Line2Mip.SetLineStyle(kDashed);
277 Line2Mip.SetLineColor(kGray + 2);
void DrawDeDx(const art::Event &evt, evdb::View2D *view)
Class to aid in the rendering of AnalysisBase objects.
std::vector< art::InputTag > fTrackLabels
module labels that produced tracks
std::vector< std::string > fParticleIDLabels
module labels that produced particleid
TLine & AddLine(double x1, double y1, double x2, double y2)
cout<< "Opened file "<< fin<< " ixs= "<< ixs<< endl;if(ixs==0) hhh=(TH1F *) fff-> Get("h1")
A collection of drawable 2-D objects.
IDparameter< geo::PlaneID > PlaneID
Member type of validated geo::PlaneID parameter.
decltype(auto) constexpr size(T &&obj)
ADL-aware version of std::size.
std::vector< std::string > fCalorimetryLabels
module labels that produced calorimetry
TPolyMarker & AddPolyMarker(int n, int c, int st, double sz)
TLatex & AddLatex(double x, double y, const char *text)
float dEdx(detinfo::DetectorClocksData const &clockData, detinfo::DetectorPropertiesData const &detProp, const TCSlice &slc, TP3D &tp3d)
static const int kColor[kNCOLS]
std::size_t color(std::string const &procname)
Place to keep constants for event display.
bool getByLabel(std::string const &label, std::string const &instance, Handle< PROD > &result) const
Provides recob::Track data product.
std::vector< art::InputTag > fShowerLabels
module labels that produced showers
void fill_ptr_vector(std::vector< Ptr< T >> &ptrs, H const &h)
void CalorShower(const art::Event &evt, evdb::View2D *view)
recob::tracking::Plane Plane
void DrawKineticEnergy(const art::Event &evt, evdb::View2D *view)
TMarker & AddMarker(double x, double y, int c, int st, double sz)