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
6 changes: 5 additions & 1 deletion Modules/MUON/Common/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ set(SRCS
src/Helpers.cxx
src/MergeableTH1Ratio.cxx
src/MergeableTH2Ratio.cxx
src/HistPlotter.cxx
src/MuonTrack.cxx
src/TrackPlotter.cxx
src/TracksCheck.cxx
src/TracksTask.cxx
Expand All @@ -14,6 +16,8 @@ set(SRCS
set(HEADERS
include/MUONCommon/MergeableTH1Ratio.h
include/MUONCommon/MergeableTH2Ratio.h
include/MUONCommon/HistPlotter.h
include/MUONCommon/MuonTrack.h
include/MUONCommon/TrackCheck.h
include/MUONCommon/TrackPlotter.h
include/MUONCommon/TracksTask.h
Expand All @@ -29,7 +33,7 @@ target_include_directories(
PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/src
)

target_link_libraries(${MODULE_NAME} PUBLIC O2QualityControl O2::MCHMappingImpl4 O2::DataFormatsMCH O2::MCHTracking O2::MCHRawElecMap O2::ReconstructionDataFormats O2::MCHGeometryTransformer)
target_link_libraries(${MODULE_NAME} PUBLIC O2QualityControl O2::MCHMappingImpl4 O2::DataFormatsMCH O2::MCHTracking O2::MCHRawElecMap O2::ReconstructionDataFormats O2::MCHGeometryTransformer O2::DataFormatsGlobalTracking)

# Digit.h is moving from MCHBase to DataFormatsMCH : let's handle both
# gracefully for the moment...
Expand Down
36 changes: 36 additions & 0 deletions Modules/MUON/Common/etc/qc-tracks-mchmid.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
{
"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"
}
},
"tasks": {
"MUONTracks": {
"active": "true",
"className": "o2::quality_control_modules::muon::TracksTask",
"moduleName": "QcMUONCommon",
"detectorName": "GLO",
"cycleDurationSeconds": "600",
"maxNumberCycles": "-1",
"dataSource": {
"type": "direct",
"query": "trackMCH:MCH/TRACKS;trackMCHROF:MCH/TRACKROFS;trackMCHTRACKCLUSTERS:MCH/TRACKCLUSTERS;mchtrackdigits:MCH/CLUSTERDIGITS;trackMID:MID/TRACKS;trackMIDROF:MID/TRACKROFS;trackMIDTRACKCLUSTERS:MID/TRACKCLUSTERS;trackClMIDROF:MID/TRCLUSROFS;matchMCHMID:GLO/MTC_MCHMID"
},
"taskParameters": {
"maxTracksPerTF": "600",
"GID" : "MCH,MID,MCH-MID"
},
"location": "remote"
}
}
}
}
36 changes: 36 additions & 0 deletions Modules/MUON/Common/etc/qc-tracks-mftmch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
{
"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"
}
},
"tasks": {
"MUONTracks": {
"active": "true",
"className": "o2::quality_control_modules::muon::TracksTask",
"moduleName": "QcMUONCommon",
"detectorName": "GLO",
"cycleDurationSeconds": "600",
"maxNumberCycles": "-1",
"dataSource": {
"type": "direct",
"query": "trackMCH:MCH/TRACKS;trackMCHROF:MCH/TRACKROFS;trackMCHTRACKCLUSTERS:MCH/TRACKCLUSTERS;mchtrackdigits:MCH/CLUSTERDIGITS;trackMFT:MFT/TRACKS;trackMFTROF:MFT/MFTTrackROF;trackMFTClIdx:MFT/TRACKCLSID;alpparMFT:MFT/ALPIDEPARAM;fwdtracks:GLO/GLFWD"
},
"taskParameters": {
"maxTracksPerTF": "600",
"GID" : "MCH,MFT,MFT-MCH"
},
"location": "remote"
}
}
}
}
36 changes: 36 additions & 0 deletions Modules/MUON/Common/etc/qc-tracks-mftmchmid.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
{
"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"
}
},
"tasks": {
"MUONTracks": {
"active": "true",
"className": "o2::quality_control_modules::muon::TracksTask",
"moduleName": "QcMUONCommon",
"detectorName": "GLO",
"cycleDurationSeconds": "600",
"maxNumberCycles": "-1",
"dataSource": {
"type": "direct",
"query": "trackMCH:MCH/TRACKS;trackMCHROF:MCH/TRACKROFS;trackMCHTRACKCLUSTERS:MCH/TRACKCLUSTERS;mchtrackdigits:MCH/CLUSTERDIGITS;trackMFT:MFT/TRACKS;trackMFTROF:MFT/MFTTrackROF;trackMFTClIdx:MFT/TRACKCLSID;alpparMFT:MFT/ALPIDEPARAM;trackMID:MID/TRACKS;trackMIDROF:MID/TRACKROFS;trackMIDTRACKCLUSTERS:MID/TRACKCLUSTERS;trackClMIDROF:MID/TRCLUSROFS;matchMCHMID:GLO/MTC_MCHMID;fwdtracks:GLO/GLFWD"
},
"taskParameters": {
"maxTracksPerTF": "600",
"GID" : "MCH,MFT,MID,MFT-MCH,MCH-MID,MFT-MCH-MID"
},
"location": "remote"
}
}
}
}
51 changes: 51 additions & 0 deletions Modules/MUON/Common/include/MUONCommon/HistPlotter.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
// 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.

#ifndef QC_MODULE_MUON_COMMON_HIST_PLOTTER_H
#define QC_MODULE_MUON_COMMON_HIST_PLOTTER_H

#include "QualityControl/ObjectsManager.h"
#include <TObject.h>
#include <string>
#include <vector>

namespace o2::quality_control_modules::muon
{

class HistPlotter
{
public:
HistPlotter() = default;
~HistPlotter() = default;

public:
struct HistInfo {
TObject* object;
std::string drawOptions;
std::string displayHints;
};

/** reset all histograms */
void reset();

std::vector<HistInfo>& histograms() { return mHistograms; }

const std::vector<HistInfo>& histograms() const { return mHistograms; }

void publish(std::shared_ptr<o2::quality_control::core::ObjectsManager> objectsManager);

private:
std::vector<HistInfo> mHistograms;
};

} // namespace o2::quality_control_modules::muon

#endif
99 changes: 99 additions & 0 deletions Modules/MUON/Common/include/MUONCommon/MuonTrack.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
// 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.

#ifndef QC_MODULE_MUON_COMMON_TRACK_H
#define QC_MODULE_MUON_COMMON_TRACK_H

#include <CommonDataFormat/InteractionRecord.h>
#include <DataFormatsGlobalTracking/RecoContainer.h>
#include <DataFormatsMCH/TrackMCH.h>
#include <ReconstructionDataFormats/TrackMCHMID.h>
#include <ReconstructionDataFormats/GlobalFwdTrack.h>
#include <MCHTracking/TrackParam.h>
#include <Math/Vector4D.h>
#include <memory>

namespace o2::quality_control_modules::muon
{

class MuonTrack
{
public:
MuonTrack(const o2::mch::TrackMCH* track, const o2::globaltracking::RecoContainer& recoCont);
MuonTrack(const o2::dataformats::TrackMCHMID* track, const o2::globaltracking::RecoContainer& recoCont);
MuonTrack(const o2::dataformats::GlobalFwdTrack* track, const o2::globaltracking::RecoContainer& recoCont);

void init();

ROOT::Math::PxPyPzMVector getMuonMomentum() const { return mMuonMomentum; }
ROOT::Math::PxPyPzMVector getMuonMomentumAtVertex() const { return mMuonMomentumAtVertex; }
double getP() const
{
return mMuonMomentum.P();
}
double getDCA() const { return mDCA; }
double getPDCAMCH() const { return mPDCAMCH; }
double getRAbs() const { return mRAbs; }
double getChi2OverNDF() const { return mChi2OverNDF; }

/// get the interaction record associated to this track
InteractionRecord getIR() const { return mIR; }
/// get the interaction record associated to the MFT track
InteractionRecord getIRMFT() const { return mIRMFT; }
/// get the interaction record associated to the MCH track
InteractionRecord getIRMCH() const { return mIRMCH; }
/// get the interaction record associated to the MID track
InteractionRecord getIRMID() const { return mIRMID; }

/// get the interaction record associated to the MFT track
int getTrackIdMFT() const { return mTrackIdMFT; }
/// get the interaction record associated to the MCH track
int getTrackIdMCH() const { return mTrackIdMCH; }
/// get the interaction record associated to the MID track
int getTrackIdMID() const { return mTrackIdMID; }

bool hasMFT() const { return (mTrackIdMFT >= 0); }
bool hasMCH() const { return (mTrackIdMCH >= 0); }
bool hasMID() const { return (mTrackIdMID >= 0); }

/// get the muon sign
short getSign() const { return mSign; }

static constexpr double sAbsZBeg = -90.; ///< Position of the begining of the absorber (cm)
static constexpr double sAbsZEnd = -505.; ///< Position of the end of the absorber (cm)

private:
o2::mch::TrackParam mTrackParameters;
o2::mch::TrackParam mTrackParametersMCH;

ROOT::Math::PxPyPzMVector mMuonMomentum;
ROOT::Math::PxPyPzMVector mMuonMomentumAtVertex;

float mDCA{ 0 };
float mPDCAMCH{ 0 };
float mRAbs{ 0 };
float mChi2OverNDF{ 0 };

InteractionRecord mIR{}; ///< associated interaction record
InteractionRecord mIRMFT{}; ///< MFT interaction record
InteractionRecord mIRMCH{}; ///< MCH interaction record
InteractionRecord mIRMID{}; ///< MID interaction record

int mTrackIdMFT{ -1 };
int mTrackIdMCH{ -1 };
int mTrackIdMID{ -1 };

short mSign;
};

} // namespace o2::quality_control_modules::muon

#endif
Loading