10#include "TrackClones.h"
13#include "DataManager.h"
17 TrackClones::TrackClones(TString className, TString branchname, TString dirname) :
18 fBranchName(branchname), fDirName(dirname), fClones(NULL) {
19 if (className !=
"") { fClones =
new TClonesArray(className); }
22 void TrackClones::Register(Bool_t write) {
23 DataManager* mngr = DataManager::Instance();
24 mngr->Register(fBranchName, fDirName, fClones, write);
27 void TrackClones::GetFromTree() {
28 if (fClones) {
delete fClones; }
30 fClones = (TClonesArray*) DataManager::Instance()->GetObject(fBranchName);
31 if (fClones == NULL) { Cout::PrintInfo(Form(
"Branch %s not found!", fBranchName.Data()), EInfo::kError); }
34 TrackClones::~TrackClones() {
35 if (fClones)
delete fClones;
38 Bool_t TrackClones::ExistInTree()
const {
39 DataManager* mngr = DataManager::Instance();
40 return mngr->CheckBranch(fBranchName);
43 void TrackClones::Compress(Int_t* map, Int_t ) {
45 for (
int i = 0; i < fClones->GetEntriesFast(); i++) {
46 if (i == map[good_pos]) {
55 void TrackClones::DeleteClones() {
56 if (fClones)
delete fClones;