|
| 1 | +// Copyright 2019-2025 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 | +using std::vector; |
| 13 | + |
| 14 | +void VectorPadFlagsStreamer(TBuffer& R__b, void* objp) |
| 15 | +{ |
| 16 | + std::vector<o2::tpc::PadFlags>* obj = static_cast<std::vector<o2::tpc::PadFlags>*>(objp); |
| 17 | + if (R__b.IsReading()) { |
| 18 | + std::vector<int> R__stl; |
| 19 | + R__stl.clear(); |
| 20 | + int R__n; |
| 21 | + R__b >> R__n; |
| 22 | + R__stl.reserve(R__n); |
| 23 | + for (int R__i = 0; R__i < R__n; R__i++) { |
| 24 | + Int_t readtemp; |
| 25 | + R__b >> readtemp; |
| 26 | + R__stl.push_back(readtemp); |
| 27 | + } |
| 28 | + auto data = reinterpret_cast<unsigned short*>(R__stl.data()); |
| 29 | + for (int i = 0; i < R__n; ++i) { |
| 30 | + obj->push_back(static_cast<o2::tpc::PadFlags>(data[i])); |
| 31 | + } |
| 32 | + } else { |
| 33 | + // We always save things with the old format. |
| 34 | + R__b << (int)obj->size() / 2; |
| 35 | + for (size_t i = 0; i < obj->size(); i++) { |
| 36 | + R__b << (short)obj->at(i); |
| 37 | + } |
| 38 | + } |
| 39 | +} |
| 40 | + |
| 41 | +#define RootStreamerLocal(name,STREAMER) \ |
| 42 | +namespace ROOT { \ |
| 43 | + \ |
| 44 | + /** \cond HIDDEN_SYMBOLS */ \ |
| 45 | + static auto _R__UNIQUE_(R__dummyStreamer) = \ |
| 46 | + []() { TClass::GetClass<name>()->SetStreamerFunc(STREAMER); return 0; }(); \ |
| 47 | + /** \endcond */ \ |
| 48 | + R__UseDummy(_R__UNIQUE_(R__dummyStreamer)); \ |
| 49 | +} |
| 50 | + |
| 51 | +RootStreamerLocal(vector<o2::tpc::PadFlags>, VectorPadFlagsStreamer); |
0 commit comments