33 : fDetId(detIDs),fHitId(hitIDs),fCurv(curv), fDip(dip), fInv(inv),fQoverpSeed(0.), fMcTrackId(-1)
36 throw GFException(
"genf::GFTrackCand::GFTrackCand(): hit/det size mismatch", __LINE__, __FILE__).
setFatal();
39 genf::GFTrackCand::GFTrackCand(
double curv,
double dip,
double inv, std::vector<unsigned int> detIDs, std::vector<unsigned int> hitIDs,std::vector<double> rhos)
40 : fDetId(detIDs),fHitId(hitIDs),fRho(rhos),fCurv(curv), fDip(dip), fInv(inv),fQoverpSeed(0.), fMcTrackId(-1)
43 throw GFException(
"genf::GFTrackCand::GFTrackCand(): hit/det size mismatch", __LINE__, __FILE__).
setFatal();
45 throw GFException(
"genf::GFTrackCand::GFTrackCand(): rho/det size mismatch", __LINE__, __FILE__).
setFatal();
51 fDetId.push_back(detId);
52 fHitId.push_back(hitId);
53 fPlaneId.push_back(planeId);
57 std::vector<unsigned int>
63 std::vector<unsigned int> result;
64 unsigned int n=fHitId.size();
65 for(
unsigned int i=0;i<
n;++i){
66 if(fDetId[i]==(
unsigned int)detId)result.push_back(fHitId[i]);
75 fDetId.clear();fHitId.clear();
80 for (
unsigned int i = 0; i < fDetId.size(); i++){
81 if (detId == fDetId[i])
82 if (hitId == fHitId[i])
96 out <<
"======== GFTrackCand::print ========";
97 if(fMcTrackId>=0) out <<
"\nmcTrackId=" << fMcTrackId;
98 out <<
"\nseed values for pos,direction, and q/p: " << std::endl;
101 out <<
"q/p=" << fQoverpSeed << std::endl;
102 if (fDetId.size() !=fHitId.size())
103 throw std::runtime_error(
"genf::GFTrackCand::GFTrackCand(): hit/det size mismatch");
104 out <<
"detId|hitId|rho ";
105 for(
unsigned int i=0;i<fDetId.size();++i)
106 out << fDetId.at(i) <<
"|" << fHitId.at(i) <<
"|" << fRho.at(i) <<
" ";
111 unsigned int detId,hitId;
113 for(
unsigned int i=0;i<rhs.
getNHits();++i){
114 rhs.
getHit(i,detId,hitId,rho);
115 addHit(detId,hitId,rho);
void Print(std::ostream &out=std::cout) const
void append(const GFTrackCand &)
bool HitInTrack(unsigned int detId, unsigned int hitId)
Test if hit already is part of this track candidate.
bool operator==(const genf::GFDetPlane &, const genf::GFDetPlane &)
bool equal(double a, double b)
Comparison tolerance, in centimeters.
void getHit(unsigned int i, unsigned int &detId, unsigned int &hitId) const
Get detector ID and cluster index (hitId) for hit number i.
unsigned int getNHits() const
Exception class for error handling in GENFIT (provides storage for diagnostic information) ...
std::vector< unsigned int > GetHitIDs(int detId=-1)
void PrintROOTobject(std::ostream &, const ROOTOBJ &)
Small utility functions which print some ROOT objects into an output stream.
GFException & setFatal(bool b=true)
set fatal flag. if this is true, the fit stops for this current track repr.
void addHit(unsigned int detId, unsigned int hitId, double rho=0., unsigned int planeId=0)
std::vector< unsigned int > fDetId
std::vector< unsigned int > fHitId
std::vector< double > fRho