PandaRoot
PndMcCloner.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 
27 #pragma once
28 
29 #include "FairTask.h"
30 #include "PndMCTrack.h"
31 #include <map>
32 
33 using namespace std;
34 
35 class TClonesArray;
36 
37 class PndMcCloner : public FairTask {
38 
39  public:
41  PndMcCloner();
42 
44  ~PndMcCloner();
45 
47  virtual InitStatus Init();
48 
50  virtual void Exec(Option_t *);
51 
52  void SetCleanMc(Bool_t opt = kTRUE) { fCleanMC = opt; }
53 
54  protected:
55  void FindUsedMCIndices();
56  void CloneMCTrack();
57  void CloneAndCleanMCTrack();
58  void CorrectMotherIndices();
59  void CorrectPidIndices();
60 
62  TClonesArray *fInputArray = nullptr;
63 
65  TClonesArray *fPidChargedArray = nullptr;
66 
68  TClonesArray *fPidNeutralArray = nullptr;
69 
71  TClonesArray *fOutputArray = nullptr;
72 
73  map<Int_t, Int_t> mapMCIndex; // Map <old mc index, new mc index>
74 
75  Bool_t fCleanMC = false; // Flag to clean the MCTrack from unused indices
76 
77  ClassDef(PndMcCloner, 2);
78 };
79 
STL namespace.
void SetCleanMc(Bool_t opt=kTRUE)
Definition: PndMcCloner.h:52
map< Int_t, Int_t > mapMCIndex
Definition: PndMcCloner.h:73