diff --git a/macro/mcbm/mcbm_reco_event.C b/macro/mcbm/mcbm_reco_event.C index 015689c452bfd68f210a477941f043521c484e57..b5cf9e132d45c8c88ebec4adcd266e9069ac1ef7 100644 --- a/macro/mcbm/mcbm_reco_event.C +++ b/macro/mcbm/mcbm_reco_event.C @@ -393,6 +393,16 @@ void mcbm_reco_event(Int_t nEvents = 10, TString dataset = "data/test", run->AddTask(globalFindTracks); //run->AddTask(new CbmKfFitTracksTask(CbmKfFitTracksTask::FitMode::kMcbm)); + // Primary vertex finder from global tracks + auto* pvFinder = new CbmPVFinderKF(); + pvFinder->SetSourceTrackType(CbmPVFinderKF::ESourceTrackType::kGlobalTrack); + CbmFindPrimaryVertex* findVertex = new CbmFindPrimaryVertex(pvFinder); + run->AddTask(findVertex); + + if (debugWithMC) { // match tracks + CbmMatchRecoToMC* match2 = new CbmMatchRecoToMC(); + run->AddTask(match2); + } // ----- Parameter database -------------------------------------------- std::cout << std::endl << std::endl; diff --git a/reco/KF/Interface/CbmKFTrack.h b/reco/KF/Interface/CbmKFTrack.h index c3b3978131313a37003d48e63330fee2966bb6d1..02da1d12c8a6ac2f6f324065a5db546849c1b3da 100644 --- a/reco/KF/Interface/CbmKFTrack.h +++ b/reco/KF/Interface/CbmKFTrack.h @@ -32,18 +32,36 @@ class CbmKFTrack : public CbmKFTrackInterface { public: std::vector<CbmKFHit*> fHits; + /// \brief Default constructor CbmKFTrack(); + + /// \brief Destructor ~CbmKFTrack() {} + /// \brief Constructor from the CbmKFTrackInterface + /// \param track Reference to the CbmKFTrackInterface CbmKFTrack(CbmKFTrackInterface& track) : fMass(0), fChi2(0), fIsElectron(0), fNDF(0), fHits() { SetTrack(track); } + /// \brief Constructor from the FairTrackParam + /// \param track Reference to the FairTrackParam instance CbmKFTrack(FairTrackParam& track) : fMass(0), fChi2(0), fIsElectron(0), fNDF(0), fHits() { SetTrackParam(track); } + /// \brief Constructor from the CbmStsTrack + /// \param track Reference to the CbmStsTrack instance + /// \param first true: parameters in the first hit, false: parameters in the last hit CbmKFTrack(CbmStsTrack& track, bool first = 1) : fMass(0), fChi2(0), fIsElectron(0), fNDF(0), fHits() { SetStsTrack(track, first); } + /// \brief Constructor from the CbmGlobalTrack + /// \param track Reference to the CbmGlobalTrack instance + /// \param first true: parameters in the first hit, false: parameters in the last hit + CbmKFTrack(CbmGlobalTrack& track, bool first = 1) : fMass(0), fChi2(0), fIsElectron(0), fNDF(0), fHits() + { + SetGlobalTrack(track, first); + } + void SetTrack(CbmKFTrackInterface& track); void SetTrackParam(const FairTrackParam& track); void SetStsTrack(CbmStsTrack& track, bool first = 1); diff --git a/reco/KF/Interface/CbmPVFinderKF.h b/reco/KF/Interface/CbmPVFinderKF.h index 14d961aac3818af43fed310fda9e16fb6f0b279a..ab9fea4e408f9ab84e106ee332d7cf4d4184a9ca 100644 --- a/reco/KF/Interface/CbmPVFinderKF.h +++ b/reco/KF/Interface/CbmPVFinderKF.h @@ -1,45 +1,51 @@ /* Copyright (C) 2006-2016 GSI Helmholtzzentrum fuer Schwerionenforschung, Darmstadt SPDX-License-Identifier: GPL-3.0-only - Authors: Sergey Gorbunov, Denis Bertini [committer], Volker Friese */ - -/** CbmPVFinderKF - *@author S.Gorbunov - ** - **/ + Authors: Sergey Gorbunov, Denis Bertini [committer], Volker Friese, Sergei Zharko */ +/// \file CbmPVFinderKF.h +/// \author S.Gorbunov #ifndef CBMKFPVFINDERKF_H #define CBMKFPVFINDERKF_H 1 - #include "CbmPrimaryVertexFinder.h" - +/// \class CbmPVFinderKF +/// \brief Implementation of the primary vertex finder using KF utility +/// class CbmPVFinderKF : public CbmPrimaryVertexFinder { public: - /** Default constructor **/ - CbmPVFinderKF(){}; + /// \brief Track type for PV recnostruction + enum ESourceTrackType { + kStsTrack = 0, + kGlobalTrack = 1 + }; + /// \brief Default constructor + CbmPVFinderKF() {}; - /** Destructor **/ - ~CbmPVFinderKF(){}; + /// \brief Destructior + ~CbmPVFinderKF() {}; - /** Execution of PV finding. - *@param tracks TClonesArray of CbmStsTracks - *@param vertex Primary vertex (output) - *@param event Pointer to event object - **/ + /// \brief Execution of PV finding. + /// \param tracks TClonesArray of CbmStsTracks + /// \param vertex Primary vertex (output) + /// \param event Pointer to event object virtual Int_t FindPrimaryVertex(TClonesArray* tracks, CbmVertex* vertex); - /** Execution of PV finding. - ** @param event Pointer to event object - ** @param tracks TClonesArray of CbmStsTracks - **/ + /// \brief Execution of PV finding. + /// \param event Pointer to event object + /// \param tracks TClonesArray of CbmStsTracks virtual Int_t FindEventVertex(CbmEvent* event, TClonesArray* tracks); + /// \brief Sets source track type for the primary vertex reconstruction + void SetSourceTrackType(ESourceTrackType type) { fTrackType = type; } + +private: + ESourceTrackType fTrackType = kStsTrack; ClassDef(CbmPVFinderKF, 1); };