PandaRoot
PndPatternDBMerger.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  * PndPatternDBMerger.h
15  *
16  * Created on: Nov 15, 2017
17  * Author: vagrant
18  */
19 
20 #ifndef PNDTRACKERS_PNDPATTERNMATCHER_PNDPATTERNDBMERGER_H_
21 #define PNDTRACKERS_PNDPATTERNMATCHER_PNDPATTERNDBMERGER_H_
22 #include "PndPattern.h"
23 #include <TChain.h>
24 #include <TFile.h>
25 #include <TString.h>
26 #include <TTree.h>
27 
28 // number of identical entries, actual entries in file
29 typedef std::multimap<int, std::set<int>> IdenticalEntries;
30 
32  public:
34  virtual ~PndPatternDBMerger();
35 
36  void SetInputFilename(TString filename) { finputFilename = filename; }
37  void SetInputTreename(TString treename) { finputTreename = treename; }
38  void SetOutputFilename(TString filename) { foutputFilename = filename; }
39  void SetOutputTreename(TString treename) { foutputTreename = treename; }
40 
41  void Execute();
42 
43  private:
44  bool InitInputChain();
45  void InitOutputTree();
46 
47  IdenticalEntries FindIdenticalEntries();
48  std::vector<PndPattern> GetPatternsForMerging(std::pair<int, std::set<int>> entryPair);
49  PndPattern MergePatterns(std::vector<PndPattern> &entries);
50  void FillOutputTree(PndPattern &mergedPattern);
51 
52  TChain *fpatternTree;
53  TFile *foutputDBFile;
54  TTree *foutputTree;
55 
56  TString finputFilename;
57  TString finputTreename;
58  TString foutputFilename;
59  TString foutputTreename;
60 
61  PndPattern *bPattern;
62  PndPattern *bMergedPattern;
63 
64  ClassDef(PndPatternDBMerger, 1)
65 };
66 
67 #endif /* PNDTRACKERS_PNDPATTERNMATCHER_PNDPATTERNDBMERGER_H_ */
void SetOutputFilename(TString filename)
virtual ~PndPatternDBMerger()
void SetInputFilename(TString filename)
std::multimap< int, std::set< int > > IdenticalEntries
void SetOutputTreename(TString treename)
void SetInputTreename(TString treename)