All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
SCECorrection_module.cc
Go to the documentation of this file.
1 ////////////////////////////////////////////////////////////////////////
2 // Class: SCECorrection
3 // Plugin Type: producer (art v3_04_00)
4 // File: SCECorrection_module.cc
5 //
6 // Generated at Sun Mar 22 09:23:33 2020 by Edward Tyley using cetskelgen
7 // from cetlib version v3_09_00.
8 ////////////////////////////////////////////////////////////////////////
9 
10 #include "art/Framework/Core/EDProducer.h"
11 #include "art/Framework/Core/ModuleMacros.h"
12 #include "art/Framework/Principal/Event.h"
13 #include "art/Framework/Principal/Handle.h"
14 #include "art/Framework/Principal/Run.h"
15 #include "art/Framework/Principal/SubRun.h"
16 #include "art/Framework/Services/Registry/ServiceHandle.h"
17 #include "canvas/Persistency/Common/FindManyP.h"
18 #include "canvas/Utilities/InputTag.h"
19 #include "fhiclcpp/ParameterSet.h"
20 #include "messagefacility/MessageLogger/MessageLogger.h"
21 
30 
40 
41 namespace sce {
42 class SCECorrection;
43 }
44 
45 class sce::SCECorrection : public art::EDProducer {
46  public:
47  explicit SCECorrection(fhicl::ParameterSet const& p);
48  // The compiler-generated destructor is fine for non-base
49  // classes without bare pointers or other resource use.
50 
51  // Plugins should not be copied or assigned.
52  SCECorrection(SCECorrection const&) = delete;
53  SCECorrection(SCECorrection&&) = delete;
54  SCECorrection& operator=(SCECorrection const&) = delete;
56 
57  // Required functions.
58  void produce(art::Event& evt) override;
59 
60  private:
61  // Declare member data here.
64 
66 
67  const std::string fPFPLabel, fTrackLabel;
68  const std::vector<std::string> fT0Labels;
69  const std::vector<bool> fT0LabelsCorrectT0;
70 
71  geo::Vector_t applyT0Shift(const double& t0, const geo::TPCID& tpcId) const;
72 
73  std::map<art::Ptr<anab::T0>, bool> getSliceT0s(
74  const art::Event& evt,
75  const std::vector<art::Ptr<recob::PFParticle>>& slicePFPs,
76  const art::Handle<std::vector<recob::PFParticle>>& pfpHandle,
77  const art::Handle<std::vector<recob::Track>>& trackHandle,
78  const art::FindManyP<recob::Track>& fmPFPTrack) const;
79 
80  std::pair<art::Ptr<anab::T0>, bool> getSliceBestT0(
81  const std::map<art::Ptr<anab::T0>, bool>& sliceT0CorrectMap) const;
82 };
83 
84 sce::SCECorrection::SCECorrection(fhicl::ParameterSet const& p)
85  : EDProducer { p }
86  , fGeom(lar::providerFrom<geo::Geometry>())
87  , fSCE(lar::providerFrom<spacecharge::SpaceChargeService>())
88  , fCorrectNoT0Tag(p.get<bool>("CorrectNoT0Tag"))
89  , fCorrectSCE(p.get<bool>("CorrectSCE"))
90  , fSCEXCorrFlip(p.get<bool>("SCEXCorrFlip"))
91  , fPFPLabel(p.get<std::string>("PFPLabel"))
92  , fTrackLabel(p.get<std::string>("TrackLabel"))
93  , fT0Labels(p.get<std::vector<std::string>>("T0Labels"))
94  , fT0LabelsCorrectT0(p.get<std::vector<bool>>("T0LabelsCorrectT0"))
95 {
96 
97  produces<std::vector<anab::T0>>();
98  produces<std::vector<recob::Slice>>();
99  produces<std::vector<recob::PFParticle>>();
100  produces<std::vector<recob::SpacePoint>>();
101  produces<std::vector<recob::Cluster>>();
102  produces<std::vector<recob::Vertex>>();
103  produces<std::vector<larpandoraobj::PFParticleMetadata>>();
104 
105  // produces<art::Assns<anab::T0, recob::Slice> >();
106  produces<art::Assns<anab::T0, recob::PFParticle>>();
107  produces<art::Assns<recob::Slice, recob::Hit>>();
108 
109  produces<art::Assns<recob::PFParticle, recob::Slice>>();
110  produces<art::Assns<recob::PFParticle, recob::SpacePoint>>();
111  produces<art::Assns<recob::PFParticle, recob::Vertex>>();
112  produces<art::Assns<recob::PFParticle, recob::Cluster>>();
113  produces<art::Assns<recob::PFParticle, larpandoraobj::PFParticleMetadata>>();
114  produces<art::Assns<recob::SpacePoint, recob::Hit>>();
115  produces<art::Assns<recob::Cluster, recob::Hit>>();
116 }
117 
119 {
120  // Implementation of required member function here.
121  // auto const* sce = lar::providerFrom<spacecharge::SpaceChargeService>();
122  auto t0Collection = std::make_unique<std::vector<anab::T0>>();
123  auto pfpCollection = std::make_unique<std::vector<recob::PFParticle>>();
124  auto clusterCollection = std::make_unique<std::vector<recob::Cluster>>();
125  auto spCollection = std::make_unique<std::vector<recob::SpacePoint>>();
126  auto vtxCollection = std::make_unique<std::vector<recob::Vertex>>();
127  auto sliceCollection = std::make_unique<std::vector<recob::Slice>>();
128  auto pfpMetaCollection = std::make_unique<std::vector<larpandoraobj::PFParticleMetadata>>();
129 
130  // auto t0SliceAssn = std::make_unique<art::Assns<anab::T0, recob::Slice> >();
131  auto t0PFPAssn = std::make_unique<art::Assns<anab::T0, recob::PFParticle>>();
132  auto sliceHitAssn = std::make_unique<art::Assns<recob::Slice, recob::Hit>>();
133  auto pfpSliceAssn = std::make_unique<art::Assns<recob::PFParticle, recob::Slice>>();
134  auto pfpVtxAssn = std::make_unique<art::Assns<recob::PFParticle, recob::Vertex>>();
135  auto pfpSPAssn = std::make_unique<art::Assns<recob::PFParticle, recob::SpacePoint>>();
136  auto pfpClusterAssn = std::make_unique<art::Assns<recob::PFParticle, recob::Cluster>>();
137  auto pfpMetaAssn = std::make_unique<art::Assns<recob::PFParticle, larpandoraobj::PFParticleMetadata>>();
138  auto spHitAssn = std::make_unique<art::Assns<recob::SpacePoint, recob::Hit>>();
139  auto clusterHitAssn = std::make_unique<art::Assns<recob::Cluster, recob::Hit>>();
140 
141  art::PtrMaker<anab::T0> t0PtrMaker { evt };
142  art::PtrMaker<recob::PFParticle> pfpPtrMaker { evt };
143  art::PtrMaker<recob::Cluster> clusterPtrMaker { evt };
144  art::PtrMaker<recob::Vertex> vtxPtrMaker { evt };
145  art::PtrMaker<recob::Slice> slicePtrMaker { evt };
146  art::PtrMaker<recob::SpacePoint> spPtrMaker { evt };
147  art::PtrMaker<larpandoraobj::PFParticleMetadata> pfpMetaPtrMaker { evt };
148 
149  // Get all the slices in the event
150  art::Handle<std::vector<recob::Slice>> sliceHandle;
151  std::vector<art::Ptr<recob::Slice>> allSlices;
152  if (evt.getByLabel(fPFPLabel, sliceHandle))
153  art::fill_ptr_vector(allSlices, sliceHandle);
154 
155  // Get all the Clusters in the event
156  art::Handle<std::vector<recob::Cluster>> clusterHandle;
157  std::vector<art::Ptr<recob::Cluster>> allClusters;
158  if (evt.getByLabel(fPFPLabel, clusterHandle))
159  art::fill_ptr_vector(allClusters, clusterHandle);
160 
161  // Get all the SpacePoints in the event
162  art::Handle<std::vector<recob::SpacePoint>> spHandle;
163  std::vector<art::Ptr<recob::SpacePoint>> allSpacePoints;
164  if (evt.getByLabel(fPFPLabel, spHandle))
165  art::fill_ptr_vector(allSpacePoints, spHandle);
166 
167  // Get all the PFParticles in the event
168  art::Handle<std::vector<recob::PFParticle>> pfpHandle;
169  std::vector<art::Ptr<recob::PFParticle>> allPFParticles;
170  if (evt.getByLabel(fPFPLabel, pfpHandle))
171  art::fill_ptr_vector(allPFParticles, pfpHandle);
172 
173  // Get all the Tracks in the event
174  art::Handle<std::vector<recob::Track>> trackHandle;
175  std::vector<art::Ptr<recob::Track>> allTracks;
176  if (evt.getByLabel(fTrackLabel, trackHandle))
177  art::fill_ptr_vector(allTracks, trackHandle);
178 
179  art::FindManyP<recob::PFParticle> fmSlicePFP(sliceHandle, evt, fPFPLabel);
180  art::FindManyP<recob::Track> fmPFPTrack(pfpHandle, evt, fTrackLabel);
181  art::FindManyP<recob::SpacePoint> fmPFPSP(pfpHandle, evt, fPFPLabel);
182  art::FindManyP<recob::Cluster> fmPFPCluster(pfpHandle, evt, fPFPLabel);
183  art::FindManyP<recob::Vertex> fmPFPVertex(pfpHandle, evt, fPFPLabel);
184  art::FindManyP<recob::Hit> fmClusterHit(clusterHandle, evt, fPFPLabel);
185  art::FindManyP<recob::Hit> fmSPHit(spHandle, evt, fPFPLabel);
186  art::FindManyP<recob::Hit> fmSliceHit(sliceHandle, evt, fPFPLabel);
187  art::FindManyP<larpandoraobj::PFParticleMetadata> fmPFPMeta(pfpHandle, evt, fPFPLabel);
188 
189  // Check the assns that are necessary, others are optional and will be checked
190  // when they are used to create the new assns
191  if (!fmSlicePFP.isValid()) {
192  throw cet::exception("SCECorrection") << "FindMany Slice-PFP is not Valid" << std::endl;
193  }
194  if (!fmPFPSP.isValid()) {
195  throw cet::exception("SCECorrection") << "FindMany PFP-SpacePoint is not Valid" << std::endl;
196  }
197  if (!fmSPHit.isValid()) {
198  throw cet::exception("SCECorrection") << "FindMany SpacePoint-Hit is not Valid" << std::endl;
199  }
200 
201  // For each slice, get all the PFPs and tracks and check for T0 tags
202  // std::cout<<"Test: Slices: "<<allSlices.size()<<std::endl;
203  auto const clockData = art::ServiceHandle<detinfo::DetectorClocksService const>()->DataFor(evt);
204  auto const detProp = art::ServiceHandle<detinfo::DetectorPropertiesService const>()->DataFor(evt, clockData);
205 
206  for (auto const& slice : allSlices) {
207 
208  //Cretae a new slice
209  recob::Slice newSlice(*slice);
210  sliceCollection->push_back(newSlice);
211  art::Ptr<recob::Slice> newSlicePtr = slicePtrMaker(sliceCollection->size() - 1);
212 
213  // Get the pfps and hits associated to the slice
214  const std::vector<art::Ptr<recob::PFParticle>> slicePFPs = fmSlicePFP.at(slice.key());
215 
216  const std::map<art::Ptr<anab::T0>, bool> sliceT0CorrectMap = getSliceT0s(
217  evt, slicePFPs, pfpHandle, trackHandle, fmPFPTrack);
218 
219  const std::pair<art::Ptr<anab::T0>, bool> sliceT0CorrectPair = getSliceBestT0(sliceT0CorrectMap);
220 
221  if (sliceT0CorrectPair.first.isNull() && !fCorrectNoT0Tag) {
222  continue;
223  }
224 
225  art::Ptr<anab::T0> newT0Ptr;
226  double t0Offset(0);
227  if (!sliceT0CorrectPair.first.isNull()) {
228  // Calculate the shift we need to apply for the t0
229  t0Offset = detProp.DriftVelocity() * sliceT0CorrectPair.first->Time() / 1e3;
230  // Create a new T0
231  t0Collection->push_back(*sliceT0CorrectPair.first);
232  newT0Ptr = t0PtrMaker(t0Collection->size() - 1);
233  // t0SliceAssn->addSingle(newT0Ptr, newSlicePtr);
234  }
235 
236  // Make an association with the new slice and the old hits
237  if (fmSliceHit.isValid()) {
238  const std::vector<art::Ptr<recob::Hit>> sliceHits = fmSliceHit.at(slice.key());
239  for (const art::Ptr<recob::Hit>& hitPtr : sliceHits) {
240  sliceHitAssn->addSingle(newSlicePtr, hitPtr);
241  }
242  }
243 
244  // Correct all PFPs in the slice
245  for (auto const& pfp : slicePFPs) {
246 
247  // Create new PFPs and associate them to the slice
248  recob::PFParticle newPFP(*pfp);
249  pfpCollection->push_back(newPFP);
250  art::Ptr<recob::PFParticle> newPFPPtr = pfpPtrMaker(pfpCollection->size() - 1);
251  pfpSliceAssn->addSingle(newPFPPtr, newSlicePtr);
252 
253  if (!newT0Ptr.isNull()) {
254  t0PFPAssn->addSingle(newT0Ptr, newPFPPtr);
255  }
256 
257  std::vector<art::Ptr<recob::SpacePoint>> pfpSPs = fmPFPSP.at(pfp.key());
258  // Get the vertex associated to the PFP
259  if (fmPFPVertex.isValid()) {
260  std::vector<art::Ptr<recob::Vertex>> pfpVertices = fmPFPVertex.at(pfp.key());
261  for (auto const& pfpVertex : pfpVertices) {
262 
263  geo::Point_t vtxPos(pfpVertex->position());
264  //Find the closest SP to the vertex
265  // If the PFP has no space points, look in the whole event
266  std::vector<art::Ptr<recob::SpacePoint>> vtxSPs = pfpSPs.size() ? pfpSPs : allSpacePoints;
267 
268  double minVtxSPDist = std::numeric_limits<double>::max();
269  art::Ptr<recob::SpacePoint> spPtr;
270  for (auto const& sp : vtxSPs) {
271  geo::Point_t spPos(sp->XYZ()[0], sp->XYZ()[1], sp->XYZ()[2]);
272  geo::Vector_t vtxSPDiff = vtxPos - spPos;
273  if (vtxSPDiff.Mag2() < minVtxSPDist) {
274  spPtr = sp;
275  minVtxSPDist = vtxSPDiff.Mag2();
276  }
277  }
278 
279  if (spPtr.isNull())
280  continue;
281 
282  // Get the hit and TPC Id associated to closest SP
283  art::Ptr<recob::Hit> spHitPtr = fmSPHit.at(spPtr.key()).front();
284  geo::TPCID tpcId = spHitPtr->WireID().asTPCID();
285 
286  if (!sliceT0CorrectPair.first.isNull() && sliceT0CorrectPair.second) {
287  geo::Vector_t posOffset = applyT0Shift(t0Offset, tpcId);
288  vtxPos += posOffset;
289  }
290 
291  if (fCorrectSCE && fSCE->EnableCalSpatialSCE()) {
292  geo::Vector_t posOffset = fSCE->GetCalPosOffsets(vtxPos, tpcId.TPC);
293  if (fSCEXCorrFlip) {
294  posOffset.SetX(-posOffset.X());
295  }
296  vtxPos += posOffset;
297  }
298 
299  // Create a new vertex and associate it to the PFP
300  recob::Vertex newVtx(vtxPos, pfpVertex->covariance(), pfpVertex->chi2(),
301  pfpVertex->ndof(), pfpVertex->ID());
302  vtxCollection->push_back(newVtx);
303  art::Ptr<recob::Vertex> newVtxPtr = vtxPtrMaker(vtxCollection->size() - 1);
304  pfpVtxAssn->addSingle(newPFPPtr, newVtxPtr);
305  }
306  }
307 
308  for (auto const& sp : pfpSPs) {
309 
310  //Get the spacepoint position in a nicer form
311  geo::Point_t spPos(sp->XYZ()[0], sp->XYZ()[1], sp->XYZ()[2]);
312 
313  // Get the hit so we know what TPC the sp was in
314  // N.B. We can't use SP position to infer the TPC as it could be
315  // shifted into another TPC
316  art::Ptr<recob::Hit> spHitPtr = fmSPHit.at(sp.key()).front();
317  geo::TPCID tpcId = spHitPtr->WireID().asTPCID();
318 
319  if (!sliceT0CorrectPair.first.isNull() && sliceT0CorrectPair.second) {
320  geo::Vector_t posOffset = applyT0Shift(t0Offset, tpcId);
321  spPos += posOffset;
322  }
323 
324  if (fCorrectSCE && fSCE->EnableCalSpatialSCE()) {
325  geo::Vector_t posOffset = fSCE->GetCalPosOffsets(spPos, tpcId.TPC);
326  if (fSCEXCorrFlip) {
327  posOffset.SetX(-posOffset.X());
328  }
329  spPos += posOffset;
330  }
331 
332  // Create new spacepoint and associate it to the pfp and hit
333  Double32_t spXYZ[3] = { spPos.X(), spPos.Y(), spPos.Z() };
334  recob::SpacePoint correctedSP(spXYZ, sp->ErrXYZ(), sp->Chisq(), sp->ID());
335 
336  spCollection->push_back(correctedSP);
337  art::Ptr<recob::SpacePoint> spPtr = spPtrMaker(spCollection->size() - 1);
338  pfpSPAssn->addSingle(newPFPPtr, spPtr);
339  spHitAssn->addSingle(spPtr, spHitPtr);
340  } // pspSPs
341 
342  // Create new clusters and associations
343  if (fmPFPCluster.isValid() && fmClusterHit.isValid()) {
344  std::vector<art::Ptr<recob::Cluster>> pfpClusters = fmPFPCluster.at(pfp.key());
345  for (auto const& pfpCluster : pfpClusters) {
346  recob::Cluster newCluster(*pfpCluster);
347  clusterCollection->push_back(newCluster);
348  art::Ptr<recob::Cluster> newClusterPtr = clusterPtrMaker(clusterCollection->size() - 1);
349 
350  std::vector<art::Ptr<recob::Hit>> clusterHits = fmClusterHit.at(pfpCluster.key());
351  pfpClusterAssn->addSingle(newPFPPtr, newClusterPtr);
352  for (auto const& clusterHit : clusterHits) {
353  clusterHitAssn->addSingle(newClusterPtr, clusterHit);
354  }
355  }
356  }
357 
358  // Create new PFParticle Metadata objects and associations
359  if (fmPFPMeta.isValid()) {
360  const std::vector<art::Ptr<larpandoraobj::PFParticleMetadata>> pfpMetas = fmPFPMeta.at(pfp.key());
361  for (const art::Ptr<larpandoraobj::PFParticleMetadata>& pfpMeta : pfpMetas) {
362  larpandoraobj::PFParticleMetadata newPFPMeta(*pfpMeta);
363  pfpMetaCollection->push_back(newPFPMeta);
364  art::Ptr<larpandoraobj::PFParticleMetadata> newPFPMetaPtr = pfpMetaPtrMaker(pfpMetaCollection->size() - 1);
365  pfpMetaAssn->addSingle(newPFPPtr, newPFPMetaPtr);
366  }
367  }
368  } // slicePFPs
369  } // slice
370 
371  // std::cout<<"Test: SPs: "<<spCollection->size()<<std::endl;
372 
373  // Put all the things we just produced into the event
374  evt.put(std::move(t0Collection));
375  evt.put(std::move(sliceCollection));
376  evt.put(std::move(clusterCollection));
377  evt.put(std::move(pfpCollection));
378  evt.put(std::move(spCollection));
379  evt.put(std::move(vtxCollection));
380  evt.put(std::move(pfpMetaCollection));
381 
382  evt.put(std::move(t0PFPAssn));
383  // evt.put(std::move(t0SliceAssn));
384  evt.put(std::move(sliceHitAssn));
385  evt.put(std::move(pfpSPAssn));
386  evt.put(std::move(spHitAssn));
387  evt.put(std::move(pfpVtxAssn));
388  evt.put(std::move(pfpSliceAssn));
389  evt.put(std::move(pfpClusterAssn));
390  evt.put(std::move(clusterHitAssn));
391  evt.put(std::move(pfpMetaAssn));
392 }
393 
394 geo::Vector_t sce::SCECorrection::applyT0Shift(const double& t0Offset, const geo::TPCID& tpcId) const
395 {
396 
397  const geo::TPCGeo& tpcGeo = fGeom->GetElement(tpcId);
398  int driftDirection = tpcGeo.DetectDriftDirection();
399 
400  switch (std::abs(driftDirection)) {
401  case 1:
402  return geo::Vector_t { t0Offset * driftDirection, 0, 0 };
403  case 2:
404  return geo::Vector_t { 0, t0Offset * driftDirection, 0 };
405  case 3:
406  return geo::Vector_t { 0, 0, t0Offset * driftDirection };
407  default:
408  throw cet::exception("SCECorrection") << "Drift direction unknown: " << driftDirection
409  << std::endl;
410  }
411 }
412 
413 std::map<art::Ptr<anab::T0>, bool> sce::SCECorrection::getSliceT0s(
414  const art::Event& evt,
415  const std::vector<art::Ptr<recob::PFParticle>>& slicePFPs,
416  const art::Handle<std::vector<recob::PFParticle>>& pfpHandle,
417  const art::Handle<std::vector<recob::Track>>& trackHandle,
418  const art::FindManyP<recob::Track>& fmPFPTrack) const
419 {
420 
421  std::map<art::Ptr<anab::T0>, bool> pfpT0CorrectMap;
422  // Loop over all of the PFPs in the slice
423  for (auto const& pfp : slicePFPs) {
424 
425  // Loop over all of the T0 labels
426  // We will take the first label to have a T0, so the order matters
427  for (unsigned int i = 0; i < fT0Labels.size(); i++) {
428  std::string t0Label = fT0Labels.at(i);
429 
430  // Get the T0
431  art::FindManyP<anab::T0> fmPFPT0(pfpHandle, evt, t0Label);
432  if (fmPFPT0.isValid()) {
433  std::vector<art::Ptr<anab::T0>> pfpT0s = fmPFPT0.at(pfp.key());
434  if (pfpT0s.size() == 1) {
435  pfpT0CorrectMap[pfpT0s.front()] = fT0LabelsCorrectT0.at(i);
436  break;
437  }
438  }
439  // If not, Check the track associated to the PFP
440  if (!fmPFPTrack.isValid())
441  continue;
442  std::vector<art::Ptr<recob::Track>> pfpTracks = fmPFPTrack.at(pfp.key());
443  if (pfpTracks.size() != 1) {
444  continue;
445  }
446  art::Ptr<recob::Track> pfpTrack = pfpTracks.front();
447 
448  // Check if the track has a T0
449  art::FindManyP<anab::T0> fmTrackT0(trackHandle, evt, t0Label);
450  if (fmTrackT0.isValid()) {
451  std::vector<art::Ptr<anab::T0>> trackT0s = fmTrackT0.at(pfpTrack.key());
452  if (trackT0s.size() == 1) {
453  pfpT0CorrectMap[trackT0s.front()] = fT0LabelsCorrectT0.at(i);
454  break;
455  }
456  }
457  } // fT0Labels
458  } // slicePFPs
459  return pfpT0CorrectMap;
460 }
461 
462 std::pair<art::Ptr<anab::T0>, bool> sce::SCECorrection::getSliceBestT0(
463  const std::map<art::Ptr<anab::T0>, bool>& sliceT0CorrectMap) const
464 {
465 
466  if (!sliceT0CorrectMap.size()) {
467  return std::pair<art::Ptr<anab::T0>, bool>();
468  }
469 
470  double minT0 = std::numeric_limits<double>::max();
471  std::pair<art::Ptr<anab::T0>, bool> sliceT0CorrectPair;
472  for (auto const& sliceT0CorrectIter : sliceT0CorrectMap) {
473  double t0Time = abs(sliceT0CorrectIter.first->Time());
474  if (t0Time < minT0) {
475  minT0 = t0Time;
476  sliceT0CorrectPair = sliceT0CorrectIter;
477  }
478  }
479  return sliceT0CorrectPair;
480 }
481 
482 DEFINE_ART_MODULE(sce::SCECorrection)
ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< double >, ROOT::Math::GlobalCoordinateSystemTag > Vector_t
Type for representation of momenta in 3D space.
Definition: geo_vectors.h:164
SCECorrection(fhicl::ParameterSet const &p)
geo::GeometryCore const * fGeom
Utilities related to art service access.
Declaration of signal hit object.
geo::Vector_t applyT0Shift(const double &t0, const geo::TPCID &tpcId) const
pdgs p
Definition: selectors.fcl:22
Geometry information for a single TPC.
Definition: TPCGeo.h:38
Set of hits with a 2D structure.
Definition: Cluster.h:71
Definition of vertex object for LArSoft.
Definition: Vertex.h:35
void produce(art::Event &evt) override
spacecharge::SpaceCharge const * fSCE
auto vector(Vector const &v)
Returns a manipulator which will print the specified array.
Definition: DumpUtils.h:265
Access the description of detector geometry.
T abs(T value)
walls no front
Definition: selectors.fcl:105
std::map< art::Ptr< anab::T0 >, bool > getSliceT0s(const art::Event &evt, const std::vector< art::Ptr< recob::PFParticle >> &slicePFPs, const art::Handle< std::vector< recob::PFParticle >> &pfpHandle, const art::Handle< std::vector< recob::Track >> &trackHandle, const art::FindManyP< recob::Track > &fmPFPTrack) const
Metadata associated to PFParticles.
const std::string fPFPLabel
const std::vector< bool > fT0LabelsCorrectT0
std::pair< art::Ptr< anab::T0 >, bool > getSliceBestT0(const std::map< art::Ptr< anab::T0 >, bool > &sliceT0CorrectMap) const
The data type to uniquely identify a TPC.
Definition: geo_types.h:386
Description of geometry of one entire detector.
Declaration of cluster object.
Provides recob::Track data product.
constexpr TPCID const & asTPCID() const
Conversion to TPCID (for convenience of notation).
Definition: geo_types.h:446
const std::string fTrackLabel
Hierarchical representation of particle flow.
Definition: PFParticle.h:44
short int DetectDriftDirection() const
Returns the expected drift direction based on geometry.
Definition: TPCGeo.cxx:157
TCEvent evt
Definition: DataStructs.cxx:8
TPCID_t TPC
Index of the TPC within its cryostat.
Definition: geo_types.h:406
ROOT::Math::PositionVector3D< ROOT::Math::Cartesian3D< double >, ROOT::Math::GlobalCoordinateSystemTag > Point_t
Type for representation of position in physical 3D space.
Definition: geo_vectors.h:184
art framework interface to geometry description
auto const detProp
const std::vector< std::string > fT0Labels
SCECorrection & operator=(SCECorrection const &)=delete