/* Copyright 2008-2010, Technische Universitaet Muenchen, Authors: Christian Hoeppner & Sebastian Neubert This file is part of GENFIT. GENFIT is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. GENFIT is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with GENFIT. If not, see . */ #include "GFTrackCand.h" #include"TDatabasePDG.h" #include #include ClassImp(GFTrackCand) GFTrackCand::GFTrackCand():fCurv(0),fDip(0),fInv(false), fQoverpSeed(0.),fMcTrackId(-1),fPdg(0){} GFTrackCand::~GFTrackCand(){} GFTrackCand::GFTrackCand(double curv, double dip, double inv, std::vector detIDs, std::vector hitIDs) : fDetId(detIDs),fHitId(hitIDs),fCurv(curv), fDip(dip), fInv(inv),fQoverpSeed(0.), fMcTrackId(-1),fPdg(0) { assert(fDetId.size()==fHitId.size()); fRho.resize(fDetId.size(),0.); } GFTrackCand::GFTrackCand(double curv, double dip, double inv, std::vector detIDs, std::vector hitIDs,std::vector rhos) : fDetId(detIDs),fHitId(hitIDs),fRho(rhos),fCurv(curv), fDip(dip), fInv(inv),fQoverpSeed(0.), fMcTrackId(-1),fPdg(0) { assert(fDetId.size()==fHitId.size()); assert(fDetId.size()==fRho.size()); } void GFTrackCand::addHit(unsigned int detId, unsigned int hitId, double rho, unsigned int planeId) { fDetId.push_back(detId); fHitId.push_back(hitId); fPlaneId.push_back(planeId); fRho.push_back(rho); } std::vector GFTrackCand::GetHitIDs(int detId){ if(detId<0){ // return hits from all detectors return fHitId; } else { std::vector result; unsigned int n=fHitId.size(); for(unsigned int i=0;i=0) std::cout << "mcTrackId=" << fMcTrackId << std::endl; std::cout << "seed values for pos,direction, and q/p: " << std::endl; fPosSeed.Print(); fDirSeed.Print(); std::cout << "q/p=" << fQoverpSeed << std::endl; assert(fDetId.size()==fHitId.size()); std::cout << "detId|hitId|rho "; for(unsigned int i=0;iGetParticle(fPdg); double charge = part->Charge()/(3.); fQoverpSeed=charge/mom.Mag(); }