5454#include < utility>
5555#include < vector>
5656
57- #include < stdlib.h >
57+ #include < cstdlib >
5858
5959using namespace o2 ;
6060using namespace o2 ::framework;
@@ -881,7 +881,8 @@ struct kstarInOO {
881881 return {};
882882 }
883883
884- double track1_mass, track2_mass;
884+ double track1_mass =0 ;
885+ double track2_mass =0 ;
885886 if (std::abs (particle1.pdgCode ()) == PionPDG) {
886887 track1_mass = massPi;
887888 } else {
@@ -973,10 +974,7 @@ struct kstarInOO {
973974 double phidiff = TVector2::Phi_mpi_pi (jet.phi () - lResonance.Phi ());
974975 double etadiff = jet.eta () - lResonance.Eta ();
975976 double R = TMath::Sqrt ((phidiff * phidiff) + (etadiff * etadiff));
976- if (R < cfgJetR && bestR == 0 ) {
977- bestR = R;
978- bestJetpT = jet.pt ();
979- } else if (R < bestR) {
977+ if (R < cfgJetR && (bestR == 0 || R < bestR)) {
980978 bestR = R;
981979 bestJetpT = jet.pt ();
982980 }
@@ -1100,9 +1098,9 @@ struct kstarInOO {
11001098 using JetTrackCandidates = soa::Join<aod::JTracks, aod::JTrackPIs>;
11011099 using JetFilteredJets = soa::Filtered<soa::Join<aod::ChargedJets, aod::ChargedJetConstituents>>;
11021100
1103- int nJetEvents = 0 ;
11041101 void processDataJets (o2::aod::JetCollision const & collision, JetFilteredJets const & chargedjets, JetTrackCandidates const & jetTracks, TrackCandidates const &)
11051102 {
1103+ static int nJetEvents = 0 ;
11061104 if (cDebugLevel > 0 ) {
11071105 nJetEvents++;
11081106 if ((nJetEvents + 1 ) % 10000 == 0 ) {
@@ -1174,7 +1172,7 @@ struct kstarInOO {
11741172
11751173 bool HasJets = false ;
11761174 int nJets = 0 ;
1177- for (auto chargedjet : chargedjets) {
1175+ for (auto & chargedjet : chargedjets) {
11781176 if (std::abs (chargedjet.eta ()) > (cfgJetMaxEta - cfgJetdR)) {
11791177 continue ;
11801178 }
@@ -1225,9 +1223,9 @@ struct kstarInOO {
12251223 // | JET MC STUFF
12261224 // |
12271225 // =======================================================
1228- int nJetMCEvents = 0 ;
12291226 void processMCJets (o2::aod::JetCollision const & collision, JetTrackCandidatesMC const & jetTracks, soa::Filtered<aod::ChargedMCDetectorLevelJets> const & mcdjets, TrackCandidatesMC const &, aod::McParticles const &, aod::JetParticles const &)
12301227 {
1228+ static int nJetMCEvents = 0 ;
12311229 if (cDebugLevel > 0 ) {
12321230 nJetMCEvents++;
12331231 if ((nJetMCEvents + 1 ) % 10000 == 0 ) {
@@ -1261,7 +1259,7 @@ struct kstarInOO {
12611259
12621260 bool HasJets = false ;
12631261 int nJets = 0 ;
1264- for (auto mcdjet : mcdjets) {
1262+ for (auto & mcdjet : mcdjets) {
12651263 if (std::abs (mcdjet.eta ()) > cfgJetMaxEta - cfgJetdR) {
12661264 continue ;
12671265 }
@@ -1421,9 +1419,9 @@ struct kstarInOO {
14211419 // | DATA STUFF (SE)
14221420 // |
14231421 // =======================================================
1424- int nEvents = 0 ;
14251422 void processDataSameEvent (EventCandidates::iterator const & collision, TrackCandidates const & tracks)
14261423 {
1424+ static int nEvents = 0 ;
14271425 if (cDebugLevel > 0 ) {
14281426 nEvents++;
14291427 if ((nEvents + 1 ) % 10000 == 0 ) {
@@ -1466,9 +1464,10 @@ struct kstarInOO {
14661464 // | DATA STUFF (ME)
14671465 // |
14681466 // =======================================================
1469- int nEventsMix = 0 ;
1467+
14701468 void processDataMixedEvent (EventCandidates const & collisions, TrackCandidates const & tracks)
14711469 {
1470+ static int nEventsMix = 0 ;
14721471 auto tracksTuple = std::make_tuple (tracks);
14731472 BinningType colBinning{{cfgBinsMixVtx, cfgBinsMixMult}, true }; // true is for 'ignore overflows' (true by default)
14741473 SameKindPair<EventCandidates, TrackCandidates, BinningType> pairs{colBinning, cfgMixNMixedEvents, -1 , collisions, tracksTuple, &cache};
@@ -1511,9 +1510,9 @@ struct kstarInOO {
15111510 // | MC STUFF (SE)
15121511 // |
15131512 // =========================================================
1514- int nEventsMC = 0 ;
15151513 void processSameEventMC (EventCandidates::iterator const & collision, TrackCandidatesMC const & tracks, aod::McParticles const &)
15161514 {
1515+ static int nEventsMC = 0 ;
15171516 if (cDebugLevel > 0 ) {
15181517 nEventsMC++;
15191518 if ((nEventsMC + 1 ) % 10000 == 0 ) {
@@ -1558,9 +1557,9 @@ struct kstarInOO {
15581557 // | MC STUFF (ME)
15591558 // |
15601559 // =======================================================
1561- int nEventsMCMix = 0 ;
15621560 void processMixedEventMC (EventCandidates const & collisions, TrackCandidatesMC const & tracks, aod::McParticles const &)
15631561 {
1562+ static int nEventsMCMix = 0 ;
15641563 auto tracksTuple = std::make_tuple (tracks);
15651564 BinningType colBinning{{cfgBinsMixVtx, cfgBinsMixMult}, true }; // true is for 'ignore overflows' (true by default)
15661565 SameKindPair<EventCandidates, TrackCandidatesMC, BinningType> pairs{colBinning, cfgMixNMixedEvents, -1 , collisions, tracksTuple, &cache};
@@ -1587,9 +1586,9 @@ struct kstarInOO {
15871586 // | GENERATED STUFF
15881587 // |
15891588 // ======================================
1590- int nEventsGen = 0 ;
15911589 void processGen (EventCandidatesTrue::iterator const & collision, soa::SmallGroups<soa::Join<aod::McCollisionLabels, EventCandidates>> const & recocolls, aod::McParticles const & mcParticles)
15921590 {
1591+ static int nEventsGen = 0 ;
15931592 if (cDebugLevel > 0 ) {
15941593 ++nEventsGen;
15951594 if (nEventsGen % 10000 == 0 ) {
@@ -1691,9 +1690,9 @@ struct kstarInOO {
16911690 // | GENERATED STUFF (INCLUSIVE & JETS)
16921691 // |
16931692 // ==============================================
1694- int nprocessGenEvents = 0 ;
16951693 void processGenJets (o2::aod::JetMcCollision const & collision, soa::SmallGroups<soa::Join<aod::JMcCollisionLbs, aod::JetCollisions>> const & recocolls, aod::JetParticles const & mcParticles)
16961694 {
1695+ static int nprocessGenEvents = 0 ;
16971696 if (cDebugLevel > 0 ) {
16981697 ++nprocessGenEvents;
16991698 if (nprocessGenEvents % 10000 == 0 ) {
@@ -1804,9 +1803,9 @@ struct kstarInOO {
18041803 } // end of process
18051804 PROCESS_SWITCH (kstarInOO, processGenJets, " Process Generated Particles Inclusive&Jets" , false );
18061805
1807- int ndRtest = 0 ;
18081806 void processJetQA (o2::aod::JetMcCollision const & collision, soa::Filtered<aod::ChargedMCParticleLevelJets> const & mcpjets, aod::JetParticles const & mcParticles, aod::McParticles const &)
18091807 {
1808+ static int ndRtest = 0 ;
18101809 if (cDebugLevel > 0 ) {
18111810 ++ndRtest;
18121811 if (ndRtest % 10000 == 0 ) {
0 commit comments