21 #include "TDatabasePDG.h"
28 GFTrackCand::
GFTrackCand():fCurv(0),fDip(0), fQ(0),fMcTrackId(-1),fPdg(0), fState6D(TMatrixD(TMatrixD::kZero,TMatrixD(6,1))),fCov6D(-1.0*TMatrixD(TMatrixD::kUnit,TMatrixD(6,6))){}
41 std::vector<unsigned int>
47 std::vector<unsigned int> result;
49 for(
unsigned int i=0;i<
n;++i){
50 if(
fDetId[i]==(
unsigned int)detId)result.push_back(
fHitId[i]);
56 std::vector<unsigned int>
58 std::cerr <<
"the method GFTrackCand::GetHitIDs is deprecated. Use GFTrackCand::getHitIDs instead\n";
63 std::vector<unsigned int> result;
65 for(
unsigned int i=0;i<
n;++i){
66 if(
fDetId[i]==(
unsigned int)detId)result.push_back(
fHitId[i]);
80 for (
unsigned int i = 0; i <
fDetId.size(); i++){
96 std::cout <<
"======== GFTrackCand::print ========\n";
97 std::cout <<
"mcTrackId=" <<
fMcTrackId <<
"\n";
98 std::cout <<
"seed values for 6D state and cov: " << std::endl;
101 std::cout <<
"q" <<
fQ <<
"\n";
102 std::cout <<
"PDG code= " <<
fPdg <<
"\n";
104 std::cout <<
"detId|hitId|rho ";
105 for(
unsigned int i=0;i<
fDetId.size();++i){
107 <<
"|" <<
fRho.at(i) <<
" ";
109 std::cout << std::endl;
113 unsigned int detId,hitId;
115 for(
unsigned int i=0;i<rhs.
getNHits();++i){
116 rhs.
getHit(i,detId,hitId,rho);
122 std::cerr <<
"the method GFTrackCand::setComplTrackSeed is deprecated. Use GFTrackCand::set6DSeed() or instead\n";
130 fCov6D(0,0) = posError[0]*posError[0];
131 fCov6D(1,1) = posError[1]*posError[1];
132 fCov6D(2,2) = posError[2]*posError[2];
133 fCov6D(3,3) = momError[0]*momError[0];
134 fCov6D(4,4) = momError[1]*momError[1];
135 fCov6D(5,5) = momError[2]*momError[2];
140 const unsigned int nHits =
getNHits();
143 std::vector<std::pair<double, int> > order(nHits);
144 for (
unsigned int i = 0; i != nHits; ++i){
145 order[i] = std::make_pair(
fRho[i],i);
147 std::stable_sort(order.begin(), order.end());
149 std::vector<unsigned int> indices(nHits);
150 for (
unsigned int i = 0; i != nHits; ++i){
151 indices[i] = order[i].second;
160 const unsigned int nHits(
getNHits());
161 if (indices.size() != nHits){
163 GFException exc(
"GFTrackCand::sortHits ==> Size of indices != number of hits!",__LINE__,__FILE__);
168 std::vector<unsigned int> sortedDetId(nHits);
169 std::vector<unsigned int> sortedHitId(nHits);
170 std::vector<unsigned int> sortedPlaneId(nHits);
171 std::vector<double> sortedRho(nHits);
172 for (
unsigned int i = 0; i != nHits; ++i){
173 unsigned int sortIndex = indices[i];
174 sortedDetId[i] =
fDetId[sortIndex];
175 sortedHitId[i] =
fHitId[sortIndex];
176 sortedPlaneId[i] =
fPlaneId[sortIndex];
177 sortedRho[i] =
fRho[sortIndex];