Skip to content

Commit

Permalink
[PWGDQ] Adding histograms and reduced table for MFT pid studies (Alic…
Browse files Browse the repository at this point in the history
…eO2Group#4207)

* Adding histograms and reduced table for MFT pid studies

* Removing one configurable

---------

Co-authored-by: Lucamicheletti93 <[email protected]>
  • Loading branch information
lucamicheletti93 and lucamicheletti authored Dec 21, 2023
1 parent 3be7757 commit 2e1b15a
Show file tree
Hide file tree
Showing 5 changed files with 63 additions and 1 deletion.
6 changes: 6 additions & 0 deletions PWGDQ/Core/HistogramsLibrary.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -477,6 +477,12 @@ void o2::aod::dqhistograms::DefineHistograms(HistogramManager* hm, const char* h
hm->AddHistogram(histClass, "pdca_vs_Rabs_vs_p", "pDCA vs R_{abs} vs p", false, 2000, 0.0, 20.0, VarManager::kP, 100, 0., 200., VarManager::kMuonRAtAbsorberEnd, 200, 0.0, 1000., VarManager::kMuonPDca);
hm->AddHistogram(histClass, "pdca_vs_Rabs_vs_pt", "pDCA vs R_{abs} vs pt", false, 2000, 0.0, 20.0, VarManager::kPt, 100, 0., 200., VarManager::kMuonRAtAbsorberEnd, 200, 0.0, 1000., VarManager::kMuonPDca);
}
if (subGroupStr.Contains("mft-pid")) {
hm->AddHistogram(histClass, "hMftTrackEtaVsPt", "", false, 100, -5.f, -2.f, VarManager::kEta, 100, 0.f, 20.f, VarManager::kPt);
hm->AddHistogram(histClass, "hMftNClusters", "", false, 16, -0.5f, 15.5f, VarManager::kMftNClusters);
hm->AddHistogram(histClass, "hMftClusterSize", "", false, 101, -0.5f, 100.5f, VarManager::kMftClusterSize);
hm->AddHistogram(histClass, "hMftMeanClusterSize", "", false, 200, 0.f, 20.f, VarManager::kMftMeanClusterSize);
}
if (subGroupStr.Contains("mc")) {
hm->AddHistogram(histClass, "Pt_vs_PtMC", "pT vs MC pT", false, 200, 0.0, 20.0, VarManager::kPt, 200, 0.0, 20.0, VarManager::kMCPt);
hm->AddHistogram(histClass, "Eta_vs_EtaMC", "#eta vs MC #eta", false, 50, -1.0, 1.0, VarManager::kEta, 50, -1.0, 1.0, VarManager::kMCEta);
Expand Down
6 changes: 6 additions & 0 deletions PWGDQ/Core/VarManager.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -438,6 +438,12 @@ void VarManager::SetDefaultVarNames()
fgVariableUnits[kIsLegFromOmega] = "";
fgVariableNames[kMuonNClusters] = "muon n-clusters";
fgVariableUnits[kMuonNClusters] = "";
fgVariableNames[kMftNClusters] = "MFT n-clusters";
fgVariableUnits[kMftNClusters] = "";
fgVariableNames[kMftClusterSize] = "MFT cluster size";
fgVariableUnits[kMftClusterSize] = "";
fgVariableNames[kMftMeanClusterSize] = "<MFT cluster size>";
fgVariableUnits[kMftMeanClusterSize] = "";
fgVariableNames[kMuonRAtAbsorberEnd] = "R at the end of the absorber";
fgVariableUnits[kMuonRAtAbsorberEnd] = "cm";
fgVariableNames[kMuonPDca] = "p x dca";
Expand Down
22 changes: 22 additions & 0 deletions PWGDQ/Core/VarManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -345,6 +345,9 @@ class VarManager : public TObject
kMuonDCAy,
kMuonTime,
kMuonTimeRes,
kMftNClusters,
kMftClusterSize,
kMftMeanClusterSize,

// MC particle variables
kMCPdgCode,
Expand Down Expand Up @@ -1082,6 +1085,25 @@ void VarManager::FillTrack(T const& track, float* values)
values = fgValues;
}

if constexpr ((fillMap & TrackMFT) > 0) {
values[kPt] = track.pt();
values[kEta] = track.eta();
values[kPhi] = track.phi();
values[kMftNClusters] = track.nClusters();

uint64_t mftClsAndFlgs = track.mftClusterSizesAndTrackFlags();
double meanClusterSize = 0;
for (int i = 0; i < 10; ++i) {
double size = (mftClsAndFlgs >> (i * 6)) & 0x3fULL;
values[kMftClusterSize + i] = (mftClsAndFlgs >> (i * 6)) & 0x3fULL;
if (size > 0) {
meanClusterSize += size;
}
}
meanClusterSize /= track.nClusters();
values[kMftMeanClusterSize] = meanClusterSize;
}

// Quantities based on the basic table (contains just kine information and filter bits)
if constexpr ((fillMap & Track) > 0 || (fillMap & Muon) > 0 || (fillMap & ReducedTrack) > 0 || (fillMap & ReducedMuon) > 0) {
values[kPt] = track.pt();
Expand Down
6 changes: 6 additions & 0 deletions PWGDQ/DataModel/ReducedInfoTables.h
Original file line number Diff line number Diff line change
Expand Up @@ -270,13 +270,19 @@ DECLARE_SOA_COLUMN(FilteringFlags, filteringFlags, uint8_t); //!
DECLARE_SOA_COLUMN(Pt, pt, float); //!
DECLARE_SOA_COLUMN(Eta, eta, float); //!
DECLARE_SOA_COLUMN(Phi, phi, float); //!
DECLARE_SOA_COLUMN(Sign, sign, int); //!
DECLARE_SOA_COLUMN(MftClusterSizesAndTrackFlags, mftClusterSizesAndTrackFlags, uint64_t); //!
} // namespace reducedmft

// MFT track kinematics
DECLARE_SOA_TABLE(ReducedMFTTracks, "AOD", "RMFTTR", //!
o2::soa::Index<>, reducedmft::ReducedEventId, reducedmft::FilteringFlags,
reducedmft::Pt, reducedmft::Eta, reducedmft::Phi);

// MFT tracks extra info (cluster size, sign)
DECLARE_SOA_TABLE(ReducedMFTTracksExtra, "AOD", "RMFTTREXTRA", //!
reducedmft::MftClusterSizesAndTrackFlags, reducedmft::Sign);

// iterator
using ReducedMFTTrack = ReducedMFTTracks::iterator;

Expand Down
24 changes: 23 additions & 1 deletion PWGDQ/TableProducer/tableMaker.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,7 @@ struct TableMaker {
Produces<ReducedMuonsCov> muonCov;
Produces<ReducedMuonsInfo> muonInfo;
Produces<ReducedMFTTracks> trackMFT;
Produces<ReducedMFTTracksExtra> trackMFTExtra;

OutputObj<THashList> fOutputList{"output"}; //! the histogram manager output list
OutputObj<TList> fStatsList{"Statistics"}; //! skimming statistics
Expand Down Expand Up @@ -246,7 +247,7 @@ struct TableMaker {
context.mOptions.get<bool>("processMuonOnlyWithCovAndCent") ||
context.mOptions.get<bool>("processMuonOnlyWithCov") || context.mOptions.get<bool>("processMuonOnlyWithCovAndEventFilter") || context.mOptions.get<bool>("processMuonOnlyWithEventFilter") ||
context.mOptions.get<bool>("processMuonOnlyWithMultsAndEventFilter") || context.mOptions.get<bool>("processAmbiguousMuonOnlyWithCov") || context.mOptions.get<bool>("processAmbiguousMuonOnly") ||
context.mOptions.get<bool>("processMuonMLOnly") || context.mOptions.get<bool>("processMuonMLOnly"));
context.mOptions.get<bool>("processMuonsAndMFT") || context.mOptions.get<bool>("processMuonsAndMFTWithFilter") || context.mOptions.get<bool>("processMuonMLOnly"));

if (enableBarrelHistos) {
if (fDoDetailedQA) {
Expand All @@ -273,6 +274,7 @@ struct TableMaker {
if (enableMuonHistos) {
if (fDoDetailedQA) {
histClasses += "Muons_BeforeCuts;";
histClasses += "MftTracks;";
if (fIsAmbiguous) {
histClasses += "Ambiguous_Muons_BeforeCuts;";
histClasses += "Orphan_Muons_MFTMCHMID;";
Expand Down Expand Up @@ -570,6 +572,7 @@ struct TableMaker {

if constexpr (static_cast<bool>(TMFTFillMap)) {
trackMFT.reserve(mftTracks.size());
trackMFTExtra.reserve(mftTracks.size());
// TODO add cuts on the MFT tracks
int nDel = 0;
for (auto& mft : mftTracks) {
Expand All @@ -582,7 +585,11 @@ struct TableMaker {

mftOffsets[mft.globalIndex()] = mft.offsets();

VarManager::FillTrack<gkMFTFillMap>(mft);
fHistMan->FillHistClass("MftTracks", VarManager::fgValues);

trackMFT(event.lastIndex(), trackFilteringTag, mft.pt(), mft.eta(), mft.phi());
trackMFTExtra(mft.mftClusterSizesAndTrackFlags(), mft.sign());
} // end of mft : mftTracks

} // end if constexpr (TMFTFillMap)
Expand Down Expand Up @@ -1076,6 +1083,13 @@ struct TableMaker {
dqhistograms::DefineHistograms(fHistMan, objArray->At(iclass)->GetName(), "track", histMuonName);
}
}

TString histMftName = fConfigAddMuonHistogram.value;
if (classStr.Contains("Mft")) {
if (fConfigDetailedQA) {
dqhistograms::DefineHistograms(fHistMan, objArray->At(iclass)->GetName(), "track", histMftName);
}
}
}

// create statistics histograms (event, tracks, muons)
Expand Down Expand Up @@ -1378,6 +1392,13 @@ struct TableMaker {
}
}

// Produce MFT tracks tables and muons ------------------------------------------------------------------------------------------------------------------
void processMuonsAndMFT(MyEvents::iterator const& collision, aod::BCsWithTimestamps const& bcs,
aod::MFTTracks const& tracksMft, soa::Filtered<MyMuonsWithCov> const& tracksMuon)
{
fullSkimming<gkEventFillMap, 0u, gkMuonFillMapWithCov, gkMFTFillMap>(collision, bcs, nullptr, tracksMuon, nullptr, nullptr, tracksMft);
}

// Produce MFT tracks tables and muons, with event filtering ------------------------------------------------------------------------------------------------------------------
void processMuonsAndMFTWithFilter(MyEventsWithFilter::iterator const& collision, aod::BCsWithTimestamps const& bcs,
aod::MFTTracks const& tracksMft, soa::Filtered<MyMuonsWithCov> const& tracksMuon)
Expand Down Expand Up @@ -1520,6 +1541,7 @@ struct TableMaker {
PROCESS_SWITCH(TableMaker, processAmbiguousBarrelOnly, "Build barrel-only DQ skimmed data model with QA plots for ambiguous tracks", false);
PROCESS_SWITCH(TableMaker, processAssociatedMuonOnly, "Build muon-only DQ skimmed data model using track-collision association tables", false);
PROCESS_SWITCH(TableMaker, processAssociatedMuonOnlyWithCov, "Build muon-only with cov DQ skimmed data model using track-collision association tables", false);
PROCESS_SWITCH(TableMaker, processMuonsAndMFT, "Build MFT and muons DQ skimmed data model", false);
PROCESS_SWITCH(TableMaker, processMuonsAndMFTWithFilter, "Build MFT and muons DQ skimmed data model, w/ event filter", false);
};

Expand Down

0 comments on commit 2e1b15a

Please sign in to comment.