Project
Loading...
Searching...
No Matches
PulseHeight.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
14
15#ifndef O2_TRD_PULSEHEIGHT_H
16#define O2_TRD_PULSEHEIGHT_H
17
25#include "TFile.h"
26#include "TTree.h"
27
28namespace o2
29{
30
31namespace globaltracking
32{
33class RecoContainer;
34}
35
36namespace trd
37{
38
40{
41
42 public:
43 PulseHeight() = default;
44
46 void init();
47
49 void setInput(const o2::globaltracking::RecoContainer& input, gsl::span<const Digit>* digits);
50
52 void reset();
53
54 void setApplyShift(bool f) { mApplyShift = f; }
55
57 void process();
58
60 void findDigitsForTracklet(const Tracklet64& trklt, const TriggerRecord& trig, int type);
61
63 const std::vector<PHData>& getPHData() { return mPHValues; }
64
65 void createOutputFile();
66 void closeOutputFile();
67
68 private:
69 // input arrays which should not be modified since they are provided externally
70 gsl::span<const TrackTRD> mTracksInITSTPCTRD;
71 gsl::span<const TrackTRD> mTracksInTPCTRD;
72 gsl::span<const Tracklet64> mTrackletsRaw;
73 const gsl::span<const Digit>* mDigits = nullptr;
74 gsl::span<const TriggerRecord> mTriggerRecords;
75 gsl::span<const TrackTriggerRecord> mTrackTriggerRecordsTPCTRD;
76 gsl::span<const TrackTriggerRecord> mTrackTriggerRecordsITSTPCTRD;
77
78 // output
79 std::vector<PHData> mPHValues, *mPHValuesPtr{&mPHValues};
80 std::vector<int> mDistances, *mDistancesPtr{&mDistances};
81 std::unique_ptr<TFile> mOutFile{nullptr};
82 std::unique_ptr<TTree> mOutTree{nullptr};
83
84 // settings
85 const TRDCalibParams& mParams{TRDCalibParams::Instance()};
86 bool mWriteOutput{false};
87 bool mApplyShift{true};
88
89 ClassDefNV(PulseHeight, 1);
90};
91
92} // namespace trd
93} // namespace o2
94
95#endif // O2_TRD_PULSEHEIGHT_H
void findDigitsForTracklet(const Tracklet64 &trklt, const TriggerRecord &trig, int type)
Search for up to 3 neighbouring digits matching given tracklet and fill the PH values.
void setInput(const o2::globaltracking::RecoContainer &input, gsl::span< const Digit > *digits)
Initialize the input arrays.
void reset()
Reset the output.
const std::vector< PHData > & getPHData()
Access to output.
Definition PulseHeight.h:63
void setApplyShift(bool f)
Definition PulseHeight.h:54
void process()
Main processing function.
void init()
Initialize what is needed.
Header for data corresponding to the same hardware trigger adapted from DataFormatsITSMFT/ROFRecord.
GLdouble f
Definition glcorearb.h:310
GLint GLint GLsizei GLint GLenum GLenum type
Definition glcorearb.h:275
a couple of static helper functions to create timestamp values for CCDB queries or override obsolete ...
std::vector< Digit > digits