2121#include < string>
2222#include < vector>
2323
24- #include " DetectorsBase/Propagator.h"
2524#include " CommonConstants/PhysicsConstants.h"
2625#include " DCAFitter/DCAFitterN.h"
26+ #include " DetectorsBase/Propagator.h"
2727#include " Framework/AnalysisTask.h"
2828#include " Framework/O2DatabasePDGPlugin.h"
2929#include " Framework/runDataProcessing.h"
3939#include " PWGHF/DataModel/CandidateReconstructionTables.h"
4040#include " PWGHF/DataModel/CandidateSelectionTables.h"
4141#include " PWGHF/Utils/utilsBfieldCCDB.h"
42- #include " PWGHF/D2H/DataModel/ReducedDataModel.h"
4342#include " PWGHF/Utils/utilsEvSelHf.h"
43+
44+ #include " PWGHF/D2H/DataModel/ReducedDataModel.h"
4445#include " PWGHF/D2H/Utils/utilsRedDataFormat.h"
4546
47+
48+
4649using namespace o2 ;
4750using namespace o2 ::analysis;
4851using namespace o2 ::aod;
@@ -160,16 +163,7 @@ struct HfDataCreatorCharmResoReduced {
160163 // MC Tables
161164 Produces<aod::HfMcRecRedDV0s> rowHfDV0McRecReduced;
162165 Produces<aod::HfMcGenRedResos> rowHfResoMcGenReduced;
163-
164- // CCDB configuration
165- o2::ccdb::CcdbApi ccdbApi;
166- Service<o2::ccdb::BasicCCDBManager> ccdb;
167- Configurable<std::string> url{" ccdb-url" , " http://alice-ccdb.cern.ch" , " url of the ccdb repository" };
168- Configurable<std::string> ccdbPathGrpMag{" ccdbPathGrpMag" , " GLO/Config/GRPMagField" , " CCDB path of the GRPMagField object (Run 3)" };
169- Configurable<bool > propagateV0toPV{" propagateV0toPV" , false , " Enable or disable V0 propagation to V0" };
170- Configurable<bool > doMcRecQa{" doMcRecQa" , true , " Fill QA histograms for Mc matching" };
171-
172- int runNumber{0 }; // needed to detect if the run changed and trigger update of calibrations etc.
166+
173167 // selection D
174168 struct : ConfigurableGroup {
175169 std::string prefix = " dmesons" ;
@@ -210,6 +204,7 @@ struct HfDataCreatorCharmResoReduced {
210204 Configurable<float > maxNsigmaTpcPr{" maxNsigmaTpcPr" , 3 ., " maximum proton NSigma in TPC for single tracks to be paired with D mesons; set negative to reject" };
211205 } cfgSingleTrackCuts;
212206
207+ // QA histograms
213208 struct : ConfigurableGroup {
214209 Configurable<bool > applyCutsForQaHistograms{" applyCutsForQaHistograms" , true , " flag to apply cuts to QA histograms" };
215210 Configurable<float > cutMassDstarMin{" cutMassDstarMin" , 0.143 , " minimum mass for Dstar candidates" };
@@ -222,17 +217,30 @@ struct HfDataCreatorCharmResoReduced {
222217 Configurable<float > cutMassLambdaMax{" cutMassLambdaMax" , 1.12 , " maximum mass for Lambda candidates" };
223218 } cfgQaPlots;
224219 // other configurables
220+ Configurable<std::string> ccdbUrl{" ccdbUrl" , " http://alice-ccdb.cern.ch" , " url of the ccdb repository" };
221+ Configurable<std::string> ccdbPathGrpMag{" ccdbPathGrpMag" , " GLO/Config/GRPMagField" , " CCDB path of the GRPMagField object (Run 3)" };
222+ Configurable<bool > propagateV0toPV{" propagateV0toPV" , false , " Enable or disable V0 propagation to V0" };
223+ Configurable<bool > doMcRecQa{" doMcRecQa" , true , " Fill QA histograms for Mc matching" };
225224 Configurable<bool > rejectPairsWithCommonDaughter{" rejectPairsWithCommonDaughter" , true , " flag to reject already at this stage the pairs that share a daughter track" };
226- // material correction for track propagation
227- o2::base::MatLayerCylSet* lut;
228- o2::base::Propagator::MatCorrType matCorr = o2::base::Propagator::MatCorrType::USEMatCorrLUT;
225+
229226 HfHelper hfHelper;
230227 o2::hf_evsel::HfEventSelection hfEvSel;
231- o2::vertexing::DCAFitterN<2 > fitter;
228+
229+ // CCDB service
230+ o2::ccdb::CcdbApi ccdbApi;
231+ Service<o2::ccdb::BasicCCDBManager> ccdb;
232232 double bz{0 .};
233+ int runNumber{0 }; // needed to detect if the run changed and trigger update of calibrations etc.
234+
235+ // material correction for track propagation
236+ o2::base::MatLayerCylSet* lut;
237+ o2::base::Propagator::MatCorrType matCorr = o2::base::Propagator::MatCorrType::USEMatCorrLUT;
238+
239+ // O2DatabasePDG service
233240 Service<o2::framework::O2DatabasePDG> pdg;
234241
235- // bool isHfCandResoConfigFilled = false;
242+ // vertex fitter
243+ o2::vertexing::DCAFitterN<2 > fitter;
236244
237245 // Helper struct to pass V0 informations
238246 struct {
@@ -264,6 +272,7 @@ struct HfDataCreatorCharmResoReduced {
264272 std::array<float , 3 > pVectorProng1;
265273 std::array<float , 3 > pVectorProng2;
266274 } varUtils;
275+
267276 using CandsDplusFiltered = soa::Filtered<soa::Join<aod::HfCand3Prong, aod::HfSelDplusToPiKPi>>;
268277 using CandsDplusFilteredWithMl = soa::Filtered<soa::Join<aod::HfCand3Prong, aod::HfSelDplusToPiKPi, aod::HfMlDplusToPiKPi>>;
269278 using CandsDstarFiltered = soa::Filtered<soa::Join<aod::HfD0FromDstar, aod::HfCandDstars, aod::HfSelDstarToD0Pi>>;
@@ -308,7 +317,7 @@ struct HfDataCreatorCharmResoReduced {
308317 const AxisSpec axisDeDx{500 , 0 .f , 1000 .f , " " };
309318 const AxisSpec axisMassD0{200 , 1 .7f , 2 .1f , " inv. mass (GeV/#it{c}^{2})" };
310319 const AxisSpec axisMassDplus{200 , 1 .7f , 2 .1f , " inv. mass (GeV/#it{c}^{2})" };
311- const AxisSpec axisMassDstar{200 , 0 .139f , 0 .179f , " inv. mass (GeV/#it{c}^{2})" };
320+ const AxisSpec axisMassDstar{200 , 0 .139f , 0 .179f , " inv. mass (GeV/#it{c}^{2})" }; // o2-linter: disable=pdg/explicit-mass (false positive)
312321 const AxisSpec axisMassLambda{100 , 1 .05f , 1 .35f , " inv. mass (GeV/#it{c}^{2})" };
313322 const AxisSpec axisMassKzero{100 , 0 .35f , 0 .65f , " inv. mass (GeV/#it{c}^{2})" };
314323 const AxisSpec axisDeltaMassToK{500 , 0.49 , 1.49 , " inv. mass (GeV/#it{c}^{2})" };
@@ -375,11 +384,11 @@ struct HfDataCreatorCharmResoReduced {
375384 }
376385
377386 // Configure CCDB access
378- ccdb->setURL (url .value );
387+ ccdb->setURL (ccdbUrl .value );
379388 ccdb->setCaching (true );
380389 ccdb->setLocalObjectValidityChecking ();
381390 ccdb->setCreatedNotAfter (std::chrono::duration_cast<std::chrono::milliseconds>(std::chrono::system_clock::now ().time_since_epoch ()).count ());
382- ccdbApi.init (url );
391+ ccdbApi.init (ccdbUrl );
383392 runNumber = 0 ;
384393 lut = o2::base::MatLayerCylSet::rectifyPtrFromFile (ccdb->get <o2::base::MatLayerCylSet>(" GLO/Param/MatLUT" ));
385394
@@ -483,7 +492,7 @@ struct HfDataCreatorCharmResoReduced {
483492 auto & trackNegProp = fitter.getTrack (1 );
484493 trackPosProp.getPxPyPzGlo (candidateV0.momPos );
485494 trackNegProp.getPxPyPzGlo (candidateV0.momNeg );
486- for (int i = 0 ; i < 3 ; ++i) { // o2-linter: disable=magic-number (loop on v0 prongs )
495+ for (int i = 0 ; i < 3 ; ++i) { // o2-linter: disable=magic-number (loop on xyz )
487496 candidateV0.mom [i] = candidateV0.momPos [i] + candidateV0.momNeg [i];
488497 }
489498 candidateV0.pT = std::hypot (candidateV0.mom [0 ], candidateV0.mom [1 ]);
@@ -504,7 +513,7 @@ struct HfDataCreatorCharmResoReduced {
504513 if (candidateV0.radius < cfgV0Cuts.radiusMin ) {
505514 return false ;
506515 }
507- for (int i = 0 ; i < 3 ; i++) {
516+ for (int i = 0 ; i < 3 ; i++) { // o2-linter: disable=magic-number (loop on xyz)
508517 candidateV0.pos [i] = vtx[i];
509518 }
510519 // v0 DCA to primary vertex
0 commit comments