Project
Loading...
Searching...
No Matches
DigitsVectorStream.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_EMCAL_DIGITSVECTORSTREAM_H_
13#define ALICEO2_EMCAL_DIGITSVECTORSTREAM_H_
14
15#include <memory>
16#include <unordered_map>
17#include <vector>
18#include <deque>
19#include <list>
20#include <optional>
21#include <gsl/span>
22#include "TRandom3.h"
29
30namespace o2
31{
32namespace emcal
33{
34
41
43{
44
45 public:
47 DigitsVectorStream() = default;
48
51
53 void clear();
54
56 void init();
57
59 void fill(std::deque<o2::emcal::DigitTimebin>& digitlist, o2::InteractionRecord record);
60
62 const std::vector<o2::emcal::Digit>& getDigits() const { return mDigits; }
63 const std::vector<o2::emcal::TriggerRecord>& getTriggerRecords() const { return mTriggerRecords; }
65
67 void doSimulateNoiseDigits(bool doNoise = true) { mSimulateNoiseDigits = doNoise; }
70
72 void doRemoveDigitsBelowThreshold(bool doThreshold = true) { mRemoveDigitsBelowThreshold = doThreshold; }
73
74 private:
75 unsigned int mStartIndex = 0;
76
77 std::vector<o2::emcal::Digit> mDigits;
79 std::vector<o2::emcal::TriggerRecord> mTriggerRecords;
80
81 bool mSimulateNoiseDigits = true;
82 bool mRemoveDigitsBelowThreshold = true;
83
84 const SimParam* mSimParam = nullptr;
85 TRandom3* mRandomGenerator = nullptr;
86
87 ClassDefNV(DigitsVectorStream, 1);
88};
89
90} // namespace emcal
91
92} // namespace o2
93
94#endif /* ALICEO2_EMCAL_DIGITSVECTORSTREAM_H_ */
EMCAL DigitTimebin for the DigitsWriteoutBuffer and DigitsWriteoutBufferTRU.
Definition of a container to keep Monte Carlo truth external to simulation objects.
A container to hold and manage MC truth information/labels.
Container class for Digits, MC lebels, and trigger records.
DigitsVectorStream()=default
Default constructor.
void doSimulateNoiseDigits(bool doNoise=true)
Flag whether to simulate noise to the digits.
void init()
Initialize the streamer.
void clear()
clear the container
const std::vector< o2::emcal::Digit > & getDigits() const
Getters for the finals data vectors, digits vector, labels vector, and trigger records vector.
void addNoiseDigits(LabeledDigit &d1)
Add noise to this digit.
const o2::dataformats::MCTruthContainer< o2::emcal::MCLabel > & getMCLabels() const
const std::vector< o2::emcal::TriggerRecord > & getTriggerRecords() const
void fill(std::deque< o2::emcal::DigitTimebin > &digitlist, o2::InteractionRecord record)
Fill all the containers, digits, labels, and trigger records.
void doRemoveDigitsBelowThreshold(bool doThreshold=true)
Remove digits below the threshold.
~DigitsVectorStream()=default
Destructor.
EMCAL labeled digit implementation.
EMCal simulation parameters.
Definition SimParam.h:28
a couple of static helper functions to create timestamp values for CCDB queries or override obsolete ...