21 #include "Utilities/func/MathUtil.h" 30 #include "NovaDAQConventions/DAQConventions.h" 59 std::vector<TVector3> & poslist);
62 std::vector<TVector3>& poslist,
63 std::vector<double>& PEs,
64 std::vector<double>& tlist);
66 double calcW(
double z,
double w1,
double w2,
double z1,
double z2);
87 produces< std::vector<rb::Track> >();
103 std::unique_ptr< std::vector<rb::Track> > trackcol(
new std::vector<rb::Track>);
106 for (
unsigned sliceIdx = 0; sliceIdx != slices->size(); ++sliceIdx) {
116 double tx_max = -9e9;
118 for (
unsigned i=0;
i!= Xhitlist.
size(); ++
i) {
120 if (tx_min > chit->
TNS()) tx_min = chit->
TNS();
121 if (tx_max < chit->TNS()) tx_max = chit->
TNS();
122 if (px_min > chit->
Plane()) px_min = chit->
Plane();
123 if (px_max < chit->Plane()) px_max = chit->
Plane();
129 double ty_max = -9e9;
131 for (
unsigned i=0;
i!= Yhitlist.
size(); ++
i) {
133 if (ty_min > chit->
TNS()) ty_min = chit->
TNS();
134 if (ty_max < chit->TNS()) ty_max = chit->
TNS();
135 if (py_min > chit->
Plane()) py_min = chit->
Plane();
136 if (py_max < chit->Plane()) py_max = chit->
Plane();
146 std::vector<TVector3> Xp_list,Yp_list;
147 std::vector<TVector3> trjList;
148 std::vector<double> t_list;
152 if (!
Tracking2D(geom,Xhitlist,0,xtrack,Xp_list) )
155 if (!
Tracking2D(geom,Yhitlist,1,ytrack,Yp_list) )
162 TVector3 lowZ_P, highZ_P;
165 unsigned nxhits_RC = Xp_list.size();
166 unsigned nyhits_RC = Yp_list.size();
168 for (
unsigned i=0;
i!= nxhits_RC; ++
i) {
174 Yp_list[nyhits_RC-1].
X(),
176 Yp_list[nyhits_RC-1].
Y() ) ) );
177 if (!rhit.IsCalibrated() )
180 trjList.emplace_back(TVector3(rhit.X(),rhit.Y(),rhit.Z()));
181 t_list.emplace_back(rhit.T());
186 FMMtrack3D.
Add(chit);
197 for (
unsigned i=0;
i!= nyhits_RC; ++
i) {
202 Xp_list[nxhits_RC-1].
X(),
204 Xp_list[nxhits_RC-1].
Y() ) ) );
206 if (!rhit.IsCalibrated() )
210 trjList.emplace_back(TVector3(rhit.X(),rhit.Y(),rhit.Z()));
211 t_list.emplace_back(rhit.T());
213 FMMtrack3D.
Add(chit);
240 trackcol->emplace_back(FMMtrack3D);
243 evt.
put(std::move(trackcol));
252 std::vector<TVector3> &
plist 256 std::vector<double>
x,
y,
w,
t;
261 for (
unsigned i=0;
i!= hitlist.
size(); ++
i) {
265 w.emplace_back(chit->
ADC() );
267 x.emplace_back(xyz[2]);
268 y.emplace_back(xyz[view]);
269 t.emplace_back(chit->
TNS());
277 for (
unsigned i=0;
i!= hitlist.
size(); ++
i) {
280 track.
Add(hitlist[i]);
281 plist.emplace_back( TVector3(y[i], x[i], t[i]) );
291 std::vector<TVector3>& poslist,
292 std::vector<double>& PEs,
293 std::vector<double>& tlist)
297 for (
unsigned i=0;
i!= PEs.size(); ++
i) {
308 double w = (w2*(z-z1)+w1*(z2-z))/(z2-z1);
309 if (w > 761) w = 761;
310 else if (w < -761) w = -761;
T max(const caf::Proxy< T > &a, T b)
bool Tracking2D(art::ServiceHandle< geo::Geometry > const &geom, const art::PtrVector< rb::CellHit > &hitlist, int view, rb::Track &track, std::vector< TVector3 > &poslist)
back track the reconstruction to the simulation
unsigned int NCell(geo::View_t view) const
Number of cells in view view.
const art::PtrVector< rb::CellHit > & XCells() const
Get all cells from the x-view.
Float_t y1[n_points_granero]
unsigned short Plane() const
Float_t x1[n_points_granero]
rb::RecoHit MakeRecoHit(rb::CellHit const &cellhit, double w)
A collection of associated CellHits.
A rb::Prong with full reconstructed trajectory.
const PlaneGeo * Plane(unsigned int i) const
DEFINE_ART_MODULE(TestTMapFile)
Calibrated quantities relying on position in the orthogonal view. To generate a rb::CellHit from a rb...
std::string fClusterInput
Input folder from cluster reco.
virtual void Add(const art::Ptr< rb::CellHit > &cell, double weight=1)
ProductID put(std::unique_ptr< PROD > &&product)
unsigned short Cell() const
double LinFitMinDperp(const std::vector< double > &x, const std::vector< double > &y, const std::vector< double > &w, double *x1, double *y1, double *x2, double *y2)
Find the best-fit line to a collection of points in 2-D by minimizing the squared perpendicular dista...
double DsqrToLine(double x0, double y0, double x1, double y1, double x2, double y2)
In two dimensions, return the perpendicular distance from a point (x0,y0) to a line defined by end po...
const art::PtrVector< rb::CellHit > & YCells() const
Get all cells from the x-view.
void AppendTrajectoryPoint(TVector3 pt)
fvar< T > exp(const fvar< T > &x)
Collect Geo headers and supply basic geometry functions.
art::Ptr< rb::CellHit > Cell(geo::View_t view, unsigned int viewIdx) const
Get the ith cell from view view.
int16_t ADC(uint32_t i) const
bool getByLabel(std::string const &label, std::string const &productInstanceName, Handle< PROD > &result) const
double recoT(TVector3 position, std::vector< TVector3 > &poslist, std::vector< double > &PEs, std::vector< double > &tlist)
FMMTracker(fhicl::ParameterSet const &pset)
double calcW(double z, double w1, double w2, double z1, double z2)
void produce(art::Event &evt)
T min(const caf::Proxy< T > &a, T b)
Encapsulate the geometry of one entire detector (near, far, ndos)