-
Notifications
You must be signed in to change notification settings - Fork 499
Expand file tree
/
Copy pathCPVDigitizerSpec.h
More file actions
77 lines (66 loc) · 3.01 KB
/
CPVDigitizerSpec.h
File metadata and controls
77 lines (66 loc) · 3.01 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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
// 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.
#ifndef STEER_DIGITIZERWORKFLOW_CPVDIGITIZER_H_
#define STEER_DIGITIZERWORKFLOW_CPVDIGITIZER_H_
#include <vector>
#include "Framework/DataProcessorSpec.h"
#include "Framework/Task.h"
#include "DataFormatsCPV/Digit.h"
#include "DataFormatsCPV/Hit.h"
#include "CPVSimulation/Digitizer.h"
#include "SimulationDataFormat/MCTruthContainer.h"
#include "DetectorsBase/BaseDPLDigitizer.h"
class TChain;
namespace o2
{
namespace cpv
{
/// \class DigitizerSpec
/// \brief Task for CPV digitization in the data processing layer
/// \author Dmitri Peresunko, NRC "Kurchatov institute"
/// \author Adopted from PHOS code
/// \since Jan, 2020
class DigitizerSpec final : public o2::base::BaseDPLDigitizer
{
public:
/// \brief Constructor
DigitizerSpec() : o2::base::BaseDPLDigitizer(o2::base::InitServices::GEOM) {}
/// \brief Destructor
~DigitizerSpec() final = default;
/// \brief init digitizer
/// \param ctx Init context
void initDigitizerTask(framework::InitContext& ctx) final;
/// \brief run digitizer
/// \param ctx Processing context
///
/// Handling of pileup events:
/// - Open readout window when the event sets a trigger
/// - Accumulate digits sampled via the time response from different bunch crossings
/// - Retrieve digits when the readout window closes
void run(framework::ProcessingContext& ctx);
private:
void updateTimeDependentParams(framework::ProcessingContext& ctx);
float mReadoutTime = 0.; ///< PHOS readout time
float mDeadTime = 0.; ///< PHOS dead time
Digitizer mDigitizer; ///< Digitizer object
std::vector<TChain*> mSimChains; ///< Chain of files for background/signal events
std::vector<Hit>* mHits = nullptr; ///< Vector with input hits from Signal event
std::vector<Digit> mDigitsTmp; ///< Vector with accumulated digits (per collision)
std::vector<Digit> mDigitsFinal; ///< Vector with accumulated digits (per collision)
std::vector<Digit> mDigitsOut; ///< Vector with accumulated digits (per collision)
dataformats::MCTruthContainer<o2::MCCompLabel> mLabels; ///< List of labels
};
/// \brief Create new digitizer spec
/// \return Digitizer spec
o2::framework::DataProcessorSpec getCPVDigitizerSpec(int channel, bool mctruth = true);
} // end namespace cpv
} // end namespace o2
#endif /* STEER_DIGITIZERWORKFLOW_CPVDIGITIZER_H_ */