Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update trajectory::addMeasurement from void to bool for adding successfully. #18

Merged
merged 1 commit into from
Oct 12, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion core/include/AidaTT.hh
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
* where the chosen implementations of the abstract classes are also passed as arguments.
*
* Measurements are then added by
* void trajectory::addMeasurement(const Vector3D& position, const std::vector<double>& resolution, const ISurface& surface, void* id),
* bool trajectory::addMeasurement(const Vector3D& position, const std::vector<double>& resolution, const ISurface& surface, void* id),
* other points or elements like scattering material or points of interest (nominal starting point, calorimeter face,...) are added with either
* void trajectory::addElement(const Vector3D& position, void* id);
* void trajectory::addElement(const Vector3D& position, const ISurface& surface, void* id);
Expand Down
3 changes: 2 additions & 1 deletion core/include/trajectory.hh
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,9 @@ namespace aidaTT

/** add a trajectoryElement with a measurement/hit to the trajectory - identified by:
* a position, the precision, the surface and a user defined id/pointer
* if this measurement has been successfully added, return true, otherwise return false.
*/
void addMeasurement(const Vector3D& position, const std::vector<double>& precision,
bool addMeasurement(const Vector3D& position, const std::vector<double>& precision,
const ISurface& surface, void* id, bool isScatterer=false ) ;


Expand Down
6 changes: 4 additions & 2 deletions core/src/trajectory.cc
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ namespace aidaTT {



void trajectory::addMeasurement(const Vector3D& position, const std::vector<double>& precision,
bool trajectory::addMeasurement(const Vector3D& position, const std::vector<double>& precision,
const ISurface& surface, void* id, bool isScatterer)
{

Expand All @@ -166,7 +166,7 @@ namespace aidaTT {
<< " does not intersect with surface : " << surface
<< " hit will be ignored ! " << std::endl ;

return ;
return false;
}

// std::cout << " prevS : " << prevS << " - s to next intersection: " << s << std::endl ;
Expand Down Expand Up @@ -235,6 +235,8 @@ namespace aidaTT {

// note: need to get the curvilinear system at s==0. as this is where the local track state is defined
_initialTrajectoryElements.push_back(new trajectoryElement(s, trkParam, surface, measDir, new_prec, residuals, calculateLocalCurvilinearSystem(0., *trkParam), id , isScatterer ));

return true;
}

void trajectory::addScatterer( const ISurface& surface ){
Expand Down