4 #include "KiTrack/IHit.h"
5 #include "KiTrack/ISectorConnector.h"
6 #include "KiTrack/ISectorSystem.h"
7 #include "KiTrack/KiTrackExceptions.h"
20 static const int sNFwdLayers = 7;
21 static const int sNFttLayers = 4;
22 static const int sNFstLayers = 3;
23 FwdSystem(
const int ndisks = FwdSystem::sNFwdLayers) : KiTrack::ISectorSystem(), mNDisks(ndisks){};
25 virtual unsigned int getLayer(
int diskid)
const {
30 std::string getInfoOnSector(
int sec)
const {
return "NOOP"; }
40 set( -999, -999, -999, 0, -1 );
42 McTrack(
double pt,
double eta = -999,
double phi = -999,
int q = 0,
43 int start_vertex = -1) {
44 set( pt, eta, phi, q, start_vertex );
47 void set(
double pt,
double eta = -999,
double phi = -999,
int q = 0,
int start_vertex = -1){
52 mStartVertex = start_vertex;
55 void addFttHit(KiTrack::IHit *
hit) { mFttHits.push_back(hit); }
56 void addFstHit(KiTrack::IHit *hit) { mFstHits.push_back(hit); }
58 double mPt, mEta, mPhi;
59 int mTid, mQ, mStartVertex;
61 std::vector<KiTrack::IHit *> mFttHits;
62 std::vector<KiTrack::IHit *> mFstHits;
70 class FwdHit :
public KiTrack::IHit {
73 FwdHit() : KiTrack::IHit() {
84 _covmat.ResizeTo( 3, 3 );
86 FwdHit(
unsigned int id,
float x,
float y,
float z,
int vid,
int detid,
int tid,
87 TMatrixDSym covmat, std::shared_ptr<McTrack> mcTrack )
98 _covmat.ResizeTo( 3, 3 );
102 int map[] = {0, 0, 0, 0, 0, 1, 2, 0, 0, 3, 4, 5, 6};
115 void setXYZDetId(
float x,
float y,
float z,
int detid ){
122 bool isFst()
const {
return _detid == kFstId; }
123 bool isFtt()
const {
return _detid == kFttId; }
124 bool isPV()
const {
return _detid == kTpcId; }
126 std::shared_ptr<McTrack> getMcTrack() {
return _mcTrack; }
128 const KiTrack::ISectorSystem *getSectorSystem()
const {
129 return FwdSystem::sInstance;
132 std::string Print()
const {
133 return "FwdHit: \n" + std::to_string(_id) +
" x: " + std::to_string(_x) +
134 " y: " + std::to_string(_y) +
" z: " + std::to_string(_z) +
135 " detid: " + std::to_string(_detid) +
" tid: " + std::to_string(_tid) +
136 " vid: " + std::to_string(_vid) +
" sector: " + std::to_string(_sector) +
138 " covmat: \n" + std::to_string(_covmat(0,0)) +
" " + std::to_string(_covmat(0,1)) +
" " + std::to_string(_covmat(0,2)) +
" \n" +
139 std::to_string(_covmat(1,0)) +
" " + std::to_string(_covmat(1,1)) +
" " + std::to_string(_covmat(1,2)) +
" \n" +
140 std::to_string(_covmat(2,0)) +
" " + std::to_string(_covmat(2,1)) +
" " + std::to_string(_covmat(2,2));
143 void setSector(
int s ){ _sector = s; }
144 int getTrackId() {
return _tid;}
149 std::shared_ptr<McTrack> _mcTrack;
156 typedef std::vector<KiTrack::IHit *>
Seed_t;
161 : _distance(distance) {}
165 virtual std::set<int> getTargetSectors(
int disk) {
169 if (disk > 0 && _distance >= 1)
172 if (disk > 1 && _distance >= 2)
175 if (disk > 2 && _distance >= 3)
178 if (disk > 3 && _distance >= 4)
187 unsigned int _distance;
191 inline double operator()(
Seed_t s) {
return double(s.size()) / FwdSystem::sNFttLayers ; }
196 std::map<unsigned int, unsigned int> hit_counts;
200 for (
auto h : trackA) {
201 hit_counts[
static_cast<FwdHit *
>(h)->_id]++;
205 for (
auto h : trackB) {
206 hit_counts[
static_cast<FwdHit *
>(h)->_id]++;
209 if (hit_counts[static_cast<FwdHit *>(h)->_id] >= 2) {