62 for(
size_t imod = 0; imod < recoOpt->
fTrackLabels.size(); ++imod) {
69 std::vector<art::Ptr<recob::Track> > tracklist;
76 art::FindMany<anab::Calorimetry> fmcal(trackListHandle, evt, callabel);
77 if (!fmcal.isValid())
continue;
82 art::FindMany<anab::ParticleID> fmpid(trackListHandle, evt, pidlabel);
83 if (!fmpid.isValid())
continue;
87 for(
size_t trkIter = 0; trkIter<tracklist.size(); ++trkIter){
88 if (anaOpt->
fTrackID >=0 and tracklist[trkIter]->ID() != anaOpt->
fTrackID)
continue;
91 std::vector<const anab::Calorimetry*> calos = fmcal.at(trkIter);
92 std::vector<const anab::ParticleID*> pids = fmpid.at(trkIter);
93 if (!calos.size())
continue;
94 if (calos.size()!=pids.size())
continue;
99 for (
size_t icalo = 0; icalo < calos.size(); ++icalo){
100 if (calos[icalo]->
dEdx().size() > nmaxhits){
101 nmaxhits = calos[icalo]->dEdx().size();
102 bestplane = calos[icalo]->PlaneID().Plane;
106 for (
size_t icalo = 0; icalo < calos.size(); ++icalo){
108 calos[icalo]->dEdx().size())
109 bestplane = calos[icalo]->
PlaneID().Plane;
113 for (
size_t icalo = 0; icalo < calos.size(); ++icalo){
114 if (calos[icalo]->
PlaneID().Plane==bestplane){
127 for(
size_t h = 0;
h<calos[calopl]->dEdx().size();++
h){
128 double xvalue = calos[calopl]->ResidualRange().at(
h);
129 double yvalue = calos[calopl]->dEdx().at(
h);
130 pm.SetPoint(
h,xvalue,yvalue);
132 double error = yvalue*(0.04231 + 0.0001783*(yvalue*yvalue));
133 TLine&
l = view->AddLine(xvalue,yvalue-
error,xvalue,yvalue+
error);
143 sprintf(trackinfo,
"Track #%d: K.E. = %.1f MeV , Range = %.1f cm",
144 int(tracklist[trkIter].
key()),
145 calos[calopl]->KineticEnergy(),
146 calos[calopl]->
Range());
164 double offset = (ntracks - 1)*10.0;
165 TLatex& track_tex = view->AddLatex(13.0, (46.0) - offset,trackinfo);
166 TLatex& pida_tex = view->AddLatex(13.0, (46.0-2.5) - offset,pida);
167 TLatex& proton_tex = view->AddLatex(13.0, (46.0-5.0) - offset,proton);
169 TLatex& pion_tex = view->AddLatex(13.0, (46.0-7.5) - offset,pion);
177 track_tex.SetTextSize(0.05);
178 proton_tex.SetTextSize(0.05);
180 pion_tex.SetTextSize(0.05);
182 pida_tex.SetTextSize(0.05);
std::vector< art::InputTag > fTrackLabels
module labels that produced tracks
std::vector< std::string > fParticleIDLabels
module labels that produced particleid
decltype(auto) constexpr size(T &&obj)
ADL-aware version of std::size.
bool getByLabel(std::string const &label, std::string const &instance, Handle< PROD > &result) const
double dEdx(float dqdx, float Efield)
unsigned int Nplanes(unsigned int tpc=0, unsigned int cstat=0) const
Returns the total number of wire planes in the specified TPC.
std::vector< std::string > fCalorimetryLabels
module labels that produced calorimetry
static const int kColor[kNCOLS]
std::size_t color(std::string const &procname)
detail::Node< FrameID, bool > PlaneID
void fill_ptr_vector(std::vector< Ptr< T >> &ptrs, H const &h)
recob::tracking::Plane Plane