99// granted to it by virtue of its status as an Intergovernmental Organization
1010// or submit itself to any jurisdiction.
1111//
12- // \FIT bits to phi, eta mapping
13- // \author Sandor Lokos, sandor.lokos@cern.ch
14- // \since March 2026
12+
13+ // / \file upcTestFitBitMapping.cxx
14+ // / \brief FIT bits to phi, eta mapping
15+ // / \author Sandor Lokos, sandor.lokos@cern.ch
16+ // / \since March 2026
1517
1618#include " PWGUD/Core/UDHelpers.h" // udhelpers::Bits256, makeBits256, testBit, getPhiEtaFromFitBit
1719#include " PWGUD/DataModel/UDTables.h" // aod::UDCollisionFITBits
1820
19- #include < FT0Base/Geometry.h> // o2::ft0::Geometry
21+ #include < CommonConstants/MathConstants.h> // o2::constants::math::TwoPI
22+ #include < FT0Base/Geometry.h> // o2::ft0::Geometry
2023#include < Framework/AnalysisTask.h>
2124#include < Framework/Configurable.h>
2225#include < Framework/HistogramRegistry.h>
2528#include < Framework/runDataProcessing.h>
2629
2730#include < array>
28- #include < cmath>
2931#include < cstdint>
3032
31- #include < math.h>
32-
3333using namespace o2 ;
3434using namespace o2 ::framework;
3535
36- struct UpcTestFITBitMapping {
36+ struct UpcTestFitBitMapping {
37+ static constexpr int Thr2Selector = 2 ; // value of whichThr that selects the Thr2 bit set
38+
3739 Configurable<int > whichThr{" whichThr" , 1 , " Use 1=Thr1 bits or 2=Thr2 bits" };
3840 Configurable<int > maxEvents{" maxEvents" , -1 , " Process at most this many rows (-1 = all)" };
3941
@@ -53,13 +55,13 @@ struct UpcTestFITBitMapping {
5355 HistogramRegistry registry{
5456 " registry" ,
5557 {
56- {" hPhiA" , " FT0A #varphi;#varphi;counts" , {HistType::kTH1F , {{18 , 0.0 , 2 . * M_PI }}}},
58+ {" hPhiA" , " FT0A #varphi;#varphi;counts" , {HistType::kTH1F , {{18 , 0.0 , o2::constants::math::TwoPI }}}},
5759 {" hEtaA" , " FT0A #eta;#eta;counts" , {HistType::kTH1F , {{8 , 3.5 , 5.0 }}}},
58- {" hEtaPhiA" , " FT0A #eta vs #varphi;#eta;#varphi" , {HistType::kTH2F , {{8 , 3.5 , 5.0 }, {18 , 0.0 , 2 . * M_PI }}}},
60+ {" hEtaPhiA" , " FT0A #eta vs #varphi;#eta;#varphi" , {HistType::kTH2F , {{8 , 3.5 , 5.0 }, {18 , 0.0 , o2::constants::math::TwoPI }}}},
5961
60- {" hPhiC" , " FT0C #varphi;#varphi;counts" , {HistType::kTH1F , {{18 , 0.0 , 2 . * M_PI }}}},
62+ {" hPhiC" , " FT0C #varphi;#varphi;counts" , {HistType::kTH1F , {{18 , 0.0 , o2::constants::math::TwoPI }}}},
6163 {" hEtaC" , " FT0C #eta;#eta;counts" , {HistType::kTH1F , {{8 , -3.5 , -2.0 }}}},
62- {" hEtaPhiC" , " FT0C #eta vs #varphi;#eta;#varphi" , {HistType::kTH2F , {{8 , -3.5 , -2.0 }, {18 , 0.0 , 2 . * M_PI }}}},
64+ {" hEtaPhiC" , " FT0C #eta vs #varphi;#eta;#varphi" , {HistType::kTH2F , {{8 , -3.5 , -2.0 }, {18 , 0.0 , o2::constants::math::TwoPI }}}},
6365 }};
6466
6567 void init (InitContext&)
@@ -80,7 +82,7 @@ struct UpcTestFITBitMapping {
8082
8183 // Use udhelpers' canonical packed type + builder
8284 udhelpers::Bits256 w{};
83- if (whichThr == 2 ) {
85+ if (whichThr == Thr2Selector ) {
8486 w = udhelpers::makeBits256 (row.thr2W0 (), row.thr2W1 (), row.thr2W2 (), row.thr2W3 ());
8587 } else {
8688 w = udhelpers::makeBits256 (row.thr1W0 (), row.thr1W1 (), row.thr1W2 (), row.thr1W3 ());
@@ -115,5 +117,5 @@ struct UpcTestFITBitMapping {
115117WorkflowSpec defineDataProcessing (ConfigContext const & cfgc)
116118{
117119 return WorkflowSpec{
118- adaptAnalysisTask<UpcTestFITBitMapping >(cfgc, TaskName{ " fitbit-mapping " } )};
120+ adaptAnalysisTask<UpcTestFitBitMapping >(cfgc)};
119121}
0 commit comments