Project
Loading...
Searching...
No Matches
verifyAODFile.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
14#include "Framework/Logger.h"
15#include "Framework/ASoA.h"
16#include <TFile.h>
17#include <iostream>
18#include <memory>
19
20using namespace o2::framework;
21using namespace o2::soa;
22
23template <typename T>
24void verifyTable(TFile* infile, const char* branchName)
25{
26 std::cout << "Table: " << o2::aod::label<T::ref>() << std::endl;
27 std::unique_ptr<TTreeReader> reader = std::make_unique<TTreeReader>(branchName, infile);
28 TableBuilder builder;
29 RootTableBuilderHelpers::convertASoA<T>(builder, *reader);
30 auto table = builder.finalize();
31 std::cout << table->schema()->ToString() << std::endl;
32 std::cout << "---" << std::endl;
33}
34
35int main(int argc, char** argv)
36{
37 if (argc != 2) {
38 LOG(error) << "Bad number of arguments";
39 return 1;
40 }
41 auto infile = std::make_unique<TFile>(argv[1]);
42 if (infile.get() == nullptr || infile->IsOpen() == false) {
43 LOG(error) << "File not found: " << argv[1];
44 return 1;
45 }
46
47 verifyTable<o2::aod::Collisions>(infile.get(), "O2collision");
48 verifyTable<o2::aod::StoredTracks>(infile.get(), "O2track");
49 verifyTable<o2::aod::StoredTracksCov>(infile.get(), "O2track");
50 verifyTable<o2::aod::StoredTracksExtra>(infile.get(), "O2track");
51 verifyTable<o2::aod::Calos>(infile.get(), "O2calo");
52 verifyTable<o2::aod::StoredFwdTracks>(infile.get(), "O2fwdtrack");
53 return 0;
54}
std::shared_ptr< arrow::Table > finalize()
Defining PrimaryVertex explicitly as messageable.
Definition TFIDInfo.h:20
#define main
LOG(info)<< "Compressed in "<< sw.CpuTime()<< " s"
void verifyTable(TFile *infile, const char *branchName)