@@ -311,30 +311,6 @@ struct FlattenictyPikp {
311311 std::unique_ptr<TF1> fEDeDxVsEtaPos = nullptr ;
312312 std::unique_ptr<TF1> fEDeDxVsEtaNeg = nullptr ;
313313
314- static constexpr std::string_view kNvtxZFV0Cell [kNCellsFV0 ] = {
315- " hVtxZFV0_1" , " hVtxZFV0_2" , " hVtxZFV0_3" , " hVtxZFV0_4" , " hVtxZFV0_5" , " hVtxZFV0_6" , " hVtxZFV0_7" , " hVtxZFV0_8" ,
316- " hVtxZFV0_9" , " hVtxZFV0_10" , " hVtxZFV0_11" , " hVtxZFV0_12" , " hVtxZFV0_13" , " hVtxZFV0_14" , " hVtxZFV0_15" , " hVtxZFV0_16" ,
317- " hVtxZFV0_17" , " hVtxZFV0_18" , " hVtxZFV0_19" , " hVtxZFV0_20" , " hVtxZFV0_21" , " hVtxZFV0_22" , " hVtxZFV0_23" , " hVtxZFV0_24" ,
318- " hVtxZFV0_25" , " hVtxZFV0_26" , " hVtxZFV0_27" , " hVtxZFV0_28" , " hVtxZFV0_29" , " hVtxZFV0_30" , " hVtxZFV0_31" , " hVtxZFV0_32" ,
319- " hVtxZFV0_33" , " hVtxZFV0_34" , " hVtxZFV0_35" , " hVtxZFV0_36" , " hVtxZFV0_37" , " hVtxZFV0_38" , " hVtxZFV0_39" , " hVtxZFV0_40" ,
320- " hVtxZFV0_41" , " hVtxZFV0_42" , " hVtxZFV0_43" , " hVtxZFV0_44" , " hVtxZFV0_45" , " hVtxZFV0_46" , " hVtxZFV0_47" , " hVtxZFV0_48" };
321-
322- static constexpr std::string_view kNVtxZFV0CellCalib [kNCellsFV0 ] = {
323- " hVtxZFV0Calib_1" , " hVtxZFV0Calib_2" , " hVtxZFV0Calib_3" , " hVtxZFV0Calib_4" , " hVtxZFV0Calib_5" , " hVtxZFV0Calib_6" , " hVtxZFV0Calib_7" , " hVtxZFV0Calib_8" ,
324- " hVtxZFV0Calib_9" , " hVtxZFV0Calib_10" , " hVtxZFV0Calib_11" , " hVtxZFV0Calib_12" , " hVtxZFV0Calib_13" , " hVtxZFV0Calib_14" , " hVtxZFV0Calib_15" , " hVtxZFV0Calib_16" ,
325- " hVtxZFV0Calib_17" , " hVtxZFV0Calib_18" , " hVtxZFV0Calib_19" , " hVtxZFV0Calib_20" , " hVtxZFV0Calib_21" , " hVtxZFV0Calib_22" , " hVtxZFV0Calib_23" , " hVtxZFV0Calib_24" ,
326- " hVtxZFV0Calib_25" , " hVtxZFV0Calib_26" , " hVtxZFV0Calib_27" , " hVtxZFV0Calib_28" , " hVtxZFV0Calib_29" , " hVtxZFV0Calib_30" , " hVtxZFV0Calib_31" , " hVtxZFV0Calib_32" ,
327- " hVtxZFV0Calib_33" , " hVtxZFV0Calib_34" , " hVtxZFV0Calib_35" , " hVtxZFV0Calib_36" , " hVtxZFV0Calib_37" , " hVtxZFV0Calib_38" , " hVtxZFV0Calib_39" , " hVtxZFV0Calib_40" ,
328- " hVtxZFV0Calib_41" , " hVtxZFV0Calib_42" , " hVtxZFV0Calib_43" , " hVtxZFV0Calib_44" , " hVtxZFV0Calib_45" , " hVtxZFV0Calib_46" , " hVtxZFV0Calib_47" , " hVtxZFV0Calib_48" };
329-
330- static constexpr std::string_view kNMultFV0Cell [kNCellsFV0 ] = {
331- " hMultFV0_1" , " hMultFV0_2" , " hMultFV0_3" , " hMultFV0_4" , " hMultFV0_5" , " hMultFV0_6" , " hMultFV0_7" , " hMultFV0_8" ,
332- " hMultFV0_9" , " hMultFV0_10" , " hMultFV0_11" , " hMultFV0_12" , " hMultFV0_13" , " hMultFV0_14" , " hMultFV0_15" , " hMultFV0_16" ,
333- " hMultFV0_17" , " hMultFV0_18" , " hMultFV0_19" , " hMultFV0_20" , " hMultFV0_21" , " hMultFV0_22" , " hMultFV0_23" , " hMultFV0_24" ,
334- " hMultFV0_25" , " hMultFV0_26" , " hMultFV0_27" , " hMultFV0_28" , " hMultFV0_29" , " hMultFV0_30" , " hMultFV0_31" , " hMultFV0_32" ,
335- " hMultFV0_33" , " hMultFV0_34" , " hMultFV0_35" , " hMultFV0_36" , " hMultFV0_37" , " hMultFV0_38" , " hMultFV0_39" , " hMultFV0_40" ,
336- " hMultFV0_41" , " hMultFV0_42" , " hMultFV0_43" , " hMultFV0_44" , " hMultFV0_45" , " hMultFV0_46" , " hMultFV0_47" , " hMultFV0_48" };
337-
338314 void init (InitContext&)
339315 {
340316 auto vecParamsMIPposEta = (std::vector<float >)paramsFuncMIPposEta;
@@ -494,7 +470,10 @@ struct FlattenictyPikp {
494470 flatchrg.add (" FV0/hFV0AmplWCalib" , " " , HistType::kTH2D , {{48 , -0.5 , 47.5 , " channel" }, {500 , -0.5 , +19999.5 , " FV0 amplitude" }});
495471 flatchrg.add (" FV0/hFV0AmplvsVtxzWoCalib" , " " , HistType::kTH2D , {{30 , -15.0 , +15.0 , " z vtx (cm)" }, {1000 , -0.5 , +39999.5 , " FV0 amplitude" }});
496472 flatchrg.add (" FV0/hFV0AmplvsVtxzCalib" , " " , HistType::kTH2D , {{30 , -15.0 , +15.0 , " z vtx (cm)" }, {1000 , -0.5 , +39999.5 , " FV0 amplitude" }});
497- // V0's QA'
473+ flatchrg.add (" FV0/hFV0amp" , " " , {HistType::kTH2D , {channelFT0Axis, amplitudeFT0}});
474+ flatchrg.add (" FV0/pFV0amp" , " " , HistType::kTProfile , {channelFT0Axis});
475+ flatchrg.add (" FV0/hFV0ampCorr" , " " , {HistType::kTH2D , {channelFT0Axis, amplitudeFT0}});
476+ // V0's QA
498477 flatchrg.add (" Tracks/V0qa/hV0Pt" , " pT" , HistType::kTH1D , {{100 , 0 .0f , 10 }});
499478 flatchrg.add (" Tracks/V0qa/hV0ArmPod" , " ;#alpha; #it{q}_T" , HistType::kTH2D , {{200 , -1 .0f , +1 .0f }, {250 , 0 .0f , 0 .25f }});
500479 // dEdx PID
@@ -599,18 +578,6 @@ struct FlattenictyPikp {
599578 initEfficiency<pidSgn, o2::track::PID::Kaon>();
600579 initEfficiency<pidSgn, o2::track::PID::Proton>();
601580 });
602-
603- if (doprocessFV0Amp) {
604- flatchrg.add (" hFV0amp" , " hFV0amp" , {HistType::kTH2D , {channelFT0Axis, amplitudeFT0}});
605- flatchrg.add (" pFV0amp" , " pFV0amp" , HistType::kTProfile , {channelFT0Axis});
606- flatchrg.add (" hFV0ampCorr" , " " , {HistType::kTH2D , {channelFT0Axis, amplitudeFT0}});
607- for (int i_e = 0 ; i_e < kNCellsFV0 ; ++i_e) {
608- flatchrg.add (kNvtxZFV0Cell [i_e].data (), " " , HistType::kTProfile , {binOpt.axisVertexZ });
609- flatchrg.add (kNVtxZFV0CellCalib [i_e].data (), " " , HistType::kTProfile , {binOpt.axisVertexZ });
610- flatchrg.add (kNMultFV0Cell [i_e].data (), " " , HistType::kTH1D , {binOpt.axisMult });
611- }
612- flatchrg.add (" hFlatCalibAmp" , " hFlatCalibAmp" , {HistType::kTH1D , {flatAxis}});
613- }
614581 }
615582
616583 void initCCDB (aod::BCsWithTimestamps::iterator const & bc)
@@ -1361,6 +1328,13 @@ struct FlattenictyPikp {
13611328 float amplCh = fv0.amplitude ()[ich];
13621329 int chv0 = fv0.channel ()[ich];
13631330 int chv0phi = getFV0IndexPhi (chv0);
1331+ if constexpr (fillHist) {
1332+ flatchrg.fill (HIST (" FV0/hFV0amp" ), chv0, amplCh);
1333+ flatchrg.fill (HIST (" FV0/pFV0amp" ), chv0, amplCh);
1334+ if (applyCalibGain) {
1335+ flatchrg.fill (HIST (" FV0/hFV0ampCorr" ), chv0, amplCh / fv0AmplCorr[chv0]);
1336+ }
1337+ }
13641338 if (amplCh > 0 .) {
13651339 if (applyCalibGain) { // equalize gain channel-by-channel
13661340 amplCh /= fv0AmplCorr[chv0];
@@ -1380,9 +1354,9 @@ struct FlattenictyPikp {
13801354 }
13811355 if (applyCalibVtx) {
13821356 rhoLatticeFV0[chv0phi] *= zVtxMap->GetBinContent (zVtxMap->GetXaxis ()->FindBin (chv0phi), zVtxMap->GetYaxis ()->FindBin (collision.posZ ()));
1383- }
1384- if constexpr (fillHist) {
1385- flatchrg. fill ( HIST ( " FV0/hFV0AmplvsVtxzCalib " ), collision. posZ (), rhoLatticeFV0[chv0phi]);
1357+ if constexpr (fillHist) {
1358+ flatchrg. fill ( HIST ( " FV0/hFV0AmplvsVtxzCalib " ), collision. posZ (), rhoLatticeFV0[chv0phi]);
1359+ }
13861360 }
13871361 }
13881362 }
@@ -1959,77 +1933,6 @@ struct FlattenictyPikp {
19591933 return ccdb->getForTimeStamp <ObjType>(fullPath, timestamp);
19601934 }
19611935 }
1962-
1963- template <typename C>
1964- void correctFV0Amp (C const & collision)
1965- {
1966- rhoLatticeFV0.fill (0 );
1967- bool isOkFV0OrA = false ;
1968- if (collision.has_foundFV0 ()) {
1969- auto fv0 = collision.foundFV0 ();
1970- std::bitset<8 > fV0Triggers = fv0.triggerMask ();
1971- isOkFV0OrA = fV0Triggers [o2::fit::Triggers::bitA];
1972- if (!isOkFV0OrA) {
1973- return ;
1974- }
1975- for (std::size_t iCh = 0 ; iCh < fv0.channel ().size (); iCh++) {
1976- float ampl = fv0.amplitude ()[iCh];
1977- int fv0aChId = fv0.channel ()[iCh];
1978- int fv0aCh = getFV0IndexPhi (fv0aChId);
1979- flatchrg.fill (HIST (" hFV0amp" ), fv0aChId, ampl);
1980- flatchrg.fill (HIST (" pFV0amp" ), fv0aChId, ampl);
1981- flatchrg.fill (HIST (" hFV0ampCorr" ), fv0aChId, ampl / fv0AmplCorr[fv0aChId]);
1982-
1983- if (ampl > 0 .) {
1984- if (applyCalibGain) {
1985- ampl /= fv0AmplCorr[fv0aChId];
1986- }
1987- if (fv0aCh > 0 ) {
1988- if (fv0aChId < kInnerFV0 ) {
1989- rhoLatticeFV0[fv0aCh] += ampl;
1990- } else { // two channels per bin
1991- rhoLatticeFV0[fv0aCh] += ampl / 2 .;
1992- }
1993- }
1994- }
1995- }
1996- float flatFV0 = calcFlatenicity (rhoLatticeFV0);
1997- flatchrg.fill (HIST (" hFlatCalibAmp" ), 1 . - flatFV0);
1998-
1999- static_for<0 , kNCellsFV0 - 1 >([&](auto i) {
2000- constexpr int kIdx = i.value ;
2001- if (rhoLatticeFV0[kIdx ] > 0 ) {
2002- flatchrg.fill (HIST (kNMultFV0Cell [kIdx ]), rhoLatticeFV0[kIdx ]);
2003- }
2004- });
2005-
2006- static_for<0 , kNCellsFV0 - 1 >([&](auto i) {
2007- constexpr int kIdx = i.value ;
2008- if (rhoLatticeFV0[kIdx ] > 0 ) {
2009- flatchrg.fill (HIST (kNvtxZFV0Cell [kIdx ]), collision.posZ (), rhoLatticeFV0[kIdx ]);
2010- if (applyCalibVtx) {
2011- rhoLatticeFV0[kIdx ] *= zVtxMap->GetBinContent (zVtxMap->GetXaxis ()->FindBin (kIdx ), zVtxMap->GetYaxis ()->FindBin (collision.posZ ()));
2012- flatchrg.fill (HIST (kNVtxZFV0CellCalib [kIdx ]), collision.posZ (), rhoLatticeFV0[kIdx ]);
2013- }
2014- }
2015- });
2016- }
2017- }
2018-
2019- void processFV0Amp (MyCollisions::iterator const & collision,
2020- aod::BCsWithTimestamps const &,
2021- aod::FT0s const &,
2022- aod::FV0As const &)
2023- {
2024- auto bc = collision.bc_as <aod::BCsWithTimestamps>();
2025- int currentRun = bc.runNumber ();
2026- if (runNumber != currentRun) {
2027- initCCDB (bc);
2028- runNumber = currentRun;
2029- }
2030- correctFV0Amp (collision);
2031- }
2032- PROCESS_SWITCH (FlattenictyPikp, processFV0Amp, " Processing FV0 amplitude correction" , false );
20331936};
20341937
20351938WorkflowSpec defineDataProcessing (ConfigContext const & cfgc)
0 commit comments