29 #include <sys/types.h> 50 #include "TDecompSVD.h" 215 produces< std::vector<recob::Shower> >();
216 produces< art::Assns<recob::Shower, recob::Cluster> >();
217 produces< art::Assns<recob::Shower, recob::Hit> >();
218 produces< std::vector<anab::Calorimetry> >();
219 produces< art::Assns<recob::Shower, anab::Calorimetry> >();
258 detprop = lar::providerFrom<detinfo::DetectorPropertiesService>();
284 ftree_shwf->Branch(
"nplanes",&fNPlanes,
"nplanes/I");
335 detprop = lar::providerFrom<detinfo::DetectorPropertiesService>();
347 void ShowerReco::ShowerReco::ClearandResizeVectors(
unsigned int ) {
350 for (
unsigned int i = 1; i <=
fNPlanes; ++i) fact *= i;
376 for(
unsigned int ii=0;ii<
fNAngles;ii++) {
390 for(
unsigned int ii=0;ii<
fNPlanes;ii++)
467 detprop = lar::providerFrom<detinfo::DetectorPropertiesService>();
472 std::unique_ptr<std::vector<recob::Shower> > Shower3DVector(
new std::vector<recob::Shower>);
475 std::unique_ptr< std::vector<anab::Calorimetry> > calorimetrycol(
new std::vector<anab::Calorimetry>);
520 std::vector < art::PtrVector<recob::Cluster> >
::const_iterator clusterSet = clusterAssociationHandle->begin();
522 for(
size_t iClustSet = 0;iClustSet < clusterAssociationHandle->size(); iClustSet++){
527 if(clusterListHandle->size() < 2 || CurrentClusters.
size() < 2) {
537 std::vector< std::vector< art::Ptr<recob::Hit> > > hitlist_all;
541 for(
size_t iClust = 0; iClust < CurrentClusters.
size(); iClust++){
550 std::vector< art::Ptr<recob::Hit> >
const& hitlist = ClusterHits.at(pclust.
key());
556 if(hitlist.size() == 0)
continue;
558 p= (*hitlist.begin())->WireID().Plane;
567 p=
hit->WireID().Plane;
568 hitlist_all[p].push_back(
hit);
569 ADCcharge+=
hit->PeakAmplitude();
616 unsigned int bp1 = 0,bp2 = 0;
617 double minerror1=99999999,minerror2=9999999;
618 for(
unsigned int ii = 0; ii <
fNPlanes; ++ii)
622 if(minerror1 >= locerror )
628 for(
unsigned int ij = 0; ij <
fNPlanes; ++ij)
632 if(minerror2 >= locerror && ij!=bp1 )
641 for(
unsigned int ij = 0; ij <
fNPlanes; ++ij)
653 const double origin[3] = {0.};
654 std::vector <std::vector < double > > position;
662 std::vector <double > pos2;
663 pos2.push_back(pos1[0]);
664 pos2.push_back(pos1[1]);
665 pos2.push_back(pos1[2]);
666 position.push_back(pos2);
695 if(bp1!=fNPlanes-1 && bp2!=fNPlanes-1)
698 unsigned int wirevertex;
732 for(
unsigned int i = 0; i <
fNAngles; ++i){
753 if(!(fabs(
xphi) >89 && fabs(
xphi)<91))
765 for(
unsigned int i = 0; i < clusterListHandle->size(); ++i){
771 std::vector< recob::SpacePoint > spcpts;
778 TVector3 dcosVtx(TMath::Cos(fPhi*TMath::Pi()/180)*TMath::Sin(fTheta*TMath::Pi()/180),
779 TMath::Cos(fTheta*TMath::Pi()/180),
780 TMath::Sin(fPhi*TMath::Pi()/180)*TMath::Sin(fTheta*TMath::Pi()/180));
791 Shower3DVector->push_back(singShower);
796 for(
size_t p = 0; p < prodvec.
size(); ++p){
797 std::vector< art::Ptr<recob::Hit> >
hits = fmh.at(p);
815 art::ProductID aid = this->getProductID< std::vector < recob::Shower > >();
834 evt.
put(std::move(Shower3DVector));
835 evt.
put(std::move(cassn));
836 evt.
put(std::move(hassn));
837 evt.
put(std::move(calorimetrycol));
838 evt.
put(std::move(calassn));
863 unsigned int wire=0,plane=
fNPlanes-1;
868 double npoints_calo=0;
877 double ortdist,linedist;
878 double wire_on_line,time_on_line;
896 { dEdx_new = calalg.
dEdx_AREA((*hitIter), newpitch );
901 dEdx_new = calalg.
dEdx_AMP((*hitIter), newpitch );
912 ortdist=gser.
Get2DDistance(wire_on_line,time_on_line,wire,time);
917 double wdist=(((double)wire-(
double)
fWire_vertex[plane])*newpitch)*direction;
923 vdEdx.push_back(dEdx_new);
925 vdQdx.push_back((*hitIter)->PeakAmplitude()/newpitch);
928 Kin_En+=dEdx_new*newpitch;
957 auto const signalType
985 { dEdx = calalg.
dEdx_AREA((*hitIter), newpitch );
989 dEdx = calalg.
dEdx_AMP((*hitIter), newpitch );
996 ortdist=gser.
Get2DDistance(wire_on_line,time_on_line,wire,time);
1000 double wdist=(((double)wire-(
double)
fWire_vertex[plane])*newpitch)*direction;
1011 fRMS_2cm[
set]+= (dEdx-mevav2cm)*(dEdx-mevav2cm);
1035 { dEdx = calalg.
dEdx_AREA((*hitIter), newpitch );
1039 dEdx = calalg.
dEdx_AMP((*hitIter), newpitch );
1044 ortdist=gser.
Get2DDistance(wire_on_line,time_on_line,wire,time);
1046 double wdist=(((double)wire-(
double)
fWire_vertex[plane])*newpitch)*direction;
1056 if( ((dEdx > (mevav2cm-
fRMS_2cm[
set]) )
1057 && (dEdx < (mevav2cm+
fRMS_2cm[
set]) ))
1230 #endif // SHOWERRECO_H std::vector< double > fTime_last
fhicl::ParameterSet fCaloPSet
std::vector< double > fWire_vertexError
ShowerReco(fhicl::ParameterSet const &pset)
std::vector< double > fTotChargeADC
std::vector< double > fCorr_Charge_2cm
void set_direction_err(const TVector3 &dir_e)
PlaneGeo const & Plane(unsigned int const p, unsigned int const tpc=0, unsigned int const cstat=0) const
Returns the specified wire.
Encapsulate the construction of a single cyostat.
virtual int TriggerOffset() const =0
Double_t Get2DDistance(Double_t wire1, Double_t time1, Double_t wire2, Double_t time2) const
void Get2DVariables(art::PtrVector< recob::Hit > hitlist)
double dEdx_AREA(art::Ptr< recob::Hit > hit, double pitch, double T0=0) const
geo::WireID WireID() const
Initial tdc tick for hit.
std::vector< int > fNhitsperplane
Declaration of signal hit object.
The data type to uniquely identify a Plane.
std::vector< double > vdEdx
std::vector< double > fTotADCperplane
std::vector< std::vector< double > > fDistribChargeMeV
float StartWire() const
Returns the wire coordinate of the start of the cluster.
bool ChannelsIntersect(raw::ChannelID_t c1, raw::ChannelID_t c2, double &y, double &z) const
Returns an intersection point of two channels.
virtual double SamplingRate() const =0
Returns the period of the TPC readout electronics clock.
std::vector< int > fNpoints_corr_MeV_2cm
std::vector< std::vector< double > > fSingleEvtAngle
std::vector< double > fTime_vertex
WireID_t Wire
Index of the wire within its plane.
art::ServiceHandle< geo::Geometry > geom
float EndTick() const
Returns the tick coordinate of the end of the cluster.
std::vector< unsigned int > fWire_last
SigType_t SignalType(geo::PlaneID const &pid) const
Returns the type of signal on the channels of specified TPC plane.
EDProductGetter const * productGetter(ProductID const) const
std::vector< std::vector< double > > fDistribHalfChargeMeV
float StartAngle() const
Returns the starting angle of the cluster.
std::vector< double > fChargeMeV_2cm_refined
geo::Length_t WirePitch(geo::PlaneID const &planeid) const
Returns the distance between two consecutive wires.
void GetVertexAndAnglesFromCluster(art::Ptr< recob::Cluster > clust, unsigned int plane)
Double_t PitchInView(UInt_t plane, Double_t phi, Double_t theta) const
std::vector< double > vresRange
ProductID put(std::unique_ptr< PROD > &&product)
std::vector< int > fNpoints_2cm
auto vector(Vector const &v)
Returns a manipulator which will print the specified array.
std::vector< double > fTime_vertexError
unsigned int Nplanes(unsigned int tpc=0, unsigned int cstat=0) const
Returns the total number of wire planes in the specified TPC.
std::vector< std::vector< double > > fSingleEvtAngleVal
void LongTransEnergy(unsigned int set, std::vector< art::Ptr< recob::Hit > > hitlist, bool isData=false)
void set_direction(const TVector3 &dir)
#define DEFINE_ART_MODULE(klass)
void push_back(Ptr< U > const &p)
std::vector< double > vdQdx
virtual double Temperature() const =0
T get(std::string const &key) const
geo::WireID::WireID_t NearestWire(geo::Point_t const &point, geo::PlaneID const &planeid) const
Returns the index of wire closest to position in the specified TPC.
std::vector< double > fRMS_2cm
void produce(art::Event &evt)
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.
float SigmaStartWire() const
Returns the uncertainty on wire coordinate of the start of the cluster.
PlaneID_t Plane
Index of the plane within its TPC.
Declaration of cluster object.
std::vector< std::vector< double > > fNPitch
void reconfigure(fhicl::ParameterSet const &pset)
Detector simulation of raw signals on wires.
std::vector< double > fCorr_MeV_2cm
Encapsulate the geometry of a wire.
Int_t GetPointOnLine(Double_t slope, Double_t intercept, Double_t wire1, Double_t time1, Double_t &wireout, Double_t &timeout) const
std::string fClusterModuleLabel
data_t::const_iterator const_iterator
raw::ChannelID_t PlaneWireToChannel(WireID const &wireid) const
Returns the ID of the TPC channel connected to the specified wire.
float PeakTime() const
Time of the signal peak, in tick units.
std::vector< double > xyz_vertex_fit
T * make(ARGS...args) const
void beginRun(art::Run &run)
Utility object to perform functions of association.
Encapsulate the construction of a single detector plane.
std::vector< double > fChargeMeV_2cm
bool getByLabel(std::string const &label, std::string const &productInstanceName, Handle< PROD > &result) const
std::vector< double > fTotChargeMeV_MIPs
virtual double DriftVelocity(double efield=0., double temperature=0.) const =0
const detinfo::DetectorProperties * detprop
MaybeLogger_< ELseverityLevel::ELsev_warning, false > LogWarning
float SigmaStartTick() const
Returns the uncertainty on tick coordinate of the start of the cluster.
std::vector< double > fChargeADC_2cm
std::vector< std::vector< double > > fDistribChargeADC
EventNumber_t event() const
constexpr double kBogusD
obviously bogus double value
std::vector< double > fChargeMeV_2cm_axsum
void ClearandResizeVectors(unsigned int nPlanes)
virtual double Efield(unsigned int planegap=0) const =0
Returns the nominal electric field in the specified volume.
std::vector< int > fNpoints_corr_ADC_2cm
Namespace collecting geometry-related classes utilities.
std::vector< std::vector< double > > fDistribChargeposition
float StartTick() const
Returns the tick coordinate of the start of the cluster.
std::vector< unsigned int > fWire_vertex
SubRunNumber_t subRun() const
void LocalToWorld(const double *plane, double *world) const
Transform point from local plane frame to world frame.
std::vector< double > deadwire
double dEdx_AMP(art::Ptr< recob::Hit > hit, double pitch, double T0=0) const
art framework interface to geometry description
constexpr Point origin()
Returns a origin position with a point of the specified type.
cet::coded_exception< error, detail::translate > exception
Encapsulate the construction of a single detector plane.
std::vector< double > fTotChargeMeV
Signal from collection planes.
float EndWire() const
Returns the wire coordinate of the end of the cluster.