|
| 1 | +// Copyright 2019-2020 CERN and copyright holders of ALICE O2. |
| 2 | +// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders. |
| 3 | +// All rights not expressly granted are reserved. |
| 4 | +// |
| 5 | +// This software is distributed under the terms of the GNU General Public |
| 6 | +// License v3 (GPL Version 3), copied verbatim in the file "COPYING". |
| 7 | +// |
| 8 | +// In applying this license CERN does not waive the privileges and immunities |
| 9 | +// granted to it by virtue of its status as an Intergovernmental Organization |
| 10 | +// or submit itself to any jurisdiction. |
| 11 | + |
| 12 | +/// \file propagationService.cxx |
| 13 | +/// \brief |
| 14 | +/// \author ALICE |
| 15 | + |
| 16 | +//=============================================================== |
| 17 | +// |
| 18 | +// Merged track propagation + strangeness building task |
| 19 | +// |
| 20 | +// Provides a common task to deal with track propagation and |
| 21 | +// strangeness building in a single DPL device that is particularly |
| 22 | +// adequate for pipelining. |
| 23 | +// |
| 24 | +// Currently meant for testing and performance check |
| 25 | +// |
| 26 | +//=============================================================== |
| 27 | + |
| 28 | +#include "PWGLF/Utils/strangenessBuilderModule.h" |
| 29 | + |
| 30 | +#include "Common/Core/trackUtilities.h" |
| 31 | +#include "Common/DataModel/TrackSelectionTables.h" |
| 32 | +#include "Common/Tools/StandardCCDBLoader.h" |
| 33 | +#include "Common/Tools/TrackPropagationModule.h" |
| 34 | + |
| 35 | +#include "CCDB/BasicCCDBManager.h" |
| 36 | +#include "CCDB/CcdbApi.h" |
| 37 | +#include "CommonConstants/GeomConstants.h" |
| 38 | +#include "CommonUtils/NameConf.h" |
| 39 | +#include "DataFormatsParameters/GRPMagField.h" |
| 40 | +#include "DetectorsBase/GeometryManager.h" |
| 41 | +#include "DetectorsBase/Propagator.h" |
| 42 | +#include "Framework/AnalysisDataModel.h" |
| 43 | +#include "Framework/AnalysisTask.h" |
| 44 | +#include "Framework/HistogramRegistry.h" |
| 45 | +#include "Framework/RunningWorkflowInfo.h" |
| 46 | +#include "Framework/runDataProcessing.h" |
| 47 | +#include "ReconstructionDataFormats/DCA.h" |
| 48 | + |
| 49 | +using namespace o2; |
| 50 | +using namespace o2::framework; |
| 51 | +// using namespace o2::framework::expressions; |
| 52 | + |
| 53 | +// use parameters + cov mat non-propagated, aux info + (extension propagated) |
| 54 | +using FullTracksExt = soa::Join<aod::Tracks, aod::TracksExtra, aod::TracksCov>; |
| 55 | +using FullTracksExtIU = soa::Join<aod::TracksIU, aod::TracksExtra, aod::TracksCovIU>; |
| 56 | +using FullTracksExtWithPID = soa::Join<aod::Tracks, aod::TracksExtra, aod::TracksCov, aod::pidTPCFullEl, aod::pidTPCFullPi, aod::pidTPCFullPr, aod::pidTPCFullKa, aod::pidTPCFullHe>; |
| 57 | +using FullTracksExtIUWithPID = soa::Join<aod::TracksIU, aod::TracksExtra, aod::TracksCovIU, aod::pidTPCFullEl, aod::pidTPCFullPi, aod::pidTPCFullPr, aod::pidTPCFullKa, aod::pidTPCFullHe>; |
| 58 | +using FullTracksExtLabeled = soa::Join<aod::Tracks, aod::TracksExtra, aod::TracksCov, aod::McTrackLabels>; |
| 59 | +using FullTracksExtLabeledIU = soa::Join<aod::TracksIU, aod::TracksExtra, aod::TracksCovIU, aod::McTrackLabels>; |
| 60 | +using FullTracksExtLabeledWithPID = soa::Join<aod::Tracks, aod::TracksExtra, aod::TracksCov, aod::pidTPCFullEl, aod::pidTPCFullPi, aod::pidTPCFullPr, aod::pidTPCFullKa, aod::pidTPCFullHe, aod::McTrackLabels>; |
| 61 | +using FullTracksExtLabeledIUWithPID = soa::Join<aod::TracksIU, aod::TracksExtra, aod::TracksCovIU, aod::pidTPCFullEl, aod::pidTPCFullPi, aod::pidTPCFullPr, aod::pidTPCFullKa, aod::pidTPCFullHe, aod::McTrackLabels>; |
| 62 | +using TracksWithExtra = soa::Join<aod::Tracks, aod::TracksExtra>; |
| 63 | + |
| 64 | +// For dE/dx association in pre-selection |
| 65 | +using TracksExtraWithPID = soa::Join<aod::TracksExtra, aod::pidTPCFullEl, aod::pidTPCFullPi, aod::pidTPCFullPr, aod::pidTPCFullKa, aod::pidTPCFullHe>; |
| 66 | + |
| 67 | +struct propagationService { |
| 68 | + // CCDB boilerplate declarations |
| 69 | + o2::framework::Configurable<std::string> ccdburl{"ccdburl", "http://alice-ccdb.cern.ch", "url of the ccdb repository"}; |
| 70 | + Service<o2::ccdb::BasicCCDBManager> ccdb; |
| 71 | + |
| 72 | + // propagation stuff |
| 73 | + o2::common::StandardCCDBLoaderConfigurables standardCCDBLoaderConfigurables; |
| 74 | + o2::common::StandardCCDBLoader ccdbLoader; |
| 75 | + |
| 76 | + // boilerplate: strangeness builder stuff |
| 77 | + o2::pwglf::strangenessbuilder::products products; |
| 78 | + o2::pwglf::strangenessbuilder::coreConfigurables baseOpts; |
| 79 | + o2::pwglf::strangenessbuilder::v0Configurables v0BuilderOpts; |
| 80 | + o2::pwglf::strangenessbuilder::cascadeConfigurables cascadeBuilderOpts; |
| 81 | + o2::pwglf::strangenessbuilder::preSelectOpts preSelectOpts; |
| 82 | + o2::pwglf::strangenessbuilder::BuilderModule strangenessBuilderModule; |
| 83 | + |
| 84 | + // track propagation |
| 85 | + o2::common::TrackPropagationProducts trackPropagationProducts; |
| 86 | + o2::common::TrackPropagationConfigurables trackPropagationConfigurables; |
| 87 | + o2::common::TrackPropagationModule trackPropagation; |
| 88 | + |
| 89 | + // registry |
| 90 | + HistogramRegistry histos{"histos"}; |
| 91 | + |
| 92 | + void init(o2::framework::InitContext& initContext) |
| 93 | + { |
| 94 | + // CCDB boilerplate init |
| 95 | + ccdb->setCaching(true); |
| 96 | + ccdb->setLocalObjectValidityChecking(); |
| 97 | + ccdb->setURL(ccdburl.value); |
| 98 | + |
| 99 | + // task-specific |
| 100 | + trackPropagation.init(trackPropagationConfigurables, histos, initContext); |
| 101 | + strangenessBuilderModule.init(baseOpts, v0BuilderOpts, cascadeBuilderOpts, preSelectOpts, histos, initContext); |
| 102 | + } |
| 103 | + |
| 104 | + void processRealData(soa::Join<aod::Collisions, aod::EvSels> const& collisions, aod::V0s const& v0s, aod::Cascades const& cascades, aod::TrackedCascades const& trackedCascades, FullTracksExtIU const& tracks, aod::BCsWithTimestamps const& bcs) |
| 105 | + { |
| 106 | + ccdbLoader.initCCDBfromBCs(standardCCDBLoaderConfigurables, ccdb, bcs); |
| 107 | + trackPropagation.fillTrackTables<false>(trackPropagationConfigurables, ccdbLoader, collisions, tracks, trackPropagationProducts, histos); |
| 108 | + strangenessBuilderModule.dataProcess(ccdb, histos, collisions, static_cast<TObject*>(nullptr), v0s, cascades, trackedCascades, tracks, bcs, static_cast<TObject*>(nullptr), products); |
| 109 | + } |
| 110 | + |
| 111 | + void processMonteCarlo(soa::Join<aod::Collisions, aod::EvSels, aod::McCollisionLabels> const& collisions, aod::McCollisions const& mccollisions, aod::V0s const& v0s, aod::Cascades const& cascades, aod::TrackedCascades const& trackedCascades, FullTracksExtLabeledIU const& tracks, aod::BCsWithTimestamps const& bcs, aod::McParticles const& mcParticles) |
| 112 | + { |
| 113 | + ccdbLoader.initCCDBfromBCs(standardCCDBLoaderConfigurables, ccdb, bcs); |
| 114 | + trackPropagation.fillTrackTables<true>(trackPropagationConfigurables, ccdbLoader, collisions, tracks, trackPropagationProducts, histos); |
| 115 | + strangenessBuilderModule.dataProcess(ccdb, histos, collisions, mccollisions, v0s, cascades, trackedCascades, tracks, bcs, mcParticles, products); |
| 116 | + } |
| 117 | + |
| 118 | + // FIXME: the part below is only viable if TPC PID |
| 119 | + // switches to using TracksIU (circular dependency) |
| 120 | + // |
| 121 | + // void processRealDataWithPID(soa::Join<aod::Collisions, aod::EvSels> const& collisions, aod::V0s const& v0s, aod::Cascades const& cascades, aod::TrackedCascades const& trackedCascades, FullTracksExtIUWithPID const& tracks, aod::BCsWithTimestamps const& bcs) |
| 122 | + // { |
| 123 | + // ccdbLoader.initCCDBfromBCs(standardCCDBLoaderConfigurables, ccdb, bcs); |
| 124 | + // trackPropagation.fillTrackTables<false>(trackPropagationConfigurables, ccdbLoader, collisions, tracks, trackPropagationProducts, histos); |
| 125 | + // strangenessBuilderModule.dataProcess(ccdb, histos, collisions, static_cast<TObject*>(nullptr), v0s, cascades, trackedCascades, tracks, bcs, static_cast<TObject*>(nullptr), products); |
| 126 | + // } |
| 127 | + |
| 128 | + // void processMonteCarloWithPID(soa::Join<aod::Collisions, aod::EvSels, aod::McCollisionLabels> const& collisions, aod::McCollisions const& mccollisions, aod::V0s const& v0s, aod::Cascades const& cascades, aod::TrackedCascades const& trackedCascades, FullTracksExtLabeledIUWithPID const& tracks, aod::BCsWithTimestamps const& bcs, aod::McParticles const& mcParticles) |
| 129 | + // { |
| 130 | + // ccdbLoader.initCCDBfromBCs(standardCCDBLoaderConfigurables, ccdb, bcs); |
| 131 | + // trackPropagation.fillTrackTables<true>(trackPropagationConfigurables, ccdbLoader, collisions, tracks, trackPropagationProducts, histos); |
| 132 | + // strangenessBuilderModule.dataProcess(ccdb, histos, collisions, mccollisions, v0s, cascades, trackedCascades, tracks, bcs, mcParticles, products); |
| 133 | + // } |
| 134 | + |
| 135 | + PROCESS_SWITCH(propagationService, processRealData, "process real data", true); |
| 136 | + PROCESS_SWITCH(propagationService, processMonteCarlo, "process monte carlo", false); |
| 137 | + // PROCESS_SWITCH(propagationService, processRealDataWithPID, "process real data", false); |
| 138 | + // PROCESS_SWITCH(propagationService, processMonteCarloWithPID, "process monte carlo", false); |
| 139 | +}; |
| 140 | + |
| 141 | +//**************************************************************************************** |
| 142 | +/** |
| 143 | + * Workflow definition. |
| 144 | + */ |
| 145 | +//**************************************************************************************** |
| 146 | +WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) |
| 147 | +{ |
| 148 | + WorkflowSpec workflow{adaptAnalysisTask<propagationService>(cfgc)}; |
| 149 | + return workflow; |
| 150 | +} |
0 commit comments