AliPhysics  6f6e1e7 (6f6e1e7)
AliEmcalMCTreeWriter.h
Go to the documentation of this file.
1 /*
2  * AliEmcalMCTreeWriter.h
3  *
4  * Created on: 03.10.2014
5  * Author: markusfasel
6  */
7 
8 #ifndef ALIEMCALMCTREEWRITER_H_
9 #define ALIEMCALMCTREEWRITER_H_
10 
11 #include <cstring>
12 #include <TVector.h>
13 #include "AliAnalysisTaskEmcal.h"
14 
15 class AliVCluster;
16 class AliVParticle;
17 class AliVTrack;
18 class TTree;
19 class vector;
20 
22 public:
24  AliEmcalMCTreeWriter(const char *name);
25  virtual ~AliEmcalMCTreeWriter();
26 
27  virtual void UserCreateOutputObjects();
28  virtual Bool_t Run();
29 
30 protected:
31  double GetClusterEnergy(AliVCluster * clust, Double_t *vpos, Double_t *evec) const;
32  void GetShowerShape(AliVCluster *clust, Double_t *vector) const;
33  void GetCellEnergies(AliVCluster *clust, TVectorD &cells, TVectorF &indices) const;
34  void FindTracks(unsigned int label, std::vector<AliVTrack *> &tracks);
35  void FindClusters(unsigned int label, std::vector<AliVCluster *> &clusters);
36  bool AcceptParticle(const AliVParticle * const particle) const;
37 
38 private:
39  struct TrackInfo{
48  Double_t showershape[2]; // Defined as M02 at first and M20 at second entry
49  TVectorF fCellIndices;
50  TVectorD fCellEnergies;
51 
52  TrackInfo(): pdg(0), isPhysicalPrimary(false), isUnique(true), Egen(0.), E(0.), fCellIndices(), fCellEnergies() {
53  memset(pgen, 0, sizeof(Double_t) * 3);
54  memset(prec, 0, sizeof(Double_t) * 3);
55  memset(erec, 0, sizeof(Double_t) * 3);
56  memset(showershape, 0, sizeof(Double_t) * 2);
57  }
58  void Reset(){
59  pdg = 0;
60  isPhysicalPrimary = false;
61  isUnique = true;
62  E = 0.;
63  Egen = 0.;
64  memset(pgen, 0, sizeof(Double_t) * 3);
65  memset(prec, 0, sizeof(Double_t) * 3);
66  memset(erec, 0, sizeof(Double_t) * 3);
67  memset(showershape, 0, sizeof(Double_t) * 2);
68  for(int i = 0; i < fCellIndices.GetNrows(); i++) fCellIndices[i] = 0;
69  for(int i = 0; i < fCellEnergies.GetNrows(); i++) fCellEnergies[i] = 0;
70  }
71  };
73  TrackInfo fOutputInfo; // Track Info for the tree
74 
75  ClassDef(AliEmcalMCTreeWriter, 1)
76 };
77 
78 #endif /* ALIEMCALMCTREEWRITER_H_ */
double GetClusterEnergy(AliVCluster *clust, Double_t *vpos, Double_t *evec) const
double Double_t
Definition: External.C:58
bool AcceptParticle(const AliVParticle *const particle) const
Base task in the EMCAL framework.
void FindTracks(unsigned int label, std::vector< AliVTrack * > &tracks)
virtual Bool_t Run()
Run function. This is the core function of the analysis and contains the user code. Therefore users have to implement this function.
int Int_t
Definition: External.C:63
TrackInfo fOutputInfo
Output tree with tracks.
void GetShowerShape(AliVCluster *clust, Double_t *vector) const
void GetCellEnergies(AliVCluster *clust, TVectorD &cells, TVectorF &indices) const
bool Bool_t
Definition: External.C:53
virtual void UserCreateOutputObjects()
void FindClusters(unsigned int label, std::vector< AliVCluster * > &clusters)