/* *==================================================================== * * CBM Level 1 Reconstruction * * Authors: I.Kisel, S.Gorbunov * * e-mail : ikisel@kip.uni-heidelberg.de * *==================================================================== * * L1 branch class * *==================================================================== */ #ifndef L1Branch_H #define L1Branch_H #include "L1StsHit.h" #include class L1Triplet; struct L1Branch { L1Branch():CandIndex(0),BestCandidate(1),Momentum(0),chi2(0),NHits(0),Lengtha(0),ista(0) ,StsHits(){ // L1Branch():Momentum(0),chi2(0),NHits(0),Lengtha(0),ista(0) , StsHits(){ // StsHits.resize(8); StsHits.reserve(8); } // fscal Quality; int CandIndex; // char Nthread; bool BestCandidate; // bool SecondBest; // bool ThirdBest; fscal Momentum, chi2; char NHits; char Lengtha; unsigned char ista; // L1Branch* BestCandidateP; // L1Branch* SecondBestCandidateP; std::vector StsHits; static bool compareCand(const L1Branch *a, const L1Branch *b){ if (a->Lengtha != b->Lengtha) return (a->Lengtha > b->Lengtha); if (a->ista != b->ista ) return (a->ista < b->ista ); // if (a->chi2 != b->chi2 )return (a->chi2 < b->chi2 ); return (a->chi2 < b->chi2 ); // return (a->CandIndex < b->CandIndex ); // return (a->CandIndex > b->CandIndex ); } void Set( unsigned char iStation, unsigned char Length, float Chi2, float Qp ){ float tmp = sqrt(Chi2)/3.5*255; // if( tmp<1e-4 ) cout<255 ) tmp = 255; // Quality = (Length*(4096)) + (ista*(256)) + chi_2; Momentum = 1.0/fabs(Qp); chi2 = Chi2; Lengtha=Length; (*this).ista=iStation; } // void SetLength( unsigned char Length ){ // Quality += - (Quality*(4096)) + (Length/(4096)); // } static bool compareChi2(const L1Branch &a, const L1Branch &b){ // return (a.Quality > b.Quality); // if (a.Lengtha != b.Lengtha) return (a.Lengtha > b.Lengtha); if (a.ista != b.ista ) return (a.ista < b.ista ); return (a.chi2 < b.chi2 ); } static bool comparePChi2(const L1Branch *a, const L1Branch *b){ return compareChi2(*a,*b); } static bool compareMomentum(const L1Branch &a, const L1Branch &b){ return (a.Momentum > b.Momentum ); } static bool comparePMomentum(const L1Branch *a, const L1Branch *b){ return compareMomentum(*a,*b); } }; #endif