8 #include "TPolyLine3D.h" 9 #include "TPolyMarker.h" 10 #include "TPolyMarker3D.h" 72 for(
size_t imod = 0; imod < recoOpt->
fTrackLabels.size(); ++imod) {
78 std::vector<art::Ptr<recob::Track> > tracklist;
86 if (!fmcal.isValid())
continue;
92 if (!fmpid.isValid())
continue;
95 for(
size_t trkIter = 0; trkIter<tracklist.size(); ++trkIter){
97 std::vector<const anab::Calorimetry*> calos = fmcal.at(trkIter);
98 std::vector<const anab::ParticleID*> pids = fmpid.at(trkIter);
99 if (!calos.size())
continue;
100 if (calos.size()!=pids.size())
continue;
101 size_t bestplane = 0;
105 for (
size_t icalo = 0; icalo < calos.size(); ++icalo){
106 if (calos[icalo]->dEdx().size() > nmaxhits){
107 nmaxhits = calos[icalo]->dEdx().size();
108 bestplane = calos[icalo]->PlaneID().Plane;
112 for (
size_t icalo = 0; icalo < calos.size(); ++icalo){
114 calos[icalo]->dEdx().size())
115 bestplane = calos[icalo]->PlaneID().Plane;
119 for (
size_t icalo = 0; icalo < calos.size(); ++icalo){
120 if (calos[icalo]->PlaneID().Plane==bestplane){
124 for (
size_t ipid = 0; ipid < pids.size(); ++ipid){
125 if (pids[ipid]->PlaneID().Plane==bestplane){
131 for(
size_t h = 0; h<calos[calopl]->dEdx().size();++h){
132 double xvalue = calos[calopl]->ResidualRange().at(h);
133 double yvalue = calos[calopl]->dEdx().at(h);
134 pm.SetPoint(h,xvalue,yvalue);
136 double error = yvalue*(0.04231 + 0.0001783*(yvalue*yvalue));
137 TLine& l = view->
AddLine(xvalue,yvalue-error,xvalue,yvalue+error);
147 sprintf(trackinfo,
"Track #%d: K.E. = %.1f MeV , Range = %.1f cm",
148 int(tracklist[trkIter].key()),
149 calos[calopl]->KineticEnergy(),
150 calos[calopl]->Range());
151 sprintf(proton,
"Proton Chi2 = %.1f, Kaon Chi2 = %.1f",
152 pids[pidpl]->Chi2Proton(),
153 pids[pidpl]->Chi2Kaon());
156 sprintf(pion,
"Pion Chi2 = %.1f, Muon Chi2 = %.1f",
157 pids[pidpl]->Chi2Pion(),
158 pids[pidpl]->Chi2Muon());
161 sprintf(pida,
"Plane %d, PIDA = %.1f, NHits = %d",
162 calos[calopl]->PlaneID().
Plane,
164 int(calos[calopl]->dEdx().size()));
166 double offset = ((double)trkIter)*10.0;
167 TLatex& track_tex = view->
AddLatex(13.0, (46.0) - offset,trackinfo);
168 TLatex& pida_tex = view->
AddLatex(13.0, (46.0-2.5) - offset,pida);
169 TLatex& proton_tex = view->
AddLatex(13.0, (46.0-5.0) - offset,proton);
171 TLatex& pion_tex = view->
AddLatex(13.0, (46.0-7.5) - offset,pion);
179 track_tex.SetTextSize(0.05);
180 proton_tex.SetTextSize(0.05);
182 pion_tex.SetTextSize(0.05);
184 pida_tex.SetTextSize(0.05);
203 sprintf(proton,
"proton");
204 sprintf(kaon,
"kaon");
205 sprintf(pion,
"pion");
206 sprintf(muon,
"muon");
207 TLatex& proton_tex = view->
AddLatex(2.0, 180.0,proton);
208 TLatex& kaon_tex = view->
AddLatex(2.0, 165.0,kaon);
209 TLatex& pion_tex = view->
AddLatex(2.0, 150.0,pion);
210 TLatex& muon_tex = view->
AddLatex(2.0, 135.0,muon);
211 proton_tex.SetTextColor(kBlack);
212 kaon_tex.SetTextColor(kGray+2);
213 pion_tex.SetTextColor(kGray+1);
214 muon_tex.SetTextColor(kGray);
215 proton_tex.SetTextSize(0.075);
216 kaon_tex.SetTextSize(0.075);
217 pion_tex.SetTextSize(0.075);
218 muon_tex.SetTextSize(0.075);
221 for(
size_t imod = 0; imod < recoOpt->
fTrackLabels.size(); ++imod) {
226 std::vector<art::Ptr<recob::Track> > tracklist;
234 if (!fmcal.isValid())
continue;
241 if (!fmpid.isValid())
continue;
244 for(
size_t trkIter = 0; trkIter<tracklist.size(); ++trkIter){
247 std::vector<const anab::Calorimetry*> calos = fmcal.at(trkIter);
248 if (!calos.size())
continue;
249 size_t bestplane = 0;
251 for (
size_t icalo = 0; icalo < calos.size(); ++icalo){
252 if (calos[icalo]->dEdx().size() > nmaxhits){
253 nmaxhits = calos[icalo]->dEdx().size();
258 for (
size_t i = 0; i<geom->
Nplanes(); ++i){
264 double xvalue = calos[bestplane]->Range();
265 double yvalue = calos[bestplane]->KineticEnergy();
268 double error = yvalue*(0.6064/std::sqrt(yvalue));
269 TLine& l = view->
AddLine(xvalue,yvalue-error,xvalue,yvalue+error);
287 for(
size_t imod = 0; imod < recoOpt->
fShowerLabels.size(); ++imod) {
293 std::vector<art::Ptr<anab::Calorimetry> > calolist;
303 for(
size_t shwIter = 0; shwIter<calolist.size(); ++shwIter){
306 TPolyMarker& pm = view->
AddPolyMarker((*calolist.at(shwIter)).dEdx().size(),
color,8,0.8);
307 for(
size_t h = 0; h<(*calolist.at(shwIter)).dEdx().size();++h){
308 pm.SetPoint(h,(*calolist.at(shwIter)).ResidualRange().at(h),(*calolist.at(shwIter)).dEdx().at(h));
320 sprintf(mip,
"1 MIP");
321 sprintf(mip2,
"2 MIP");
325 TLine & Line1Mip = view->
AddLine(0, MIP, 100, MIP);
326 TLine & Line2Mip = view->
AddLine(0, 2*MIP, 100, 2*MIP);
328 TLatex& mip_tex = view->
AddLatex(40.0, (23.0-20.0) - offset,mip);
329 TLatex& mip2_tex = view->
AddLatex(40.0, (23.0-18.0) - offset,mip2);
331 mip_tex.SetTextColor(kGray+3);
332 mip2_tex.SetTextColor(kGray+2);
333 mip_tex.SetTextSize(0.02);
334 mip2_tex.SetTextSize(0.02);
336 Line1Mip.SetLineStyle(kDashed);
337 Line1Mip.SetLineColor(kGray+3);
338 Line2Mip.SetLineStyle(kDashed);
339 Line2Mip.SetLineColor(kGray+2);
351 std::vector<art::Ptr<recob::Hit> >
hits = HitHider.
Hits;
366 for(
size_t h = 0; h!=cal.
dEdx().size();++h){
380 sprintf(proton,
"Proton");
381 sprintf(kaon,
"Kaon");
382 sprintf(pion,
"Pion");
383 sprintf(muon,
"Muon");
385 sprintf(mip,
"1 MIP");
386 sprintf(mip2,
"2 MIP");
388 TLatex& proton_tex = view->
AddLatex(40.0, (23.0-1.0) - offset,proton);
389 TLatex& kaon_tex = view->
AddLatex(40.0, (23.0-2.0) - offset,kaon);
390 TLatex& pion_tex = view->
AddLatex(40.0, (23.0-3.0) - offset,pion);
391 TLatex& muon_tex = view->
AddLatex(40.0, (23.0-4.0) - offset,muon);
392 TLatex& mip_tex = view->
AddLatex(40.0, (23.0-20.0) - offset,mip);
393 TLatex& mip2_tex = view->
AddLatex(40.0, (23.0-18.0) - offset,mip2);
400 proton_tex.SetTextSize(0.03);
401 kaon_tex.SetTextSize(0.03);
402 pion_tex.SetTextSize(0.03);
403 muon_tex.SetTextSize(0.03);
405 mip_tex.SetTextColor(kGray+3);
406 mip2_tex.SetTextColor(kGray+2);
407 mip_tex.SetTextSize(0.02);
408 mip2_tex.SetTextSize(0.02);
410 double MIP = 1.5 * 1.4;
411 TLine & Line1Mip = view->
AddLine(0, MIP, 100, MIP);
412 TLine & Line2Mip = view->
AddLine(0, 2*MIP, 100, 2*MIP);
414 Line1Mip.SetLineStyle(kDashed);
415 Line1Mip.SetLineColor(kGray+3);
416 Line2Mip.SetLineStyle(kDashed);
417 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)
Declaration of signal hit object.
void CalorInteractive(const art::Event &evt, evdb::View2D *view, trkf::BezierTrack BTrack, trkf::HitPtrVec Hits)
A collection of drawable 2-D objects.
std::vector< art::Ptr< recob::Hit > > Hits
const std::vector< float > & ResidualRange() const
unsigned int Nplanes(unsigned int tpc=0, unsigned int cstat=0) const
Returns the total number of wire planes in the specified TPC.
Provides recob::Track data product.
std::vector< std::string > fCalorimetryLabels
module labels that produced calorimetry
TPolyMarker & AddPolyMarker(int n, int c, int st, double sz)
static int ColorFromPDG(int pdgcode)
TLatex & AddLatex(double x, double y, const char *text)
static const int kColor[kNCOLS]
const std::vector< float > & dEdx() const
std::size_t color(std::string const &procname)
Place to keep constants for event display.
anab::Calorimetry GetCalorimetryObject(std::vector< art::Ptr< recob::Hit > > const &Hits, geo::SigType_t sigtype, calo::CalorimetryAlg const &)
Utility object to perform functions of association.
bool getByLabel(std::string const &label, std::string const &productInstanceName, Handle< PROD > &result) const
fhicl::ParameterSet fCaloPSet
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)
Signal from collection planes.