PandaRoot
PndMcClonerMulti.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 
29 #pragma once
30 
31 #include "FairTask.h"
32 #include "PndMCTrack.h"
33 #include <map>
34 
35 using namespace std;
36 
37 class TClonesArray;
38 
39 class PndMcClonerMulti : public FairTask {
40 
41  public:
44 
47 
49  virtual InitStatus Init();
50 
52  virtual void Exec(Option_t *);
53 
54  void SetCleanMc(Bool_t opt = kTRUE) { fCleanMC = opt; }
55  void SetOutputBranch(TString branch) { fTrackBranchNamePidHypo = branch; }
56 
57  protected:
58  void FindUsedMCIndices();
59  void CloneMCTracks();
60  void CloneAndCleanMCTrack();
61  void CorrectMotherIndices();
62  void CorrectPidIndices();
63  void CloneMcTrack(Int_t mcidx = -1);
64  void MarkMcTree(Int_t mcindex = -1);
65 
67  TClonesArray *fInputArray;
68 
70  TClonesArray *fPidChargedArray[5];
71 
73  TClonesArray *fPidNeutralArray;
74 
76  TClonesArray *fOutputArray;
77 
78  map<Int_t, Int_t> fMmapMCIndex; // Map <old mc index, new mc index>
79 
80  Bool_t fCleanMC; // Flag to clean the MCTrack from unused indices
81 
82  TString fPidHypoStr[5];
83 
85 
86  ClassDef(PndMcClonerMulti, 2);
87 };
88 
TClonesArray * fPidNeutralArray
void SetCleanMc(Bool_t opt=kTRUE)
STL namespace.
map< Int_t, Int_t > fMmapMCIndex
void SetOutputBranch(TString branch)
TClonesArray * fOutputArray
TString fTrackBranchNamePidHypo
TClonesArray * fInputArray