PandaRoot
PndTrackSmearTask.h
Go to the documentation of this file.
1 //****************************************************************************
2 //* This file is part of PandaRoot. *
3 //* *
4 //* PandaRoot is distributed under the terms of the *
5 //* GNU General Public License (GPL) version 3, *
6 //* copied verbatim in the file "LICENSE". *
7 //* *
8 //* Copyright (C) 2006 - 2024 FAIR GmbH and copyright holders of PandaRoot *
9 //* The copyright holders are listed in the file "COPYRIGHTHOLDERS". *
10 //* The authors are listed in the file "AUTHORS". *
11 //****************************************************************************
12 
13 /*
14  * PndTrackSmearTask.h
15  *
16  * \brief Task to flag or to remove tracks with missing Pz information
17  *
18  * This task takes as an input any PndTrack branch. It goes through all the tracks. For those tracks only consisting of STTHits
19  * and with a ParamFirst::pz value between 0.015 and 0.025 it either sets the PndTrack::fFlag to -30 or deletes the track.
20  * What action is taken is selected by SetRemoveTrack(). If SetRemoveTrack is set to kTRUE the track is deleted otherwise flaged.
21  * The filtered PndTracks are written in an output branch either with a given name by SetOutputTrackBranch() of, if no branch name is
22  * given by InputTrackBranchName + "_filtered".
23  *
24  * Created on: 22.3.2017
25  * Author: t.stockmanns
26  */
27 
28 #ifndef PndTrackSmearTask_H_
29 #define PndTrackSmearTask_H_
30 
31 #include "PndPersistencyTask.h"
32 #include "TString.h"
33 #include "TVector3.h"
34 #include "FairTrackParP.h"
35 
36 class TClonesArray;
37 
39  public:
40  PndTrackSmearTask() : PndPersistencyTask("Missing Pz Track Cleaner Task"), fInputTrackBranches(), fOutputTrackBranches(), fTracks(0), fMomSigma(0.03, 0.03, 0.03)
41  {
42  SetPersistency(kTRUE);
43  };
44 
45  PndTrackSmearTask(const TString &branchName)
46  : PndPersistencyTask("Missing Pz Track Cleaner Task"), fInputTrackBranches(), fOutputTrackBranches(), fTracks(0), fMomSigma(0.03, 0.03, 0.03)
47  {
48  SetPersistency(kTRUE);
49  AddInputTrackBranch(branchName);
50  };
51 
52  virtual ~PndTrackSmearTask(){};
53 
55  virtual void SetParContainers();
56  virtual InitStatus Init();
57 
59  virtual void Exec(Option_t *opt);
60  virtual void FinishEvent();
61  virtual void Finish();
62 
63  void SetMomSmearing(TVector3 dpop) { fMomSigma = dpop; }
64  void AddInputTrackBranch(const TString &name)
65  {
66  fInputTrackBranches.push_back(name);
67  fOutputTrackBranches.push_back(name + "_fakeonline");
68  }
69  void SetPersistence(const Bool_t &val) { SetPersistency(val); }
70 
71  private:
72  FairTrackParP SmearTrackPar(FairTrackParP par);
73  void SmearMom(TVector3 &vec, Double_t Cov66[6][6]);
74 
75  std::vector<TString> fInputTrackBranches;
76  std::vector<TString> fOutputTrackBranches;
77  std::vector<TClonesArray *> fTracks;
78  std::vector<TClonesArray *> fOutputTracks;
79 
80  TVector3 fMomSigma;
81 
82  ClassDef(PndTrackSmearTask, 1);
83 };
84 
85 #endif /* PndTrackSmearTask_H_ */
virtual void Exec(Option_t *opt)
virtual ~PndTrackSmearTask()
PndTrackSmearTask(const TString &branchName)
void SetPersistency(Bool_t val=kTRUE)
virtual void FinishEvent()
void SetPersistence(const Bool_t &val)
void AddInputTrackBranch(const TString &name)
virtual void SetParContainers()
virtual InitStatus Init()
virtual void Finish()
void SetMomSmearing(TVector3 dpop)