PandaRoot
PndAnalysis.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 #ifndef PNDANALYSIS_H
14 #define PNDANALYSIS_H 1
15 
16 #include <string>
17 #include <vector>
18 #include <array>
19 
20 #include "TString.h"
21 #include "TVector3.h"
22 #include "TLorentzVector.h"
23 #include "TMatrixD.h"
24 
25 #include "RhoCandList.h"
26 #include "FairRootManager.h"
27 #include "FairTrackParP.h"
28 
29 class TChain;
30 class TClonesArray;
31 class TBranch;
32 
33 class TDatabasePDG;
34 class FairMCEventHeader;
35 class PndAnaPidSelector;
36 class PndAnaPidCombiner;
37 class PndMCTrack;
38 class PndTrack;
41 
42 // class PndEventInfo;
43 
44 class TGeant3;
45 
46 class PndAnalysis {
47  public:
48  PndAnalysis(TString tname1 = "", TString tname2 = "", TString algnamec = "PidAlgoIdealCharged", TString algnamen = "PidAlgoIdealNeutral");
49  virtual ~PndAnalysis();
50 
51  void Rewind();
52  void Reset() { Rewind(); }
53  Int_t GetEvent(Int_t n = -1);
54  void GetEventInTask();
55  FairMCEventHeader *GetEventHeader();
56  Int_t GetEntries();
57  Bool_t FillList(RhoCandList &l, TString listkey = "All", TString pidTcaNames = "", int trackHypothesis = -1);
58  void SetGoodTrackCriterion(TString crit="veryLoose");
59  void SetVerbose(Int_t level) { fVerbose = level; }
60  // void SetPidChargedName(TString s) {fChargedPidName = s;}
61  // void SetPidNeutralName(TString s) {fNeutralPidName = s;}
62  // void SetTracksName(TString s) {fTracksName = s;}
63  // void SetTracksName2(TString s) {fTracksName2 = s;}
64 
65  Bool_t PropagateToIp(RhoCandidate *cand);
66  Bool_t PropagateToZAxis(RhoCandidate *cand);
67  Bool_t PropagateToPoint(RhoCandidate *cand, TVector3 mypoint);
68  Bool_t PropagateToPlane(RhoCandidate *cand, TVector3 origin, TVector3 dj, TVector3 dk);
69 
71  FairTrackParP GetFirstPar(RhoCandidate *cand);
72 
73  Bool_t ResetCandidate(RhoCandidate *cand);
74  Bool_t ResetDaughters(RhoCandidate *cand);
75  Bool_t McTruthMatch(RhoCandidate *cand, Int_t level = 2, bool verbose = false);
76  std::vector<int> McTruthMatch(RhoCandList &list, Int_t level = 2, bool verbose = false);
77  // this also allows match, when some soft photons are missing in decay
78  void McMatchAllowPhotos(int maxn = 1, double thresh = 0.05)
79  {
80  fPhotosMax = maxn;
81  fPhotosThresh = thresh;
82  }
83 
84  // FIXME: This is an aweful solution to access the correct
85  // track array from a fitter object. [R.K.03'11]
86  // todo:removed this because fuck it
87  // TClonesArray* GetTrackArrayPointer() const {return fTracks;};
88 
89  Bool_t Propagator(int mode, FairTrackParP &tStart, RhoCandidate *cand, TVector3 point = TVector3(0, 0, 0), Bool_t skipcov = kFALSE, Bool_t overwrite = kFALSE,
90  TVector3 planej = TVector3(1, 0, 0), TVector3 planek = TVector3(0, 1, 0));
91 
92  protected:
93  void Init();
94  virtual void BuildMcCands();
95  Bool_t GetMcCandList(RhoCandList &l);
96  void ReadRecoCandidates();
97  void Cleanup();
98  // void ReadCandidates();
99 
100  TClonesArray *ReadTCA(TString tcaname);
101 
102  Bool_t MctMatch(RhoCandidate &c, RhoCandList &mct, Int_t level = 2, bool verbose = false) { return MctMatch(&c, mct, level, verbose); };
103  Bool_t MctMatch(RhoCandidate *c, RhoCandList &mct, Int_t level = 2, bool verbose = false);
104  // Private Member Variables
105 
106  FairRootManager *fRootManager;
111  Int_t fEvtCount;
113  Bool_t fEventRead;
115  Int_t fVerbose;
116  Int_t fPhotosMax;
117  Double_t fPhotosThresh;
118 
119  std::map<int, RhoCandidate *> fMcPresenceMap;
120 
121  std::array<TClonesArray *, 6> fChargedCands; // 0-4 for trk hypothesis, 5 for fallback
122  std::array<TClonesArray *, 6> fBremCorr; // 0-4 for trk hypothesis, 5 for fallback
123  TClonesArray *fNeutralCands;
124  std::array<TClonesArray *, 6> fChargedProbability; // 0-4 for trk hypothesis, 5 for fallback
125  // TClonesArray* fNeutralProbability;
126  std::array<TClonesArray *, 6> fTracks; // 0-4 for trk hypothesis, 5 for fallback
127  std::array<TClonesArray *, 6> fTracks2; // 0-4 for trk hypothesis, 5 for fallback
128  TClonesArray *fMcCands;
129  TClonesArray *fMcTracks;
130 
131  std::array<RhoCandList, 6> fChargedCandList; // 0-4 for trk hypothesis, 5 for fallback
135 
138  TString fTracksName;
139  TString fTracksName2;
140 
141  TString fPidHypoStr[6]; // 0-4 for trk hypothesis, 5 for fallback
142  Int_t fHypoPdg[6]; // 0-4 for trk hypothesis, 5 for fallback
143  Bool_t fHypoFlagCharged[6];
144  Int_t fDefaultHypo; // Default hypothesis (pion), used if no hypo is specified by user
145  ClassDef(PndAnalysis, 0);
146 };
147 
148 #endif
Int_t GetEntries()
Int_t fHypoPdg[6]
Definition: PndAnalysis.h:142
Bool_t ResetCandidate(RhoCandidate *cand)
Bool_t PropagateToPoint(RhoCandidate *cand, TVector3 mypoint)
TClonesArray * fMcCands
Definition: PndAnalysis.h:128
Bool_t fBuildMcCands
Definition: PndAnalysis.h:114
FairTrackParP GetFirstPar(RhoCandidate *cand)
RhoGoodPhotonSelector * fGoodPhotonSelector
Definition: PndAnalysis.h:109
std::array< TClonesArray *, 6 > fTracks
Definition: PndAnalysis.h:126
Int_t fVerbose
Definition: PndAnalysis.h:115
std::array< TClonesArray *, 6 > fBremCorr
Definition: PndAnalysis.h:122
Bool_t PropagateToZAxis(RhoCandidate *cand)
Double_t fPhotosThresh
Definition: PndAnalysis.h:117
RhoCandList fMcCandList
Definition: PndAnalysis.h:134
PndAnaPidSelector * fPidSelector
Definition: PndAnalysis.h:107
TString fNeutralPidName
Definition: PndAnalysis.h:137
Bool_t FillList(RhoCandList &l, TString listkey="All", TString pidTcaNames="", int trackHypothesis=-1)
Bool_t MctMatch(RhoCandidate &c, RhoCandList &mct, Int_t level=2, bool verbose=false)
Definition: PndAnalysis.h:102
PndTrack * GetTrack(RhoCandidate *cand)
ClassDef(PndAnalysis, 0)
Int_t fEvtCount
Definition: PndAnalysis.h:111
Bool_t GetMcCandList(RhoCandList &l)
Bool_t PropagateToPlane(RhoCandidate *cand, TVector3 origin, TVector3 dj, TVector3 dk)
Int_t fDefaultHypo
Flag to check which hypo lists exists //0-4 for trk hypothesis, 5 for fallback.
Definition: PndAnalysis.h:144
void SetGoodTrackCriterion(TString crit="veryLoose")
std::array< TClonesArray *, 6 > fChargedCands
Definition: PndAnalysis.h:121
PndAnaPidCombiner * fPidCombiner
Definition: PndAnalysis.h:108
void GetEventInTask()
virtual ~PndAnalysis()
void Rewind()
std::array< TClonesArray *, 6 > fTracks2
Definition: PndAnalysis.h:127
RhoCandList fAllCandList
Definition: PndAnalysis.h:133
TClonesArray * fMcTracks
Definition: PndAnalysis.h:129
std::array< RhoCandList, 6 > fChargedCandList
Definition: PndAnalysis.h:131
PndAnalysis(TString tname1="", TString tname2="", TString algnamec="PidAlgoIdealCharged", TString algnamen="PidAlgoIdealNeutral")
void ReadRecoCandidates()
TString fChargedPidName
Definition: PndAnalysis.h:136
virtual void BuildMcCands()
std::array< TClonesArray *, 6 > fChargedProbability
Definition: PndAnalysis.h:124
void Reset()
Definition: PndAnalysis.h:52
void Cleanup()
Bool_t Propagator(int mode, FairTrackParP &tStart, RhoCandidate *cand, TVector3 point=TVector3(0, 0, 0), Bool_t skipcov=kFALSE, Bool_t overwrite=kFALSE, TVector3 planej=TVector3(1, 0, 0), TVector3 planek=TVector3(0, 1, 0))
FairMCEventHeader * GetEventHeader()
RhoGoodTrackSelector * fGoodTrackSelector
Definition: PndAnalysis.h:110
TString fPidHypoStr[6]
Definition: PndAnalysis.h:141
TString fTracksName2
Definition: PndAnalysis.h:139
FairRootManager * fRootManager
Definition: PndAnalysis.h:106
void McMatchAllowPhotos(int maxn=1, double thresh=0.05)
Definition: PndAnalysis.h:78
TString fTracksName
Definition: PndAnalysis.h:138
Bool_t PropagateToIp(RhoCandidate *cand)
RhoCandList fNeutralCandList
Definition: PndAnalysis.h:132
Int_t fChainEntries
Definition: PndAnalysis.h:112
Bool_t McTruthMatch(RhoCandidate *cand, Int_t level=2, bool verbose=false)
Int_t fPhotosMax
Definition: PndAnalysis.h:116
Bool_t fHypoFlagCharged[6]
Definition: PndAnalysis.h:143
Int_t GetEvent(Int_t n=-1)
TClonesArray * ReadTCA(TString tcaname)
std::map< int, RhoCandidate * > fMcPresenceMap
Definition: PndAnalysis.h:119
Bool_t fEventRead
Definition: PndAnalysis.h:113
TClonesArray * fNeutralCands
Definition: PndAnalysis.h:123
Bool_t ResetDaughters(RhoCandidate *cand)
void SetVerbose(Int_t level)
Definition: PndAnalysis.h:59