@@ -149,7 +149,6 @@ struct HfTaskElectronWeakBoson {
149149 Configurable<float > rcVetoR{" rcVetoR" , 0.4 , " veto radius" };
150150 Configurable<bool > useUEsub{" useUEsub" , true , " apply UE subtraction in isolation" };
151151
152- TRandom3* rnd = new TRandom3(0 );
153152
154153 struct HfElectronCandidate {
155154 float pt, eta, phi, dcaxyTrk, dcazTrk, eop, energyIso, momIso;
@@ -221,6 +220,9 @@ struct HfTaskElectronWeakBoson {
221220 Zorro zorro;
222221 OutputObj<ZorroSummary> zorroSummary{" zorroSummary" };
223222
223+ // defined rnd
224+ TRandom3* rnd = nullptr ;
225+
224226 void init (InitContext const &)
225227 {
226228 // Configure CCDB
@@ -242,6 +244,9 @@ struct HfTaskElectronWeakBoson {
242244 // add configurable for CCDB path
243245 zorro.setBaseCCDBPath (cfgCCDBPath.value );
244246
247+ // init random
248+ rnd = new TRandom3 (0 );
249+
245250 // define axes you want to use
246251 const AxisSpec axisZvtx{40 , -20 , 20 , " Zvtx" };
247252 const AxisSpec axisCounter{1 , 0 , 1 , " events" };
@@ -429,9 +434,10 @@ struct HfTaskElectronWeakBoson {
429434
430435 float energySumRC = 0 ;
431436
432- for (auto & c : clusters) {
433- if (c.energy () > rcHardE)
437+ for (const auto & c : clusters) {
438+ if (c.energy () > rcHardE) {
434439 continue ;
440+ }
435441 double dEtarc = etarc - c.eta ();
436442 double dPhirc = phirc - c.phi ();
437443 dPhirc = RecoDecay::constrainAngle (dPhirc, -o2::constants::math::PI);
@@ -445,9 +451,9 @@ struct HfTaskElectronWeakBoson {
445451 sumErc.push_back (energySumRC);
446452 }
447453
448- if (sumErc.empty ())
454+ if (sumErc.empty ()) {
449455 return 0 ;
450-
456+ }
451457 std::nth_element (sumErc.begin (),
452458 sumErc.begin () + sumErc.size () / 2 ,
453459 sumErc.end ());
0 commit comments