Project
Loading...
Searching...
No Matches
SectorEdgeFluctuations.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_TPC_SECTOREDGEFLUCTUATIONS_H
17#define ALICEO2_TPC_SECTOREDGEFLUCTUATIONS_H
18
19#include <map>
20#include <vector>
21#include <string>
22#include <utility>
23#include "Rtypes.h"
24
25class TTree;
26
27namespace o2::tpc
28{
29
33 Long64_t startTimeMS{0};
34 Long64_t endTimeMS{0};
35 std::vector<std::pair<int, float>> sectors;
37};
38
54{
55 public:
58 bool loadFromCSVFile(const std::string& filename);
59
63 void dumpToFile(const char* file, const char* name = "ccdb_object", const char* brName = "SectorEdgeFluctuation");
64
68 void loadFromFile(const char* inpf, const char* name = "ccdb_object", const int iEntry = 0, const char* brName = "SectorEdgeFluctuation");
69
71 void setFromTree(TTree& tree, const int iEntry = 0, const char* brName = "SectorEdgeFluctuation");
72
76 std::vector<std::pair<int, float>> getSectorsAtTime(int run, Long64_t timestampMS) const;
77
80 static int parseSectorId(const std::string& sectorStr);
81
83 size_t size() const
84 {
85 size_t n = 0;
86 for (const auto& [run, v] : mIntervals) {
87 n += v.size();
88 }
89 return n;
90 }
91
93 size_t getNRuns() const { return mIntervals.size(); }
94 bool empty() const { return mIntervals.empty(); }
95
97 const auto& getIntervals() const { return mIntervals; }
98
99 private:
101 std::map<int, std::vector<SectorEdgeInterval>> mIntervals;
102
103 ClassDefNV(SectorEdgeFluctuations, 1);
104};
105
106} // namespace o2::tpc
107
108#endif // ALICEO2_TPC_SECTOREDGEFLUCTUATIONS_H
const auto & getIntervals() const
get stored data
size_t size() const
Total number of intervals across all runs.
bool loadFromCSVFile(const std::string &filename)
std::vector< std::pair< int, float > > getSectorsAtTime(int run, Long64_t timestampMS) const
void loadFromFile(const char *inpf, const char *name="ccdb_object", const int iEntry=0, const char *brName="SectorEdgeFluctuation")
void setFromTree(TTree &tree, const int iEntry=0, const char *brName="SectorEdgeFluctuation")
set this object from input tree
static int parseSectorId(const std::string &sectorStr)
size_t getNRuns() const
number of total runs stored
void dumpToFile(const char *file, const char *name="ccdb_object", const char *brName="SectorEdgeFluctuation")
GLdouble n
Definition glcorearb.h:1982
const GLdouble * v
Definition glcorearb.h:832
GLuint const GLchar * name
Definition glcorearb.h:781
Global TPC definitions and constants.
Definition SimTraits.h:168
std::string filename()
Long64_t startTimeMS
interval start, Unix time in ms
std::vector< std::pair< int, float > > sectors
{o2SectorId, scalingFactor}
Long64_t endTimeMS
interval end, Unix time in ms
ClassDefNV(SectorEdgeInterval, 1)
std::unique_ptr< TTree > tree((TTree *) flIn.Get(std::string(o2::base::NameConf::CTFTREENAME).c_str()))