Skip to content

Commit 424d6f2

Browse files
committed
UUUU
1 parent 84691a4 commit 424d6f2

File tree

4 files changed

+48
-0
lines changed

4 files changed

+48
-0
lines changed

ALICE3/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,4 @@ add_subdirectory(Core)
1515
add_subdirectory(Tasks)
1616
add_subdirectory(TableProducer)
1717
# add_subdirectory(Tools)
18+
add_subdirectory(Cfg)

ALICE3/Cfg/CMakeLists.txt

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# Copyright 2019-2020 CERN and copyright holders of ALICE O2.
2+
# See https://alice-o2.web.cern.ch/copyright for details of the copyright holders.
3+
# All rights not expressly granted are reserved.
4+
#
5+
# This software is distributed under the terms of the GNU General Public
6+
# License v3 (GPL Version 3), copied verbatim in the file "COPYING".
7+
#
8+
# In applying this license CERN does not waive the privileges and immunities
9+
# granted to it by virtue of its status as an Intergovernmental Organization
10+
# or submit itself to any jurisdiction.
11+
12+
install(FILES a3geo.ini
13+
PERMISSIONS GROUP_READ GROUP_EXECUTE OWNER_EXECUTE OWNER_WRITE OWNER_READ WORLD_EXECUTE WORLD_READ
14+
DESTINATION share/alice3/)

ALICE3/macros/makeSimpleAO2D.C

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
2+
3+
#include "TFile.h"
4+
#include "TTree.h"
5+
void makeSimpleAO2D()
6+
{
7+
TFile fin("/tmp/AO2D.root", "READ");
8+
// Copy the tree structure of the AO2D
9+
for (int i = 0; i < fin.GetListOfKeys()->GetEntries(); i++) {
10+
TKey* key = (TKey*)fin.GetListOfKeys()->At(i);
11+
TString keyname = key->GetName();
12+
if (!keyname.Contains("DF_")) {
13+
continue;
14+
}
15+
TFile fout("/tmp/AO2D_1.root", "RECREATE");
16+
fout.cd();
17+
TMap* metaData = (TMap*)fin.Get("metaData");
18+
metaData->Write("metaData", TObject::kSingleKey);
19+
fout.mkdir(keyname.Data());
20+
fout.cd(keyname.Data());
21+
TTree* tree = (TTree*)fin.Get(Form("%s/O2bc_001", keyname.Data()));
22+
tree->ls();
23+
TTree* newtree = tree->CloneTree(0);
24+
newtree->SetDirectory(gDirectory);
25+
// Keep only the first entry
26+
tree->GetEntry(0);
27+
newtree->Fill();
28+
newtree->Write();
29+
fout.ls();
30+
fout.Close();
31+
break;
32+
}
33+
}

0 commit comments

Comments
 (0)