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
CTPPS: tracking for the diamond detector #17817
Merged
cmsbuild
merged 23 commits into
cms-sw:master
from
forthommel:ctpps-diamond-localtracks_91X
Mar 30, 2017
Merged
Changes from all commits
Commits
Show all changes
23 commits
Select commit
Hold shift + click to select a range
5d39c91
Added the CTPPSDiamondLocalTrack object
forthommel 17dfa01
New cfi file for the local tracks fitter
forthommel 26dd3ac
first attempt of reco
nminafra d8d0af1
Added setters to CTPPS*LocalTrack and RecHit
nminafra c6926bb
New constructor for the track recognition algorithm object ; plugging…
forthommel 7c3bd1f
Added the fitting parameters to the configuration file
forthommel 7caf7bf
Combined both the totemRP and ctppsDiamond local reconstructions into…
forthommel b5120ae
Making use of the already present recoCTPPS object (instead of defini…
forthommel ffe12e6
Added the local tracks to the output definition
forthommel b2a13e3
Reco good to go
nminafra eb19b84
Changed variable names
nminafra 10098d9
Storing local tracks information as floats instead of doubles ; match…
forthommel bbff525
Code documentation and cleanup
forthommel e6c6b05
Setting the default value to 0 for timing information in the local tr…
forthommel 163c98c
Reco out of time bug fixed
nminafra 921564a
RecHit and LocalTrack MH included
nminafra 46800ae
Amended the diamonds local track recognition ; New local tracks const…
forthommel 51530aa
Improved memory footprint of the local tracks recognition
forthommel 3fc6e15
Use the precise pixel efficiency function instead of the fast one
forthommel fd4dd25
Passing by references ; range for loops
forthommel f45af97
Tracks sorting by temporal, then by spatial position
forthommel edf1427
Track recognition algorithms not defined as pointers
forthommel 1744996
Unordered maps for the parameters and hitmp in local tracks fitter ; …
forthommel File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
There are no files selected for viewing
101 changes: 101 additions & 0 deletions
101
DataFormats/CTPPSReco/interface/CTPPSDiamondLocalTrack.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,101 @@ | ||
/**************************************************************************** | ||
* | ||
* This is a part of CTPPS offline software. | ||
* Authors: | ||
* Laurent Forthomme (laurent.forthomme@cern.ch) | ||
* Nicola Minafra nicola.minafra@cern.ch) | ||
* | ||
****************************************************************************/ | ||
|
||
#ifndef DataFormats_CTPPSReco_CTPPSDiamondLocalTrack | ||
#define DataFormats_CTPPSReco_CTPPSDiamondLocalTrack | ||
|
||
#include "DataFormats/Math/interface/Point3D.h" | ||
#include "DataFormats/CTPPSReco/interface/CTPPSDiamondRecHit.h" | ||
|
||
//---------------------------------------------------------------------------------------------------- | ||
|
||
class CTPPSDiamondLocalTrack | ||
{ | ||
public: | ||
CTPPSDiamondLocalTrack() : | ||
chi_squared_( 0. ), valid_( true ), t_( 0. ), t_sigma_( 0. ), ts_index_( 0 ), mh_( 0 ) {} | ||
CTPPSDiamondLocalTrack( const math::XYZPoint& pos0, const math::XYZPoint& pos0_sigma, float chisq, float t, float t_sigma, int oot_idx, int mult_hits ) : | ||
pos0_( pos0 ), pos0_sigma_( pos0_sigma ), | ||
chi_squared_( chisq ), valid_( false ), | ||
t_( t ), t_sigma_( t_sigma ), ts_index_( oot_idx ), mh_( mult_hits ) {} | ||
virtual ~CTPPSDiamondLocalTrack() {} | ||
|
||
//--- spatial get'ters | ||
|
||
inline float getX0() const { return pos0_.x(); } | ||
inline float getX0Sigma() const { return pos0_sigma_.x(); } | ||
|
||
inline float getY0() const { return pos0_.y(); } | ||
inline float getY0Sigma() const { return pos0_sigma_.y(); } | ||
|
||
inline float getZ0() const { return pos0_.z(); } | ||
|
||
inline float getChiSquared() const { return chi_squared_; } | ||
|
||
//--- spatial set'ters | ||
|
||
inline void setPosition( const math::XYZPoint& pos0 ) { pos0_ = pos0; } | ||
inline void setPositionSigma( const math::XYZPoint& pos0_sigma ) { pos0_sigma_ = pos0_sigma; } | ||
|
||
inline void setChiSquared( const float chisq ) { chi_squared_ = chisq; } | ||
|
||
inline bool isValid() const { return valid_; } | ||
inline void setValid( bool valid ) { valid_ = valid; } | ||
|
||
//--- temporal get'ters | ||
|
||
inline float getT() const { return t_; } | ||
inline float getTSigma() const { return t_sigma_; } | ||
|
||
//--- temporal set'ters | ||
|
||
inline void setT( const float t ) { t_ = t; } | ||
inline void setTSigma( const float t_sigma ) { t_sigma_ = t_sigma; } | ||
|
||
inline void setOOTIndex( const int i ) { ts_index_ = i; } | ||
inline int getOOTIndex() const { return ts_index_; } | ||
|
||
inline void setMultipleHits( const int i ) { mh_ = i; } | ||
inline int getMultipleHits() const { return mh_; } | ||
|
||
private: | ||
//--- spatial information | ||
|
||
/// initial track position | ||
math::XYZPoint pos0_; | ||
/// error on the initial track position | ||
math::XYZPoint pos0_sigma_; | ||
|
||
/// fit chi^2 | ||
float chi_squared_; | ||
|
||
/// fit valid? | ||
bool valid_; | ||
|
||
//--- timing information | ||
|
||
float t_; | ||
float t_sigma_; | ||
/// Time slice index | ||
int ts_index_; | ||
/// Multiple hits counter | ||
int mh_; | ||
|
||
}; | ||
|
||
inline bool operator<( const CTPPSDiamondLocalTrack& lhs, const CTPPSDiamondLocalTrack& rhs ) | ||
{ | ||
// start to sort by temporal coordinate | ||
if ( lhs.getT() < rhs.getT() ) return true; | ||
if ( lhs.getT() > rhs.getT() ) return false; | ||
// then sort by x-position | ||
return ( lhs.getX0() < rhs.getX0() ); | ||
} | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
73 changes: 73 additions & 0 deletions
73
RecoCTPPS/TotemRPLocal/interface/CTPPSDiamondTrackRecognition.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
/**************************************************************************** | ||
* | ||
* This is a part of CTPPS offline software. | ||
* Authors: | ||
* Laurent Forthomme (laurent.forthomme@cern.ch) | ||
* Nicola Minafra (nicola.minafra@cern.ch) | ||
* | ||
****************************************************************************/ | ||
|
||
#ifndef RecoCTPPS_TotemRPLocal_CTPPSDiamondTrackRecognition | ||
#define RecoCTPPS_TotemRPLocal_CTPPSDiamondTrackRecognition | ||
|
||
#include "FWCore/ParameterSet/interface/ParameterSet.h" | ||
|
||
#include "DataFormats/Common/interface/DetSet.h" | ||
#include "DataFormats/Common/interface/DetSetVector.h" | ||
|
||
#include "DataFormats/CTPPSReco/interface/CTPPSDiamondRecHit.h" | ||
#include "DataFormats/CTPPSReco/interface/CTPPSDiamondLocalTrack.h" | ||
|
||
#include <vector> | ||
#include <unordered_map> | ||
#include "TF1.h" | ||
|
||
/** | ||
* \brief Class performing smart reconstruction for CTPPS Diamond Detectors. | ||
* \date Jan 2017 | ||
**/ | ||
class CTPPSDiamondTrackRecognition | ||
{ | ||
public: | ||
CTPPSDiamondTrackRecognition( const edm::ParameterSet& ); | ||
~CTPPSDiamondTrackRecognition(); | ||
|
||
/// Reset the list of hits | ||
void clear(); | ||
|
||
/// Feed a new hit to the tracks recognition algorithm | ||
void addHit( const CTPPSDiamondRecHit& recHit ); | ||
|
||
/// Produce a collection of tracks for the current station, given its hits collection | ||
int produceTracks( edm::DetSet<CTPPSDiamondLocalTrack>& tracks ); | ||
|
||
private: | ||
struct HitParameters { | ||
HitParameters( const float center, const float width ) : | ||
center( center ), width( width ) {} | ||
float center; | ||
float width; | ||
}; | ||
typedef std::vector<HitParameters> HitParametersVector; | ||
typedef std::unordered_map<int,HitParametersVector> HitParametersVectorMap; | ||
|
||
/// Default hit function accounting for the pad spatial efficiency | ||
static const std::string pixelEfficiencyDefaultFunction_; | ||
|
||
const float threshold_; | ||
const float thresholdFromMaximum_; | ||
const float resolution_; | ||
const float sigma_; | ||
const float startFromX_; | ||
const float stopAtX_; | ||
|
||
float yPosition_; | ||
float yWidth_; | ||
|
||
/// Function for pad efficiency | ||
TF1 hit_f_; | ||
HitParametersVectorMap hitParametersVectorMap_; | ||
std::unordered_map<int,int> mhMap_; | ||
}; | ||
|
||
#endif |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it's a bit odd to see diagonal-only elements of uncertainty.
Don't you need to have a more complete covariance, e.g.
typedef math::ErrorF<3>::type CovMatrix;
?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looking at the implementation, it's unclear to me if z is actually needed.
Is there going to be another reconstruction algo which sets it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, it is needed for the proton reconstruction - this detector samples the proton trajectory at the given z position from the IP.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For the covariance matrix - Laurent and Nicola correct me if I'm wrong - as the sensor has rectangular pads with edges parallel to x and y, I can't see how one could get non-trivial off-diagonal elements. But I'm not expert.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What Jan says is true, moreover the size of the pads is ~mm, while the detector is parallel to x and y with an accuracy of <mRad. Hence the non-diagonal terms will always be negligible (~um) with respect to the precision of the tracks (~100 um).