Project
Loading...
Searching...
No Matches
Utils.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
12#ifndef ALICEO2_TOF_UTILS_H_
13#define ALICEO2_TOF_UTILS_H_
14
15#include <iosfwd>
16#include "Rtypes.h"
17#include "TOFBase/Geo.h"
21#include <vector>
22
23#include <TF1.h>
24#include <TChain.h>
25#include <TH2F.h>
26
27namespace o2
28{
29namespace tof
30{
33
34template <typename trackType>
36{
37 return true;
38} // accept all
39
40class Utils
41{
42 public:
43 Utils() = default;
44
45 static bool hasFillScheme();
46 static int getNinteractionBC();
47 static void addBC(float toftime, bool subLatency = false);
48 static void addBC(double toftime, bool subLatency = false) { addBC(float(toftime), subLatency); }
49 static void addInteractionBC(int bc, bool fromCollisonCotext = false);
50 static int getInteractionBC(int ibc) { return mFillScheme[ibc]; }
51 static double subtractInteractionBC(double time, int& mask, bool subLatency = false);
52 static float subtractInteractionBC(float time, int& mask, bool subLatency = false);
53 static void init();
54 static void printFillScheme();
55 static void addCalibTrack(float time);
56 static void computeLHCphase();
57
58 // info can be tuned
59 static float mEventTimeSpread;
60 static float mEtaMin;
61 static float mEtaMax;
62 static float mLHCPhase;
63
64 static int addMaskBC(int mask, int channel);
65 static int getMaxUsed();
66 static int getMaxUsedChannel(int channel);
71
72 static uint32_t getNOrbitInTF() { return mNOrbitInTF; }
73 static void setNOrbitInTF(uint32_t norb) { mNOrbitInTF = norb; }
74
75 private:
76 static std::vector<int> mFillScheme;
77 static int mBCmult[o2::constants::lhc::LHCMaxBunches];
78 static int mNautodet;
79 static int mMaxBC;
80 static bool mIsInit;
81
82 // for LHCphase from calib infos
83 static constexpr int NTRACKS_REQUESTED = 1000;
84 static int mNCalibTracks;
85 static o2::dataformats::CalibInfoTOF mCalibTracks[NTRACKS_REQUESTED];
86 static int mNsample;
87 static int mIsample;
88 static float mPhases[100];
89 static uint64_t mMaskBC[16];
90 static uint64_t mMaskBCUsed[16];
91 static int mMaskBCchan[o2::tof::Geo::NCHANNELS][16];
92 static int mMaskBCchanUsed[o2::tof::Geo::NCHANNELS][16];
93
94 static TChain* mTreeFit;
95 static std::vector<dataformats::CalibInfoTOF> mVectC;
96 static std::vector<dataformats::CalibInfoTOF>* mPvectC;
97 static const int NCHPERBUNCH = Geo::NCHANNELS / Geo::NSECTORS / 16;
98 static const int NMINTOFIT = 300;
99 static int mNfits;
100
101 static uint32_t mNOrbitInTF;
102
103 ClassDefNV(Utils, 1);
104};
105
106} // namespace tof
107} // namespace o2
108#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.
Definition of the TOF event time maker.
uint64_t bc
Definition RawEventData.h:5
int16_t time
Definition RawEventData.h:4
Class for time synchronization of RawReader instances.
static constexpr Int_t NSECTORS
Definition Geo.h:120
static constexpr int NCHANNELS
Definition Geo.h:124
TOF utils.
Definition Utils.h:41
static void addBC(double toftime, bool subLatency=false)
Definition Utils.h:48
static double subtractInteractionBC(double time, int &mask, bool subLatency=false)
Definition Utils.cxx:122
static void fitTimeSlewing(int sector, const dataformats::CalibTimeSlewingParamTOF *oldTS, dataformats::CalibTimeSlewingParamTOF *newTS)
Definition Utils.cxx:375
static void addBC(float toftime, bool subLatency=false)
Definition Utils.cxx:220
static int extractNewTimeSlewing(const dataformats::CalibTimeSlewingParamTOF *oldTS, dataformats::CalibTimeSlewingParamTOF *newTS)
Definition Utils.cxx:330
static float mEtaMin
Definition Utils.h:60
static void addCalibTrack(float time)
Definition Utils.cxx:72
static void setNOrbitInTF(uint32_t norb)
Definition Utils.h:73
static int addMaskBC(int mask, int channel)
Definition Utils.cxx:270
static void addInteractionBC(int bc, bool fromCollisonCotext=false)
Definition Utils.cxx:52
static void fitChannelsTS(int chStart, const dataformats::CalibTimeSlewingParamTOF *oldTS, dataformats::CalibTimeSlewingParamTOF *newTS)
Definition Utils.cxx:383
static float mLHCPhase
Definition Utils.h:62
Utils()=default
static void computeLHCphase()
Definition Utils.cxx:84
static int getMaxUsed()
Definition Utils.cxx:304
static int getMaxUsedChannel(int channel)
Definition Utils.cxx:317
static int getNinteractionBC()
Definition Utils.cxx:117
static float mEventTimeSpread
Definition Utils.h:59
static void init()
Definition Utils.cxx:67
static void printFillScheme()
Definition Utils.cxx:109
static float mEtaMax
Definition Utils.h:61
static bool hasFillScheme()
Definition Utils.cxx:261
static int getInteractionBC(int ibc)
Definition Utils.h:50
static int fitSingleChannel(int ch, TH2F *h, const dataformats::CalibTimeSlewingParamTOF *oldTS, dataformats::CalibTimeSlewingParamTOF *newTS)
Definition Utils.cxx:452
static uint32_t getNOrbitInTF()
Definition Utils.h:72
GLint GLuint mask
Definition glcorearb.h:291
constexpr int LHCMaxBunches
bool filterCalib(const o2::dataformats::CalibInfoTOF &tr)
Definition Utils.h:35
a couple of static helper functions to create timestamp values for CCDB queries or override obsolete ...