Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MFT: new MC Track Task #2115

Merged
merged 5 commits into from
Feb 15, 2024
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
3 changes: 3 additions & 0 deletions Modules/MFT/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ target_sources(O2QcMFT PRIVATE
src/QcMFTClusterTask.cxx
src/QcMFTTrackCheck.cxx
src/QcMFTTrackTask.cxx
src/QcMFTTrackMCTask.cxx
src/QcMFTReadoutCheck.cxx
src/QcMFTReadoutTask.cxx
src/QcMFTReadoutTrend.cxx
Expand All @@ -35,6 +36,7 @@ add_root_dictionary(O2QcMFT
include/MFT/QcMFTClusterTask.h
include/MFT/QcMFTTrackCheck.h
include/MFT/QcMFTTrackTask.h
include/MFT/QcMFTTrackMCTask.h
include/MFT/QcMFTReadoutCheck.h
include/MFT/QcMFTReadoutTask.h
include/MFT/QcMFTReadoutTrend.h
Expand Down Expand Up @@ -97,6 +99,7 @@ endforeach()
install(FILES mft-digits.json
mft-clusters.json
mft-tracks.json
mft-tracks-mc.json
mft-readout.json
mft-readout-trend.json
mft-occupancy-trend.json
Expand Down
2 changes: 2 additions & 0 deletions Modules/MFT/include/MFT/LinkDef.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,10 @@
#pragma link C++ class o2::quality_control_modules::mft::QcMFTClusterCheck + ;
#pragma link C++ class o2::quality_control_modules::mft::QcMFTTrackTask + ;
#pragma link C++ class o2::quality_control_modules::mft::QcMFTTrackCheck + ;
#pragma link C++ class o2::quality_control_modules::mft::QcMFTTrackMCTask + ;
#pragma link C++ class o2::quality_control_modules::mft::QcMFTReadoutCheck + ;
#pragma link C++ class o2::quality_control_modules::mft::QcMFTReadoutTask + ;
#pragma link C++ class o2::quality_control_modules::mft::QcMFTReadoutTrend + ;
#pragma link C++ class o2::quality_control_modules::mft::QcMFTOccupancyTrend + ;

#endif
98 changes: 98 additions & 0 deletions Modules/MFT/include/MFT/QcMFTTrackMCTask.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
// Copyright CERN and copyright holders of ALICE O2. This software is
// // distributed under the terms of the GNU General Public License v3 (GPL
// // Version 3), copied verbatim in the file "COPYING".
// //
// // See http://alice-o2.web.cern.ch/license for full licensing information.
// //
// // 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 QcMFTTrackMCTask.h
/// \author Diana Krupova
/// Sara Haidlova
/// inspired by ITS sim task

#ifndef QC_MFT_TRACK_MC_TASK_H
#define QC_MFT_TRACK_MC_TASK_H

// ROOT
#include <TH1D.h>
#include <TH2D.h>
#include <TEfficiency.h>
// O2
#include <DataFormatsITSMFT/TopologyDictionary.h>
#include "SimulationDataFormat/MCTrack.h"
#include "SimulationDataFormat/MCCompLabel.h"
#include "DataFormatsMFT/TrackMFT.h"
// QualityControl
#include "QualityControl/TaskInterface.h"

class TH1D;
class TH2D;

using namespace o2::quality_control::core;
using namespace std;

namespace o2::quality_control_modules::mft
{

class QcMFTTrackMCTask : public TaskInterface
{

public:
QcMFTTrackMCTask() = default;
~QcMFTTrackMCTask() override;

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;

struct InfoStruct {
bool isFilled = 0;
int isReco = 0;
bool isPrimary = 0;
float pt;
float eta;
float phi;
};

private:
std::vector<std::vector<InfoStruct>> info;

std::unique_ptr<TH1D> hRecoValid_pt = nullptr;
std::unique_ptr<TH1D> hRecoFake_pt = nullptr;
std::unique_ptr<TH1D> hTrue_pt = nullptr;

std::unique_ptr<TH1D> hRecoValid_eta = nullptr;
std::unique_ptr<TH1D> hRecoFake_eta = nullptr;
std::unique_ptr<TH1D> hTrue_eta = nullptr;

std::unique_ptr<TH1D> hRecoValid_phi = nullptr;
std::unique_ptr<TH1D> hRecoFake_phi = nullptr;
std::unique_ptr<TH1D> hTrue_phi = nullptr;

std::unique_ptr<TEfficiency> hEfficiency_pt = nullptr;
std::unique_ptr<TEfficiency> hEfficiency_phi = nullptr;
std::unique_ptr<TEfficiency> hEfficiency_eta = nullptr;
std::unique_ptr<TEfficiency> hFakeTrack_pt = nullptr;
std::unique_ptr<TEfficiency> hFakeTrack_phi = nullptr;
std::unique_ptr<TEfficiency> hFakeTrack_eta = nullptr;

std::unique_ptr<TH1D> hPrimaryReco_pt = nullptr;
std::unique_ptr<TH1D> hPrimaryGen_pt = nullptr;

std::unique_ptr<TH1D> hResolution_pt = nullptr;

int mRunNumber = 0;
std::string mCollisionsContextPath;
};
} // namespace o2::quality_control_modules::mft

#endif // QC_MFT_TRACK_MC_TASK_H
64 changes: 64 additions & 0 deletions Modules/MFT/mft-tracks-mc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
{
"qc" : {
"config" : {
"database" : {
"implementation" : "CCDB",
"host" : "ccdb-test.cern.ch:8080",
"username" : "not_applicable",
"password" : "not_applicable",
"name" : "not_applicable"
},
"Activity" : {
"number" : "42",
"type" : "2"
},
"monitoring" : {
"url" : "infologger:///debug?qc"
},
"consul" : {
"url" : ""
},
"conditionDB" : {
"url" : "ccdb-test.cern.ch:8080"
}
},
"tasks" : {
"TracksMC" : {
"active" : "true",
"className" : "o2::quality_control_modules::mft::QcMFTTrackMCTask",
"moduleName" : "QcMFT",
"detectorName" : "MFT",
"cycleDurationSeconds" : "30",
"maxNumberCycles" : "-1",
"dataSource_comment" : "The other type of dataSource is \"direct\", see basic-no-sampling.json.",
"dataSource" : {
"type" : "dataSamplingPolicy",
"name" : "tracks-mc"
},
"location" : "remote",
"taskParameters" : {
"collisionsContextPath": "./collisioncontext.root"
}
}
}
},

"dataSamplingPolicies" : [
{
"id" : "tracks-mc",
"active" : "true",
"machines" : [],
"query" : "tracks:MFT/TRACKS/0;mctruth:MFT/TRACKSMCTR/0",
"samplingConditions" : [
{
"condition" : "random",
"fraction" : "1",
"seed" : "1234"
}
],

"blocking" : "false"
}
]
}

Loading
Loading