PandaRoot
PndPatternDBGenerator.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  * PndPatternDBGenerator.h
15  *
16  * Created on: Nov 8, 2017
17  * Author: Michael Papenbrock
18  */
19 
20 #ifndef PNDTRACKERS_PNDPATTERNMATCHER_PNDPATTERNDBGENERATOR_H_
21 #define PNDTRACKERS_PNDPATTERNMATCHER_PNDPATTERNDBGENERATOR_H_
22 
23 #include <FairTask.h>
24 #include <PndGeoSttPar.h>
25 #include <PndMCTrack.h>
26 #include <PndPattern.h>
27 #include <PndSttHit.h>
28 
29 #include <TTree.h>
30 #include <TClonesArray.h>
31 
32 typedef std::vector<PndSttHit *> HitArray;
33 typedef std::multimap<int, int> HitSectorMap;
34 typedef std::vector<PndPattern> PndPatterns;
35 
36 class PndPatternDBGenerator : public FairTask {
37  public:
39  virtual ~PndPatternDBGenerator();
40 
41  void SetOutputFilename(TString filename = "patternDB.root") { foutputFilename = filename; }
42 
43  protected:
44  virtual void SetParContainers();
45  virtual InitStatus Init();
46  virtual void Exec(Option_t *opt);
47  virtual void FinishTask();
48 
49  private:
50  void GenerateTrackPatterns();
51  HitSectorMap FillSectorHitMap(HitArray sttHitArray);
52  PndPatterns FillSectorPatterns(HitArray hitArray, PndMCTrack *mcTrack);
53  PndPatterns FillTrackPatterns(HitArray hitArray, PndMCTrack *mcTrack);
54  void AddPatternsToTree(PndPatterns patterns, TTree *tree);
55 
56  PndGeoSttPar *fSttParameters;
57  TClonesArray *fEventHeader;
58  TClonesArray *fTubeArray;
59  TClonesArray *fSttHitArray;
60  TClonesArray *fMCTrackArray;
61  TClonesArray *trackCands;
62 
63  TFile *foutputFile;
64  TTree *fsectorPatternTree;
65  TTree *ftrackPatternTree;
66 
67  PndPattern *bPattern;
68 
69  int sttBranchID;
70  int mcTrackID;
71  TString foutputFilename;
72 
73  int nTotalTracks;
74  int nMultipleMCTrackLinks;
75 
76  ClassDef(PndPatternDBGenerator, 1)
77 };
78 
79 #endif /* PNDTRACKERS_PNDPATTERNMATCHER_PNDPATTERNDBGENERATOR_H_ */
std::vector< PndPattern > PndPatterns
virtual void Exec(Option_t *opt)
virtual void FinishTask()
virtual void SetParContainers()
void SetOutputFilename(TString filename="patternDB.root")
virtual ~PndPatternDBGenerator()
std::multimap< int, int > HitSectorMap
std::vector< PndSttHit * > HitArray
virtual InitStatus Init()