Project
Loading...
Searching...
No Matches
CollectCalibInfoTOF.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_GLOBTRACKING_COLLECTCALIBINFOTOF_
17#define ALICEO2_GLOBTRACKING_COLLECTCALIBINFOTOF_
18
19#include <Rtypes.h>
20#include <array>
21#include <vector>
22#include <string>
23#include <TStopwatch.h>
24#include <TParameter.h>
27#include "TOFBase/Geo.h"
28
29class TTree;
30
31namespace o2
32{
33
34namespace globaltracking
35{
37{
38 using Geo = o2::tof::Geo;
39
40 public:
41 static constexpr int MAXNUMBEROFHITS = 256;
42
43 CollectCalibInfoTOF() : mMinTimestamp("minTimestamp", -1), mMaxTimestamp("maxTimestamp", -1) {}
44
46 void run();
47
49 void init();
50
52 void setInputTreeTOFCalibInfo(TTree* tree) { mTreeTOFCalibInfo = tree; }
53
55 void setOutputTree(TTree* tr) { mOutputTree = tr; }
56
58 void setTOFCalibInfoBranchName(const std::string& nm) { mTOFCalibInfoBranchName = nm; }
59 void setOutputBranchName(const std::string& nm) { mOutputBranchName = nm; }
60
62 const std::string& getTOFCalibInfoBranchName() const { return mTOFCalibInfoBranchName; }
63 const std::string& getOutputBranchName() const { return mOutputBranchName; }
64
66 const TParameter<int>& getMinTimestamp() const { return mMinTimestamp; }
67 const TParameter<int>& getMaxTimestamp() const { return mMaxTimestamp; }
68
70 void print() const;
71
72 private:
73 void attachInputTrees();
74 bool loadTOFCalibInfo();
75
77 void addHit(o2::dataformats::CalibInfoTOF& calibInfoTOF);
78
80 void fillTree();
81
82 //================================================================
83
84 // Data members
85
86 bool mInitDone = false;
87 int mCurrTOFInfoTreeEntry = -1;
88
90
91 // to be done later
92
93 TTree* mTreeTOFCalibInfo = nullptr;
94
95 TTree* mOutputTree = nullptr;
96
98 // since this info is provided by external device
99 std::vector<o2::dataformats::CalibInfoTOF>* mTOFCalibInfo = nullptr;
101 std::vector<o2::dataformats::CalibInfoTOFshort> mTOFCollectedCalibInfo[Geo::NCHANNELS];
102 std::vector<o2::dataformats::CalibInfoTOFshort>* mTOFCalibInfoOut = nullptr;
103
104 std::string mTOFCalibInfoBranchName = "TOFCalibInfo";
105 std::string mOutputBranchName = "TOFCollectedCalibInfo";
106
107 TStopwatch mTimerTot;
108 TStopwatch mTimerDBG;
109
110 TParameter<int> mMinTimestamp;
112
113 TParameter<int> mMaxTimestamp;
115
116 ClassDefNV(CollectCalibInfoTOF, 1);
117};
118} // namespace globaltracking
119} // namespace o2
120
121#endif
Class to store the output of the matching to TOF for calibration.
Class to store the output of the matching to TOF for calibration (no channel info,...
const TParameter< int > & getMinTimestamp() const
void setTOFCalibInfoBranchName(const std::string &nm)
void setOutputBranchName(const std::string &nm)
get input branch names for the input from the tree
const std::string & getOutputBranchName() const
get the min/max timestamp for following calibration of LHCPhase
void run()
perform all initializations
void setInputTreeTOFCalibInfo(TTree *tree)
set output tree to write matched tracks
void init()
set tree/chain containing TOF calib info
void setOutputTree(TTree *tr)
set input branch names for the input from the tree
const TParameter< int > & getMaxTimestamp() const
print settings
CollectCalibInfoTOF()
collect the CalibInfo for the TOF channels
const std::string & getTOFCalibInfoBranchName() const
TOF geo parameters (only statics)
Definition Geo.h:28
static constexpr int NCHANNELS
Definition Geo.h:124
a couple of static helper functions to create timestamp values for CCDB queries or override obsolete ...
std::unique_ptr< TTree > tree((TTree *) flIn.Get(std::string(o2::base::NameConf::CTFTREENAME).c_str()))