PandaRoot
PndMissingPzCleanerTask.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  * PndMissingPzCleanerTask.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 PndMissingPzCleanerTask_H_
29 #define PndMissingPzCleanerTask_H_
30 
31 #include "PndPersistencyTask.h"
32 #include "TString.h"
33 
34 class TClonesArray;
35 
37  public:
39  : PndPersistencyTask("Missing Pz Track Cleaner Task"), fInputTrackBranch(""), fOutputTrackBranch(""), fTracks(nullptr), fFilteredTracks(nullptr), fRemoveTrack(kFALSE)
40  {
41  SetPersistency(kTRUE);
42  };
43  PndMissingPzCleanerTask(const TString &branchName)
44  : PndPersistencyTask("Missing Pz Track Cleaner Task"), fInputTrackBranch(branchName), fOutputTrackBranch(""), fTracks(nullptr), fFilteredTracks(nullptr), fRemoveTrack(kFALSE)
45  {
46  SetPersistency(kTRUE);
47  };
49 
51  virtual void SetParContainers();
52  virtual InitStatus Init();
53 
55  virtual void Exec(Option_t *opt);
56  virtual void FinishEvent();
57  virtual void Finish();
58 
59  void SetInputTrackBranch(const TString &name) { fInputTrackBranch = name; }
60  void SetOutputTrackBranch(const TString &name) { fOutputTrackBranch = name; }
61  void SetRemoveTrack(const Bool_t &remove) { fRemoveTrack = remove; }
62  void SetPersistence(const Bool_t &val) { SetPersistency(val); }
63 
64  private:
65  TString fInputTrackBranch;
66  TString fOutputTrackBranch;
67 
68  TClonesArray *fTracks;
69  TClonesArray *fFilteredTracks;
70 
71  Bool_t fRemoveTrack;
72 
73  ClassDef(PndMissingPzCleanerTask, 1);
74 };
75 
76 #endif /* PndMissingPzCleanerTask_H_ */
virtual void Finish()
virtual void FinishEvent()
PndMissingPzCleanerTask(const TString &branchName)
void SetPersistency(Bool_t val=kTRUE)
void SetOutputTrackBranch(const TString &name)
void SetPersistence(const Bool_t &val)
virtual void SetParContainers()
void SetInputTrackBranch(const TString &name)
virtual InitStatus Init()
void SetRemoveTrack(const Bool_t &remove)
virtual void Exec(Option_t *opt)