forked from AliceO2Group/AliceO2
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcentralEventFilterProcessor.h
More file actions
51 lines (40 loc) · 1.66 KB
/
centralEventFilterProcessor.h
File metadata and controls
51 lines (40 loc) · 1.66 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
// Copyright 2019-2020 CERN and copyright holders of ALICE O2.
// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders.
// All rights not expressly granted are reserved.
//
// This software is distributed under the terms of the GNU General Public
// License v3 (GPL Version 3), copied verbatim in the file "COPYING".
//
// In applying this license CERN does not waive the privileges and immunities
// granted to it by virtue of its status as an Intergovernmental Organization
// or submit itself to any jurisdiction.
/// @file centralEventFilterProcessor.h
#ifndef O2_CentralEventFilterProcessor
#define O2_CentralEventFilterProcessor
#include "Framework/DataProcessorSpec.h"
#include "Framework/Task.h"
#include <random>
#include "filterTables.h"
class TH1D;
namespace o2::aod::filtering
{
class CentralEventFilterProcessor : public framework::Task
{
public:
CentralEventFilterProcessor(const std::string& config) : mConfigFile{config} {}
~CentralEventFilterProcessor() override = default;
void init(framework::InitContext& ic) final;
void run(framework::ProcessingContext& pc) final;
void endOfStream(framework::EndOfStreamContext& ec) final;
private:
TH1D* mScalers;
TH1D* mFiltered;
std::string mConfigFile;
std::unordered_map<std::string, std::unordered_map<std::string, float>> mDownscaling;
std::mt19937_64 mGeneratorEngine;
std::uniform_real_distribution<double> mUniformGenerator = std::uniform_real_distribution<double>(0., 1.);
};
/// create a processor spec
framework::DataProcessorSpec getCentralEventFilterProcessorSpec(std::string& config);
} // namespace o2::aod::filtering
#endif /* O2_CentralEventFilterProcessor */