PandaRoot
PndSimpleAnalysis.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 Class PndSimpleAnalysis
15 
16 Task to perform analysis (combinatorics, simple filetring)
17 by setting a configuration file
18 
19 Writes out a TTree 'ntp'
20 
21 Author: K.Goetzen, GSI, 06/2008
22 
23 *******************************************************/
24 
25 #ifndef PNDSIMPLEANALYSIS_H
26 #define PNDSIMPLEANALYSIS_H 1
27 
28 #include "FairTask.h"
29 #include <map>
30 #include <string>
31 #include <vector>
32 #include "RhoCandList.h"
33 #include "TLorentzVector.h"
34 
35 #define fMaxEntries 1000
36 
37 class TClonesArray;
38 class TObjectArray;
39 class TDatabasePDG;
40 class TH1F;
41 class TTree;
42 
48 
54 
55 class RhoCandidate;
56 // class RhoCandList;
57 
58 class PndListDefiner;
59 
60 class PndSimpleAnalysis : public FairTask {
61 
62  public:
63  typedef std::map<Int_t, Float_t> mapper;
64 
67 
68  PndSimpleAnalysis(std::string filename);
69 
72 
74  virtual InitStatus Init();
75 
77  virtual void Exec(Option_t *opt);
78 
79  virtual void Finish();
80  // void CreateStructure();
81 
82  protected:
83  int evcount;
84  void PrintTree(RhoCandidate *tc, int level = 0);
85  void SetConfigFile(std::string filename = "analysis.cfg");
86  bool SetupAnalysis();
87  void InitGenericLists();
88  void FillGenericLists();
89  void InitColumnNames();
90 
91  bool IsGenericListName(std::string n);
92  int GetPdgCode(std::string name);
93  int GetAntiPdgCode(std::string name);
94  int GetAntiPdgCode(int pdgcode);
95 
96  bool ErrorMessage(int mid, int line = 0, std::string arg = "");
97 
98  // **** some basic selectors
99  //
100  // RhoChargedParticleSelector *chargedSel;
104 
110 
111  // **** mass selectors for the resonances/composites
112  //
113 
114  private:
116  TClonesArray *fChargedArray;
117  TClonesArray *fNeutralArray;
118  TClonesArray *fChargedProbability;
119  TClonesArray *fNeutralProbability;
120 
121  TClonesArray *fMcArray;
122 
123  TClonesArray *fMicroArray;
124 
125  RhoCandList chargedCands;
126  RhoCandList neutralCands;
127  RhoCandList mcCands;
128 
129  std::vector<std::string> fGenericListNames; // names of standard lists
130  std::vector<PndListDefiner *> fListDefiners; // mapping of tree structure
131  std::map<std::string, int> fListMap; // maps list names to PndListDefiner index
132 
133  std::map<std::string, int> fColKeyMap; // maps column names for dumpout to int keys
134  std::map<int, std::vector<std::string>> fColShortKeyMap; // maps col index to a list of col indices
135 
136  std::string fCfgFileName;
137 
138  TTree *ntp;
139 
140  // int fMaxEntries; // the maximum number of entries in column
141 
142  TLorentzVector fpInit;
143 
147  virtual void SetParContainers();
148 
149  ClassDef(PndSimpleAnalysis, 1);
150 };
151 
152 #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