Commit a4565f32 authored by Adrien Matta's avatar Adrien Matta
Browse files

* Adding Tracking utility file

parent b2f6db6b
......@@ -7,4 +7,4 @@ add_custom_command(OUTPUT TrackingDict.cxx COMMAND ${CMAKE_BINARY_DIR}/scripts/b
add_library(NPTrackReconstruction SHARED NPRansac.cxx NPCluster.cxx NPTrack.cxx Tracking.cxx NPRansacDict.cxx NPClusterDict.cxx TrackingDict.cxx)
target_link_libraries(NPTrackReconstruction ${ROOT_LIBRARIES} NPCore)
install(FILES NPRansac.h NPCluster.h NPTrack.h Tracking.h DESTINATION ${CMAKE_INCLUDE_OUTPUT_DIRECTORY})
install(FILES NPRansac.h NPCluster.h NPTrack.h Tracking.h NPTrackingUtility.h DESTINATION ${CMAKE_INCLUDE_OUTPUT_DIRECTORY})
#ifndef NPUTILITY_H
#define NPUTILITY_H
/*****************************************************************************
* Copyright (C) 2009-2016 this file is part of the NPTool Project *
* *
* For the licensing terms see $NPTOOL/Licence/NPTool_Licence *
* For the list of contributors see $NPTOOL/Licence/Contributors *
*****************************************************************************/
/*****************************************************************************
* *
* Original Author : Adrien Matta contact address: matta@lpccaen.in2p3.fr *
* *
* Creation Date : July 2020 *
*---------------------------------------------------------------------------*
* Decription: *
* This class deal with finding all the track event by event *
*****************************************************************************/
namespace NPL{
double MinimunDistance(TVector3 v1,TVector3 v2, TVector3 w1, TVector3 w2){
TVector3 v=v1-v2;
TVector3 w = w2-w1;
// Minimum distance
// let be n perpendicular to both line
TVector3 n = v.Cross(w);
double d = n.Dot(v1-w1)/n.Mag();
return d;
}
}
#endif
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment