Project
Loading...
Searching...
No Matches
TestbeamAnalysis.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#include <TTree.h>
12#include <TROOT.h>
13#include <fairlogger/Logger.h>
15
16using namespace o2::focal;
17
19{
20
21 mCurrentFile = std::unique_ptr<TFile>(TFile::Open(mInputFilename.data(), "READ"));
22 if (!mCurrentFile || mCurrentFile->IsZombie()) {
23 LOG(error) << "Failed reading input file " << mInputFilename;
24 }
25
26 mEventReader = std::make_unique<EventReader>(mCurrentFile->Get<TTree>("o2sim"));
27 mCurrentEventNumber = 0;
28
29 gROOT->cd();
30 init();
31
32 while (mEventReader->hasNext()) {
33 auto currentevent = mEventReader->readNextEvent();
34 if (mVerbose) {
35 LOG(info) << "Processing event " << mCurrentEventNumber;
36 }
37 if (currentevent.isInitialized()) {
38 process(currentevent);
39 mCurrentEventNumber++;
40 }
41 }
42
43 terminate();
44}
LOG(info)<< "Compressed in "<< sw.CpuTime()<< " s"