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 const std::vector<PHDataHD>& getPHDataHD() { return mPHValuesHD; }
65
66 void createOutputFile();
67 void closeOutputFile();
68
69 private:
70 // input arrays which should not be modified since they are provided externally
71 gsl::span<const TrackTRD> mTracksInITSTPCTRD;
72 gsl::span<const TrackTRD> mTracksInTPCTRD;
73 gsl::span<const Tracklet64> mTrackletsRaw;
74 const gsl::span<const Digit>* mDigits = nullptr;
75 gsl::span<const TriggerRecord> mTriggerRecords;
76 gsl::span<const TrackTriggerRecord> mTrackTriggerRecordsTPCTRD;
77 gsl::span<const TrackTriggerRecord> mTrackTriggerRecordsITSTPCTRD;
78
79 // output
80 std::vector<PHData> mPHValues, *mPHValuesPtr{&mPHValues};
81 std::vector<PHDataHD> mPHValuesHD, *mPHValuesHDPtr{&mPHValuesHD};
82 std::vector<int> mDistances, *mDistancesPtr{&mDistances};
83 std::unique_ptr<TFile> mOutFile{nullptr};
84 std::unique_ptr<TTree> mOutTree{nullptr};
85
86 // settings
87 const TRDCalibParams& mParams{TRDCalibParams::Instance()};
88 bool mWriteOutput{false};
89 bool mApplyShift{true};
90
91 ClassDefNV(PulseHeight, 1);
92};
93
94} // namespace trd
95} // namespace o2
96
97#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.
const std::vector< PHDataHD > & getPHDataHD()
Definition PulseHeight.h:64
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