Project
Loading...
Searching...
No Matches
MilleRecordWriter.h
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
16#ifndef ALICEO2_FWDALIGN_MILLERECORD_WRITER_H
17#define ALICEO2_FWDALIGN_MILLERECORD_WRITER_H
18
19#include <Rtypes.h>
20#include <TString.h>
21
23
24class TFile;
25class TTree;
26namespace o2
27{
28namespace fwdalign
29{
30
32{
33 public:
36
38 virtual ~MilleRecordWriter();
39
41 void setCyclicAutoSave(const long nEntries);
42
44 void setDataFileName(TString fname) { mDataFileName = fname; }
45
47 void changeDataBranchName(const bool isConstraintsRec = true);
48
50 void init();
51
53 bool isInitOk() const { return mIsSuccessfulInit; }
54
57
59 Long64_t getCurrentDataID() const { return mCurrentDataID; }
60
62 void fillRecordTree(const bool doPrint = false);
63
65 void terminate();
66
68 void setRecordRun(int run);
69
71 void setRecordWeight(double wgh);
72
73 protected:
74 TTree* mDataTree;
75 TFile* mDataFile;
79 TString mDataFileName;
80 TString mDataTreeName;
83 Long64_t mCurrentDataID;
84
86};
87} // namespace fwdalign
88} // namespace o2
89
90#endif
Class to store the data of single track processing.
Store residuals and local/global deriavtives from a single track processing.
TString mDataFileName
name of the output file that will store the record TTree
void setCyclicAutoSave(const long nEntries)
Set the number of entries to be used by TTree::AutoSave()
bool isInitOk() const
check if init went well
void setDataFileName(TString fname)
choose data records filename
Long64_t mCurrentDataID
counter increasing when adding a record to the tree
void init()
init output file and tree
TTree * mDataTree
TTree container that stores the records.
bool mIsSuccessfulInit
boolean to monitor the success of the initialization
o2::fwdalign::MillePedeRecord * mRecord
the running record
bool mIsConstraintsRec
boolean to know if these are data records or constraints records
TFile * mDataFile
output file where the records are written
TString mDataTreeName
name of the record TTree
void setRecordRun(int run)
assign run
TString mDataBranchName
name of the branch where records will be stored
ClassDef(MilleRecordWriter, 0)
long mNEntriesAutoSave
max entries in the buffer after which TTree::AutoSave() is automatically used
void terminate()
write tree and close output file
Long64_t getCurrentDataID() const
return the ID of the current record in the TTree
void changeDataBranchName(const bool isConstraintsRec=true)
choose data records filename
void setRecordWeight(double wgh)
assign weight
void fillRecordTree(const bool doPrint=false)
fill tree
o2::fwdalign::MillePedeRecord * getRecord()
return the record
a couple of static helper functions to create timestamp values for CCDB queries or override obsolete ...