You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 091fbfb
Browse filesBrowse the repository at this point in the historyBrowse files
auto entriesPerChannel = pc.inputs().get<std::array<int, Geo::NCHANNELS>>("entriesCh");
55
55
int offsetStart = 0;
56
56
for (int ich = 0; ich < o2::tof::Geo::NCHANNELS; ich++) {
57
57
mTOFCalibInfoOut.clear();
58
-
auto offsetEnd = offsetStart + entriesPerChannel[ich] - 1;
59
-
if (offsetEnd >= offsetStart) {
58
+
if (entriesPerChannel[ich] > 0) {
60
59
mTOFCalibInfoOut.resize(entriesPerChannel[ich]);
61
-
std::copy(collectedInfo.begin() + offsetStart, collectedInfo.begin() + offsetEnd + 1, mTOFCalibInfoOut.begin()); //mTOFCalibInfoOut->begin()); // this is very inefficient; maybe instead of vectors, using span and then one could avoid copying? https://solarianprogrammer.com/2019/11/03/cpp-20-span-tutorial/ --> did not work
60
+
auto subSpanVect = gsl::span<const o2::dataformats::CalibInfoTOFshort>(&collectedInfo[offsetStart], entriesPerChannel[ich]);
@@ -76,10 +77,10 @@ class TOFCalibCollectorWriter : public o2::framework::Task
76
77
intmCount = 0; // how many times we filled the tree
77
78
boolmIsEndOfStream = false;
78
79
std::vector<o2::dataformats::CalibInfoTOFshort> mTOFCalibInfoOut, *mPTOFCalibInfoOut = &mTOFCalibInfoOut; ///< these are the object and pointer to the CalibInfo of a specific channel that we need to fill the output tree
79
-
TTree*mOutputTree;///< tree for the collected calib tof info
80
+
std::unique_ptr<TTree>mOutputTree; ///< tree for the collected calib tof info
80
81
std::string mTOFCalibInfoBranchName = "TOFCalibInfo"; ///< name of branch containing input TOF calib infos
81
82
std::string mOutputBranchName = "TOFCollectedCalibInfo"; ///< name of branch containing output
82
-
TFile* mfileOut = nullptr;// file in which to write the output
83
+
std::unique_ptr<TFile> mfileOut = nullptr; // file in which to write the output
0 commit comments