forked from AliceO2Group/O2Physics
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
CF 2-prong candidate filter and tables (AliceO2Group#4362)
- Loading branch information
Showing
5 changed files
with
214 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
// 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. | ||
#include "Framework/runDataProcessing.h" | ||
#include "Framework/AnalysisTask.h" | ||
#include "Framework/AnalysisDataModel.h" | ||
#include "Framework/ASoAHelpers.h" | ||
|
||
#include "MathUtils/detail/TypeTruncation.h" | ||
|
||
#include "PWGCF/DataModel/CorrelationsDerived.h" | ||
|
||
#include "PWGHF/Core/HfHelper.h" | ||
#include "PWGHF/DataModel/CandidateReconstructionTables.h" | ||
#include "PWGHF/DataModel/CandidateSelectionTables.h" | ||
|
||
using namespace o2; | ||
using namespace o2::framework; | ||
using namespace o2::framework::expressions; | ||
using namespace o2::math_utils::detail; | ||
|
||
#define FLOAT_PRECISION 0xFFFFFFF0 | ||
#define O2_DEFINE_CONFIGURABLE(NAME, TYPE, DEFAULT, HELP) Configurable<TYPE> NAME{#NAME, DEFAULT, HELP}; | ||
|
||
struct Filter2Prong { | ||
O2_DEFINE_CONFIGURABLE(cfgVerbosity, int, 0, "Verbosity level (0 = major, 1 = per collision)") | ||
|
||
Produces<aod::CF2ProngTracks> output2ProngTracks; | ||
|
||
using HFCandidates = soa::Join<aod::HfCand2Prong, aod::HfSelD0>; | ||
void processData(aod::Collisions::iterator const& collision, aod::BCsWithTimestamps const&, aod::CFCollRefs const& cfcollisions, aod::CFTrackRefs const& cftracks, HFCandidates const& candidates) | ||
{ | ||
if (cfcollisions.size() <= 0 || cftracks.size() <= 0) | ||
return; // rejected collision | ||
if (cfgVerbosity > 0 && candidates.size() > 0) | ||
LOGF(info, "Candidates for collision: %lu, cfcollisions: %lu, CFTracks: %lu", candidates.size(), cfcollisions.size(), cftracks.size()); | ||
for (auto& c : candidates) { | ||
int prongCFId[2] = {-1, -1}; | ||
for (auto& cftrack : cftracks) { | ||
if (c.prong0Id() == cftrack.trackId()) { | ||
prongCFId[0] = cftrack.globalIndex(); | ||
break; | ||
} | ||
} | ||
for (auto& cftrack : cftracks) { | ||
if (c.prong1Id() == cftrack.trackId()) { | ||
prongCFId[1] = cftrack.globalIndex(); | ||
break; | ||
} | ||
} | ||
// look-up the collision id | ||
auto collisionId = cfcollisions.begin().globalIndex(); | ||
if ((c.hfflag() & (1 << aod::hf_cand_2prong::DecayType::D0ToPiK)) == 0) | ||
continue; | ||
output2ProngTracks(collisionId, | ||
prongCFId[0], prongCFId[1], c.pt(), c.eta(), c.phi(), aod::cf2prongtrack::D0ToPiK); | ||
} | ||
} | ||
PROCESS_SWITCH(Filter2Prong, processData, "Process data D0 candidates", true); | ||
}; // struct | ||
|
||
WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) | ||
{ | ||
return WorkflowSpec{ | ||
adaptAnalysisTask<Filter2Prong>(cfgc, TaskName{"filter-2prong"})}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters