@@ -122,12 +122,9 @@ struct kinkBuilder {
122122 Configurable<bool > unlikeSignBkg{" unlikeSignBkg" , false , " Use unlike sign background" };
123123
124124 // CCDB options
125- Configurable<double > inputBz{" inputBz" , -999 , " bz field, -999 is automatic" };
126125 Configurable<std::string> ccdbPath{" ccdbPath" , " http://alice-ccdb.cern.ch" , " url of the ccdb repository" };
127- Configurable<std::string> grpPath{" grpPath" , " GLO/GRP/GRP" , " Path of the grp file" };
128126 Configurable<std::string> grpmagPath{" grpmagPath" , " GLO/Config/GRPMagField" , " CCDB path of the GRPMagField object" };
129127 Configurable<std::string> lutPath{" lutPath" , " GLO/Param/MatLUT" , " Path of the Lut parametrization" };
130- Configurable<std::string> geoPath{" geoPath" , " GLO/Config/GeometryAligned" , " Path of the geometry file" };
131128
132129 // PDG codes
133130
@@ -174,7 +171,6 @@ struct kinkBuilder {
174171 ccdb->setURL (ccdbPath);
175172 ccdb->setCaching (true );
176173 ccdb->setLocalObjectValidityChecking ();
177- ccdb->setFatalWhenNull (false );
178174 fitter.setPropagateToPCA (true );
179175 fitter.setMaxR (200 .);
180176 fitter.setMinParamChange (1e-3 );
@@ -183,10 +179,6 @@ struct kinkBuilder {
183179 fitter.setMaxChi2 (1e9 );
184180 fitter.setUseAbsDCA (true );
185181
186- lut = o2::base::MatLayerCylSet::rectifyPtrFromFile (ccdb->get <o2::base::MatLayerCylSet>(lutPath));
187- int mat{static_cast <int >(cfgMaterialCorrection)};
188- fitter.setMatCorrType (static_cast <o2::base::Propagator::MatCorrType>(mat));
189-
190182 svCreator.setTimeMargin (customVertexerTimeMargin);
191183 if (skipAmbiTracks) {
192184 svCreator.setSkipAmbiTracks ();
@@ -210,6 +202,11 @@ struct kinkBuilder {
210202 h2MothMassPt = qaRegistry.add <TH2>(" h2MothMassPt" , " ; p_{T} (GeV/#it{c}); m (GeV/#it{c}^{2})" , HistType::kTH2F , {ptAxis, massAxis});
211203 h2ClsMapPtMoth = qaRegistry.add <TH2>(" h2ClsMapPtMoth" , " ; p_{T} (GeV/#it{c}); ITS cluster map" , HistType::kTH2F , {ptAxis, itsClusterMapAxis});
212204 h2ClsMapPtDaug = qaRegistry.add <TH2>(" h2ClsMapPtDaug" , " ; p_{T} (GeV/#it{c}); ITS cluster map" , HistType::kTH2F , {ptAxis, itsClusterMapAxis});
205+
206+ for (int i = 0 ; i < 5 ; i++) {
207+ mBBparamsDaug [i] = cfgBetheBlochParams->get (" Daughter" , Form (" p%i" , i));
208+ }
209+ mBBparamsDaug [5 ] = cfgBetheBlochParams->get (" Daughter" , " resolution" );
213210 }
214211
215212 template <typename T>
@@ -247,7 +244,7 @@ struct kinkBuilder {
247244 }
248245
249246 template <class Tcolls , class Ttracks >
250- void fillCandidateData (const Tcolls& collisions, const Ttracks& tracks, aod::AmbiguousTracks const & ambiguousTracks, aod::BCsWithTimestamps const & bcs)
247+ void fillCandidateData (const Tcolls& collisions, const Ttracks& tracks, aod::AmbiguousTracks const & ambiguousTracks, aod::BCs const & bcs)
251248 {
252249 svCreator.clearPools ();
253250 svCreator.fillBC2Coll (collisions, bcs);
@@ -274,7 +271,7 @@ struct kinkBuilder {
274271 auto trackDaug = tracks.rawIteratorAt (svCand.tr1Idx );
275272
276273 auto const & collision = trackMoth.template collision_as <Tcolls>();
277- auto const & bc = collision.template bc_as <aod::BCsWithTimestamps >();
274+ auto const & bc = collision.template bc_as <aod::BCs >();
278275 initCCDB (bc);
279276
280277 o2::dataformats::VertexBase primaryVertex;
@@ -283,9 +280,9 @@ struct kinkBuilder {
283280 kinkCand.primVtx = {primaryVertex.getX (), primaryVertex.getY (), primaryVertex.getZ ()};
284281
285282 o2::track::TrackParCov trackParCovMoth = getTrackParCov (trackMoth);
283+ o2::track::TrackParCov trackParCovMothPV{trackParCovMoth};
286284 o2::base::Propagator::Instance ()->PropagateToXBxByBz (trackParCovMoth, LayerRadii[trackMoth.itsNCls () - 1 ]);
287285
288- o2::track::TrackParCov trackParCovMothPV = getTrackParCov (trackMoth);
289286 std::array<float , 2 > dcaInfoMoth;
290287 o2::base::Propagator::Instance ()->propagateToDCABxByBz ({primaryVertex.getX (), primaryVertex.getY (), primaryVertex.getZ ()}, trackParCovMothPV, 2 .f , static_cast <o2::base::Propagator::MatCorrType>(cfgMaterialCorrection.value ), &dcaInfoMoth);
291288
@@ -401,51 +398,28 @@ struct kinkBuilder {
401398 }
402399 }
403400
404- void initCCDB (aod::BCsWithTimestamps ::iterator const & bc)
401+ void initCCDB (aod::BCs ::iterator const & bc)
405402 {
406403 if (mRunNumber == bc.runNumber ()) {
407404 return ;
408405 }
409- auto run3grp_timestamp = bc.timestamp ();
410-
411- o2::parameters::GRPObject* grpo = ccdb->getForTimeStamp <o2::parameters::GRPObject>(grpPath, run3grp_timestamp);
412- o2::parameters::GRPMagField* grpmag = 0x0 ;
413- if (grpo) {
414- o2::base::Propagator::initFieldFromGRP (grpo);
415- if (inputBz < -990 ) {
416- // Fetch magnetic field from ccdb for current collision
417- mBz = grpo->getNominalL3Field ();
418- LOG (info) << " Retrieved GRP for timestamp " << run3grp_timestamp << " with magnetic field of " << mBz << " kZG" ;
419- } else {
420- mBz = inputBz;
421- }
422- } else {
423- grpmag = ccdb->getForTimeStamp <o2::parameters::GRPMagField>(grpmagPath, run3grp_timestamp);
424- if (!grpmag) {
425- LOG (fatal) << " Got nullptr from CCDB for path " << grpmagPath << " of object GRPMagField and " << grpPath << " of object GRPObject for timestamp " << run3grp_timestamp;
426- }
427- o2::base::Propagator::initFieldFromGRP (grpmag);
428- if (inputBz < -990 ) {
429- // Fetch magnetic field from ccdb for current collision
430- mBz = std::lround (5 .f * grpmag->getL3Current () / 30000 .f );
431- LOG (info) << " Retrieved GRP for timestamp " << run3grp_timestamp << " with magnetic field of " << mBz << " kZG" ;
432- } else {
433- mBz = inputBz;
434- }
435- }
406+ mRunNumber = bc.runNumber ();
407+ LOG (info) << " Initializing CCDB for run " << mRunNumber ;
408+ o2::parameters::GRPMagField* grpmag = ccdb->getForRun <o2::parameters::GRPMagField>(grpmagPath, mRunNumber );
409+ o2::base::Propagator::initFieldFromGRP (grpmag);
410+ mBz = grpmag->getNominalL3Field ();
411+ fitter.setBz (mBz );
436412
437- for (int i = 0 ; i < 5 ; i++) {
438- mBBparamsDaug [i] = cfgBetheBlochParams->get (" Daughter" , Form (" p%i" , i));
413+ if (!lut) {
414+ lut = o2::base::MatLayerCylSet::rectifyPtrFromFile (ccdb->get <o2::base::MatLayerCylSet>(lutPath));
415+ int mat{static_cast <int >(cfgMaterialCorrection)};
416+ fitter.setMatCorrType (static_cast <o2::base::Propagator::MatCorrType>(mat));
439417 }
440- mBBparamsDaug [5 ] = cfgBetheBlochParams->get (" Daughter" , " resolution" );
441-
442- fitter.setBz (mBz );
443- mRunNumber = bc.runNumber ();
444418 o2::base::Propagator::Instance ()->setMatLUT (lut);
445419 LOG (info) << " Task initialized for run " << mRunNumber << " with magnetic field " << mBz << " kZG" ;
446420 }
447421
448- void process (aod::Collisions const & collisions, TracksFull const & tracks, aod::AmbiguousTracks const & ambiTracks, aod::BCsWithTimestamps const & bcs)
422+ void process (aod::Collisions const & collisions, TracksFull const & tracks, aod::AmbiguousTracks const & ambiTracks, aod::BCs const & bcs)
449423 {
450424
451425 kinkCandidates.clear ();
0 commit comments