@@ -411,15 +411,15 @@ struct DalitzSelection {
411411 }
412412 int i = 0 ;
413413 for (auto cut = fTrackCuts .begin (); cut != fTrackCuts .end (); ++cut, ++i) {
414- if ((*cut).IsSelected (VarManager::fgValues)) {
414+ if ((*cut).IsSelected (static_cast < float *>( VarManager::fgValues) )) {
415415 filterMap |= (uint8_t (1 ) << i);
416416 fSkipEvent = false ;
417417 }
418418 }
419419 if (fIsTagAndProbe ) {
420420 i = 0 ;
421421 for (auto cut = fTrackCutsProbe .begin (); cut != fTrackCutsProbe .end (); ++cut, ++i) {
422- if ((*cut).IsSelected (VarManager::fgValues)) {
422+ if ((*cut).IsSelected (static_cast < float *>( VarManager::fgValues) )) {
423423 filterMapProbe |= (uint8_t (1 ) << i);
424424 }
425425 }
@@ -530,7 +530,7 @@ struct DalitzSelection {
530530 if (!(twoTracksFilterMap & (uint8_t (1 ) << icut))) {
531531 continue ;
532532 }
533- if ((*pairCut).IsSelected (VarManager::fgValues)) {
533+ if ((*pairCut).IsSelected (static_cast < float *>( VarManager::fgValues) )) {
534534 fSkipEvent = false ;
535535 bool isPairAlreadySelected = false ;
536536 if (isReassoc & fConfigOptions .fRemoveDoubleCounting ) {
@@ -560,7 +560,7 @@ struct DalitzSelection {
560560 fDalitzmapProbe [trackIdx2] |= (uint8_t (1 ) << icut);
561561 }
562562 if (fConfigOptions .fQA && !isPairAlreadySelected) {
563- fHistMan ->FillHistClass (Form (" Pair_%s_%s_%s" , (*trackCut).GetName (), fTrackCutsProbe .at (icut).GetName (), (*pairCut).GetName ()), VarManager::fgValues);
563+ fHistMan ->FillHistClass (Form (" Pair_%s_%s_%s" , (*trackCut).GetName (), fTrackCutsProbe .at (icut).GetName (), (*pairCut).GetName ()), static_cast < float *>( VarManager::fgValues) );
564564 }
565565 } else {
566566 if (isReassoc & fConfigOptions .fRemoveDoubleCounting ) {
@@ -569,12 +569,12 @@ struct DalitzSelection {
569569 fDalitzmap [trackIdx2] |= (uint8_t (1 ) << icut);
570570 }
571571 if (fConfigOptions .fQA && !isPairAlreadySelected) {
572- fHistMan ->FillHistClass (Form (" Pair_%s_%s" , (*trackCut).GetName (), (*pairCut).GetName ()), VarManager::fgValues);
572+ fHistMan ->FillHistClass (Form (" Pair_%s_%s" , (*trackCut).GetName (), (*pairCut).GetName ()), static_cast < float *>( VarManager::fgValues) );
573573 }
574574 }
575575 } else {
576576 if (fConfigOptions .fQA && !isPairAlreadySelected) {
577- fHistMan ->FillHistClass (fIsTagAndProbe ? Form (" PairLS_%s_%s_%s" , (*trackCut).GetName (), fTrackCutsProbe .at (icut).GetName (), (*pairCut).GetName ()) : Form (" PairLS_%s_%s" , (*trackCut).GetName (), (*pairCut).GetName ()), VarManager::fgValues);
577+ fHistMan ->FillHistClass (fIsTagAndProbe ? Form (" PairLS_%s_%s_%s" , (*trackCut).GetName (), fTrackCutsProbe .at (icut).GetName (), (*pairCut).GetName ()) : Form (" PairLS_%s_%s" , (*trackCut).GetName (), (*pairCut).GetName ()), static_cast < float *>( VarManager::fgValues) );
578578 }
579579 } // end if like-sign
580580 } // end if isSelected
@@ -585,12 +585,12 @@ struct DalitzSelection {
585585 // Fill Hists
586586 if (fConfigOptions .fQA && !fSkipEvent ) {
587587 for (const auto & track : tracks1) {
588- uint8_t filterMap;
589- uint8_t filterMapProbe;
588+ auto filterMap = uint8_t ( 0 ) ;
589+ auto filterMapProbe = uint8_t ( 0 ) ;
590590 if constexpr (isReassoc) {
591591 auto const & fullTrack = track.template track_as <TFullTracks>();
592- filterMap = fDalitzmap [fullTrack.globalIndex ()];
593- filterMapProbe = fDalitzmapProbe [fullTrack.globalIndex ()];
592+ filterMap = fDalitzmap [fullTrack.globalIndex ()]; // cppcheck-suppress redundantInitialization
593+ filterMapProbe = fDalitzmapProbe [fullTrack.globalIndex ()]; // cppcheck-suppress redundantInitialization
594594 if (fConfigOptions .fRemoveDoubleCounting ) {
595595 // we remove track selections which were already selected before
596596 uint8_t currentFilterMap = fDalitzmapAmbiguity [fullTrack.globalIndex ()];
@@ -650,11 +650,11 @@ struct DalitzSelection {
650650 for (auto pairCut = fPairCuts .begin (); pairCut != fPairCuts .end (); pairCut++, trackCut++, icut++) {
651651 if (filterMap & (uint8_t (1 ) << icut)) {
652652 dynamic_cast <TH1I *>(fStatsList ->At (0 ))->Fill (fIsTagAndProbe ? 2 * icut + 1 : icut + 1 );
653- fHistMan ->FillHistClass (fIsTagAndProbe ? Form (" TrackBarrelTag_%s_%s_%s" , (*trackCut).GetName (), fTrackCutsProbe .at (icut).GetName (), (*pairCut).GetName ()) : Form (" TrackBarrel_%s_%s" , (*trackCut).GetName (), (*pairCut).GetName ()), VarManager::fgValues);
653+ fHistMan ->FillHistClass (fIsTagAndProbe ? Form (" TrackBarrelTag_%s_%s_%s" , (*trackCut).GetName (), fTrackCutsProbe .at (icut).GetName (), (*pairCut).GetName ()) : Form (" TrackBarrel_%s_%s" , (*trackCut).GetName (), (*pairCut).GetName ()), static_cast < float *>( VarManager::fgValues) );
654654 }
655655 if (filterMapProbe & (uint8_t (1 ) << icut)) {
656656 dynamic_cast <TH1I *>(fStatsList ->At (0 ))->Fill (2 * icut + 2 );
657- fHistMan ->FillHistClass (Form (" TrackBarrelProbe_%s_%s_%s" , (*trackCut).GetName (), fTrackCutsProbe .at (icut).GetName (), (*pairCut).GetName ()), VarManager::fgValues);
657+ fHistMan ->FillHistClass (Form (" TrackBarrelProbe_%s_%s_%s" , (*trackCut).GetName (), fTrackCutsProbe .at (icut).GetName (), (*pairCut).GetName ()), static_cast < float *>( VarManager::fgValues) );
658658 }
659659 }
660660 }
@@ -664,14 +664,14 @@ struct DalitzSelection {
664664 void runMixing ()
665665 {
666666 // run the mixing with the events in the pool corresponding to this event
667- auto & pool = fMixingHandler .GetPool (fMixingHandler .FindEventCategory (VarManager::fgValues));
667+ auto & pool = fMixingHandler .GetPool (fMixingHandler .FindEventCategory (static_cast < float *>( VarManager::fgValues) ));
668668
669669 // Bit 8 is a special bit in this case (keeping track sign), so we don't want it to be erased, except when everything else is empty
670670 uint32_t bitMask = (static_cast <uint32_t >(1 ) << 8 );
671671 fMixingEvent ->ClearFilteringMask (bitMask);
672672
673673 for (auto & poolEvent : pool.events ) {
674- if (! (poolEvent.filteringMask & static_cast <uint32_t >(255 ))) {
674+ if ((poolEvent.filteringMask & static_cast <uint32_t >(255 )) == 0 ) {
675675 // all other bits have been erased, so we can also mark bit 8 for deletion
676676 poolEvent.filteringMask |= bitMask;
677677 poolEvent.counters [8 ] = fMixingHandler .GetPoolDepth ();
@@ -680,8 +680,8 @@ struct DalitzSelection {
680680 // tag from event 1 and probe from event 2. If not tag and probe method, all tracks are in tracks1 array
681681 for (auto const & t2 : (fIsTagAndProbe ? poolEvent.tracks2 : poolEvent.tracks1 )) {
682682 // check the two-track filter for the mixed pair
683- uint8_t mixedTwoTrackFilter = static_cast <uint8_t >(t1.filteringFlags & t2.filteringFlags & static_cast <uint32_t >(255 )); // we keep only first 8 bits
684- if (! mixedTwoTrackFilter) {
683+ auto mixedTwoTrackFilter = static_cast <uint8_t >(t1.filteringFlags & t2.filteringFlags & static_cast <uint32_t >(255 )); // we keep only first 8 bits
684+ if (mixedTwoTrackFilter == 0 ) {
685685 continue ;
686686 }
687687 VarManager::FillPairMEAcrossTFs (t1, t2);
@@ -693,19 +693,19 @@ struct DalitzSelection {
693693 VarManager::fgValues[VarManager::kPhi2 ] = t2.phi ;
694694 }
695695 bool isLS = (t1.filteringFlags & (static_cast <uint32_t >(1 ) << 8 )) == (t2.filteringFlags & (static_cast <uint32_t >(1 ) << 8 ));
696- for (size_t icut = 0 ; icut < fPairCuts .size (); icut++) {
697- if ((mixedTwoTrackFilter & (static_cast <uint8_t >(1 ) << icut)) && fPairCuts .at (icut).IsSelected (VarManager::fgValues)) {
696+ for (uint32_t icut = 0 ; icut < fPairCuts .size (); icut++) {
697+ if ((( mixedTwoTrackFilter & (static_cast <uint8_t >(1 ) << icut)) != 0 ) && fPairCuts .at (icut).IsSelected (static_cast < float *>( VarManager::fgValues) )) {
698698 if (fIsTagAndProbe ) {
699699 if (!isLS) {
700- fHistMan ->FillHistClass (Form (" PairME_%s_%s_%s" , fTrackCuts .at (icut).GetName (), fTrackCutsProbe .at (icut).GetName (), fPairCuts .at (icut).GetName ()), VarManager::fgValues);
700+ fHistMan ->FillHistClass (Form (" PairME_%s_%s_%s" , fTrackCuts .at (icut).GetName (), fTrackCutsProbe .at (icut).GetName (), fPairCuts .at (icut).GetName ()), static_cast < float *>( VarManager::fgValues) );
701701 } else {
702- fHistMan ->FillHistClass (Form (" PairMELS_%s_%s_%s" , fTrackCuts .at (icut).GetName (), fTrackCutsProbe .at (icut).GetName (), fPairCuts .at (icut).GetName ()), VarManager::fgValues);
702+ fHistMan ->FillHistClass (Form (" PairMELS_%s_%s_%s" , fTrackCuts .at (icut).GetName (), fTrackCutsProbe .at (icut).GetName (), fPairCuts .at (icut).GetName ()), static_cast < float *>( VarManager::fgValues) );
703703 }
704704 } else {
705705 if (!isLS) {
706- fHistMan ->FillHistClass (Form (" PairME_%s_%s" , fTrackCuts .at (icut).GetName (), fPairCuts .at (icut).GetName ()), VarManager::fgValues);
706+ fHistMan ->FillHistClass (Form (" PairME_%s_%s" , fTrackCuts .at (icut).GetName (), fPairCuts .at (icut).GetName ()), static_cast < float *>( VarManager::fgValues) );
707707 } else {
708- fHistMan ->FillHistClass (Form (" PairMELS_%s_%s" , fTrackCuts .at (icut).GetName (), fPairCuts .at (icut).GetName ()), VarManager::fgValues);
708+ fHistMan ->FillHistClass (Form (" PairMELS_%s_%s" , fTrackCuts .at (icut).GetName (), fPairCuts .at (icut).GetName ()), static_cast < float *>( VarManager::fgValues) );
709709 }
710710 }
711711 }
@@ -716,8 +716,8 @@ struct DalitzSelection {
716716 for (auto const & t2 : fMixingEvent ->tracks2 ) {
717717 // tag from event 2 and probe from event 1
718718 for (auto const & t1 : poolEvent.tracks1 ) {
719- uint8_t mixedTwoTrackFilter = static_cast <uint8_t >(t1.filteringFlags & t2.filteringFlags & static_cast <uint32_t >(255 )); // we keep only first 8 bits
720- if (! mixedTwoTrackFilter) {
719+ auto mixedTwoTrackFilter = static_cast <uint8_t >(t1.filteringFlags & t2.filteringFlags & static_cast <uint32_t >(255 )); // we keep only first 8 bits
720+ if (mixedTwoTrackFilter == 0 ) {
721721 continue ;
722722 }
723723 VarManager::FillPairMEAcrossTFs (t1, t2);
@@ -729,12 +729,12 @@ struct DalitzSelection {
729729 VarManager::fgValues[VarManager::kPhi2 ] = t2.phi ;
730730 }
731731 bool isLS = (t1.filteringFlags & (static_cast <uint32_t >(1 ) << 8 )) == (t2.filteringFlags & (static_cast <uint32_t >(1 ) << 8 ));
732- for (size_t icut = 0 ; icut < fPairCuts .size (); icut++) {
733- if ((mixedTwoTrackFilter & (static_cast <uint8_t >(1 ) << icut)) && fPairCuts .at (icut).IsSelected (VarManager::fgValues)) {
732+ for (uint32_t icut = 0 ; icut < fPairCuts .size (); icut++) {
733+ if ((( mixedTwoTrackFilter & (static_cast <uint8_t >(1 ) << icut)) != 0 ) && fPairCuts .at (icut).IsSelected (static_cast < float *>( VarManager::fgValues) )) {
734734 if (!isLS) {
735- fHistMan ->FillHistClass (Form (" PairME_%s_%s_%s" , fTrackCuts .at (icut).GetName (), fTrackCutsProbe .at (icut).GetName (), fPairCuts .at (icut).GetName ()), VarManager::fgValues);
735+ fHistMan ->FillHistClass (Form (" PairME_%s_%s_%s" , fTrackCuts .at (icut).GetName (), fTrackCutsProbe .at (icut).GetName (), fPairCuts .at (icut).GetName ()), static_cast < float *>( VarManager::fgValues) );
736736 } else {
737- fHistMan ->FillHistClass (Form (" PairMELS_%s_%s_%s" , fTrackCuts .at (icut).GetName (), fTrackCutsProbe .at (icut).GetName (), fPairCuts .at (icut).GetName ()), VarManager::fgValues);
737+ fHistMan ->FillHistClass (Form (" PairMELS_%s_%s_%s" , fTrackCuts .at (icut).GetName (), fTrackCutsProbe .at (icut).GetName (), fPairCuts .at (icut).GetName ()), static_cast < float *>( VarManager::fgValues) );
738738 }
739739 }
740740 }
@@ -806,7 +806,7 @@ struct DalitzSelection {
806806 fTrackmapProbe .clear ();
807807 VarManager::ResetValues (VarManager::kNRunWiseVariables , VarManager::kNBarrelTrackVariables );
808808 VarManager::FillEvent<EventFillMapWithCent>(collision);
809- bool isEventSelected = fEventCut ->IsSelected (VarManager::fgValues);
809+ bool isEventSelected = fEventCut ->IsSelected (static_cast < float *>( VarManager::fgValues) );
810810
811811 if (isEventSelected) {
812812 dynamic_cast <TH1I *>(fStatsList ->At (0 ))->Fill (0 );
@@ -834,7 +834,7 @@ struct DalitzSelection {
834834 }
835835
836836 if (fConfigOptions .fRunEventMixing ) {
837- if (fMixingEvent ->tracks1 .size () > 0 ) {
837+ if (! fMixingEvent ->tracks1 .empty () ) {
838838 // we require that there is at least one tag track in the event to avoid having the pool full of events with only probe tracks which become useless for mixing
839839 runMixing ();
840840 }
@@ -867,7 +867,7 @@ struct DalitzSelection {
867867 fTrackmapProbe .clear ();
868868 VarManager::ResetValues (VarManager::kNRunWiseVariables , VarManager::kNBarrelTrackVariables );
869869 VarManager::FillEvent<EventFillMapWithCent>(collision);
870- bool isEventSelected = fEventCut ->IsSelected (VarManager::fgValues);
870+ bool isEventSelected = fEventCut ->IsSelected (static_cast < float *>( VarManager::fgValues) );
871871
872872 if (isEventSelected) {
873873
@@ -895,7 +895,7 @@ struct DalitzSelection {
895895 runDalitzPairing<true , pairType, TrackFillMap, MyBarrelTracks>(groupedTracksAssoc, groupedTracksAssoc, collision);
896896 }
897897 if (fConfigOptions .fRunEventMixing ) {
898- if (fMixingEvent ->tracks1 .size () > 0 ) {
898+ if (! fMixingEvent ->tracks1 .empty () ) {
899899 // we require that there is at least one tag track in the event to avoid having the pool full of events with only probe tracks which are then useless
900900 // In addition, this allows to avoid mixing events which are too close in time, which could contain tracks from the same event due to track-to-collision reassociation
901901 runMixing ();
@@ -929,7 +929,7 @@ struct DalitzSelection {
929929 fTrackmapProbe .clear ();
930930 VarManager::ResetValues (VarManager::kNRunWiseVariables , VarManager::kNBarrelTrackVariables );
931931 VarManager::FillEvent<EventFillMapWithCent>(collision);
932- bool isEventSelected = fEventCut ->IsSelected (VarManager::fgValues);
932+ bool isEventSelected = fEventCut ->IsSelected (static_cast < float *>( VarManager::fgValues) );
933933
934934 if (isEventSelected) {
935935
@@ -957,7 +957,7 @@ struct DalitzSelection {
957957 runDalitzPairing<true , pairType, TrackFillMapNoTOF, MyBarrelTracksNoTOF>(groupedTracksAssoc, groupedTracksAssoc, collision);
958958 }
959959 if (fConfigOptions .fRunEventMixing ) {
960- if (fMixingEvent ->tracks1 .size () > 0 ) {
960+ if (! fMixingEvent ->tracks1 .empty () ) {
961961 // we require that there is at least one tag track in the event to avoid having the pool full of events with only probe tracks which are then useless
962962 // In addition, this allows to avoid mixing events which are too close in time, which could contain tracks from the same event due to track-to-collision reassociation
963963 runMixing ();
0 commit comments