ProtonHitsRemoval_module.cc
Go to the documentation of this file.
1 ////////////////////////////////////////////////////////////////////////
2 // Class: ProtonHitsRemoval
3 // Plugin Type: producer (art v3_06_03)
4 // File: ProtonHitsRemoval_module.cc
5 //
6 // Generated at Tue Jul 13 22:36:12 2021 by Tingjun Yang using cetskelgen
7 // from cetlib version v3_11_01.
8 ////////////////////////////////////////////////////////////////////////
16 #include "fhiclcpp/ParameterSet.h"
18 #include <memory>
19 #include "art_root_io/TFileService.h"
20 #include "TTree.h"
28 
29 
35 #include "TMath.h"
36 #include "TVector3.h"
37 #include <memory>
39 #include <string>
40 #include <vector>
41 #include <utility>
42 #include <memory>
43 #include <iostream>
44 // Framework includes
49 #include "art_root_io/TFileService.h"
51 // LArSoft Includes
59 namespace pdsp {
60  class ProtonHitsRemoval;
61 }
62 
63 
64 using namespace std;
66 public:
67  explicit ProtonHitsRemoval(fhicl::ParameterSet const& p);
68  // The compiler-generated destructor is fine for non-base
69  // classes without bare pointers or other resource use.
70  // Plugins should not be copied or assigned.
71  ProtonHitsRemoval(ProtonHitsRemoval const&) = delete;
73  ProtonHitsRemoval& operator=(ProtonHitsRemoval const&) = delete;
74  ProtonHitsRemoval& operator=(ProtonHitsRemoval&&) = delete;
75  // Required functions.
76  void produce(art::Event& e) override;
77  void beginJob() override;
78  void endJob() override;
79  void reset();
80 
81  bool PassBeamQualityCut() const;
82  void TrueBeamInfo(const art::Event & evt, const simb::MCParticle* true_beam_particle);
83 private:
84  // Declare member data here.
85  TTree *fTree;
92 
93  //run info
94  int run;
95  int subrun;
96  int event;
97 
98 
99  //Data beam quality cut
100  const double beam_startZ_data = 3.75897e+00; //prod4a-reco2
101  const double beam_startZ_rms_data = 1.03771e+00; //prod4a-reco2
102  const double beam_startY_data = 4.23949e+02; //prod4a-reco2
103  const double beam_startY_rms_data = 4.61753e+00; //prod4a-reco2
104  const double beam_startX_data = -2.83979e+01; //prod4a-reco2
105  const double beam_startX_rms_data = 3.88357e+00; //prod4a-reco2
106 
107  const double beam_angleX_data = 100.454;
108  const double beam_angleY_data = 103.523;
109  const double beam_angleZ_data = 17.8288;
110 
111  //MC beam quality cut
112  //const double beam_startX_mc = -30.8075;
113  //const double beam_startY_mc = 422.41;
114  //const double beam_startZ_mc = 0.11171;
115  //const double beam_startX_rms_mc = 5.01719;
116  //const double beam_startY_rms_mc = 4.50862;
117  //const double beam_startZ_rms_mc = 0.217733;
118  //const double beam_angleX_mc = 101.578;
119  //const double beam_angleY_mc = 101.189;
120  //const double beam_angleZ_mc = 16.5942;
121 
122  const double beam_startZ_mc = 4.98555e-02; //prod4a
123  const double beam_startZ_rms_mc = 2.06792e-01; //prod4a
124  const double beam_startY_mc = 4.22400e+02; //prod4a
125  const double beam_startY_rms_mc = 4.18191e+00; //prod4a
126  const double beam_startX_mc = -3.07693e+01; //prod4a
127  const double beam_startX_rms_mc = 4.75347e+00; //prod4a
128 
129  const double beam_angleX_mc = 101.578;
130  const double beam_angleY_mc = 101.189;
131  const double beam_angleZ_mc = 16.5942;
132 
133 
134  double reco_beam_calo_startX, reco_beam_calo_startY, reco_beam_calo_startZ;
135  double reco_beam_calo_endX, reco_beam_calo_endY, reco_beam_calo_endZ;
136  double beam_dx, beam_dy, beam_dz, beam_dxy, beam_costh;
137 
141  //double true_beam_len_sce;
142  // Declare member data here.
143 
144  double sel_len; // shorten to how long (cm)
145 
146 
147 
148 };
150  : EDProducer{p} // ,
151  // More initializers here.
152 {
153  cout<<"$$$ProtonHitsRemoval$$$"<<endl;
154  // Call appropriate produces<>() functions here.
157  produces<std::vector<recob::SpacePoint>>();
158  produces<art::Assns<recob::Hit, recob::SpacePoint>>(); // this space point will only be used as a tag
159  sel_len=p.get<double>("seglen");
160 
161  // Call appropriate consumes<>() for any products to be retrieved by this module.
162 }
164  cout<<"$$$beginJob"<<endl;
166  fTree = tfs->make<TTree>("beamana","beam analysis tree");
167 
168  fTree->Branch("run",&run,"run/I");
169  fTree->Branch("subrun",&subrun,"subrun/I");
170  fTree->Branch("event",&event,"event/I");
171 
172  fTree->Branch("reco_beam_len_sce", &reco_beam_len_sce);
173  fTree->Branch("beam_dx", &beam_dx);
174  fTree->Branch("beam_dy", &beam_dy);
175  fTree->Branch("beam_dz", &beam_dz);
176  fTree->Branch("beam_dxy", &beam_dxy);
177  fTree->Branch("beam_costh", &beam_costh);
178  fTree->Branch("selected_track", &selected_track);
179  fTree->Branch("true_beam_PDG", &true_beam_PDG);
180  fTree->Branch("true_beam_endProcess", &true_beam_endProcess);
181  fTree->Branch("true_beam_len", &true_beam_len);
182  //fTree->Branch("true_beam_len_sce", &true_beam_len_sce);
183 }
185 {
186  cout<<"#####EvtNo."<<evt.id().event()<<endl;
187  reset();
188  string fPFParticleTag = "pandora";
189  //string fCalorimetryTagSCE = "pandoracalo";
190  string fCalorimetryTagSCE = "pandoracalinoxyzt";
191  string fTrackerTag = "pandoraTrack";
192  string fGeneratorTag = "generator";
193  // Implementation of required member function here.
194  // Add code to select beam tracks using Pandora information
195 
196  recob::HitCollectionCreator hcol(evt, true, false);
197  std::unique_ptr<std::vector<recob::SpacePoint>> spvp(new std::vector<recob::SpacePoint>);
198  auto assns = std::make_unique<art::Assns<recob::Hit, recob::SpacePoint>>();
199 
200  //get run info
201  run = evt.run();
202  subrun = evt.subRun();
203  event = evt.id().event();
204  std::cout<<"run/subrun/evt:"<<run<<"/"<<subrun<<"/"<<event<<std::endl;
205 
206  if (!evt.isRealData()) {// MC
207  const simb::MCParticle* true_beam_particle = 0x0;
208  auto mcTruths = evt.getValidHandle<std::vector<simb::MCTruth>>(fGeneratorTag);
209  true_beam_particle = truthUtil.GetGeantGoodParticle((*mcTruths)[0],evt);
210  if( !true_beam_particle ){
211  cout << "No true beam particle" << endl;
212  }
213  else{
214  TrueBeamInfo(evt, true_beam_particle);
215  cout<<"true_beam_PDG="<<true_beam_PDG<<endl;
216  cout<<"true_beam_endProcess="<<true_beam_endProcess<<endl;
217  cout<<"true_beam_len="<<true_beam_len<<endl;
218  //cout<<"true_beam_len_sce="<<true_beam_len_sce<<endl;
219  }
220  }
221 
222  const std::map<unsigned int, std::vector<const recob::PFParticle*>> sliceMap
223  = pfpUtil.GetPFParticleSliceMap(evt, fPFParticleTag);
224  std::vector<std::vector<const recob::PFParticle*>> beam_slices;
225  for(auto slice : sliceMap){
226  for(auto particle : slice.second){
227  bool added = false;
228  if(pfpUtil.IsBeamParticle(*particle,evt, fPFParticleTag)){
229  if (!added) {
230  beam_slices.push_back(slice.second);
231  added = true;
232  }
233  }
234  if (!added) {continue;}
235  //else {
236  // std::cout << "Not beam particle" << std::endl;
237  //}
238  }
239  }
240  if (beam_slices.size() > 0){
241  const recob::PFParticle* particle = beam_slices.at(0).at(0);
242 
243  const recob::Track* thisTrack = pfpUtil.GetPFParticleTrack(*particle,evt,fPFParticleTag,fTrackerTag);
244  //Primary Track Calorimetry
245  if( thisTrack ){
246  auto calo = trackUtil.GetRecoTrackCalorimetry(*thisTrack, evt, fTrackerTag,
247  fCalorimetryTagSCE);
248  bool found_calo = false;
249  size_t index = 0;
250  for ( index = 0; index < calo.size(); ++index) {
251  if (calo[index].PlaneID().Plane == 2) {
252  found_calo = true;
253  break;
254  }
255  }
256  if (found_calo) {
257  reco_beam_len_sce = calo[index].Range();
258  auto theXYZPoints = calo[index].XYZ();
259  std::sort(theXYZPoints.begin(), theXYZPoints.end(), [](auto a, auto b)
260  {return (a.Z() < b.Z());}); // sort according to Z position
261  if (theXYZPoints.size()) {
262  reco_beam_calo_startX = theXYZPoints[0].X();
263  reco_beam_calo_startY = theXYZPoints[0].Y();
264  reco_beam_calo_startZ = theXYZPoints[0].Z();
265  reco_beam_calo_endX = theXYZPoints.back().X();
266  reco_beam_calo_endY = theXYZPoints.back().Y();
267  reco_beam_calo_endZ = theXYZPoints.back().Z();
268  }
269 
270  TVector3 beamdir;
271  if (evt.isRealData()) { // beam quality requirement (for data)
272  cout<<"@@@Is real data"<<endl;
276  beam_dxy = sqrt(pow(beam_dx,2) + pow(beam_dy,2));
277 
278  TVector3 beamdir_data(cos(beam_angleX_data*TMath::Pi()/180),
279  cos(beam_angleY_data*TMath::Pi()/180),
280  cos(beam_angleZ_data*TMath::Pi()/180));
281  beamdir = beamdir_data.Unit();
282 
283  }
284  else { // beam quality requirement (for MC)
285  cout<<"@@@Is MC"<<endl;
289  beam_dxy = sqrt(pow(beam_dx,2) + pow(beam_dy,2));
290 
291  TVector3 beamdir_mc(cos(beam_angleX_mc*TMath::Pi()/180),
292  cos(beam_angleY_mc*TMath::Pi()/180),
293  cos(beam_angleZ_mc*TMath::Pi()/180));
294  beamdir = beamdir_mc.Unit();
295  }
296 
297  TVector3 pt0(reco_beam_calo_startX,
300  TVector3 pt1(reco_beam_calo_endX,
303  TVector3 dir = pt1 - pt0;
304  dir = dir.Unit();
305  beam_costh = dir.Dot(beamdir);
306  std::cout<<"\n--> reco_beam_len_sce:"<<reco_beam_len_sce<<""<<std::endl;
307  std::cout<<"PassBeamQualityCut:"<<PassBeamQualityCut()<<std::endl;
308  std::cout<<"selected_track:"<<selected_track<<std::endl;
310  selected_track = 1;
311  //if (reco_beam_len_sce>230 && reco_beam_len_sce<500)
312  if (reco_beam_len_sce<140)
313  selected_track = 2;
314  }
315  std::cout<<"--> selected_track:"<<selected_track<<""<<std::endl;
316  }
317 
318  string fHitModuleLabel = "hitpdune";
319  //string fSpModuleLabel = "reco3d";
320 
321  //double sel_len = 10.; // shorten to how long (cm)
322  std::cout<<"truncated length="<<sel_len<<" [cm]"<<std::endl;
323 
324  if (selected_track == 2) { // selected long tracks (not smaller than 5 m)
325  auto hitsHandle = evt.getValidHandle< std::vector<recob::Hit> >(fHitModuleLabel);
326  //auto spHandle = evt.getValidHandle< std::vector<recob::SpacePoint> >(fSpModuleLabel);
327  art::FindOneP<recob::Wire> channelHitWires (hitsHandle, evt, fHitModuleLabel);
328  //art::FindManyP< recob::SpacePoint > spFromHit(hitsHandle, evt, fSpModuleLabel);
329  //recob::HitCollectionCreator hcol(evt, true, true);
330  std::vector< art::Ptr<recob::Hit> > eventHits;
331  art::fill_ptr_vector(eventHits, hitsHandle);
332  //std::unordered_map< size_t, geo::WireID > hitToWire;
333  //hitToWire.reserve(eventHits.size());
334 
335  const std::vector< art::Ptr< recob::Hit > > beamPFP_hits = pfpUtil.GetPFParticleHits_Ptrs( *particle, evt, fPFParticleTag );
336  auto calo_dQdX = calo[index].dQdx();
337  double reco_beam_len = thisTrack->Length();
338  cout<<"$$Length:"<<reco_beam_len<<endl;
339  size_t i = 0;
340  for (; thisTrack->Length(i) > reco_beam_len - sel_len; ++i ){
341  ;
342  }
343  TVector3 pos = thisTrack->LocationAtPoint<TVector3>(i);
344  cout<<"$$"<<"\tX"<<pos.X()<<"\tY"<<pos.Y()<<"\tZ"<<pos.Z()<<endl; // position of cut point
345 
346  auto TpIndices = calo[index].TpIndices();
347 
348  double wirecoord_U = fGeom->WireCoordinate(pos.Y(), pos.Z(), 0, 1, 0);
349  double wirecoord_V = fGeom->WireCoordinate(pos.Y(), pos.Z(), 1, 1, 0);
350  double wirecoord_X = fGeom->WireCoordinate(pos.Y(), pos.Z(), 2, 1, 0);
351  cout<<"$$$WireCoord: U "<<wirecoord_U<<"\tV "<<wirecoord_V<<"\tX "<<wirecoord_X<<endl; // Wire ID of cut point
352 
353  std::vector< art::Ptr< recob::Hit > > remove_hits;
354  std::vector< art::Ptr< recob::Hit > > tag_hits;
356  std::vector< recob::SpacePoint > spv;
358  spv.push_back(sp);
359  spvp->insert(spvp->end(), spv.begin(), spv.end());
360  for (size_t kk = 0; kk < beamPFP_hits.size(); ++kk){
361  auto hit = beamPFP_hits[kk];
362 
363  geo::WireID hitid = hit->WireID();
364  //std::vector<geo::WireID> cwids = fGeom->ChannelToWire(hit->Channel());
365  //cout<<"@@@"<<hitid.Plane<<"\t"<<hitid.Wire<<"\t"<<hitid.TPC<<"\t"<<hitid.Cryostat<<endl;
366 
367  if (hitid.TPC == 1 && hitid.Cryostat == 0) {
368  if (hitid.Plane == 0) { // plane U
369  if (hitid.Wire > wirecoord_U) {
370  remove_hits.push_back(hit);
371  }
372  else {
373  tag_hits.push_back(hit);
374  }
375  }
376  else if (hitid.Plane == 1) { // plane V
377  if (hitid.Wire < wirecoord_V) {
378  remove_hits.push_back(hit);
379  }
380  else {
381  tag_hits.push_back(hit);
382  }
383  }
384  else if (hitid.Plane == 2) { // plane X
385  if (hitid.Wire > wirecoord_X) {
386  remove_hits.push_back(hit);
387  }
388  else {
389  tag_hits.push_back(hit);
390  }
391  }
392  }
393  }
394 
395  auto const hitPtrMaker = art::PtrMaker<recob::Hit>(evt);
396  // fill hits
397  for (size_t kk = 0; kk < eventHits.size(); ++kk){
398  auto hit = eventHits[kk];
399  vector<art::Ptr<recob::Hit>>::iterator itr;
400  itr = find(remove_hits.begin(), remove_hits.end(), hit);
401  if (itr == remove_hits.end()) { // not be to removed
402  hcol.emplace_back(std::move(*hit), channelHitWires.at(kk));
403 
404  vector<art::Ptr<recob::Hit>>::iterator itr_tag;
405  itr_tag = find(tag_hits.begin(), tag_hits.end(), hit);
406  if (itr_tag != tag_hits.end()) { // to be tagged (associated)
407  auto hitPtr = hitPtrMaker(hcol.size() - 1);
408  util::CreateAssn(evt, *spvp, hitPtr, *assns, 0);
409  }
410  }
411  }
412 
413  cout<<"$$$reco_beam_len_sce "<<reco_beam_len_sce<<endl;
414  }
415  }
416  }
417 
418 
419  hcol.put_into(evt);
420  evt.put(std::move(spvp));
421  evt.put(std::move(assns));
422  fTree->Fill();
423 }
425  cout<<"$$$endJob"<<endl;
426 }
428  cout<<"$$$reset"<<endl;
429  run = -1;
430  subrun =-1;
431  event =-1;
432 
433  reco_beam_len_sce = -999;
434  beam_dx = -999;
435  beam_dy = -999;
436  beam_dz = -999;
437  beam_dxy = -999;
438  beam_costh = -999;
439  reco_beam_calo_startX = -999;
440  reco_beam_calo_startY = -999;
441  reco_beam_calo_startZ = -999;
442  reco_beam_calo_endX = -999;
443  reco_beam_calo_endY = -999;
444  reco_beam_calo_endZ = -999;
445  selected_track = 0;
446 
447  true_beam_PDG = -999;
449  true_beam_len = -999.;
450  //true_beam_len_sce = -999.;
451 }
452 bool pdsp::ProtonHitsRemoval::PassBeamQualityCut() const{ // cut on beam entrance location and beam angle
453  if (beam_dxy<-1) return false;
454  if (beam_dxy>3) return false;
455 
456  if (beam_dz<-3) return false;
457  if (beam_dz>3) return false;
458 
459  if (beam_dy<-3) return false;
460  if (beam_dy>3) return false;
461 
462  if (beam_dx<-3) return false;
463  if (beam_dx>3) return false;
464 
465  if (beam_costh<0.96) return false;
466  if (beam_costh>2) return false;
467 
468  return true;
469 }
470 void pdsp::ProtonHitsRemoval::TrueBeamInfo( const art::Event & evt, const simb::MCParticle* true_beam_particle)
471 {
472  true_beam_PDG = true_beam_particle->PdgCode();
473  true_beam_endProcess = true_beam_particle->EndProcess();
474  const simb::MCTrajectory & true_beam_trajectory = true_beam_particle->Trajectory();
475  //auto sce = lar::providerFrom<spacecharge::SpaceChargeService>();
476 
477  vector<double> true_beam_traj_X;
478  vector<double> true_beam_traj_Y;
479  vector<double> true_beam_traj_Z;
480  vector<double> true_beam_traj_X_SCE;
481  vector<double> true_beam_traj_Y_SCE;
482  vector<double> true_beam_traj_Z_SCE;
483  for (size_t i = 0; i < true_beam_trajectory.size(); ++i) {
484  double trajX = true_beam_trajectory.X(i);
485  double trajY = true_beam_trajectory.Y(i);
486  double trajZ = true_beam_trajectory.Z(i);
487  true_beam_traj_X.push_back(trajX);
488  true_beam_traj_Y.push_back(trajY);
489  true_beam_traj_Z.push_back(trajZ);
490  /*auto offset = sce->GetPosOffsets( {trajX, trajY, trajZ} );
491  cout<<"@@@ "<<i<<endl;
492  true_beam_traj_X_SCE.push_back(trajX - offset.X());
493  true_beam_traj_Y_SCE.push_back(trajY + offset.Y());
494  true_beam_traj_Z_SCE.push_back(trajZ + offset.Z());*/
495  }
496  true_beam_len = 0;
497  //true_beam_len_sce = 0;
498  for (size_t i = 1; i < true_beam_trajectory.size(); ++i) {
499  true_beam_len += sqrt( pow( true_beam_traj_X.at(i)-true_beam_traj_X.at(i-1), 2)
500  + pow( true_beam_traj_Y.at(i)-true_beam_traj_Y.at(i-1), 2)
501  + pow( true_beam_traj_Z.at(i)-true_beam_traj_Z.at(i-1), 2));
502  /*true_beam_len_sce += sqrt( pow( true_beam_traj_X_SCE.at(i)-true_beam_traj_X_SCE.at(i-1), 2)
503  + pow( true_beam_traj_Y_SCE.at(i)-true_beam_traj_Y_SCE.at(i-1), 2)
504  + pow( true_beam_traj_Z_SCE.at(i)-true_beam_traj_Z_SCE.at(i-1), 2));*/
505  }
506 }
geo::Length_t WireCoordinate(double YPos, double ZPos, geo::PlaneID const &planeid) const
Returns the index of the nearest wire to the specified position.
double Z(const size_type i) const
Definition: MCTrajectory.h:151
double X(const size_type i) const
Definition: MCTrajectory.h:149
int PdgCode() const
Definition: MCParticle.h:212
bool IsBeamParticle(const recob::PFParticle &particle, art::Event const &evt, const std::string particleLabel) const
Use the pandora metadata to tell us if this is a beam particle or not.
const simb::MCParticle * GetGeantGoodParticle(const simb::MCTruth &genTruth, const art::Event &evt) const
void TrueBeamInfo(const art::Event &evt, const simb::MCParticle *true_beam_particle)
ProtonHitsRemoval(fhicl::ParameterSet const &p)
void produce(art::Event &e) override
std::string string
Definition: nybbler.cc:12
const simb::MCTrajectory & Trajectory() const
Definition: MCParticle.h:253
std::vector< anab::Calorimetry > GetRecoTrackCalorimetry(const recob::Track &track, art::Event const &evt, const std::string trackModule, const std::string caloModule) const
Get the Calorimetry(s) from a given reco track.
geo::GeometryCore const * fGeom
Point_t const & LocationAtPoint(size_t i) const
Definition: Track.h:126
constexpr T pow(T x)
Definition: pow.h:72
Class to keep data related to recob::Hit associated with recob::Track.
CryostatID_t Cryostat
Index of cryostat.
Definition: geo_types.h:212
STL namespace.
WireID_t Wire
Index of the wire within its plane.
Definition: geo_types.h:580
string dir
static void declare_products(art::ProducesCollector &collector, std::string instance_name="", bool doWireAssns=true, bool doRawDigitAssns=true)
Declares the hit products we are going to fill.
Definition: HitCreator.cxx:248
art framework interface to geometry description
protoana::ProtoDUNETruthUtils truthUtil
bool isRealData() const
Helper functions to create a hit.
QTextStream & reset(QTextStream &s)
const double e
double Length(size_t p=0) const
Access to various track properties.
Definition: Track.h:167
protoana::ProtoDUNETrackUtils trackUtil
double Y(const size_type i) const
Definition: MCTrajectory.h:150
A class handling a collection of hits and its associations.
Definition: HitCreator.h:508
#define DEFINE_ART_MODULE(klass)
Definition: ModuleMacros.h:67
std::string EndProcess() const
Definition: MCParticle.h:216
void beginJob()
Definition: Breakpoints.cc:14
protoana::ProtoDUNEPFParticleUtils pfpUtil
const double a
def move(depos, offset)
Definition: depos.py:107
const recob::Track * GetPFParticleTrack(const recob::PFParticle &particle, art::Event const &evt, const std::string particleLabel, const std::string trackLabel) const
Get the track associated to this particle. Returns a null pointer if not found.
ValidHandle< PROD > getValidHandle(InputTag const &tag) const
Definition: DataViewImpl.h:441
p
Definition: test.py:223
const std::map< unsigned int, std::vector< const recob::PFParticle * > > GetPFParticleSliceMap(art::Event const &evt, const std::string particleLabel) const
Get a map of slice index to the primary PFParticles within it.
SubRunNumber_t subRun() const
Definition: DataViewImpl.cc:78
ProductID put(std::unique_ptr< PROD > &&edp, std::string const &instance={})
Definition: DataViewImpl.h:686
bool CreateAssn(PRODUCER const &prod, art::Event &evt, std::vector< T > const &a, art::Ptr< U > const &b, art::Assns< U, T > &assn, std::string a_instance, size_t indx=UINT_MAX)
Creates a single one-to-one association.
void emplace_back(recob::Hit &&hit, art::Ptr< recob::Wire > const &wire=art::Ptr< recob::Wire >(), art::Ptr< raw::RawDigit > const &digits=art::Ptr< raw::RawDigit >())
Adds the specified hit to the data collection.
Definition: HitCreator.cxx:290
RunNumber_t run() const
Definition: DataViewImpl.cc:71
PlaneID_t Plane
Index of the plane within its TPC.
Definition: geo_types.h:493
Description of geometry of one entire detector.
void put_into(art::Event &)
Moves the data into an event.
Definition: HitCreator.h:652
Detector simulation of raw signals on wires.
ProducesCollector & producesCollector() noexcept
size_t size() const
Returns the number of hits currently in the collection.
Definition: HitCreator.h:636
Declaration of signal hit object.
Hierarchical representation of particle flow.
Definition: PFParticle.h:44
size_type size() const
Definition: MCTrajectory.h:166
Provides recob::Track data product.
const std::vector< art::Ptr< recob::Hit > > GetPFParticleHits_Ptrs(const recob::PFParticle &particle, art::Event const &evt, const std::string particleLabel) const
static bool * b
Definition: config.cpp:1043
EventNumber_t event() const
Definition: EventID.h:116
detail::Node< FrameID, bool > PlaneID
Definition: CRTID.h:125
TCEvent evt
Definition: DataStructs.cxx:7
void fill_ptr_vector(std::vector< Ptr< T >> &ptrs, H const &h)
Definition: Ptr.h:297
TPCID_t TPC
Index of the TPC within its cryostat.
Definition: geo_types.h:406
EventID id() const
Definition: Event.cc:34
Track from a non-cascading particle.A recob::Track consists of a recob::TrackTrajectory, plus additional members relevant for a "fitted" track:
Definition: Track.h:49
calorimetry
QTextStream & endl(QTextStream &s)
Event finding and building.