-
Notifications
You must be signed in to change notification settings - Fork 499
Expand file tree
/
Copy pathAnalysisDataModelHelpers.cxx
More file actions
44 lines (36 loc) · 1.36 KB
/
AnalysisDataModelHelpers.cxx
File metadata and controls
44 lines (36 loc) · 1.36 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
// Copyright CERN and copyright holders of ALICE O2. This software is
// distributed under the terms of the GNU General Public License v3 (GPL
// Version 3), copied verbatim in the file "COPYING".
//
// See http://alice-o2.web.cern.ch/license for full licensing information.
//
// In applying this license CERN does not waive the privileges and immunities
// granted to it by virtue of its status as an Intergovernmental Organization
// or submit itself to any jurisdiction.
#include "AnalysisDataModelHelpers.h"
#include "Framework/AnalysisDataModel.h"
#include "Framework/StringHelpers.h"
#include "Framework/Logger.h"
#include <boost/algorithm/string.hpp>
namespace o2::aod::datamodel
{
std::string getTreeName(header::DataHeader dh)
{
std::string description = std::string(dh.dataDescription.str);
std::string origin = std::string(dh.dataOrigin.str);
// lower case of first part of description
auto found = description.find_first_of(":");
std::string treeName = boost::algorithm::to_lower_copy(description).substr(0, found);
// add prefix according to origin
if (origin == "AOD") {
treeName = "O2" + treeName;
} else if (origin == "RN2") {
treeName = "Run2" + treeName;
}
// exceptions from this
if (origin == "AOD" && description == "MCCOLLISLABEL") {
treeName = "O2mccollisionlabel";
}
return treeName;
}
} // namespace o2::aod::datamodel