LArSoft  v10_04_05
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, geo::WireReadoutGeom const &wireReadoutGeom, 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 61 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 166 of file ShowerReco_module.cc.

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

166  : EDProducer{pset}
167  {
168  fClusterModuleLabel = pset.get<std::string>("ClusterModuleLabel");
169  fCaloPSet = pset.get<fhicl::ParameterSet>("CaloAlg");
170 
171  fdEdxlength =
172  pset.get<double>("dEdxlength"); // distance that gets used to determine e/gamma separation
174  pset.get<double>("calodEdxlength"); // cutoff distance for hits saved to the calo object.
175  fUseArea = pset.get<bool>("UseArea");
176 
177  produces<std::vector<recob::Shower>>();
178  produces<art::Assns<recob::Shower, recob::Cluster>>();
179  produces<art::Assns<recob::Shower, recob::Hit>>();
180  produces<std::vector<anab::Calorimetry>>();
181  produces<art::Assns<recob::Shower, anab::Calorimetry>>();
182  }
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 185 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, Get, detinfo::sampling_rate(), xphi, xtheta, and xyz_vertex_fit.

186  {
189  auto const& wireReadoutGeom = art::ServiceHandle<geo::WireReadout const>()->Get();
190  fNPlanes = wireReadoutGeom.Nplanes();
191  fMean_wire_pitch = wireReadoutGeom.Plane({0, 0, 0}).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
cout<< "Opened file "<< fin<< " ixs= "<< ixs<< endl;if(ixs==0) hhh=(TH1F *) fff-> Get("h1")
Definition: AddMC.C:8
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
std::vector< double > fChargeMeV_2cm_axsum
double sampling_rate(DetectorClocksData const &data)
Returns the period of the TPC readout electronics clock.
std::vector< std::vector< double > > fDistribChargeposition
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, Get, detinfo::sampling_rate(), vdEdx, vdQdx, vresRange, and xyz_vertex_fit.

234  {
235  auto const clockData = art::ServiceHandle<detinfo::DetectorClocksService const>()->DataForJob();
236  auto const detProp =
238 
240  ->Get()
241  .Plane({0, 0, 0})
242  .WirePitch(); // wire pitch in cm
243  fTimeTick = sampling_rate(clockData) / 1000.;
244  fDriftVelocity = detProp.DriftVelocity(detProp.Efield(), detProp.Temperature());
246  }
cout<< "Opened file "<< fin<< " ixs= "<< ixs<< endl;if(ixs==0) hhh=(TH1F *) fff-> Get("h1")
Definition: AddMC.C:8
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 806 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().

808  {
809  // convert to cm/cm units needed in the calculation
810  angle[plane] = clust->StartAngle();
811  slope[plane] = std::tan(clust->StartAngle());
812  fWire_vertex[plane] = clust->StartWire();
813  fTime_vertex[plane] = clust->StartTick();
814 
815  fWire_vertexError[plane] = clust->SigmaStartWire(); // wire coordinate of vertex for each plane
816  fTime_vertexError[plane] = clust->SigmaStartTick(); // time coordinate of vertex for each plane
817 
818  fWire_last[plane] = clust->EndWire(); // wire coordinate of last point for each plane
819  fTime_last[plane] = clust->EndTick();
820  }
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,
geo::WireReadoutGeom const &  wireReadoutGeom,
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 607 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::WireReadoutGeom::SignalType(), slope, lar::to_element, Trk_Length, vdEdx, vdQdx, vresRange, xphi, and xtheta.

Referenced by produce().

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

353  {
354  auto const* geom = lar::providerFrom<geo::Geometry>();
355  auto const& wireReadoutGeom = art::ServiceHandle<geo::WireReadout const>()->Get();
356  auto const clockData = art::ServiceHandle<detinfo::DetectorClocksService const>()->DataFor(evt);
357  auto const detProp =
359 
360  util::GeometryUtilities const gser{*geom, wireReadoutGeom, clockData, detProp};
361  constexpr geo::TPCID tpcid{0, 0};
362  fNPlanes = wireReadoutGeom.Nplanes(tpcid);
363  auto Shower3DVector = std::make_unique<std::vector<recob::Shower>>();
364  auto cassn = std::make_unique<art::Assns<recob::Shower, recob::Cluster>>();
365  auto hassn = std::make_unique<art::Assns<recob::Shower, recob::Hit>>();
366  auto calorimetrycol = std::make_unique<std::vector<anab::Calorimetry>>();
367  auto calassn = std::make_unique<art::Assns<anab::Calorimetry, recob::Shower>>();
368 
371  art::Handle<std::vector<recob::Cluster>> clusterListHandle;
372  evt.getByLabel(fClusterModuleLabel, clusterListHandle);
373 
375  evt.getByLabel(fClusterModuleLabel, clusterAssociationHandle);
376 
377  art::FindManyP<recob::Hit> fmh(clusterListHandle, evt, fClusterModuleLabel);
378 
379  fRun = evt.id().run();
380  fSubRun = evt.id().subRun();
381  fEvent = evt.id().event();
382 
383  // find all the hits associated to all the clusters (once and for all);
384  // the index of the query matches the index of the cluster in the collection
385  // (conveniently carried around in its art pointer)
386  art::FindManyP<recob::Hit> ClusterHits(clusterListHandle, evt, fClusterModuleLabel);
387 
388  std::vector<art::PtrVector<recob::Cluster>>::const_iterator clusterSet =
389  clusterAssociationHandle->begin();
390 
391  // loop over vector of vectors (each size of NPlanes) and reconstruct showers from each of those
392  for (size_t iClustSet = 0; iClustSet < clusterAssociationHandle->size(); iClustSet++) {
393 
394  const art::PtrVector<recob::Cluster> CurrentClusters = (*(clusterSet++));
395 
396  // do some error checking - i.e. are the clusters themselves present.
397  if (clusterListHandle->size() < 2 || CurrentClusters.size() < 2) {
398  ftree_shwf->Fill();
399  return;
400  }
401 
403 
404  std::vector<std::vector<art::Ptr<recob::Hit>>> hitlist_all;
405  hitlist_all.resize(fNPlanes);
406 
407  for (size_t iClust = 0; iClust < CurrentClusters.size(); iClust++) {
408  art::Ptr<recob::Cluster> const& pclust = CurrentClusters[iClust];
409 
410  // get all the hits for this cluster;
411  // pclust is a art::Ptr to the original cluster collection stored in the event;
412  // its key corresponds to its index in the collection
413  // (and therefore to the index in the query)
414  std::vector<art::Ptr<recob::Hit>> const& hitlist = ClusterHits.at(pclust.key());
415 
416  unsigned int p(0); //c=channel, p=plane, w=wire
417 
418  if (hitlist.size() == 0) continue;
419 
420  p = (*hitlist.begin())->WireID().Plane;
421  // get vertex position and slope information to start with - ii is the
422  // posistion of the correct cluster:
424 
425  double ADCcharge = 0;
426  //loop over cluster hits
427  for (art::Ptr<recob::Hit> const& hit : hitlist) {
428  p = hit->WireID().Plane;
429  hitlist_all[p].push_back(hit);
430  ADCcharge += hit->PeakAmplitude();
431  }
432  fNhitsperplane[p] = hitlist_all[p].size();
433  fTotADCperplane[p] = ADCcharge;
434  } // End loop on clusters.
435  // Now I have the Hitlists and the relevent clusters parameters saved.
436 
437  // find best set:
438  unsigned int bp1 = 0, bp2 = 0;
439  double minerror1 = 99999999, minerror2 = 9999999;
440  for (unsigned int ii = 0; ii < fNPlanes; ++ii) {
441  double locerror =
443  fTime_vertexError[ii] * fTime_vertexError[ii]; // time coordinate of vertex for each plane
444 
445  if (minerror1 >= locerror) // the >= sign is to favorize collection
446  {
447  minerror1 = locerror;
448  bp1 = ii;
449  }
450  }
451  for (unsigned int ij = 0; ij < fNPlanes; ++ij) {
452  double locerror =
454  fTime_vertexError[ij] * fTime_vertexError[ij]; // time coordinate of vertex for each plane
455 
456  if (minerror2 >= locerror && ij != bp1) {
457  minerror2 = locerror;
458  bp2 = ij;
459  }
460  }
461 
462  gser.Get3DaxisN(bp1, bp2, angle[bp1], angle[bp2], xphi, xtheta);
463 
465  std::vector<geo::Point_t> position;
466  position.reserve(fNPlanes);
467  // get starting positions for all planes -- FIXME: only position[0] is used.
468  for (auto const& plane : wireReadoutGeom.Iterate<geo::PlaneGeo>(tpcid)) {
469  position.push_back(plane.GetBoxCenter());
470  }
471 
472  // Assuming there is no problem ( and we found the best pair that comes
473  // close in time ) we try to get the Y and Z coordinates for the start of
474  // the shower.
475  double fTimeTick = sampling_rate(clockData) / 1000.;
476  double fDriftVelocity = detProp.DriftVelocity(detProp.Efield(), detProp.Temperature());
477  try {
478  int chan1 = wireReadoutGeom.PlaneWireToChannel({0, 0, bp1, fWire_vertex[bp1]});
479  int chan2 = wireReadoutGeom.PlaneWireToChannel({0, 0, bp2, fWire_vertex[bp2]});
480 
481  auto const intersection = wireReadoutGeom.ChannelsIntersect(chan1, chan2).value();
482  xyz_vertex_fit[1] = intersection.y;
483  xyz_vertex_fit[2] = intersection.z;
484  xyz_vertex_fit[0] =
485  (fTime_vertex[bp1] - trigger_offset(clockData)) * fDriftVelocity * fTimeTick +
486  position[0].X();
487  }
488  catch (cet::exception const& e) {
489  mf::LogWarning("ShowerReco") << "caught exception \n" << e;
490  xyz_vertex_fit[1] = 0;
491  xyz_vertex_fit[2] = 0;
492  xyz_vertex_fit[0] = 0;
493  }
494 
495  // if collection is not best plane, project starting point from that
496  if (bp1 != fNPlanes - 1 && bp2 != fNPlanes - 1) {
497  geo::PlaneID const lastPlaneID{0, 0, fNPlanes - 1};
498  auto const& plane = wireReadoutGeom.Plane(lastPlaneID);
499  auto pos = plane.GetBoxCenter();
500  pos.SetY(xyz_vertex_fit[1]);
501  pos.SetZ(xyz_vertex_fit[2]);
502  auto const wirevertex = plane.NearestWireID(pos).Wire;
503 
504  double drifttick =
505  (xyz_vertex_fit[0] / detProp.DriftVelocity(detProp.Efield(), detProp.Temperature())) *
506  (1. / fTimeTick);
507  fWire_vertex[fNPlanes - 1] = wirevertex; // wire coordinate of vertex for each plane
508  fTime_vertex[fNPlanes - 1] =
509  drifttick -
510  (pos.X() / detProp.DriftVelocity(detProp.Efield(), detProp.Temperature())) *
511  (1. / fTimeTick) +
512  trigger_offset(clockData);
513  }
514 
515  if (fabs(xphi) < 5.) {
516  xtheta = gser.Get3DSpecialCaseTheta(
517  bp1, bp2, fWire_last[bp1] - fWire_vertex[bp1], fWire_last[bp2] - fWire_vertex[bp2]);
518  }
519 
520  // zero the arrays just to make sure
521  for (unsigned int i = 0; i < fNAngles; ++i) {
522  fTotChargeADC[i] = 0;
523  fTotChargeMeV[i] = 0;
524  fTotChargeMeV_MIPs[i] = 0;
525  fNpoints_corr_ADC_2cm[i] = 0;
526  fNpoints_corr_MeV_2cm[i] = 0;
527 
528  fRMS_2cm[i] = 0;
529  fNpoints_2cm[i] = 0;
530 
531  fCorr_MeV_2cm[i] = 0;
532  fCorr_Charge_2cm[i] = 0;
533 
534  fChargeADC_2cm[i] = 0; //Initial charge in ADC/cm for each plane angle calculation 4cm
535  fChargeMeV_2cm[i] = 0; //initial charge in MeV/cm for each angle calculation first 4cm
536  }
537 
538  // do loop and choose Collection. With ful calorimetry can do all.
539  if (!(fabs(xphi) > 89 && fabs(xphi) < 91)) // do not calculate pitch for extreme angles
540  LongTransEnergy(geom,
541  wireReadoutGeom,
542  clockData,
543  detProp,
544  0,
545  hitlist_all[fNPlanes - 1]); // temporary only plane 2.
546 
548 
549  // make an art::PtrVector of the clusters
551  for (unsigned int i = 0; i < clusterListHandle->size(); ++i) {
552  art::Ptr<recob::Cluster> prod(clusterListHandle, i);
553  prodvec.push_back(prod);
554  }
555 
556  //create a singleSpacePoint at vertex.
557  std::vector<recob::SpacePoint> spcpts;
558 
559  //get direction cosines and set them for the shower
560  // TBD determine which angle to use for the actual shower
561  double fPhi = xphi;
562  double fTheta = xtheta;
563 
564  TVector3 dcosVtx(std::cos(fPhi * TMath::Pi() / 180) * std::sin(fTheta * TMath::Pi() / 180),
565  std::cos(fTheta * TMath::Pi() / 180),
566  std::sin(fPhi * TMath::Pi() / 180) * std::sin(fTheta * TMath::Pi() / 180));
569  // fill with bogus values for now
570  TVector3 dcosVtxErr(util::kBogusD, util::kBogusD, util::kBogusD);
571  recob::Shower singShower;
572  singShower.set_direction(dcosVtx);
573  singShower.set_direction_err(dcosVtxErr);
574 
575  Shower3DVector->push_back(singShower);
576  // associate the shower with its clusters
577  util::CreateAssn(evt, *Shower3DVector, prodvec, *cassn);
578 
579  // get the hits associated with each cluster and associate those with the shower
580  for (size_t p = 0; p < prodvec.size(); ++p) {
581  std::vector<art::Ptr<recob::Hit>> hits = fmh.at(p);
582  util::CreateAssn(evt, *Shower3DVector, hits, *hassn);
583  }
584 
585  geo::PlaneID planeID(0, 0, fNPlanes - 1);
586  calorimetrycol->emplace_back(
588 
590 
591  art::ProductID aid = evt.getProductID<std::vector<recob::Shower>>();
592  art::Ptr<recob::Shower> aptr(aid, 0, evt.productGetter(aid));
593  ssvec.push_back(aptr);
594 
595  util::CreateAssn(evt, *calorimetrycol, ssvec, *calassn);
596  ftree_shwf->Fill();
597  } // end loop on Vectors of "Associated clusters"
598 
599  evt.put(std::move(Shower3DVector));
600  evt.put(std::move(cassn));
601  evt.put(std::move(hassn));
602  evt.put(std::move(calorimetrycol));
603  evt.put(std::move(calassn));
604  }
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
The data type to uniquely identify a Plane.
Definition: geo_types.h:364
std::vector< int > fNpoints_corr_MeV_2cm
std::vector< double > fTime_vertex
cout<< "Opened file "<< fin<< " ixs= "<< ixs<< endl;if(ixs==0) hhh=(TH1F *) fff-> Get("h1")
Definition: AddMC.C:8
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
void LongTransEnergy(geo::GeometryCore const *geom, geo::WireReadoutGeom const &wireReadoutGeom, detinfo::DetectorClocksData const &clockData, detinfo::DetectorPropertiesData const &detProp, unsigned int set, std::vector< art::Ptr< recob::Hit >> hitlist)
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:67
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:306
PlaneID_t Plane
Index of the plane within its TPC.
Definition: geo_types.h:373
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
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 85 of file ShowerReco_module.cc.

Referenced by GetVertexAndAnglesFromCluster(), and produce().

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

Definition at line 142 of file ShowerReco_module.cc.

Referenced by produce().

float shwf::ShowerReco::fcalodEdxlength
private

Definition at line 147 of file ShowerReco_module.cc.

Referenced by LongTransEnergy(), and ShowerReco().

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

Definition at line 92 of file ShowerReco_module.cc.

Referenced by LongTransEnergy(), and ShowerReco().

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

Definition at line 106 of file ShowerReco_module.cc.

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

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

Definition at line 107 of file ShowerReco_module.cc.

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

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

Definition at line 110 of file ShowerReco_module.cc.

Referenced by beginJob(), and beginRun().

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

Definition at line 109 of file ShowerReco_module.cc.

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

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

Definition at line 87 of file ShowerReco_module.cc.

Referenced by produce(), and ShowerReco().

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

Definition at line 97 of file ShowerReco_module.cc.

Referenced by beginRun(), and produce().

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

Definition at line 96 of file ShowerReco_module.cc.

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

float shwf::ShowerReco::fdEdxlength
private

Definition at line 145 of file ShowerReco_module.cc.

Referenced by LongTransEnergy(), and ShowerReco().

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

Definition at line 112 of file ShowerReco_module.cc.

Referenced by beginJob(), and beginRun().

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

Definition at line 114 of file ShowerReco_module.cc.

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

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

Definition at line 117 of file ShowerReco_module.cc.

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

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

Definition at line 115 of file ShowerReco_module.cc.

Referenced by beginJob(), and beginRun().

double shwf::ShowerReco::fDriftVelocity
private

Definition at line 158 of file ShowerReco_module.cc.

Referenced by beginRun(), and produce().

int shwf::ShowerReco::fEvent
private

Definition at line 82 of file ShowerReco_module.cc.

Referenced by beginJob(), and produce().

double shwf::ShowerReco::fMean_wire_pitch
private

Definition at line 91 of file ShowerReco_module.cc.

Referenced by beginJob().

unsigned int shwf::ShowerReco::fNAngles
private

Definition at line 152 of file ShowerReco_module.cc.

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

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

Definition at line 161 of file ShowerReco_module.cc.

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

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

Definition at line 135 of file ShowerReco_module.cc.

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

unsigned int shwf::ShowerReco::fNPlanes
private

Definition at line 151 of file ShowerReco_module.cc.

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

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

Definition at line 95 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 99 of file ShowerReco_module.cc.

Referenced by beginRun(), and produce().

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

Definition at line 100 of file ShowerReco_module.cc.

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

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

Definition at line 94 of file ShowerReco_module.cc.

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

int shwf::ShowerReco::fRun
private

Definition at line 82 of file ShowerReco_module.cc.

Referenced by beginJob(), and produce().

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

Definition at line 119 of file ShowerReco_module.cc.

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

Definition at line 120 of file ShowerReco_module.cc.

int shwf::ShowerReco::fSubRun
private

Definition at line 82 of file ShowerReco_module.cc.

Referenced by beginJob(), and produce().

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

Definition at line 129 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 126 of file ShowerReco_module.cc.

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

float shwf::ShowerReco::ftimetick
private

Definition at line 89 of file ShowerReco_module.cc.

Referenced by beginJob().

double shwf::ShowerReco::fTimeTick
private

Definition at line 157 of file ShowerReco_module.cc.

Referenced by beginRun(), and produce().

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

Definition at line 162 of file ShowerReco_module.cc.

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

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

Definition at line 102 of file ShowerReco_module.cc.

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

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

Definition at line 103 of file ShowerReco_module.cc.

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

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

Definition at line 104 of file ShowerReco_module.cc.

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

TTree* shwf::ShowerReco::ftree_shwf
private

Definition at line 153 of file ShowerReco_module.cc.

Referenced by beginJob(), and produce().

float shwf::ShowerReco::fTrkPitchC
private

Definition at line 144 of file ShowerReco_module.cc.

Referenced by LongTransEnergy(), and produce().

bool shwf::ShowerReco::fUseArea
private

Definition at line 148 of file ShowerReco_module.cc.

Referenced by LongTransEnergy(), and ShowerReco().

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

Definition at line 128 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 125 of file ShowerReco_module.cc.

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

double shwf::ShowerReco::fWirePitch
private

Definition at line 156 of file ShowerReco_module.cc.

Referenced by beginRun().

double shwf::ShowerReco::fWireTimetoCmCm
private

Definition at line 159 of file ShowerReco_module.cc.

Referenced by beginRun(), and LongTransEnergy().

float shwf::ShowerReco::Kin_En
private

Definition at line 138 of file ShowerReco_module.cc.

Referenced by LongTransEnergy(), and produce().

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

Definition at line 84 of file ShowerReco_module.cc.

Referenced by GetVertexAndAnglesFromCluster(), and LongTransEnergy().

float shwf::ShowerReco::Trk_Length
private

Definition at line 143 of file ShowerReco_module.cc.

Referenced by LongTransEnergy(), and produce().

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

Definition at line 139 of file ShowerReco_module.cc.

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

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

Definition at line 141 of file ShowerReco_module.cc.

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

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

Definition at line 140 of file ShowerReco_module.cc.

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

double shwf::ShowerReco::xphi
private

Definition at line 150 of file ShowerReco_module.cc.

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

double shwf::ShowerReco::xtheta
private

Definition at line 150 of file ShowerReco_module.cc.

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

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

Definition at line 132 of file ShowerReco_module.cc.

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


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