353 auto const* geom = lar::providerFrom<geo::Geometry>();
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>>();
386 clusterAssociationHandle->begin();
388 for (
size_t iClustSet = 0; iClustSet < clusterAssociationHandle->size(); iClustSet++) {
393 if (clusterListHandle->size() < 2 || CurrentClusters.
size() < 2) {
400 std::vector<std::vector<art::Ptr<recob::Hit>>> hitlist_all;
403 for (
size_t iClust = 0; iClust < CurrentClusters.
size(); iClust++) {
410 std::vector<art::Ptr<recob::Hit>>
const& hitlist = ClusterHits.
at(pclust.
key());
414 if (hitlist.size() == 0)
continue;
416 p = (*hitlist.begin())->
WireID().Plane;
421 double ADCcharge = 0;
424 p =
hit->WireID().Plane;
425 hitlist_all[
p].push_back(
hit);
426 ADCcharge +=
hit->PeakAmplitude();
434 unsigned int bp1 = 0, bp2 = 0;
435 double minerror1 = 99999999, minerror2 = 9999999;
436 for (
unsigned int ii = 0; ii <
fNPlanes; ++ii) {
441 if (minerror1 >= locerror)
443 minerror1 = locerror;
447 for (
unsigned int ij = 0; ij <
fNPlanes; ++ij) {
450 fTime_vertexError[ij] * fTime_vertexError[ij];
452 if (minerror2 >= locerror && ij != bp1) {
453 minerror2 = locerror;
461 const double origin[3] = {0.};
462 std::vector<std::vector<double>>
position;
464 double fDriftVelocity = detProp.DriftVelocity(detProp.Efield(), detProp.Temperature());
466 for (
unsigned int xx = 0; xx <
fNPlanes; xx++) {
468 geom->Plane(xx).LocalToWorld(origin, pos1);
469 std::vector<double> pos2;
470 pos2.push_back(pos1[0]);
471 pos2.push_back(pos1[1]);
472 pos2.push_back(pos1[2]);
473 position.push_back(pos2);
479 int chan1 = geom->PlaneWireToChannel(bp1,
fWire_vertex[bp1], 0);
480 int chan2 = geom->PlaneWireToChannel(bp2,
fWire_vertex[bp2], 0);
483 geom->ChannelsIntersect(chan1, chan2, y, z);
499 if (bp1 != fNPlanes - 1 && bp2 != fNPlanes - 1) {
501 unsigned int wirevertex;
503 geom->Plane(fNPlanes - 1).LocalToWorld(origin, pos);
507 wirevertex = geom->NearestWire(pos, fNPlanes - 1);
510 (
xyz_vertex_fit[0] / detProp.DriftVelocity(detProp.Efield(), detProp.Temperature())) *
515 (pos[0] / detProp.DriftVelocity(detProp.Efield(), detProp.Temperature())) *
520 if (fabs(
xphi) < 5.) {
521 xtheta = gser.Get3DSpecialCaseTheta(
526 for (
unsigned int i = 0; i <
fNAngles; ++i) {
544 if (!(fabs(
xphi) > 89 && fabs(
xphi) < 91))
549 hitlist_all[fNPlanes - 1]);
555 for (
unsigned int i = 0; i < clusterListHandle->size(); ++i) {
561 std::vector<recob::SpacePoint> spcpts;
569 TMath::Cos(fPhi * TMath::Pi() / 180) * TMath::Sin(fTheta * TMath::Pi() / 180),
570 TMath::Cos(fTheta * TMath::Pi() / 180),
571 TMath::Sin(fPhi * TMath::Pi() / 180) * TMath::Sin(fTheta * TMath::Pi() / 180));
580 Shower3DVector->push_back(singShower);
585 for (
size_t p = 0;
p < prodvec.
size(); ++
p) {
586 std::vector<art::Ptr<recob::Hit>> hits = fmh.at(
p);
591 calorimetrycol->emplace_back(
std::vector< double > fWire_vertexError
std::vector< double > fTotChargeADC
std::vector< double > fCorr_Charge_2cm
void set_direction_err(const TVector3 &dir_e)
ProductID getProductID(std::string const &instance_name="") const
std::vector< int > fNhitsperplane
The data type to uniquely identify a Plane.
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
void GetVertexAndAnglesFromCluster(art::Ptr< recob::Cluster > clust, unsigned int plane)
std::vector< float > vdQdx
std::vector< int > fNpoints_2cm
std::vector< double > fTime_vertexError
bool getByLabel(std::string const &label, std::string const &instance, Handle< PROD > &result) const
void set_direction(const TVector3 &dir)
IDparameter< geo::WireID > WireID
Member type of validated geo::WireID parameter.
void push_back(Ptr< U > const &p)
std::vector< float > vresRange
EDProductGetter const * productGetter(ProductID const pid) const
key_type key() const noexcept
std::vector< double > fRMS_2cm
ProductID put(std::unique_ptr< PROD > &&edp, std::string const &instance={})
bool CreateAssn(PRODUCER const &prod, art::Event &evt, std::vector< T > const &a, art::Ptr< U > const &b, art::Assns< U, T > &assn, std::string a_instance, size_t indx=UINT_MAX)
Creates a single one-to-one association.
reference at(size_type n)
Detector simulation of raw signals on wires.
std::vector< double > fCorr_MeV_2cm
std::string fClusterModuleLabel
std::vector< double > xyz_vertex_fit
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
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)
double sampling_rate(DetectorClocksData const &data)
Returns the period of the TPC readout electronics clock.
std::vector< int > fNpoints_corr_ADC_2cm
std::vector< unsigned int > fWire_vertex
SubRunNumber_t subRun() const
constexpr Point origin()
Returns a origin position with a point of the specified type.
cet::coded_exception< error, detail::translate > exception
std::vector< double > fTotChargeMeV