Skip to content
Snippets Groups Projects
Commit 8d99f200 authored by Andrea Celentano's avatar Andrea Celentano
Browse files

Update file MManager.h

parent 21c31e6a
1 merge request!563Resolve "SimpleTrackingMM method - checks in CanTrack"
Pipeline #11070387 failed
...@@ -69,8 +69,8 @@ struct MManager ...@@ -69,8 +69,8 @@ struct MManager
void AddEvent(const RecoEvent&); void AddEvent(const RecoEvent&);
void AddEvent(const RecoEvent&,const MMcond); void AddEvent(const RecoEvent&,const MMcond);
bool UpStreamOK() const; bool UpStreamOK() const;
bool DownStreamOK(bool requireAtLeastTwo) const; bool CanTrackSimpleTracking() const;
bool CanTrack(bool requireAtLeastTwoDownstream=false) const; bool CanTrackDeflectionOrGenfit() const;
SimpleTrack SimpleTrackingMM(); SimpleTrack SimpleTrackingMM();
SimpleTrack PointDeflectionTracking(); SimpleTrack PointDeflectionTracking();
double GetAngleSimple(); double GetAngleSimple();
...@@ -94,6 +94,8 @@ private: ...@@ -94,6 +94,8 @@ private:
TVector3 mm3; TVector3 mm3;
TVector3 mm4; TVector3 mm4;
bool DownStreamOK(const int NMin) const;
// EventDisplay crash on machines with Intel graphics, workaround: // EventDisplay crash on machines with Intel graphics, workaround:
// $ export LIBGL_ALWAYS_INDIRECT=1 // $ export LIBGL_ALWAYS_INDIRECT=1
// https://root.cern.ch/phpBB3/viewtopic.php?t=21274 // https://root.cern.ch/phpBB3/viewtopic.php?t=21274
...@@ -188,20 +190,26 @@ bool MManager::UpStreamOK() const ...@@ -188,20 +190,26 @@ bool MManager::UpStreamOK() const
} }
bool MManager::DownStreamOK(bool requireAtLeastTwo) const bool MManager::DownStreamOK(const int NMin) const
{ {
const unsigned int Nup = downstream.size(); const unsigned int Nup = downstream.size();
const unsigned int NupMIN = requireAtLeastTwo ? 2 :1; if(Nup < NMin) return false; //TODO: in theory is possible with just one
if(Nup < NupMIN) return false; //TODO: in theory is possible with just one
else return true; else return true;
} }
bool MManager::CanTrack(bool requireAtLeastTwoDownstream) const bool MManager::CanTrackSimpleTracking() const
{
//if(!UpStreamOK())cout << "not enough hit upstream" << endl;
//if(!DownStreamOK())cout << "not enough hit downstream" << endl;
return UpStreamOK() && DownStreamOK(2);
}
bool MManager::CanTrackDeflectionOrGenfit() const
{ {
//if(!UpStreamOK())cout << "not enough hit upstream" << endl; //if(!UpStreamOK())cout << "not enough hit upstream" << endl;
//if(!DownStreamOK())cout << "not enough hit downstream" << endl; //if(!DownStreamOK())cout << "not enough hit downstream" << endl;
return UpStreamOK() && DownStreamOK(requireAtLeastTwoDownstream); return UpStreamOK() && DownStreamOK(1);
} }
void MManager::CollectPointsSimple(const vector<const Micromega*>& vec,TVector3& mmup,TVector3& mmdown) void MManager::CollectPointsSimple(const vector<const Micromega*>& vec,TVector3& mmup,TVector3& mmdown)
...@@ -231,7 +239,7 @@ SimpleTrack MManager::SimpleTrackingMM() ...@@ -231,7 +239,7 @@ SimpleTrack MManager::SimpleTrackingMM()
SimpleTrack st; SimpleTrack st;
if(!CanTrack(true)) if(!CanTrackSimpleTracking())
return st; return st;
///ELSE:simple tracking algorithm for the MM ///ELSE:simple tracking algorithm for the MM
...@@ -254,7 +262,7 @@ SimpleTrack MManager::PointDeflectionTracking() ...@@ -254,7 +262,7 @@ SimpleTrack MManager::PointDeflectionTracking()
//define track //define track
SimpleTrack st; SimpleTrack st;
if(!CanTrack()) if(!CanTrackDeflectionOrGenfit())
return st; return st;
//use all point downstream and upstream to have an estimate on momentum reconstruction //use all point downstream and upstream to have an estimate on momentum reconstruction
...@@ -295,11 +303,16 @@ double MManager::GetAngleSimple() ...@@ -295,11 +303,16 @@ double MManager::GetAngleSimple()
void MManager::PrintMM(unsigned int verbose = 3) void MManager::PrintMM(unsigned int verbose = 3)
{ {
if(CanTrack() && verbose > 1) if(CanTrackSimpleTracking() && verbose > 1)
cout << "THIS EVENT TRACKING IS POSSIBLE" << endl; cout << "THIS EVENT SIMPLE TRACKING IS POSSIBLE" << endl;
else if(verbose > 1) else if(verbose > 1)
cout << "THIS EVENT TRACKING IS NOT POSSIBLE" << endl; cout << "THIS EVENT TRACKING IS NOT POSSIBLE" << endl;
if(CanTrackDeflectionOrGenfit() && verbose > 1)
cout << "THIS EVENT GENFIT TRACKING IS POSSIBLE" << endl;
else if(verbose > 1)
cout << "THIS EVENT GENFIT TRACKING IS NOT POSSIBLE" << endl;
cout << "MM with hits upstream " << endl; cout << "MM with hits upstream " << endl;
for(auto it = upstream.begin();it!=upstream.end();++it) for(auto it = upstream.begin();it!=upstream.end();++it)
{ {
...@@ -369,7 +382,7 @@ void MManager::GenfitInit(const TString geofile) ...@@ -369,7 +382,7 @@ void MManager::GenfitInit(const TString geofile)
void MManager::GenfitTrack() void MManager::GenfitTrack()
{ {
if(!CanTrack()) if(!CanTrackDeflectionOrGenfit())
return; return;
typedef genfit::MeasurementProducer<genfit::mySpacepointDetectorHit, genfit::mySpacepointMeasurement> MyMeasurementProducer; typedef genfit::MeasurementProducer<genfit::mySpacepointDetectorHit, genfit::mySpacepointMeasurement> MyMeasurementProducer;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment