@@ -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>
@@ -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
@@ -407,39 +404,17 @@ struct kinkBuilder {
407404 return ;
408405 }
409406 mRunNumber = bc.runNumber ();
407+ LOG (info) << " Initializing CCDB for run " << mRunNumber ;
408+ o2::parameters::GRPMagField* grpmag = grpmag = ccdb->getForRun <o2::parameters::GRPMagField>(grpmagPath, mRunNumber );
409+ o2::base::Propagator::initFieldFromGRP (grpmag);
410+ mBz = grpmag->getNominalL3Field ();
411+ fitter.setBz (mBz );
410412
411- o2::parameters::GRPObject* grpo = ccdb->getForRun <o2::parameters::GRPObject>(grpPath, mRunNumber );
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 run " << mRunNumber << " with magnetic field of " << mBz << " kZG" ;
419- } else {
420- mBz = inputBz;
421- }
422- } else {
423- grpmag = ccdb->getForRun <o2::parameters::GRPMagField>(grpmagPath, mRunNumber );
424- if (!grpmag) {
425- LOG (fatal) << " Got nullptr from CCDB for path " << grpmagPath << " of object GRPMagField and " << grpPath << " of object GRPObject for run " << mRunNumber ;
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 run " << mRunNumber << " with magnetic field of " << mBz << " kZG" ;
432- } else {
433- mBz = inputBz;
434- }
435- }
436-
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 );
443418 o2::base::Propagator::Instance ()->setMatLUT (lut);
444419 LOG (info) << " Task initialized for run " << mRunNumber << " with magnetic field " << mBz << " kZG" ;
445420 }
0 commit comments