Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion Modules/TPC/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@ target_sources(O2QcTPC PRIVATE src/PID.cxx
src/IDCScaleReductor.cxx
src/SACs.cxx
src/TPCAggregator.cxx
src/SACZeroScaleReductor.cxx)
src/SACZeroScaleReductor.cxx
src/TrackClusters.cxx)

target_include_directories(
O2QcTPC
Expand Down Expand Up @@ -89,6 +90,7 @@ add_root_dictionary(O2QcTPC
include/TPC/SACs.h
include/TPC/TPCAggregator.h
include/TPC/SACZeroScaleReductor.h
include/TPC/TrackClusters.h
LINKDEF include/TPC/LinkDef.h)

install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/include/TPC
Expand Down Expand Up @@ -168,4 +170,5 @@ install(FILES run/tpcQCPID_sampled.json
run/tpcQCROCTrending.json
run/tpcQCSACs.json
run/tpcQCSACScaleTrend.json
run/tpcQCTrackClusters.json
DESTINATION etc)
1 change: 1 addition & 0 deletions Modules/TPC/include/TPC/LinkDef.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
#pragma link C++ class o2::quality_control_modules::tpc::SACs + ;
#pragma link C++ class o2::quality_control_modules::tpc::TPCAggregator + ;
#pragma link C++ class o2::quality_control_modules::tpc::SACZeroScaleReductor + ;
#pragma link C++ class o2::quality_control_modules::tpc::TrackClusters + ;

#pragma link C++ function o2::quality_control_modules::tpc::addAndPublish + ;
#pragma link C++ function o2::quality_control_modules::tpc::toVector + ;
Expand Down
60 changes: 60 additions & 0 deletions Modules/TPC/include/TPC/TrackClusters.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
// Copyright 2019-2020 CERN and copyright holders of ALICE O2.
// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders.
// All rights not expressly granted are reserved.
//
// This software is distributed under the terms of the GNU General Public
// License v3 (GPL Version 3), copied verbatim in the file "COPYING".
//
// In applying this license CERN does not waive the privileges and immunities
// granted to it by virtue of its status as an Intergovernmental Organization
// or submit itself to any jurisdiction.

///
/// \file TrackClusters.h
/// \author Laura Serksnyte
///

#ifndef QC_MODULE_TPC_TRACKCLUSTERS_H
#define QC_MODULE_TPC_TRACKCLUSTERS_H

// O2 includes
#include "TPCQC/TrackClusters.h"

// QC includes
#include "QualityControl/TaskInterface.h"

// ROOT includes
#include <TRandom3.h>

using namespace o2::quality_control::core;

namespace o2::quality_control_modules::tpc
{

/// \brief Quality Control task for the shared clusters and crossed rows distribution
class TrackClusters : public TaskInterface
{
public:
/// \brief Constructor
TrackClusters();
/// \brief Destructor
~TrackClusters() = default;

// Definition of the methods for the template method pattern
void initialize(o2::framework::InitContext& ctx) override;
void startOfActivity(const Activity& activity) override;
void startOfCycle() override;
void monitorData(o2::framework::ProcessingContext& ctx) override;
void endOfCycle() override;
void endOfActivity(const Activity& activity) override;
void reset() override;

private:
o2::tpc::qc::TrackClusters mQCTrackClusters{}; ///< TPC QC class from o2
TRandom3* mRandomGenerator;
float mSamplingFraction;
};

} // namespace o2::quality_control_modules::tpc

#endif // QC_MODULE_TPC_TRACKCLUSTERS_H
46 changes: 46 additions & 0 deletions Modules/TPC/run/tpcQCTrackClusters.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
{
"qc": {
"config": {
"database": {
"implementation": "CCDB",
"host": "ccdb-test.cern.ch:8080",
"username": "not_applicable",
"password": "not_applicable",
"name": "not_applicable"
},
"Activity": {
},
"monitoring": {
"url": "infologger:///debug?qc"
},
"consul": {
"url": ""
},
"conditionDB": {
"url": "ccdb-test.cern.ch:8080"
}
},
"tasks": {
"TrackClusters": {
"active": "true",
"className": "o2::quality_control_modules::tpc::TrackClusters",
"moduleName": "QcTPC",
"detectorName": "TPC",
"cycleDurationSeconds": "200",
"maxNumberCycles": "-1",
"dataSource": {
"type": "direct",
"query": "inputTracks:TPC/TRACKS/0;inputClusters:TPC/CLUSTERNATIVE/0;inputClusRefs:TPC/CLUSREFS/0"
},
"taskParameters": {
"cutAbsEta": "1.", "cutMinNCluster": "60", "cutMindEdxTot": "20.",
"seed": "0", "samplingFraction": "1"
},
"location": "remote"
}
}
},
"dataSamplingPolicies": [

]
}
106 changes: 106 additions & 0 deletions Modules/TPC/src/TrackClusters.cxx
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
// Copyright 2019-2020 CERN and copyright holders of ALICE O2.
// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders.
// All rights not expressly granted are reserved.
//
// This software is distributed under the terms of the GNU General Public
// License v3 (GPL Version 3), copied verbatim in the file "COPYING".
//
// In applying this license CERN does not waive the privileges and immunities
// granted to it by virtue of its status as an Intergovernmental Organization
// or submit itself to any jurisdiction.

///
/// \file TrackClusters.cxx
/// \author Laura Serksnyte
///

// O2 includes
#include "Framework/ProcessingContext.h"
#include <Framework/InputRecord.h>
#include "DataFormatsTPC/TrackTPC.h"
#include "TPCQC/Helpers.h"
#include "DataFormatsTPC/ClusterNative.h"
#include "DataFormatsTPC/WorkflowHelper.h"

// QC includes
#include "QualityControl/QcInfoLogger.h"
#include "TPC/TrackClusters.h"
#include "Common/Utils.h"

using namespace o2::framework;
using namespace o2::tpc;

namespace o2::quality_control_modules::tpc
{

TrackClusters::TrackClusters() : TaskInterface()
{
}

void TrackClusters::initialize(InitContext& /*ctx*/)
{
ILOG(Debug, Devel) << "initialize TPC TrackClusters QC task" << ENDM;

// do random generator
const int seed = o2::quality_control_modules::common::getFromConfig<int>(mCustomParameters, "seed");
mRandomGenerator = new TRandom3(seed);
mSamplingFraction = o2::quality_control_modules::common::getFromConfig<float>(mCustomParameters, "samplingFraction");

const int cutMinNCluster = o2::quality_control_modules::common::getFromConfig<int>(mCustomParameters, "cutMinNCluster");
const float cutMindEdxTot = o2::quality_control_modules::common::getFromConfig<float>(mCustomParameters, "cutMindEdxTot");
const float cutAbsEta = o2::quality_control_modules::common::getFromConfig<float>(mCustomParameters, "cutAbsEta");

mQCTrackClusters.setTrackClustersCuts(cutMinNCluster, cutMindEdxTot, cutAbsEta);
mQCTrackClusters.initializeHistograms();

o2::tpc::qc::helpers::setStyleHistogramsInMap(mQCTrackClusters.getMapOfHisto());
for (auto const& pair : mQCTrackClusters.getMapOfHisto()) {
for (auto& hist : pair.second) {
getObjectsManager()->startPublishing(hist.get());
}
}
}

void TrackClusters::startOfActivity(const Activity& /*activity*/)
{
ILOG(Debug, Devel) << "startOfActivity" << ENDM;
// serksnyte: anything neeeded for start of activity (in track tasks there is a reset of histograms)?
}

void TrackClusters::startOfCycle()
{
ILOG(Debug, Devel) << "startOfCycle" << ENDM;
}

void TrackClusters::monitorData(ProcessingContext& ctx)
{
if (mRandomGenerator->Uniform(0., 1.) < mSamplingFraction) {

using TrackType = std::vector<o2::tpc::TrackTPC>;
using ClusterRefType = std::vector<o2::tpc::TPCClRefElem>;

auto tracks = ctx.inputs().get<TrackType>("inputTracks");
const auto& inputsTPCclusters = o2::tpc::getWorkflowTPCInput(ctx, 0, false);
auto clusRefs = ctx.inputs().get<ClusterRefType>("inputClusRefs");

mQCTrackClusters.processTrackAndClusters(&tracks, &inputsTPCclusters->clusterIndex, &clusRefs);
}
}

void TrackClusters::endOfCycle()
{
ILOG(Debug, Devel) << "endOfCycle" << ENDM;
}

void TrackClusters::endOfActivity(const Activity& /*activity*/)
{
ILOG(Debug, Devel) << "endOfActivity" << ENDM;
}

void TrackClusters::reset()
{
ILOG(Debug, Devel) << "Resetting the data" << ENDM;
mQCTrackClusters.resetHistograms();
}

} // namespace o2::quality_control_modules::tpc