73 mReaderRaw->openInput(inpName);
74 mClusterer.
process(1, *mReaderRaw.get(), &mCompClus, &mPatterns, &mROFRecVec,
nullptr);
76 auto basename = outName.substr(0, outName.size() -
sizeof(
"root"));
77 auto nFiles =
int(mROFRecVec.size() / maxROframe);
79 for (;
i < nFiles;
i++) {
88 TFile outFile(outName.data(),
"new");
89 if (!outFile.IsOpen()) {
90 LOG(fatal) <<
"Failed to open output file " << outName;
93 TTree outTree(
"o2sim",
"ITS Clusters");
95 auto compClusPtr = &mCompClus;
96 outTree.Branch(
"ITSClusterComp", &compClusPtr);
98 auto rofRecVecPtr = &mROFRecVec;
99 outTree.Branch(
"ITSClustersROF", &rofRecVecPtr);
101 auto clsLabelsPtr = &mClsLabels;
102 if (mUseMCTruth && mReaderMC->getDigitsMCTruth()) {
104 outTree.Branch(
"ITSClusterMCTruth", &clsLabelsPtr);
108 LOG(info) << Class()->GetName() <<
" | MCTruth: " << (mUseMCTruth ?
"ON" :
"OFF");
110 outTree.Branch(
"ITSClusterPatt", &mPatterns);
112 std::vector<o2::itsmft::MC2ROFRecord> mc2rof, *mc2rofPtr = &mc2rof;
114 auto mc2rofOrig = mReaderMC->getMC2ROFRecords();
115 mc2rof.reserve(mc2rofOrig.size());
116 for (
const auto& m2r : mc2rofOrig) {
117 mc2rof.push_back(m2r);
119 outTree.Branch(
"ITSClustersMC2ROF", mc2rofPtr);
123 while (mReaderMC->readNextEntry()) {
124 mClusterer.
process(1, *mReaderMC.get(), &mCompClus, &mPatterns, &mROFRecVec, &mClsLabels);
137 TFile outFile(
name.data(),
"new");
138 if (!outFile.IsOpen()) {
139 LOG(fatal) <<
"Failed to open output file " <<
name;
141 TTree outTree(
"o2sim",
"ITS Clusters");
143 size_t max = (
i + 1) * maxROframe;
144 auto lastf = (
max < mROFRecVec.size()) ? mROFRecVec.begin() +
max : mROFRecVec.end();
145 std::vector<o2::itsmft::ROFRecord> rofRecBuffer(mROFRecVec.begin() +
i * maxROframe, lastf);
146 std::vector<o2::itsmft::ROFRecord>* rofRecPtr = &rofRecBuffer;
147 outTree.Branch(
"ITSClustersROF", rofRecPtr);
149 auto first = rofRecBuffer[0].getFirstEntry();
150 auto last = rofRecBuffer.back().getFirstEntry() + rofRecBuffer.back().getNEntries();
152 std::vector<CompClusterExt> compClusBuffer, *compClusPtr = &compClusBuffer;
153 compClusBuffer.assign(&mCompClus[
first], &mCompClus[last]);
154 outTree.Branch(
"ITSClusterComp", &compClusPtr);
155 outTree.Branch(
"ITSClusterPatt", &mPatterns);
157 for (
auto& rof : rofRecBuffer) {
158 rof.setFirstEntry(rof.getFirstEntry() -
first);
void process(int nThreads, PixelReader &r, CompClusCont *compClus, PatternCont *patterns, ROFRecCont *vecROFRec, MCTruth *labelsCl=nullptr)