Project
Loading...
Searching...
No Matches
DataReader.cxx
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
16#include "TOFBase/Geo.h"
17#include <algorithm>
18#include <fairlogger/Logger.h> // for LOG
19
20using namespace o2::tof;
21using o2::tof::Digit;
22
23//______________________________________________________________________________
25{
26
27 // getting the next strip that needs to be clusterized
28
29 stripData.clear();
30 if (!mLastDigit) {
31 if (mIdx >= mDigitArray->size()) {
32 return kFALSE;
33 }
34 mLastDigit = &((*mDigitArray)[mIdx++]);
35 }
36
37 stripData.stripID = mLastDigit->getChannel() / Geo::NPADS;
38
39 stripData.digits.emplace_back(*mLastDigit);
40
41 mLastDigit = nullptr;
42
43 while (mIdx < mDigitArray->size()) {
44 mLastDigit = &((*mDigitArray)[mIdx++]);
45 if (stripData.stripID != mLastDigit->getChannel() / Geo::NPADS) {
46 break;
47 }
48 stripData.digits.emplace_back(*mLastDigit);
49 mLastDigit = nullptr;
50 }
51
52 // sorting the digits of the current strip according to the TDC
53 std::sort(stripData.digits.begin(), stripData.digits.end(),
54 [](const Digit& a, const Digit& b) { if(a.getBC() != b.getBC()){ return a.getBC() < b.getBC();} return a.getTDC() < b.getTDC(); });
55
56 return kTRUE;
57}
58
59//______________________________________________________________________________
60Bool_t RawDataReader::getNextStripData(DataReader::StripData& stripData) { return kTRUE; }
Definition of the TOF hit reader.
Bool_t getNextStripData(StripData &stripData) override
TOF digit implementation.
Definition Digit.h:31
Int_t getChannel() const
Definition Digit.h:49
static constexpr Int_t NPADS
Definition Geo.h:110
Bool_t getNextStripData(StripData &stripData) override
GLsizeiptr size
Definition glcorearb.h:659
GLboolean GLboolean GLboolean b
Definition glcorearb.h:1233
GLboolean GLboolean GLboolean GLboolean a
Definition glcorearb.h:1233
Transient data for single strip digits.
Definition DataReader.h:32
std::vector< Digit > digits
Definition DataReader.h:34