PandaRoot
PndSimpleAnalysis.h
Go to the documentation of this file.
1 /******************************************************
2 Class PndSimpleAnalysis
3 
4 Task to perform analysis (combinatorics, simple filetring)
5 by setting a configuration file
6 
7 Writes out a TTree 'ntp'
8 
9 Author: K.Goetzen, GSI, 06/2008
10 
11 *******************************************************/
12 
13 #ifndef PNDSIMPLEANALYSIS_H
14 #define PNDSIMPLEANALYSIS_H 1
15 
16 #include "FairTask.h"
17 #include <map>
18 #include <string>
19 #include <vector>
20 #include "RhoCandList.h"
21 #include "TLorentzVector.h"
22 
23 #define fMaxEntries 1000
24 
25 class TClonesArray;
26 class TObjectArray;
27 class TDatabasePDG;
28 class TH1F;
29 class TTree;
30 
36 
42 
43 class RhoCandidate;
44 // class RhoCandList;
45 
46 class PndListDefiner;
47 
48 class PndSimpleAnalysis : public FairTask {
49 
50  public:
51  typedef std::map<Int_t, Float_t> mapper;
52 
55 
56  PndSimpleAnalysis(std::string filename);
57 
60 
62  virtual InitStatus Init();
63 
65  virtual void Exec(Option_t *opt);
66 
67  virtual void Finish();
68  // void CreateStructure();
69 
70  protected:
71  int evcount;
72  void PrintTree(RhoCandidate *tc, int level = 0);
73  void SetConfigFile(std::string filename = "analysis.cfg");
74  bool SetupAnalysis();
75  void InitGenericLists();
76  void FillGenericLists();
77  void InitColumnNames();
78 
79  bool IsGenericListName(std::string n);
80  int GetPdgCode(std::string name);
81  int GetAntiPdgCode(std::string name);
82  int GetAntiPdgCode(int pdgcode);
83 
84  bool ErrorMessage(int mid, int line = 0, std::string arg = "");
85 
86  // **** some basic selectors
87  //
88  // RhoChargedParticleSelector *chargedSel;
92 
98 
99  // **** mass selectors for the resonances/composites
100  //
101 
102  private:
104  TClonesArray *fChargedArray;
105  TClonesArray *fNeutralArray;
106  TClonesArray *fChargedProbability;
107  TClonesArray *fNeutralProbability;
108 
109  TClonesArray *fMcArray;
110 
111  TClonesArray *fMicroArray;
112 
113  RhoCandList chargedCands;
114  RhoCandList neutralCands;
115  RhoCandList mcCands;
116 
117  std::vector<std::string> fGenericListNames; // names of standard lists
118  std::vector<PndListDefiner *> fListDefiners; // mapping of tree structure
119  std::map<std::string, int> fListMap; // maps list names to PndListDefiner index
120 
121  std::map<std::string, int> fColKeyMap; // maps column names for dumpout to int keys
122  std::map<int, std::vector<std::string>> fColShortKeyMap; // maps col index to a list of col indices
123 
124  std::string fCfgFileName;
125 
126  TTree *ntp;
127 
128  // int fMaxEntries; // the maximum number of entries in column
129 
130  TLorentzVector fpInit;
131 
135  virtual void SetParContainers();
136 
137  ClassDef(PndSimpleAnalysis, 1);
138 };
139 
140 #endif
int GetPdgCode(std::string name)
RhoMinusParticleSelector * minusSel
void PrintTree(RhoCandidate *tc, int level=0)
int GetAntiPdgCode(std::string name)
virtual void Finish()
RhoNeutralParticleSelector * neutralSel
RhoSimpleElectronSelector * eSel
RhoSimplePionSelector * piSel
virtual void Exec(Option_t *opt)
virtual InitStatus Init()
bool IsGenericListName(std::string n)
std::map< Int_t, Float_t > mapper
void SetConfigFile(std::string filename="analysis.cfg")
bool ErrorMessage(int mid, int line=0, std::string arg="")
RhoSimpleMuonSelector * muSel
RhoPlusParticleSelector * plusSel
RhoSimpleKaonSelector * kSel
RhoSimpleProtonSelector * pSel