Skip to content
Snippets Groups Projects
Commit ac6c8fc4 authored by Marco Clemencic's avatar Marco Clemencic
Browse files

v6r5

parent 160ea87b
No related branches found
No related tags found
No related merge requests found
package RecSys package RecSys
version v6r4 version v6r5
branches cmt doc python branches cmt doc python
...@@ -35,7 +35,7 @@ use TrackUtils v1r25 Tr # Eduardo Rodrigues ...@@ -35,7 +35,7 @@ use TrackUtils v1r25 Tr # Eduardo Rodrigues
# Tf packages: Track Pattern Recognition # Tf packages: Track Pattern Recognition
use TrackSys v4r22 Tf # Stephanie Hansmann-Menzemer use TrackSys v4r22 Tf # Stephanie Hansmann-Menzemer
use PatAlgorithms v3r17 Tf # Stephanie Hansmann-Menzemer use PatAlgorithms v3r18 Tf # Stephanie Hansmann-Menzemer
use PatVelo v3r12 Tf # David Hutchcroft use PatVelo v3r12 Tf # David Hutchcroft
use PatVeloTT v3r6 Tf # Mariusz Witek use PatVeloTT v3r6 Tf # Mariusz Witek
use TfTools v1r7 Tf # Stephanie Hansmann-Menzemer use TfTools v1r7 Tf # Stephanie Hansmann-Menzemer
......
v6r4 v6r5
...@@ -5,6 +5,14 @@ Purpose: LHCb reconstruction packages. ...@@ -5,6 +5,14 @@ Purpose: LHCb reconstruction packages.
This project groups together all the reconstruction packages needed This project groups together all the reconstruction packages needed
by one or more LHCb applications. by one or more LHCb applications.
</PRE><H1><A NAME=v6r5>2009-04-22 RecSys v6r5</A></H1><PRE>
This version uses Gaudi v20r4 and LHCb v26r3.
- Packages modified: PatAlgorithms v3r18
- In PatAlgorithms v3r18
. Make PatSeedFit safe against unreasonable track input
</PRE><H1><A NAME=v6r4>2009-04-20 RecSys v6r4</A></H1><PRE> </PRE><H1><A NAME=v6r4>2009-04-20 RecSys v6r4</A></H1><PRE>
This version uses Gaudi v20r4 and LHCb v26r3. This version uses Gaudi v20r4 and LHCb v26r3.
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
# Maintainer : Stephanie Hansmann-Menzemer # Maintainer : Stephanie Hansmann-Menzemer
#============================================================================ #============================================================================
package PatAlgorithms package PatAlgorithms
version v3r17 version v3r18
#============================================================================ #============================================================================
# Structure, i.e. directories to process. # Structure, i.e. directories to process.
......
v3r17 v3r18
...@@ -4,13 +4,17 @@ ...@@ -4,13 +4,17 @@
! Purpose : track finding ! Purpose : track finding
!----------------------------------------------------------------------------- !-----------------------------------------------------------------------------
!========================== PatAlgorithms v3r18 2009-04-22 ===================
! 2009-04-22 - Stephanie Hansmann-Menzemer
- make PatSeedFit safe against unreasonable track input
!========================== PatAlgorithms v3r17 2009-04-20 =================== !========================== PatAlgorithms v3r17 2009-04-20 ===================
! 2009-04-20 - Marco Cattaneo ! 2009-04-20 - Marco Cattaneo
- Fix an untested StatusCode - Fix an untested StatusCode
- Replace endreq by endmsg everywhere - Replace endreq by endmsg everywhere
! 2009-04-18 - Stephanie Hansmann-Menzemer ! 2009-04-18 - Stephanie Hansmann-Menzemer
- add correction for tilde of straws to fitter initialization code - add correction for tilt of straws to fitter initialization code
!========================== PatAlgorithms v3r16 2009-04-07 =================== !========================== PatAlgorithms v3r16 2009-04-07 ===================
! 2009-04-07 - Olivier Callot ! 2009-04-07 - Olivier Callot
......
// $Id: PatSeedFit.cpp,v 1.5 2009-04-20 06:46:56 cattanem Exp $ // $Id: PatSeedFit.cpp,v 1.6 2009-04-22 13:09:00 smenzeme Exp $
#include "GaudiKernel/ToolFactory.h" #include "GaudiKernel/ToolFactory.h"
#include "GaudiKernel/IRegistry.h" #include "GaudiKernel/IRegistry.h"
#include "Event/STLiteCluster.h" #include "Event/STLiteCluster.h"
...@@ -128,7 +128,7 @@ StatusCode PatSeedFit::fitSeed( const std::vector<LHCb::LHCbID> lhcbIDs, ...@@ -128,7 +128,7 @@ StatusCode PatSeedFit::fitSeed( const std::vector<LHCb::LHCbID> lhcbIDs,
return Error("No module found for OT hit!"); return Error("No module found for OT hit!");
} }
LHCb::OTLiteTime otlitetime = m_otdecoder->time( otid );// *module ) ; LHCb::OTLiteTime otlitetime = m_otdecoder->time( otid );
Tf::OTHit* othit = new Tf::OTHit( *module, otlitetime ) ; Tf::OTHit* othit = new Tf::OTHit( *module, otlitetime ) ;
othits.push_back( othit) ; othits.push_back( othit) ;
hits.push_back( new PatFwdHit( *othit ) ) ; hits.push_back( new PatFwdHit( *othit ) ) ;
...@@ -138,9 +138,13 @@ StatusCode PatSeedFit::fitSeed( const std::vector<LHCb::LHCbID> lhcbIDs, ...@@ -138,9 +138,13 @@ StatusCode PatSeedFit::fitSeed( const std::vector<LHCb::LHCbID> lhcbIDs,
if( hits.size() >= 4 ) { if( hits.size() >= 4 ) {
std::vector< PatFwdHit* > seedhits(4,static_cast<PatFwdHit*>(0)) ; std::vector< PatFwdHit* > seedhits(4,static_cast<PatFwdHit*>(0)) ;
size_t numStereo(0) ; size_t numStereo(0) ;
double n=0;
BOOST_FOREACH( PatFwdHit* ihit, hits ) { BOOST_FOREACH( PatFwdHit* ihit, hits ) {
ihit->setSelected(true) ; ihit->setSelected(true) ;
if( ihit->hit()->isX() ) { if( ihit->hit()->isX() ) {
n++;
if( seedhits[0] == 0 || if( seedhits[0] == 0 ||
ihit->hit()->zAtYEq0() < seedhits[0]->hit()->zAtYEq0() ) ihit->hit()->zAtYEq0() < seedhits[0]->hit()->zAtYEq0() )
seedhits[0] = ihit ; seedhits[0] = ihit ;
...@@ -157,28 +161,39 @@ StatusCode PatSeedFit::fitSeed( const std::vector<LHCb::LHCbID> lhcbIDs, ...@@ -157,28 +161,39 @@ StatusCode PatSeedFit::fitSeed( const std::vector<LHCb::LHCbID> lhcbIDs,
seedhits[2] = ihit ; seedhits[2] = ihit ;
} }
} }
//for(int i=0; i<4; ++i) seedhits[i] ;
PatSeedTrack * pattrack = PatSeedTrack * pattrack =
new PatSeedTrack(seedhits[0],seedhits[1],seedhits[2],seedhits[3], m_zReference, m_dRatio, m_initialArrow ) ; new PatSeedTrack(seedhits[0],seedhits[1],seedhits[2],seedhits[3], m_zReference, m_dRatio, m_initialArrow ) ;
// save initial track parameters in case, internal fit fails later
double z0,bx,ax,cx,dx,ay,by;
pattrack->getParameters( z0, bx,ax, cx,dx,ay, by);
BOOST_FOREACH( PatFwdHit* ihit, hits ) { BOOST_FOREACH( PatFwdHit* ihit, hits ) {
if( std::find(seedhits.begin(), seedhits.end(), ihit ) == seedhits.end() ) { if( std::find(seedhits.begin(), seedhits.end(), ihit ) == seedhits.end() ) {
updateHitForTrack( ihit, pattrack->yAtZ(ihit->z()), 0); updateHitForTrack( ihit, pattrack->yAtZ(ihit->z()), 0);
pattrack->addCoord( ihit ) ; pattrack->addCoord( ihit ) ;
} }
} }
StatusCode sc = fitTrack( *pattrack, m_maxChi2, 0, false, false);
if(sc.isFailure()) {
Warning("First call to fitTrack failed", sc, 0).ignore();
pattrack->setParameters(z0, bx,ax, cx,dx,ay, by);
} else {
StatusCode sc = fitTrack( *pattrack, m_maxChi2, 0, false, false); BOOST_FOREACH( PatFwdHit* ihit, hits ) {
if(sc.isFailure()) Warning("First call to fitTrack failed", sc, 0).ignore(); if( std::find(seedhits.begin(), seedhits.end(), ihit ) == seedhits.end() )
updateHitForTrack( ihit, pattrack->yAtZ(ihit->z()), 0);
BOOST_FOREACH( PatFwdHit* ihit, hits ) { }
if( std::find(seedhits.begin(), seedhits.end(), ihit ) == seedhits.end() ) sc = fitTrack( *pattrack, m_maxChi2, 0, false, false);
updateHitForTrack( ihit, pattrack->yAtZ(ihit->z()), 0); if(sc.isFailure()) {
Warning("Second call to fitTrack failed", sc, 0).ignore();
pattrack->setParameters(z0, bx,ax, cx,dx,ay, by);
}
} }
sc = fitTrack( *pattrack, m_maxChi2, 0, false, false);
if(sc.isFailure()) Warning("Second call to fitTrack failed", sc, 0).ignore();
LHCb::State temp(Gaudi::TrackVector(pattrack->xAtZ(m_zReference), LHCb::State temp(Gaudi::TrackVector(pattrack->xAtZ(m_zReference),
pattrack->yAtZ(m_zReference), pattrack->yAtZ(m_zReference),
...@@ -188,21 +203,7 @@ StatusCode PatSeedFit::fitSeed( const std::vector<LHCb::LHCbID> lhcbIDs, ...@@ -188,21 +203,7 @@ StatusCode PatSeedFit::fitSeed( const std::vector<LHCb::LHCbID> lhcbIDs,
double qOverP, sigmaQOverP; double qOverP, sigmaQOverP;
sc = m_momentumTool->calculate(&temp, qOverP, sigmaQOverP, true) ; sc = m_momentumTool->calculate(&temp, qOverP, sigmaQOverP, true) ;
/*
if(states.size()>0 && states.begin().location()<=LHCb::State::EndVelo) {
//success = m_momentumTool->calculate(&(track.firstState()), &temp, qOverP, sigmaQOverP, true) ;
//qOverP = -qOverP;
for( std::vector<LHCb::State>::iterator istate = states.begin();
istate != states.end(); ++istate) {
if(istate->location() <= LHCb::State::EndVelo) {
istate->setQOverP( qOverP ) ;
istate->setErrQOverP2(sigmaQOverP*sigmaQOverP) ;
}
}
}
*/
//else success = m_momentumTool->calculate(&temp, qOverP, sigmaQOverP, true) ;
if(sc.isFailure()) { if(sc.isFailure()) {
// if our momentum tool doesn't succeed, we have to try ourselves // if our momentum tool doesn't succeed, we have to try ourselves
qOverP = pattrack->curvature() ; qOverP = pattrack->curvature() ;
...@@ -232,12 +233,11 @@ StatusCode PatSeedFit::fitSeed( const std::vector<LHCb::LHCbID> lhcbIDs, ...@@ -232,12 +233,11 @@ StatusCode PatSeedFit::fitSeed( const std::vector<LHCb::LHCbID> lhcbIDs,
info() << "Not enough SEED hits! "<<hits.size() << endmsg ; info() << "Not enough SEED hits! "<<hits.size() << endmsg ;
} }
// deletthe hits // delete the hits
BOOST_FOREACH( PatFwdHit* ihit, hits ) delete ihit ; BOOST_FOREACH( PatFwdHit* ihit, hits ) delete ihit ;
BOOST_FOREACH( Tf::STHit* ihit, sthits ) delete ihit ; BOOST_FOREACH( Tf::STHit* ihit, sthits ) delete ihit ;
BOOST_FOREACH( Tf::OTHit* ihit, othits ) delete ihit ; BOOST_FOREACH( Tf::OTHit* ihit, othits ) delete ihit ;
//std::cout<<states->size()<<std::endl;
return StatusCode::SUCCESS ; return StatusCode::SUCCESS ;
} }
......
// $Id: PatSeedFit.h,v 1.1 2009-03-04 15:13:22 smenzeme Exp $ // $Id: PatSeedFit.h,v 1.2 2009-04-22 13:09:21 smenzeme Exp $
#ifndef INCLUDE_PATSEEDFIT_H #ifndef INCLUDE_PATSEEDFIT_H
#define INCLUDE_PATSEEDFIT_H 1 #define INCLUDE_PATSEEDFIT_H 1
#include "GaudiAlg/GaudiTool.h" #include "GaudiAlg/GaudiTool.h"
#include "TrackInterfaces/IPatSeedFit.h" #include "TrackInterfaces/IPatSeedFit.h"
static const InterfaceID IID_PatSeedFit("PatSeedFit", 1, 0); static const InterfaceID IID_PatSeedFit("PatSeedFit", 1, 0);
// forward declarations // forward declarations
......
// $Id: PatSeedTrack.h,v 1.4 2008-08-26 09:57:02 mschille Exp $ // $Id: PatSeedTrack.h,v 1.5 2009-04-22 13:09:00 smenzeme Exp $
#ifndef PATSEEDTRACK_H #ifndef PATSEEDTRACK_H
#define PATSEEDTRACK_H 1 #define PATSEEDTRACK_H 1
...@@ -44,6 +44,28 @@ class PatSeedTrack { ...@@ -44,6 +44,28 @@ class PatSeedTrack {
virtual ~PatSeedTrack( ); ///< Destructor virtual ~PatSeedTrack( ); ///< Destructor
void getParameters( double& z0, double& bx, double &ax, double &cx, double& dx,
double& ay, double& by){
z0 = m_z0;
bx = m_bx;
ax = m_ax;
cx = m_cx;
dx = m_dx;
ay = m_ay;
by = m_by;
}
void setParameters (double z0, double bx, double ax, double cx, double dx,
double ay, double by){
m_z0 = z0;
m_bx = bx;
m_ax = ax;
m_cx = cx;
m_dx = dx;
m_ay = ay;
m_by = by;
}
double z0() const { return m_z0; } ///< return reference z double z0() const { return m_z0; } ///< return reference z
double xAtZEqZ0() const { return m_ax; } ///< return x at reference z double xAtZEqZ0() const { return m_ax; } ///< return x at reference z
...@@ -230,6 +252,7 @@ class PatSeedTrack { ...@@ -230,6 +252,7 @@ class PatSeedTrack {
protected: protected:
private: private:
bool m_valid; bool m_valid;
unsigned m_nbPlanes; unsigned m_nbPlanes;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment