Project
Loading...
Searching...
No Matches
AnalysisDataModelHelpers.cxx
Go to the documentation of this file.
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
15
16std::string str_tolower(std::string s)
17{
18 std::transform(s.begin(), s.end(), s.begin(),
19 [](unsigned char c) { return std::tolower(c); } // correct
20 );
21 return s;
22}
23
24namespace o2::aod::datamodel
25{
26std::string getTreeName(header::DataHeader dh, bool wasAOD)
27{
28 auto description = std::string(dh.dataDescription.str);
29 auto iver = (float)dh.subSpecification;
30
31 // lower case of first part of description
32 auto found = description.find_first_of(':');
33 std::string treeName = str_tolower(description).substr(0, found);
34 if (iver > 0) {
35 treeName += std::string{"_"}.append(std::string(2 - (int)std::log10(iver), '0')).append(std::to_string((int)iver));
36 }
37
38 // add prefix according to origin
39 if (wasAOD || std::ranges::any_of(framework::AODOrigins, [&o = dh.dataOrigin](header::DataOrigin const& origin) { return o == origin; })) {
40 treeName = "O2" + treeName;
41 }
42
43 // exceptions from this
44 auto origin = std::string(dh.dataOrigin.str);
45 if ((origin == "AOD" || wasAOD) && description == "MCCOLLISLABEL") {
46 treeName = "O2mccollisionlabel";
47 }
48
49 return treeName;
50}
51
52} // namespace o2::aod::datamodel
header::DataDescription description
std::string str_tolower(std::string s)
Timeframe settings Average distance in cm of events merged into Randomize distance around average distance of merged events Simulate correct bunch interactions instead of placing only the average number of events A value[n] sets TFlen for[n] collisions in Number of bunches per trainsort Number of bunch trains Instantaneous interaction rate Do not simulate border Total number of collisions to be placed in the interior of all time Do not select random but walk over array of events in stride steps h Event generator settings h configStandalone Use CPU for GPU Force usage of the specified GPU device no CPU fallback Continue processing after an error s
configStandalone Reconstruction rec_tpc float
uint32_t c
Definition RawData.h:2
std::string getTreeName(header::DataHeader dh, bool wasAOD)
consteval header::DataOrigin origin()
Definition ASoA.h:376
std::string to_string(gsl::span< T, Size > span)
Definition common.h:52
the main header struct
Definition DataHeader.h:623
DataDescription dataDescription
Definition DataHeader.h:641
SubSpecificationType subSpecification
Definition DataHeader.h:661