51 unsigned int mProcessEveryNthTF{1};
58 int mMaxTFPerFile{-1};
59 std::string mOutputFileName;
60 bool mNewInterval{
true};
66 mOutputFileName = ic.
options().
get<std::string>(
"output-file-name");
67 mMaxTFPerFile = ic.
options().
get<
int>(
"max-tf-per-file");
69 mProcessEveryNthTF = ic.
options().
get<
int>(
"processEveryNthTF");
70 if (mProcessEveryNthTF <= 0) {
71 mProcessEveryNthTF = 1;
74 if (mProcessEveryNthTF > 1) {
75 std::mt19937 rng(std::time(
nullptr));
76 std::uniform_int_distribution<std::mt19937::result_type> dist(1, mProcessEveryNthTF);
77 mTFCounter = dist(rng);
78 LOGP(info,
"Skipping first {} TFs", mProcessEveryNthTF - mTFCounter);
84 if (mTFCounter++ % mProcessEveryNthTF) {
86 LOGP(info,
"Skipping TF {}", currentTF);
100 const auto& clustersInputs = getWorkflowTPCInput(pc);
101 const auto& clusterIndex = clustersInputs->clusterIndex;
106 for (
size_t icl = 0; icl < clusterIndex.nClusters[
sector][
padrow]; ++icl) {
107 const auto& cl = clusterIndex.clusters[
sector][
padrow][icl];
114 if ((mMaxTFPerFile > 0) && (mClusterQC.
getProcessedTFs() % mMaxTFPerFile) == 0) {
119void ClusterQCDevice::endInterval()
126 LOGP(info,
"End interval for run: {}, TFs: {} - {}, creation: {} - {}, processed TFs: {}",
127 mRunNumber, mFirstTF, mLastTF, mFirstCreation, mLastCreation, mClusterQC.
getProcessedTFs());
129 const auto outputFileName = fmt::format(fmt::runtime(mOutputFileName), fmt::arg(
"run", mRunNumber),
130 fmt::arg(
"firstTF", mFirstTF), fmt::arg(
"lastTF", mLastTF),
131 fmt::arg(
"firstCreation", mFirstCreation), fmt::arg(
"lastCreation", mLastCreation));
132 std::unique_ptr<TFile>
f(TFile::Open(outputFileName.data(),
"recreate"));
133 f->WriteObject(&mClusterQC,
"ClusterQC");
137 mRunNumber = mFirstTF = mLastTF = mFirstCreation = mLastCreation = 0;
143 LOG(info) <<
"Finalizig Cluster QC filter";
149 std::vector<InputSpec> inputs;
150 std::vector<OutputSpec> outputs;
158 adaptFromTask<ClusterQCDevice>(),
160 {
"output-file-name", VariantType::String,
"clusterQC_{run}_{firstCreation}_{lastCreation}_{firstTF}_{lastTF}.root", {
"name of the output file"}},
161 {
"processEveryNthTF", VariantType::Int, 1, {
"Using only a fraction of the data: 1: Use every TF, 10: Process only every tenth TF."}},
162 {
"max-tf-per-file", VariantType::Int, -1, {
"Number of TFs to process before a file is written. -1 = all"}},
Workflow to run clusterQC.
configStandalone Light OpenGL display display_light Apply smoothing to points Enable Z buffer Highlight links Highlight seeds Highlight sector tracks Highlight final tracks Show individual sector
Timeframe settings Average distance in cm of events merged into Randomize distance around average distance of merged events Simulate correct bunch interactions instead of placing only the average number of events A value[n] sets TFlen for[n] collisions in Number of bunches per trainsort Number of bunch trains Instantaneous interaction rate Do not simulate border Total number of collisions to be placed in the interior of all time Do not select random but walk over array of events in stride steps h Event generator settings h configStandalone Use CPU for GPU Force usage of the specified GPU device no CPU fallback Continue processing after an error First event to Number of events to Number of iterations to Number of iterations to Number of initial iterations excluded from const char Directory with events to Events directory is and not inside events Show standalone event Run event generator maximum time bin of continuous for triggered for automatic continuous for automatic continuous triggered uint64_t
Helper class to obtain TPC clusters / digits / labels from DPL.
T get(const char *key) const
ConfigParamRegistry const & options()
void endOfStream(EndOfStreamContext &eos) final
void init(framework::InitContext &ic) final
void run(ProcessingContext &pc) final
bool processCluster(const T &cluster, const o2::tpc::Sector sector, const int row)
Defining ITS Vertex explicitly as messageable.
uint32_t getCurrentTF(o2::framework::ProcessingContext &pc)
uint64_t getRunNumber(o2::framework::ProcessingContext &pc)
uint64_t getCreationTime(o2::framework::ProcessingContext &pc)
Global TPC definitions and constants.
o2::framework::DataProcessorSpec getClusterQCSpec()
create a processor speco2::framework::DataProcessorSpec getClusterQCSpec();
LOG(info)<< "Compressed in "<< sw.CpuTime()<< " s"