LArSoft  v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
shwf::ShowerReco Class Reference
Inheritance diagram for shwf::ShowerReco:
art::EDProducer art::detail::Producer art::detail::LegacyModule art::Modifier art::ModuleBase art::ProductRegistryHelper

Public Types

using ModuleType = EDProducer
 
template<typename UserConfig , typename KeysToIgnore = void>
using Table = Modifier::Table< UserConfig, KeysToIgnore >
 

Public Member Functions

 ShowerReco (fhicl::ParameterSet const &pset)
 
void doBeginJob (SharedResources const &resources)
 
void doEndJob ()
 
void doRespondToOpenInputFile (FileBlock const &fb)
 
void doRespondToCloseInputFile (FileBlock const &fb)
 
void doRespondToOpenOutputFiles (FileBlock const &fb)
 
void doRespondToCloseOutputFiles (FileBlock const &fb)
 
bool doBeginRun (RunPrincipal &rp, ModuleContext const &mc)
 
bool doEndRun (RunPrincipal &rp, ModuleContext const &mc)
 
bool doBeginSubRun (SubRunPrincipal &srp, ModuleContext const &mc)
 
bool doEndSubRun (SubRunPrincipal &srp, ModuleContext const &mc)
 
bool doEvent (EventPrincipal &ep, ModuleContext const &mc, std::atomic< std::size_t > &counts_run, std::atomic< std::size_t > &counts_passed, std::atomic< std::size_t > &counts_failed)
 
void fillProductDescriptions ()
 
void registerProducts (ProductDescriptions &productsToRegister)
 
ModuleDescription const & moduleDescription () const
 
void setModuleDescription (ModuleDescription const &)
 
std::array< std::vector< ProductInfo >, NumBranchTypes > const & getConsumables () const
 
void sortConsumables (std::string const &current_process_name)
 
std::unique_ptr< Worker > makeWorker (WorkerParams const &wp)
 
template<typename T , BranchType BT>
ViewToken< T > consumesView (InputTag const &tag)
 
template<typename T , BranchType BT>
ViewToken< T > mayConsumeView (InputTag const &tag)
 

Protected Member Functions

ConsumesCollector & consumesCollector ()
 
template<typename T , BranchType = InEvent>
ProductToken< T > consumes (InputTag const &)
 
template<typename Element , BranchType = InEvent>
ViewToken< Element > consumesView (InputTag const &)
 
template<typename T , BranchType = InEvent>
void consumesMany ()
 
template<typename T , BranchType = InEvent>
ProductToken< T > mayConsume (InputTag const &)
 
template<typename Element , BranchType = InEvent>
ViewToken< Element > mayConsumeView (InputTag const &)
 
template<typename T , BranchType = InEvent>
void mayConsumeMany ()
 

Private Member Functions

void beginJob ()
 
void beginRun (art::Run &run)
 
void produce (art::Event &evt)
 
void GetVertexAndAnglesFromCluster (art::Ptr< recob::Cluster > clust, unsigned int plane)
 
void LongTransEnergy (geo::GeometryCore const *geom, detinfo::DetectorClocksData const &clockData, detinfo::DetectorPropertiesData const &detProp, unsigned int set, std::vector< art::Ptr< recob::Hit >> hitlist)
 
void ClearandResizeVectors (unsigned int nPlanes)
 

Private Attributes

int fRun
 
int fEvent
 
int fSubRun
 
float slope [3]
 
float angle [3]
 
std::string fClusterModuleLabel
 
float ftimetick
 
double fMean_wire_pitch
 
fhicl::ParameterSet fCaloPSet
 
std::vector< double > fRMS_2cm
 
std::vector< int > fNpoints_2cm
 
std::vector< double > fCorr_MeV_2cm
 
std::vector< double > fCorr_Charge_2cm
 
std::vector< int > fNpoints_corr_ADC_2cm
 
std::vector< int > fNpoints_corr_MeV_2cm
 
std::vector< double > fTotChargeADC
 
std::vector< double > fTotChargeMeV
 
std::vector< double > fTotChargeMeV_MIPs
 
std::vector< double > fChargeADC_2cm
 
std::vector< double > fChargeMeV_2cm
 
std::vector< double > fChargeMeV_2cm_refined
 
std::vector< double > fChargeMeV_2cm_axsum
 
std::vector< std::vector< double > > fDistribChargeADC
 
std::vector< std::vector< double > > fDistribChargeMeV
 
std::vector< std::vector< double > > fDistribHalfChargeMeV
 
std::vector< std::vector< double > > fDistribChargeposition
 
std::vector< std::vector< double > > fSingleEvtAngle
 
std::vector< std::vector< double > > fSingleEvtAngleVal
 
std::vector< unsigned int > fWire_vertex
 
std::vector< double > fTime_vertex
 
std::vector< double > fWire_vertexError
 
std::vector< double > fTime_vertexError
 
std::vector< unsigned int > fWire_last
 
std::vector< double > fTime_last
 
std::vector< double > xyz_vertex_fit
 
std::vector< std::vector< double > > fNPitch
 
float Kin_En
 
std::vector< float > vdEdx
 
std::vector< float > vresRange
 
std::vector< float > vdQdx
 
std::vector< float > deadwire
 
float Trk_Length
 
float fTrkPitchC
 
float fdEdxlength
 
float fcalodEdxlength
 
bool fUseArea
 
double xphi
 
double xtheta
 
unsigned int fNPlanes
 
unsigned int fNAngles
 
TTree * ftree_shwf
 
double fWirePitch
 
double fTimeTick
 
double fDriftVelocity
 
double fWireTimetoCmCm
 
std::vector< int > fNhitsperplane
 
std::vector< double > fTotADCperplane
 

Detailed Description

Definition at line 60 of file ShowerReco_module.cc.

Member Typedef Documentation

Definition at line 17 of file EDProducer.h.

template<typename UserConfig , typename KeysToIgnore = void>
using art::detail::Producer::Table = Modifier::Table<UserConfig, KeysToIgnore>
inherited

Definition at line 26 of file Producer.h.

Constructor & Destructor Documentation

shwf::ShowerReco::ShowerReco ( fhicl::ParameterSet const &  pset)
explicit

Definition at line 164 of file ShowerReco_module.cc.

References fcalodEdxlength, fCaloPSet, fClusterModuleLabel, fdEdxlength, fUseArea, and fhicl::ParameterSet::get().

164  : EDProducer{pset}
165  {
166  fClusterModuleLabel = pset.get<std::string>("ClusterModuleLabel");
167  fCaloPSet = pset.get<fhicl::ParameterSet>("CaloAlg");
168 
169  fdEdxlength =
170  pset.get<double>("dEdxlength"); // distance that gets used to determine e/gamma separation
172  pset.get<double>("calodEdxlength"); // cutoff distance for hits saved to the calo object.
173  fUseArea = pset.get<bool>("UseArea");
174 
175  produces<std::vector<recob::Shower>>();
176  produces<art::Assns<recob::Shower, recob::Cluster>>();
177  produces<art::Assns<recob::Shower, recob::Hit>>();
178  produces<std::vector<anab::Calorimetry>>();
179  produces<art::Assns<recob::Shower, anab::Calorimetry>>();
180  }
fhicl::ParameterSet fCaloPSet
EDProducer(fhicl::ParameterSet const &pset)
Definition: EDProducer.cc:6
T get(std::string const &key) const
Definition: ParameterSet.h:314
std::string fClusterModuleLabel

Member Function Documentation

void shwf::ShowerReco::beginJob ( )
privatevirtual
Todo:
the call to geo->Nplanes() assumes this is a single cryostat and single TPC detector; need to generalize to multiple cryostats and TPCs

Get TFileService and define output Histograms

All-knowing tree with reconstruction information

Reimplemented from art::EDProducer.

Definition at line 183 of file ShowerReco_module.cc.

References fChargeADC_2cm, fChargeMeV_2cm, fChargeMeV_2cm_axsum, fChargeMeV_2cm_refined, fDistribChargeADC, fDistribChargeMeV, fDistribChargeposition, fDistribHalfChargeMeV, fEvent, fMean_wire_pitch, fNAngles, fNhitsperplane, fNPitch, fNPlanes, fNpoints_2cm, fRMS_2cm, fRun, fSubRun, ftimetick, fTotADCperplane, fTotChargeADC, fTotChargeMeV, fTotChargeMeV_MIPs, ftree_shwf, geo::GeometryCore::Nplanes(), detinfo::sampling_rate(), geo::GeometryCore::WirePitch(), xphi, xtheta, and xyz_vertex_fit.

184  {
186 
190  fNPlanes = geo->Nplanes();
191  fMean_wire_pitch = geo->WirePitch(); // wire pitch in cm
192 
193  auto const clockData = art::ServiceHandle<detinfo::DetectorClocksService const>()->DataForJob();
194  ftimetick = sampling_rate(clockData) / 1000.;
195 
198 
199  ftree_shwf = tfs->make<TTree>("ShowerReco",
200  "Results");
201  ftree_shwf->Branch("run", &fRun, "run/I");
202  ftree_shwf->Branch("subrun", &fSubRun, "subrun/I");
203  ftree_shwf->Branch("event", &fEvent, "event/I");
204  ftree_shwf->Branch("nplanes", &fNPlanes, "nplanes/I");
205  ftree_shwf->Branch("nangles", &fNAngles, "nangles/I");
206  ftree_shwf->Branch("xtheta", &xtheta, "xtheta/D");
207  ftree_shwf->Branch("xphi", &xphi, "xphi/D");
208  ftree_shwf->Branch("ftotChargeADC", "std::vector<double>", &fTotChargeADC);
209  ftree_shwf->Branch("ftotChargeMeV", "std::vector<double>", &fTotChargeMeV);
210  ftree_shwf->Branch("fTotChargeMeV_MIPs", "std::vector<double>", &fTotChargeMeV_MIPs);
211  ftree_shwf->Branch("NPitch", "std::vector< std::vector<double> >", &fNPitch);
212 
213  // this should be temporary - until the omega is sorted out.
214  ftree_shwf->Branch("RMS_2cm", "std::vector<double>", &fRMS_2cm);
215  ftree_shwf->Branch("Npoints_2cm", "std::vector<int>", &fNpoints_2cm);
216  ftree_shwf->Branch("ChargeADC_2cm", "std::vector<double>", &fChargeADC_2cm);
217  ftree_shwf->Branch("ChargeMeV_2cm", "std::vector<double>", &fChargeMeV_2cm);
218  ftree_shwf->Branch("ChargeMeV_2cm_refined", "std::vector<double>", &fChargeMeV_2cm_refined);
219  ftree_shwf->Branch("ChargeMeV_2cm_axsum", "std::vector<double>", &fChargeMeV_2cm_axsum);
220  ftree_shwf->Branch("fNhitsperplane", "std::vector<int>", &fNhitsperplane);
221  ftree_shwf->Branch("fTotADCperplane", "std::vector<double>", &fTotADCperplane);
222  ftree_shwf->Branch(
223  "ChargedistributionADC", "std::vector<std::vector<double>>", &fDistribChargeADC);
224  ftree_shwf->Branch(
225  "ChargedistributionMeV", "std::vector<std::vector<double>>", &fDistribChargeMeV);
226  ftree_shwf->Branch(
227  "DistribHalfChargeMeV", "std::vector<std::vector<double>>", &fDistribHalfChargeMeV);
228  ftree_shwf->Branch(
229  "ChargedistributionPosition", "std::vector<std::vector<double>>", &fDistribChargeposition);
230  ftree_shwf->Branch("xyz_vertex_fit", "std::vector<double>", &xyz_vertex_fit);
231  }
std::vector< double > fTotChargeADC
std::vector< int > fNhitsperplane
std::vector< std::vector< double > > fNPitch
std::vector< std::vector< double > > fDistribChargeMeV
std::vector< double > fTotADCperplane
std::vector< std::vector< double > > fDistribHalfChargeMeV
std::vector< double > fChargeMeV_2cm_refined
std::vector< int > fNpoints_2cm
std::vector< double > fRMS_2cm
std::vector< double > xyz_vertex_fit
std::vector< double > fChargeMeV_2cm
std::vector< double > fTotChargeMeV_MIPs
std::vector< double > fChargeADC_2cm
std::vector< std::vector< double > > fDistribChargeADC
unsigned int Nplanes(TPCID const &tpcid=tpc_zero) const
Returns the total number of planes in the specified TPC.
Definition: GeometryCore.h:977
std::vector< double > fChargeMeV_2cm_axsum
double sampling_rate(DetectorClocksData const &data)
Returns the period of the TPC readout electronics clock.
Namespace collecting geometry-related classes utilities.
std::vector< std::vector< double > > fDistribChargeposition
Length_t WirePitch(PlaneID const &planeid=plane_zero) const
Returns the distance between two consecutive wires.
std::vector< double > fTotChargeMeV
void shwf::ShowerReco::beginRun ( art::Run run)
privatevirtual

Reimplemented from art::EDProducer.

Definition at line 233 of file ShowerReco_module.cc.

References fChargeADC_2cm, fChargeMeV_2cm, fChargeMeV_2cm_axsum, fChargeMeV_2cm_refined, fCorr_Charge_2cm, fCorr_MeV_2cm, fDistribChargeADC, fDistribChargeMeV, fDistribChargeposition, fDistribHalfChargeMeV, fDriftVelocity, fNAngles, fNhitsperplane, fNPitch, fNPlanes, fNpoints_2cm, fNpoints_corr_ADC_2cm, fNpoints_corr_MeV_2cm, fRMS_2cm, fTime_last, fTime_vertex, fTime_vertexError, fTimeTick, fTotADCperplane, fTotChargeADC, fTotChargeMeV, fTotChargeMeV_MIPs, fWire_last, fWire_vertex, fWire_vertexError, fWirePitch, fWireTimetoCmCm, detinfo::sampling_rate(), vdEdx, vdQdx, vresRange, and xyz_vertex_fit.

234  {
235  auto const* geom = lar::providerFrom<geo::Geometry>();
236  auto const clockData = art::ServiceHandle<detinfo::DetectorClocksService const>()->DataForJob();
237  auto const detProp =
239 
240  fWirePitch = geom->WirePitch(); // wire pitch in cm
241  fTimeTick = sampling_rate(clockData) / 1000.;
242  fDriftVelocity = detProp.DriftVelocity(detProp.Efield(), detProp.Temperature());
244  }
double sampling_rate(DetectorClocksData const &data)
Returns the period of the TPC readout electronics clock.
void shwf::ShowerReco::ClearandResizeVectors ( unsigned int  nPlanes)
private

Referenced by produce().

template<typename T , BranchType BT>
ProductToken< T > art::ModuleBase::consumes ( InputTag const &  tag)
protectedinherited

Definition at line 61 of file ModuleBase.h.

References art::ModuleBase::collector_, and art::ConsumesCollector::consumes().

62  {
63  return collector_.consumes<T, BT>(tag);
64  }
ConsumesCollector collector_
Definition: ModuleBase.h:56
ProductToken< T > consumes(InputTag const &)
ConsumesCollector & art::ModuleBase::consumesCollector ( )
protectedinherited

Definition at line 57 of file ModuleBase.cc.

References art::ModuleBase::collector_.

58  {
59  return collector_;
60  }
ConsumesCollector collector_
Definition: ModuleBase.h:56
template<typename T , BranchType BT>
void art::ModuleBase::consumesMany ( )
protectedinherited

Definition at line 75 of file ModuleBase.h.

References art::ModuleBase::collector_, and art::ConsumesCollector::consumesMany().

76  {
77  collector_.consumesMany<T, BT>();
78  }
ConsumesCollector collector_
Definition: ModuleBase.h:56
template<typename Element , BranchType = InEvent>
ViewToken<Element> art::ModuleBase::consumesView ( InputTag const &  )
protectedinherited
template<typename T , BranchType BT>
ViewToken<T> art::ModuleBase::consumesView ( InputTag const &  tag)
inherited

Definition at line 68 of file ModuleBase.h.

References art::ModuleBase::collector_, and art::ConsumesCollector::consumesView().

69  {
70  return collector_.consumesView<T, BT>(tag);
71  }
ConsumesCollector collector_
Definition: ModuleBase.h:56
ViewToken< Element > consumesView(InputTag const &)
void art::detail::Producer::doBeginJob ( SharedResources const &  resources)
inherited

Definition at line 22 of file Producer.cc.

References art::detail::Producer::beginJobWithFrame(), and art::detail::Producer::setupQueues().

23  {
24  setupQueues(resources);
25  ProcessingFrame const frame{ScheduleID{}};
26  beginJobWithFrame(frame);
27  }
virtual void setupQueues(SharedResources const &)=0
virtual void beginJobWithFrame(ProcessingFrame const &)=0
bool art::detail::Producer::doBeginRun ( RunPrincipal rp,
ModuleContext const &  mc 
)
inherited

Definition at line 65 of file Producer.cc.

References art::detail::Producer::beginRunWithFrame(), art::RangeSet::forRun(), art::RunPrincipal::makeRun(), r, art::RunPrincipal::runID(), and art::ModuleContext::scheduleID().

66  {
67  auto r = rp.makeRun(mc, RangeSet::forRun(rp.runID()));
68  ProcessingFrame const frame{mc.scheduleID()};
69  beginRunWithFrame(r, frame);
70  r.commitProducts();
71  return true;
72  }
TRandom r
Definition: spectrum.C:23
virtual void beginRunWithFrame(Run &, ProcessingFrame const &)=0
static RangeSet forRun(RunID)
Definition: RangeSet.cc:51
bool art::detail::Producer::doBeginSubRun ( SubRunPrincipal srp,
ModuleContext const &  mc 
)
inherited

Definition at line 85 of file Producer.cc.

References art::detail::Producer::beginSubRunWithFrame(), art::RangeSet::forSubRun(), art::SubRunPrincipal::makeSubRun(), art::ModuleContext::scheduleID(), and art::SubRunPrincipal::subRunID().

86  {
87  auto sr = srp.makeSubRun(mc, RangeSet::forSubRun(srp.subRunID()));
88  ProcessingFrame const frame{mc.scheduleID()};
89  beginSubRunWithFrame(sr, frame);
90  sr.commitProducts();
91  return true;
92  }
virtual void beginSubRunWithFrame(SubRun &, ProcessingFrame const &)=0
static RangeSet forSubRun(SubRunID)
Definition: RangeSet.cc:57
void art::detail::Producer::doEndJob ( )
inherited

Definition at line 30 of file Producer.cc.

References art::detail::Producer::endJobWithFrame().

31  {
32  ProcessingFrame const frame{ScheduleID{}};
33  endJobWithFrame(frame);
34  }
virtual void endJobWithFrame(ProcessingFrame const &)=0
bool art::detail::Producer::doEndRun ( RunPrincipal rp,
ModuleContext const &  mc 
)
inherited

Definition at line 75 of file Producer.cc.

References art::detail::Producer::endRunWithFrame(), art::RunPrincipal::makeRun(), r, art::ModuleContext::scheduleID(), and art::Principal::seenRanges().

76  {
77  auto r = rp.makeRun(mc, rp.seenRanges());
78  ProcessingFrame const frame{mc.scheduleID()};
79  endRunWithFrame(r, frame);
80  r.commitProducts();
81  return true;
82  }
TRandom r
Definition: spectrum.C:23
virtual void endRunWithFrame(Run &, ProcessingFrame const &)=0
bool art::detail::Producer::doEndSubRun ( SubRunPrincipal srp,
ModuleContext const &  mc 
)
inherited

Definition at line 95 of file Producer.cc.

References art::detail::Producer::endSubRunWithFrame(), art::SubRunPrincipal::makeSubRun(), art::ModuleContext::scheduleID(), and art::Principal::seenRanges().

96  {
97  auto sr = srp.makeSubRun(mc, srp.seenRanges());
98  ProcessingFrame const frame{mc.scheduleID()};
99  endSubRunWithFrame(sr, frame);
100  sr.commitProducts();
101  return true;
102  }
virtual void endSubRunWithFrame(SubRun &, ProcessingFrame const &)=0
bool art::detail::Producer::doEvent ( EventPrincipal ep,
ModuleContext const &  mc,
std::atomic< std::size_t > &  counts_run,
std::atomic< std::size_t > &  counts_passed,
std::atomic< std::size_t > &  counts_failed 
)
inherited

Definition at line 105 of file Producer.cc.

References art::detail::Producer::checkPutProducts_, e, art::EventPrincipal::makeEvent(), art::detail::Producer::produceWithFrame(), and art::ModuleContext::scheduleID().

110  {
111  auto e = ep.makeEvent(mc);
112  ++counts_run;
113  ProcessingFrame const frame{mc.scheduleID()};
114  produceWithFrame(e, frame);
115  e.commitProducts(checkPutProducts_, &expectedProducts<InEvent>());
116  ++counts_passed;
117  return true;
118  }
bool const checkPutProducts_
Definition: Producer.h:70
Float_t e
Definition: plot.C:35
virtual void produceWithFrame(Event &, ProcessingFrame const &)=0
void art::detail::Producer::doRespondToCloseInputFile ( FileBlock const &  fb)
inherited

Definition at line 44 of file Producer.cc.

References art::detail::Producer::respondToCloseInputFileWithFrame().

45  {
46  ProcessingFrame const frame{ScheduleID{}};
48  }
virtual void respondToCloseInputFileWithFrame(FileBlock const &, ProcessingFrame const &)=0
TFile fb("Li6.root")
void art::detail::Producer::doRespondToCloseOutputFiles ( FileBlock const &  fb)
inherited

Definition at line 58 of file Producer.cc.

References art::detail::Producer::respondToCloseOutputFilesWithFrame().

59  {
60  ProcessingFrame const frame{ScheduleID{}};
62  }
virtual void respondToCloseOutputFilesWithFrame(FileBlock const &, ProcessingFrame const &)=0
TFile fb("Li6.root")
void art::detail::Producer::doRespondToOpenInputFile ( FileBlock const &  fb)
inherited

Definition at line 37 of file Producer.cc.

References art::detail::Producer::respondToOpenInputFileWithFrame().

38  {
39  ProcessingFrame const frame{ScheduleID{}};
41  }
virtual void respondToOpenInputFileWithFrame(FileBlock const &, ProcessingFrame const &)=0
TFile fb("Li6.root")
void art::detail::Producer::doRespondToOpenOutputFiles ( FileBlock const &  fb)
inherited

Definition at line 51 of file Producer.cc.

References art::detail::Producer::respondToOpenOutputFilesWithFrame().

52  {
53  ProcessingFrame const frame{ScheduleID{}};
55  }
virtual void respondToOpenOutputFilesWithFrame(FileBlock const &, ProcessingFrame const &)=0
TFile fb("Li6.root")
void art::Modifier::fillProductDescriptions ( )
inherited

Definition at line 10 of file Modifier.cc.

References art::ProductRegistryHelper::fillDescriptions(), and art::ModuleBase::moduleDescription().

11  {
13  }
void fillDescriptions(ModuleDescription const &md)
ModuleDescription const & moduleDescription() const
Definition: ModuleBase.cc:13
std::array< std::vector< ProductInfo >, NumBranchTypes > const & art::ModuleBase::getConsumables ( ) const
inherited

Definition at line 43 of file ModuleBase.cc.

References art::ModuleBase::collector_, and art::ConsumesCollector::getConsumables().

44  {
45  return collector_.getConsumables();
46  }
ConsumesCollector collector_
Definition: ModuleBase.h:56
std::array< std::vector< ProductInfo >, NumBranchTypes > const & getConsumables() const
void shwf::ShowerReco::GetVertexAndAnglesFromCluster ( art::Ptr< recob::Cluster clust,
unsigned int  plane 
)
private

Actual routine that reconstruct the shower

Definition at line 801 of file ShowerReco_module.cc.

References angle, DEFINE_ART_MODULE, recob::Cluster::EndTick(), recob::Cluster::EndWire(), fTime_last, fTime_vertex, fTime_vertexError, fWire_last, fWire_vertex, fWire_vertexError, recob::Cluster::SigmaStartTick(), recob::Cluster::SigmaStartWire(), slope, recob::Cluster::StartAngle(), recob::Cluster::StartTick(), and recob::Cluster::StartWire().

Referenced by produce().

803  {
804  // convert to cm/cm units needed in the calculation
805  angle[plane] = clust->StartAngle();
806  slope[plane] = std::tan(clust->StartAngle());
807  fWire_vertex[plane] = clust->StartWire();
808  fTime_vertex[plane] = clust->StartTick();
809 
810  fWire_vertexError[plane] = clust->SigmaStartWire(); // wire coordinate of vertex for each plane
811  fTime_vertexError[plane] = clust->SigmaStartTick(); // time coordinate of vertex for each plane
812 
813  fWire_last[plane] = clust->EndWire(); // wire coordinate of last point for each plane
814  fTime_last[plane] = clust->EndTick();
815  }
std::vector< double > fTime_last
std::vector< double > fWire_vertexError
float StartWire() const
Returns the wire coordinate of the start of the cluster.
Definition: Cluster.h:276
std::vector< double > fTime_vertex
float EndTick() const
Returns the tick coordinate of the end of the cluster.
Definition: Cluster.h:331
std::vector< unsigned int > fWire_last
float StartAngle() const
Returns the starting angle of the cluster.
Definition: Cluster.h:461
std::vector< double > fTime_vertexError
float SigmaStartWire() const
Returns the uncertainty on wire coordinate of the start of the cluster.
Definition: Cluster.h:296
float SigmaStartTick() const
Returns the uncertainty on tick coordinate of the start of the cluster.
Definition: Cluster.h:305
float StartTick() const
Returns the tick coordinate of the start of the cluster.
Definition: Cluster.h:287
std::vector< unsigned int > fWire_vertex
float EndWire() const
Returns the wire coordinate of the end of the cluster.
Definition: Cluster.h:318
void shwf::ShowerReco::LongTransEnergy ( geo::GeometryCore const *  geom,
detinfo::DetectorClocksData const &  clockData,
detinfo::DetectorPropertiesData const &  detProp,
unsigned int  set,
std::vector< art::Ptr< recob::Hit >>  hitlist 
)
private

third loop to get only points inside of 1RMS of value.

Definition at line 603 of file ShowerReco_module.cc.

References tca::dEdx(), calo::CalorimetryAlg::dEdx_AMP(), calo::CalorimetryAlg::dEdx_AREA(), fcalodEdxlength, fCaloPSet, fChargeMeV_2cm, fChargeMeV_2cm_refined, fCorr_MeV_2cm, fdEdxlength, fDistribChargeMeV, fDistribChargeposition, fNPitch, fNPlanes, fNpoints_2cm, fNpoints_corr_MeV_2cm, fRMS_2cm, fTime_vertex, fTotChargeADC, fTotChargeMeV, fTrkPitchC, fUseArea, fWire_vertex, fWireTimetoCmCm, geo::kCollection, Kin_En, geo::kMysteryType, geo::GeometryCore::SignalType(), slope, lar::to_element, Trk_Length, vdEdx, vdQdx, vresRange, xphi, and xtheta.

Referenced by produce().

608  {
609  // alogorithm for energy vs dx of the shower (roto-translation) COLLECTION
610  // VIEW
611 
613 
614  double totCnrg = 0,
615  totCnrg_corr = 0; // tot enegry of the shower in collection
616 
617  double time;
618  unsigned int wire = 0, plane = fNPlanes - 1;
619 
620  double mevav2cm = 0.;
621  double npoints_calo = 0;
622 
623  int direction = -1;
624 
625  //override direction if phi (XZ angle) is less than 90 degrees
626  if (fabs(xphi) < 90) direction = 1;
627 
628  //variables to check whether a hit is close to the shower axis.
629  double ortdist, linedist;
630  double wire_on_line, time_on_line;
631 
632  //get effective pitch using 3D angles
633  util::GeometryUtilities const gser{*geom, clockData, detProp};
634  double newpitch = gser.PitchInView(plane, xphi, xtheta);
635 
636  using lar::to_element;
637  using ranges::views::transform;
638  for (auto const& hit : hitlist | transform(to_element)) {
639  time = hit.PeakTime();
640  wire = hit.WireID().Wire;
641  plane = hit.WireID().Plane;
642 
643  double dEdx_new;
644 
645  if (fUseArea) { dEdx_new = calalg.dEdx_AREA(clockData, detProp, hit, newpitch); }
646  else // this will hopefully go away, once all of the calibration factors
647  // are calculated.
648  {
649  dEdx_new = calalg.dEdx_AMP(clockData, detProp, hit, newpitch);
650  }
651 
652  //calculate total energy.
653  totCnrg_corr += dEdx_new;
654 
655  // calculate the wire,time coordinates of the hit projection on to the 2D shower axis
656  gser.GetPointOnLine(slope[plane] / fWireTimetoCmCm,
657  fWire_vertex[plane],
658  fTime_vertex[plane],
659  wire,
660  time,
661  wire_on_line,
662  time_on_line);
663  linedist =
664  gser.Get2DDistance(wire_on_line, time_on_line, fWire_vertex[plane], fTime_vertex[plane]);
665  ortdist = gser.Get2DDistance(wire_on_line, time_on_line, wire, time);
666 
667  //calculate the distance from the vertex using the effective pitch metric
668  double wdist = (((double)wire - (double)fWire_vertex[plane]) * newpitch) *
669  direction; //wdist is always positive
670 
671  if ((wdist < fcalodEdxlength) && (wdist > 0.2)) {
672 
673  vdEdx.push_back(dEdx_new);
674  vresRange.push_back(fabs(wdist));
675  vdQdx.push_back(hit.PeakAmplitude() / newpitch);
676  Trk_Length = wdist;
677  fTrkPitchC = fNPitch[set][plane];
678  Kin_En += dEdx_new * newpitch;
679  npoints_calo++;
680 
681  if (wdist < fdEdxlength &&
682  ((direction == 1 && wire > fWire_vertex[plane]) // take no hits before vertex
683  // (depending on direction)
684  || (direction == -1 && wire < fWire_vertex[plane])) &&
685  ortdist < 4.5 && linedist < fdEdxlength) {
686  fChargeMeV_2cm[set] += dEdx_new;
687  fNpoints_2cm[set]++;
688  }
689 
690  // fill out for 4cm preshower
691 
692  fDistribChargeMeV[set].push_back(dEdx_new); // vector with the first De/Dx points
693  fDistribChargeposition[set].push_back(
694  wdist); // vector with the first De/Dx points' positions
695 
696  } // end inside range if statement
697 
698  } // end first loop on hits.
699 
700  auto const signalType =
701  hitlist.empty() ? geo::kMysteryType : geom->SignalType(hitlist.front()->WireID());
702 
703  if (signalType == geo::kCollection) {
704  fTotChargeADC[set] = totCnrg * newpitch;
705  fTotChargeMeV[set] = totCnrg_corr * newpitch;
706  }
707 
708  // calculate average dE/dx
709  if (fNpoints_2cm[set] > 0) { mevav2cm = fChargeMeV_2cm[set] / fNpoints_2cm[set]; }
710 
711  // second loop to calculate RMS
712  for (auto const& hit : hitlist | transform(to_element)) {
713  time = hit.PeakTime();
714  wire = hit.WireID().Wire;
715  plane = hit.WireID().Plane;
716  double dEdx = 0;
717 
718  if (fUseArea) { dEdx = calalg.dEdx_AREA(clockData, detProp, hit, newpitch); }
719  else // this will hopefully go away, once all of the calibration factors
720  // are calculated.
721  {
722  dEdx = calalg.dEdx_AMP(clockData, detProp, hit, newpitch);
723  }
724 
725  gser.GetPointOnLine(slope[plane] / fWireTimetoCmCm,
726  fWire_vertex[plane],
727  fTime_vertex[plane],
728  wire,
729  time,
730  wire_on_line,
731  time_on_line);
732  linedist =
733  gser.Get2DDistance(wire_on_line, time_on_line, fWire_vertex[plane], fTime_vertex[plane]);
734  ortdist = gser.Get2DDistance(wire_on_line, time_on_line, wire, time);
735 
736  double wdist = (((double)wire - (double)fWire_vertex[plane]) * newpitch) * direction;
737 
738  if ((wdist < fcalodEdxlength) && (wdist > 0.2)) {
739  if (wdist < fdEdxlength &&
740  ((direction == 1 && wire > fWire_vertex[plane]) ||
741  (direction == -1 && wire < fWire_vertex[plane])) &&
742  ortdist < 4.5 && linedist < fdEdxlength) {
743  fRMS_2cm[set] += (dEdx - mevav2cm) * (dEdx - mevav2cm);
744  }
745 
746  } // end if on correct hits.
747  } // end RMS_calculating loop.
748 
749  if (fNpoints_2cm[set] > 0) { fRMS_2cm[set] = TMath::Sqrt(fRMS_2cm[set] / fNpoints_2cm[set]); }
750 
752 
753  for (auto const& hit : hitlist | transform(to_element)) {
754  time = hit.PeakTime();
755  wire = hit.WireID().Wire;
756  plane = hit.WireID().Plane;
757 
758  double dEdx = 0;
759  if (fUseArea) { dEdx = calalg.dEdx_AREA(clockData, detProp, hit, newpitch); }
760  else // this will hopefully go away, once all of the calibration factors
761  // are calculated.
762  {
763  dEdx = calalg.dEdx_AMP(clockData, detProp, hit, newpitch);
764  }
765 
766  gser.GetPointOnLine(slope[plane] / fWireTimetoCmCm,
767  fWire_vertex[plane],
768  fTime_vertex[plane],
769  wire,
770  time,
771  wire_on_line,
772  time_on_line);
773  linedist =
774  gser.Get2DDistance(wire_on_line, time_on_line, fWire_vertex[plane], fTime_vertex[plane]);
775  ortdist = gser.Get2DDistance(wire_on_line, time_on_line, wire, time);
776 
777  double wdist = (((double)wire - (double)fWire_vertex[plane]) * newpitch) * direction;
778 
779  if ((wdist < fcalodEdxlength) && (wdist > 0.2 &&
780  ((direction == 1 && wire > fWire_vertex[plane]) ||
781  (direction == -1 && wire < fWire_vertex[plane])) &&
782  ortdist < 4.5 && linedist < fdEdxlength)) {
783  if (wdist < fdEdxlength) {
784  if (((dEdx > (mevav2cm - fRMS_2cm[set])) && (dEdx < (mevav2cm + fRMS_2cm[set]))) ||
785  (newpitch > 0.3 * fdEdxlength)) {
786  fCorr_MeV_2cm[set] += dEdx;
787  fNpoints_corr_MeV_2cm[set]++;
788  }
789 
790  } // end if on good hits
791  }
792  } // end of third loop on hits
793 
794  if (fNpoints_corr_MeV_2cm[set] > 0) {
797  }
798  }
fhicl::ParameterSet fCaloPSet
std::vector< double > fTotChargeADC
constexpr to_element_t to_element
Definition: ToElement.h:25
Who knows?
Definition: geo_types.h:153
double PitchInView(unsigned int plane, double phi, double theta) const
std::vector< std::vector< double > > fNPitch
std::vector< std::vector< double > > fDistribChargeMeV
std::vector< int > fNpoints_corr_MeV_2cm
std::vector< double > fTime_vertex
std::vector< double > fChargeMeV_2cm_refined
std::vector< float > vdEdx
std::vector< float > vdQdx
std::vector< int > fNpoints_2cm
std::vector< float > vresRange
std::vector< double > fRMS_2cm
float dEdx(detinfo::DetectorClocksData const &clockData, detinfo::DetectorPropertiesData const &detProp, const TCSlice &slc, TP3D &tp3d)
Definition: PFPUtils.cxx:2675
Detector simulation of raw signals on wires.
std::vector< double > fCorr_MeV_2cm
std::vector< double > fChargeMeV_2cm
std::vector< std::vector< double > > fDistribChargeposition
std::vector< unsigned int > fWire_vertex
std::vector< double > fTotChargeMeV
Signal from collection planes.
Definition: geo_types.h:152
std::unique_ptr< Worker > art::ModuleBase::makeWorker ( WorkerParams const &  wp)
inherited

Definition at line 37 of file ModuleBase.cc.

References art::ModuleBase::doMakeWorker(), and art::NumBranchTypes.

38  {
39  return doMakeWorker(wp);
40  }
virtual std::unique_ptr< Worker > doMakeWorker(WorkerParams const &wp)=0
template<typename T , BranchType BT>
ProductToken< T > art::ModuleBase::mayConsume ( InputTag const &  tag)
protectedinherited

Definition at line 82 of file ModuleBase.h.

References art::ModuleBase::collector_, and art::ConsumesCollector::mayConsume().

83  {
84  return collector_.mayConsume<T, BT>(tag);
85  }
ProductToken< T > mayConsume(InputTag const &)
ConsumesCollector collector_
Definition: ModuleBase.h:56
template<typename T , BranchType BT>
void art::ModuleBase::mayConsumeMany ( )
protectedinherited

Definition at line 96 of file ModuleBase.h.

References art::ModuleBase::collector_, and art::ConsumesCollector::mayConsumeMany().

97  {
98  collector_.mayConsumeMany<T, BT>();
99  }
ConsumesCollector collector_
Definition: ModuleBase.h:56
template<typename Element , BranchType = InEvent>
ViewToken<Element> art::ModuleBase::mayConsumeView ( InputTag const &  )
protectedinherited
template<typename T , BranchType BT>
ViewToken<T> art::ModuleBase::mayConsumeView ( InputTag const &  tag)
inherited

Definition at line 89 of file ModuleBase.h.

References art::ModuleBase::collector_, and art::ConsumesCollector::mayConsumeView().

90  {
91  return collector_.mayConsumeView<T, BT>(tag);
92  }
ConsumesCollector collector_
Definition: ModuleBase.h:56
ViewToken< Element > mayConsumeView(InputTag const &)
ModuleDescription const & art::ModuleBase::moduleDescription ( ) const
inherited

Definition at line 13 of file ModuleBase.cc.

References art::errors::LogicError.

Referenced by art::OutputModule::doRespondToOpenInputFile(), art::OutputModule::doWriteEvent(), art::Modifier::fillProductDescriptions(), art::OutputModule::makePlugins_(), art::OutputWorker::OutputWorker(), reco::shower::LArPandoraModularShowerCreation::produce(), art::Modifier::registerProducts(), and art::OutputModule::registerProducts().

14  {
15  if (md_.has_value()) {
16  return *md_;
17  }
18 
20  "There was an error while calling moduleDescription().\n"}
21  << "The moduleDescription() base-class member function cannot be called\n"
22  "during module construction. To determine which module is "
23  "responsible\n"
24  "for calling it, find the '<module type>:<module "
25  "label>@Construction'\n"
26  "tag in the message prefix above. Please contact artists@fnal.gov\n"
27  "for guidance.\n";
28  }
cet::coded_exception< errors::ErrorCodes, ExceptionDetail::translate > Exception
Definition: Exception.h:66
std::optional< ModuleDescription > md_
Definition: ModuleBase.h:55
void shwf::ShowerReco::produce ( art::Event evt)
privatevirtual

Get Clusters

Todo:
really need to determine the values of the arguments of the recob::Shower ctor

Implements art::EDProducer.

Definition at line 350 of file ShowerReco_module.cc.

References angle, ClearandResizeVectors(), util::CreateAssn(), deadwire, e, art::EventID::event(), fChargeADC_2cm, fChargeMeV_2cm, fClusterModuleLabel, fCorr_Charge_2cm, fCorr_MeV_2cm, fDriftVelocity, fEvent, fNAngles, fNhitsperplane, fNPlanes, fNpoints_2cm, fNpoints_corr_ADC_2cm, fNpoints_corr_MeV_2cm, fRMS_2cm, fRun, fSubRun, fTime_vertex, fTime_vertexError, fTimeTick, fTotADCperplane, fTotChargeADC, fTotChargeMeV, fTotChargeMeV_MIPs, ftree_shwf, fTrkPitchC, fWire_last, fWire_vertex, fWire_vertexError, art::ProductRetriever::getByLabel(), art::ProductRetriever::getProductID(), GetVertexAndAnglesFromCluster(), hits(), art::Event::id(), util::kBogusD, art::Ptr< T >::key(), Kin_En, LongTransEnergy(), geo::PlaneID::Plane, art::ProductRetriever::productGetter(), art::PtrVector< T >::push_back(), art::Event::put(), art::EventID::run(), detinfo::sampling_rate(), recob::Shower::set_direction(), recob::Shower::set_direction_err(), art::PtrVector< T >::size(), art::EventID::subRun(), detinfo::trigger_offset(), Trk_Length, vdEdx, vdQdx, vresRange, X, xphi, xtheta, xyz_vertex_fit, y, and z.

351  {
352  auto const* geom = lar::providerFrom<geo::Geometry>();
353  auto const clockData = art::ServiceHandle<detinfo::DetectorClocksService const>()->DataFor(evt);
354  auto const detProp =
356 
357  util::GeometryUtilities const gser{*geom, clockData, detProp};
358  constexpr geo::TPCID tpcid{0, 0};
359  fNPlanes = geom->Nplanes(tpcid);
360  auto Shower3DVector = std::make_unique<std::vector<recob::Shower>>();
361  auto cassn = std::make_unique<art::Assns<recob::Shower, recob::Cluster>>();
362  auto hassn = std::make_unique<art::Assns<recob::Shower, recob::Hit>>();
363  auto calorimetrycol = std::make_unique<std::vector<anab::Calorimetry>>();
364  auto calassn = std::make_unique<art::Assns<anab::Calorimetry, recob::Shower>>();
365 
368  art::Handle<std::vector<recob::Cluster>> clusterListHandle;
369  evt.getByLabel(fClusterModuleLabel, clusterListHandle);
370 
372  evt.getByLabel(fClusterModuleLabel, clusterAssociationHandle);
373 
374  art::FindManyP<recob::Hit> fmh(clusterListHandle, evt, fClusterModuleLabel);
375 
376  fRun = evt.id().run();
377  fSubRun = evt.id().subRun();
378  fEvent = evt.id().event();
379 
380  // find all the hits associated to all the clusters (once and for all);
381  // the index of the query matches the index of the cluster in the collection
382  // (conveniently carried around in its art pointer)
383  art::FindManyP<recob::Hit> ClusterHits(clusterListHandle, evt, fClusterModuleLabel);
384 
385  std::vector<art::PtrVector<recob::Cluster>>::const_iterator clusterSet =
386  clusterAssociationHandle->begin();
387  // loop over vector of vectors (each size of NPlanes) and reconstruct showers from each of those
388  for (size_t iClustSet = 0; iClustSet < clusterAssociationHandle->size(); iClustSet++) {
389 
390  const art::PtrVector<recob::Cluster> CurrentClusters = (*(clusterSet++));
391 
392  // do some error checking - i.e. are the clusters themselves present.
393  if (clusterListHandle->size() < 2 || CurrentClusters.size() < 2) {
394  ftree_shwf->Fill();
395  return;
396  }
397 
399 
400  std::vector<std::vector<art::Ptr<recob::Hit>>> hitlist_all;
401  hitlist_all.resize(fNPlanes);
402 
403  for (size_t iClust = 0; iClust < CurrentClusters.size(); iClust++) {
404  art::Ptr<recob::Cluster> const& pclust = CurrentClusters[iClust];
405 
406  // get all the hits for this cluster;
407  // pclust is a art::Ptr to the original cluster collection stored in the event;
408  // its key corresponds to its index in the collection
409  // (and therefore to the index in the query)
410  std::vector<art::Ptr<recob::Hit>> const& hitlist = ClusterHits.at(pclust.key());
411 
412  unsigned int p(0); //c=channel, p=plane, w=wire
413 
414  if (hitlist.size() == 0) continue;
415 
416  p = (*hitlist.begin())->WireID().Plane;
417  // get vertex position and slope information to start with - ii is the
418  // posistion of the correct cluster:
420 
421  double ADCcharge = 0;
422  //loop over cluster hits
423  for (art::Ptr<recob::Hit> const& hit : hitlist) {
424  p = hit->WireID().Plane;
425  hitlist_all[p].push_back(hit);
426  ADCcharge += hit->PeakAmplitude();
427  }
428  fNhitsperplane[p] = hitlist_all[p].size();
429  fTotADCperplane[p] = ADCcharge;
430  } // End loop on clusters.
431  // Now I have the Hitlists and the relevent clusters parameters saved.
432 
433  // find best set:
434  unsigned int bp1 = 0, bp2 = 0;
435  double minerror1 = 99999999, minerror2 = 9999999;
436  for (unsigned int ii = 0; ii < fNPlanes; ++ii) {
437  double locerror =
439  fTime_vertexError[ii] * fTime_vertexError[ii]; // time coordinate of vertex for each plane
440 
441  if (minerror1 >= locerror) // the >= sign is to favorize collection
442  {
443  minerror1 = locerror;
444  bp1 = ii;
445  }
446  }
447  for (unsigned int ij = 0; ij < fNPlanes; ++ij) {
448  double locerror =
450  fTime_vertexError[ij] * fTime_vertexError[ij]; // time coordinate of vertex for each plane
451 
452  if (minerror2 >= locerror && ij != bp1) {
453  minerror2 = locerror;
454  bp2 = ij;
455  }
456  }
457 
458  gser.Get3DaxisN(bp1, bp2, angle[bp1], angle[bp2], xphi, xtheta);
459 
461  std::vector<geo::Point_t> position;
462  position.reserve(fNPlanes);
463  // get starting positions for all planes -- FIXME: only position[0] is used.
464  for (auto const& plane : geom->Iterate<geo::PlaneGeo>(tpcid)) {
465  position.push_back(plane.GetBoxCenter());
466  }
467 
468  // Assuming there is no problem ( and we found the best pair that comes
469  // close in time ) we try to get the Y and Z coordinates for the start of
470  // the shower.
471  double fTimeTick = sampling_rate(clockData) / 1000.;
472  double fDriftVelocity = detProp.DriftVelocity(detProp.Efield(), detProp.Temperature());
473  try {
474  int chan1 = geom->PlaneWireToChannel({0, 0, bp1, fWire_vertex[bp1]});
475  int chan2 = geom->PlaneWireToChannel({0, 0, bp2, fWire_vertex[bp2]});
476 
477  double y, z;
478  geom->ChannelsIntersect(chan1, chan2, y, z);
479 
480  xyz_vertex_fit[1] = y;
481  xyz_vertex_fit[2] = z;
482  xyz_vertex_fit[0] =
483  (fTime_vertex[bp1] - trigger_offset(clockData)) * fDriftVelocity * fTimeTick +
484  position[0].X();
485  }
486  catch (cet::exception const& e) {
487  mf::LogWarning("ShowerReco") << "caught exception \n" << e;
488  xyz_vertex_fit[1] = 0;
489  xyz_vertex_fit[2] = 0;
490  xyz_vertex_fit[0] = 0;
491  }
492 
493  // if collection is not best plane, project starting point from that
494  if (bp1 != fNPlanes - 1 && bp2 != fNPlanes - 1) {
495  geo::PlaneID const lastPlaneID{0, 0, fNPlanes - 1};
496  auto pos = geom->Plane(lastPlaneID).GetBoxCenter();
497  pos.SetY(xyz_vertex_fit[1]);
498  pos.SetZ(xyz_vertex_fit[2]);
499  auto const wirevertex = geom->NearestWireID(pos, lastPlaneID).Wire;
500 
501  double drifttick =
502  (xyz_vertex_fit[0] / detProp.DriftVelocity(detProp.Efield(), detProp.Temperature())) *
503  (1. / fTimeTick);
504  fWire_vertex[fNPlanes - 1] = wirevertex; // wire coordinate of vertex for each plane
505  fTime_vertex[fNPlanes - 1] =
506  drifttick -
507  (pos.X() / detProp.DriftVelocity(detProp.Efield(), detProp.Temperature())) *
508  (1. / fTimeTick) +
509  trigger_offset(clockData);
510  }
511 
512  if (fabs(xphi) < 5.) {
513  xtheta = gser.Get3DSpecialCaseTheta(
514  bp1, bp2, fWire_last[bp1] - fWire_vertex[bp1], fWire_last[bp2] - fWire_vertex[bp2]);
515  }
516 
517  // zero the arrays just to make sure
518  for (unsigned int i = 0; i < fNAngles; ++i) {
519  fTotChargeADC[i] = 0;
520  fTotChargeMeV[i] = 0;
521  fTotChargeMeV_MIPs[i] = 0;
522  fNpoints_corr_ADC_2cm[i] = 0;
523  fNpoints_corr_MeV_2cm[i] = 0;
524 
525  fRMS_2cm[i] = 0;
526  fNpoints_2cm[i] = 0;
527 
528  fCorr_MeV_2cm[i] = 0;
529  fCorr_Charge_2cm[i] = 0;
530 
531  fChargeADC_2cm[i] = 0; //Initial charge in ADC/cm for each plane angle calculation 4cm
532  fChargeMeV_2cm[i] = 0; //initial charge in MeV/cm for each angle calculation first 4cm
533  }
534 
535  // do loop and choose Collection. With ful calorimetry can do all.
536  if (!(fabs(xphi) > 89 && fabs(xphi) < 91)) // do not calculate pitch for extreme angles
537  LongTransEnergy(geom,
538  clockData,
539  detProp,
540  0,
541  hitlist_all[fNPlanes - 1]); // temporary only plane 2.
542 
544 
545  // make an art::PtrVector of the clusters
547  for (unsigned int i = 0; i < clusterListHandle->size(); ++i) {
548  art::Ptr<recob::Cluster> prod(clusterListHandle, i);
549  prodvec.push_back(prod);
550  }
551 
552  //create a singleSpacePoint at vertex.
553  std::vector<recob::SpacePoint> spcpts;
554 
555  //get direction cosines and set them for the shower
556  // TBD determine which angle to use for the actual shower
557  double fPhi = xphi;
558  double fTheta = xtheta;
559 
560  TVector3 dcosVtx(std::cos(fPhi * TMath::Pi() / 180) * std::sin(fTheta * TMath::Pi() / 180),
561  std::cos(fTheta * TMath::Pi() / 180),
562  std::sin(fPhi * TMath::Pi() / 180) * std::sin(fTheta * TMath::Pi() / 180));
565  // fill with bogus values for now
566  TVector3 dcosVtxErr(util::kBogusD, util::kBogusD, util::kBogusD);
567  recob::Shower singShower;
568  singShower.set_direction(dcosVtx);
569  singShower.set_direction_err(dcosVtxErr);
570 
571  Shower3DVector->push_back(singShower);
572  // associate the shower with its clusters
573  util::CreateAssn(evt, *Shower3DVector, prodvec, *cassn);
574 
575  // get the hits associated with each cluster and associate those with the shower
576  for (size_t p = 0; p < prodvec.size(); ++p) {
577  std::vector<art::Ptr<recob::Hit>> hits = fmh.at(p);
578  util::CreateAssn(evt, *Shower3DVector, hits, *hassn);
579  }
580 
581  geo::PlaneID planeID(0, 0, fNPlanes - 1);
582  calorimetrycol->emplace_back(
584 
586 
587  art::ProductID aid = evt.getProductID<std::vector<recob::Shower>>();
588  art::Ptr<recob::Shower> aptr(aid, 0, evt.productGetter(aid));
589  ssvec.push_back(aptr);
590 
591  util::CreateAssn(evt, *calorimetrycol, ssvec, *calassn);
592  ftree_shwf->Fill();
593  } // end loop on Vectors of "Associated clusters"
594 
595  evt.put(std::move(Shower3DVector));
596  evt.put(std::move(cassn));
597  evt.put(std::move(hassn));
598  evt.put(std::move(calorimetrycol));
599  evt.put(std::move(calassn));
600  }
std::vector< double > fWire_vertexError
std::vector< double > fTotChargeADC
std::vector< double > fCorr_Charge_2cm
void set_direction_err(const TVector3 &dir_e)
Definition: Shower.h:135
std::vector< int > fNhitsperplane
ProductID getProductID(std::string const &instance_name="") const
Float_t y
Definition: compare.C:6
Double_t z
Definition: plot.C:276
The data type to uniquely identify a Plane.
Definition: geo_types.h:463
std::vector< int > fNpoints_corr_MeV_2cm
std::vector< double > fTime_vertex
std::vector< double > fTotADCperplane
std::vector< unsigned int > fWire_last
std::vector< float > vdEdx
RunNumber_t run() const
Definition: EventID.h:98
void GetVertexAndAnglesFromCluster(art::Ptr< recob::Cluster > clust, unsigned int plane)
std::vector< float > vdQdx
PutHandle< PROD > put(std::unique_ptr< PROD > &&edp, std::string const &instance={})
Definition: Event.h:77
std::vector< int > fNpoints_2cm
std::vector< double > fTime_vertexError
void hits()
Definition: readHits.C:15
void set_direction(const TVector3 &dir)
Definition: Shower.h:134
EDProductGetter const * productGetter(ProductID const pid) const
IDparameter< geo::WireID > WireID
Member type of validated geo::WireID parameter.
void push_back(Ptr< U > const &p)
Definition: PtrVector.h:435
std::vector< float > vresRange
key_type key() const noexcept
Definition: Ptr.h:166
Geometry information for a single wire plane.The plane is represented in the geometry by a solid whic...
Definition: PlaneGeo.h:78
std::vector< double > fRMS_2cm
reference at(size_type n)
Definition: PtrVector.h:359
The data type to uniquely identify a TPC.
Definition: geo_types.h:381
PlaneID_t Plane
Index of the plane within its TPC.
Definition: geo_types.h:481
size_type size() const
Definition: PtrVector.h:302
Detector simulation of raw signals on wires.
std::vector< double > fCorr_MeV_2cm
std::string fClusterModuleLabel
bool CreateAssn(art::Event &evt, std::vector< T > const &a, art::Ptr< U > const &b, art::Assns< U, T > &assn, std::string a_instance, size_t index=UINT_MAX)
Creates a single one-to-one association.
std::vector< double > xyz_vertex_fit
bool getByLabel(std::string const &label, std::string const &instance, Handle< PROD > &result) const
std::vector< double > fChargeMeV_2cm
std::vector< double > fTotChargeMeV_MIPs
MaybeLogger_< ELseverityLevel::ELsev_warning, false > LogWarning
std::vector< double > fChargeADC_2cm
std::vector< float > deadwire
int trigger_offset(DetectorClocksData const &data)
EventNumber_t event() const
Definition: EventID.h:116
void LongTransEnergy(geo::GeometryCore const *geom, detinfo::DetectorClocksData const &clockData, detinfo::DetectorPropertiesData const &detProp, unsigned int set, std::vector< art::Ptr< recob::Hit >> hitlist)
constexpr double kBogusD
obviously bogus double value
void ClearandResizeVectors(unsigned int nPlanes)
Float_t e
Definition: plot.C:35
double sampling_rate(DetectorClocksData const &data)
Returns the period of the TPC readout electronics clock.
std::vector< int > fNpoints_corr_ADC_2cm
Float_t X
Definition: plot.C:37
std::vector< unsigned int > fWire_vertex
SubRunNumber_t subRun() const
Definition: EventID.h:110
EventID id() const
Definition: Event.cc:23
cet::coded_exception< error, detail::translate > exception
Definition: exception.h:33
std::vector< double > fTotChargeMeV
void art::Modifier::registerProducts ( ProductDescriptions productsToRegister)
inherited

Definition at line 16 of file Modifier.cc.

References art::ModuleBase::moduleDescription(), and art::ProductRegistryHelper::registerProducts().

17  {
18  ProductRegistryHelper::registerProducts(productsToRegister,
20  }
void registerProducts(ProductDescriptions &productsToRegister, ModuleDescription const &md)
ModuleDescription const & moduleDescription() const
Definition: ModuleBase.cc:13
void art::ModuleBase::setModuleDescription ( ModuleDescription const &  md)
inherited

Definition at line 31 of file ModuleBase.cc.

References art::ModuleBase::md_.

32  {
33  md_ = md;
34  }
std::optional< ModuleDescription > md_
Definition: ModuleBase.h:55
void art::ModuleBase::sortConsumables ( std::string const &  current_process_name)
inherited

Definition at line 49 of file ModuleBase.cc.

References art::ModuleBase::collector_, and art::ConsumesCollector::sortConsumables().

50  {
51  // Now that we know we have seen all the consumes declarations,
52  // sort the results for fast lookup later.
53  collector_.sortConsumables(current_process_name);
54  }
ConsumesCollector collector_
Definition: ModuleBase.h:56
void sortConsumables(std::string const &current_process_name)

Member Data Documentation

float shwf::ShowerReco::angle[3]
private

Definition at line 83 of file ShowerReco_module.cc.

Referenced by GetVertexAndAnglesFromCluster(), and produce().

std::vector<float> shwf::ShowerReco::deadwire
private

Definition at line 140 of file ShowerReco_module.cc.

Referenced by produce().

float shwf::ShowerReco::fcalodEdxlength
private

Definition at line 145 of file ShowerReco_module.cc.

Referenced by LongTransEnergy(), and ShowerReco().

fhicl::ParameterSet shwf::ShowerReco::fCaloPSet
private

Definition at line 90 of file ShowerReco_module.cc.

Referenced by LongTransEnergy(), and ShowerReco().

std::vector<double> shwf::ShowerReco::fChargeADC_2cm
private

Definition at line 104 of file ShowerReco_module.cc.

Referenced by beginJob(), beginRun(), and produce().

std::vector<double> shwf::ShowerReco::fChargeMeV_2cm
private

Definition at line 105 of file ShowerReco_module.cc.

Referenced by beginJob(), beginRun(), LongTransEnergy(), and produce().

std::vector<double> shwf::ShowerReco::fChargeMeV_2cm_axsum
private

Definition at line 108 of file ShowerReco_module.cc.

Referenced by beginJob(), and beginRun().

std::vector<double> shwf::ShowerReco::fChargeMeV_2cm_refined
private

Definition at line 107 of file ShowerReco_module.cc.

Referenced by beginJob(), beginRun(), and LongTransEnergy().

std::string shwf::ShowerReco::fClusterModuleLabel
private

Definition at line 85 of file ShowerReco_module.cc.

Referenced by produce(), and ShowerReco().

std::vector<double> shwf::ShowerReco::fCorr_Charge_2cm
private

Definition at line 95 of file ShowerReco_module.cc.

Referenced by beginRun(), and produce().

std::vector<double> shwf::ShowerReco::fCorr_MeV_2cm
private

Definition at line 94 of file ShowerReco_module.cc.

Referenced by beginRun(), LongTransEnergy(), and produce().

float shwf::ShowerReco::fdEdxlength
private

Definition at line 143 of file ShowerReco_module.cc.

Referenced by LongTransEnergy(), and ShowerReco().

std::vector<std::vector<double> > shwf::ShowerReco::fDistribChargeADC
private

Definition at line 110 of file ShowerReco_module.cc.

Referenced by beginJob(), and beginRun().

std::vector<std::vector<double> > shwf::ShowerReco::fDistribChargeMeV
private

Definition at line 112 of file ShowerReco_module.cc.

Referenced by beginJob(), beginRun(), and LongTransEnergy().

std::vector<std::vector<double> > shwf::ShowerReco::fDistribChargeposition
private

Definition at line 115 of file ShowerReco_module.cc.

Referenced by beginJob(), beginRun(), and LongTransEnergy().

std::vector<std::vector<double> > shwf::ShowerReco::fDistribHalfChargeMeV
private

Definition at line 113 of file ShowerReco_module.cc.

Referenced by beginJob(), and beginRun().

double shwf::ShowerReco::fDriftVelocity
private

Definition at line 156 of file ShowerReco_module.cc.

Referenced by beginRun(), and produce().

int shwf::ShowerReco::fEvent
private

Definition at line 80 of file ShowerReco_module.cc.

Referenced by beginJob(), and produce().

double shwf::ShowerReco::fMean_wire_pitch
private

Definition at line 89 of file ShowerReco_module.cc.

Referenced by beginJob().

unsigned int shwf::ShowerReco::fNAngles
private

Definition at line 150 of file ShowerReco_module.cc.

Referenced by beginJob(), beginRun(), and produce().

std::vector<int> shwf::ShowerReco::fNhitsperplane
private

Definition at line 159 of file ShowerReco_module.cc.

Referenced by beginJob(), beginRun(), and produce().

std::vector<std::vector<double> > shwf::ShowerReco::fNPitch
private

Definition at line 133 of file ShowerReco_module.cc.

Referenced by beginJob(), beginRun(), and LongTransEnergy().

unsigned int shwf::ShowerReco::fNPlanes
private

Definition at line 149 of file ShowerReco_module.cc.

Referenced by beginJob(), beginRun(), LongTransEnergy(), and produce().

std::vector<int> shwf::ShowerReco::fNpoints_2cm
private

Definition at line 93 of file ShowerReco_module.cc.

Referenced by beginJob(), beginRun(), LongTransEnergy(), and produce().

std::vector<int> shwf::ShowerReco::fNpoints_corr_ADC_2cm
private

Definition at line 97 of file ShowerReco_module.cc.

Referenced by beginRun(), and produce().

std::vector<int> shwf::ShowerReco::fNpoints_corr_MeV_2cm
private

Definition at line 98 of file ShowerReco_module.cc.

Referenced by beginRun(), LongTransEnergy(), and produce().

std::vector<double> shwf::ShowerReco::fRMS_2cm
private

Definition at line 92 of file ShowerReco_module.cc.

Referenced by beginJob(), beginRun(), LongTransEnergy(), and produce().

int shwf::ShowerReco::fRun
private

Definition at line 80 of file ShowerReco_module.cc.

Referenced by beginJob(), and produce().

std::vector<std::vector<double> > shwf::ShowerReco::fSingleEvtAngle
private

Definition at line 117 of file ShowerReco_module.cc.

std::vector<std::vector<double> > shwf::ShowerReco::fSingleEvtAngleVal
private

Definition at line 118 of file ShowerReco_module.cc.

int shwf::ShowerReco::fSubRun
private

Definition at line 80 of file ShowerReco_module.cc.

Referenced by beginJob(), and produce().

std::vector<double> shwf::ShowerReco::fTime_last
private

Definition at line 127 of file ShowerReco_module.cc.

Referenced by beginRun(), and GetVertexAndAnglesFromCluster().

std::vector<double> shwf::ShowerReco::fTime_vertex
private
std::vector<double> shwf::ShowerReco::fTime_vertexError
private

Definition at line 124 of file ShowerReco_module.cc.

Referenced by beginRun(), GetVertexAndAnglesFromCluster(), and produce().

float shwf::ShowerReco::ftimetick
private

Definition at line 87 of file ShowerReco_module.cc.

Referenced by beginJob().

double shwf::ShowerReco::fTimeTick
private

Definition at line 155 of file ShowerReco_module.cc.

Referenced by beginRun(), and produce().

std::vector<double> shwf::ShowerReco::fTotADCperplane
private

Definition at line 160 of file ShowerReco_module.cc.

Referenced by beginJob(), beginRun(), and produce().

std::vector<double> shwf::ShowerReco::fTotChargeADC
private

Definition at line 100 of file ShowerReco_module.cc.

Referenced by beginJob(), beginRun(), LongTransEnergy(), and produce().

std::vector<double> shwf::ShowerReco::fTotChargeMeV
private

Definition at line 101 of file ShowerReco_module.cc.

Referenced by beginJob(), beginRun(), LongTransEnergy(), and produce().

std::vector<double> shwf::ShowerReco::fTotChargeMeV_MIPs
private

Definition at line 102 of file ShowerReco_module.cc.

Referenced by beginJob(), beginRun(), and produce().

TTree* shwf::ShowerReco::ftree_shwf
private

Definition at line 151 of file ShowerReco_module.cc.

Referenced by beginJob(), and produce().

float shwf::ShowerReco::fTrkPitchC
private

Definition at line 142 of file ShowerReco_module.cc.

Referenced by LongTransEnergy(), and produce().

bool shwf::ShowerReco::fUseArea
private

Definition at line 146 of file ShowerReco_module.cc.

Referenced by LongTransEnergy(), and ShowerReco().

std::vector<unsigned int> shwf::ShowerReco::fWire_last
private

Definition at line 126 of file ShowerReco_module.cc.

Referenced by beginRun(), GetVertexAndAnglesFromCluster(), and produce().

std::vector<unsigned int> shwf::ShowerReco::fWire_vertex
private
std::vector<double> shwf::ShowerReco::fWire_vertexError
private

Definition at line 123 of file ShowerReco_module.cc.

Referenced by beginRun(), GetVertexAndAnglesFromCluster(), and produce().

double shwf::ShowerReco::fWirePitch
private

Definition at line 154 of file ShowerReco_module.cc.

Referenced by beginRun().

double shwf::ShowerReco::fWireTimetoCmCm
private

Definition at line 157 of file ShowerReco_module.cc.

Referenced by beginRun(), and LongTransEnergy().

float shwf::ShowerReco::Kin_En
private

Definition at line 136 of file ShowerReco_module.cc.

Referenced by LongTransEnergy(), and produce().

float shwf::ShowerReco::slope[3]
private

Definition at line 82 of file ShowerReco_module.cc.

Referenced by GetVertexAndAnglesFromCluster(), and LongTransEnergy().

float shwf::ShowerReco::Trk_Length
private

Definition at line 141 of file ShowerReco_module.cc.

Referenced by LongTransEnergy(), and produce().

std::vector<float> shwf::ShowerReco::vdEdx
private

Definition at line 137 of file ShowerReco_module.cc.

Referenced by beginRun(), LongTransEnergy(), and produce().

std::vector<float> shwf::ShowerReco::vdQdx
private

Definition at line 139 of file ShowerReco_module.cc.

Referenced by beginRun(), LongTransEnergy(), and produce().

std::vector<float> shwf::ShowerReco::vresRange
private

Definition at line 138 of file ShowerReco_module.cc.

Referenced by beginRun(), LongTransEnergy(), and produce().

double shwf::ShowerReco::xphi
private

Definition at line 148 of file ShowerReco_module.cc.

Referenced by beginJob(), LongTransEnergy(), and produce().

double shwf::ShowerReco::xtheta
private

Definition at line 148 of file ShowerReco_module.cc.

Referenced by beginJob(), LongTransEnergy(), and produce().

std::vector<double> shwf::ShowerReco::xyz_vertex_fit
private

Definition at line 130 of file ShowerReco_module.cc.

Referenced by beginJob(), beginRun(), and produce().


The documentation for this class was generated from the following file: