@@ -123,9 +123,9 @@ struct ThreeParticleCorrelations {
123123 Configurable<bool > confFilterSwitch{" confFilterSwitch" , false , " Switch for the fakeV0Filter function" };
124124
125125 // Efficiency histograms
126- TH1D ** hEffPions = new TH1D *[2 ];
127- TH1D ** hEffKaons = new TH1D *[2 ];
128- TH1D ** hEffProtons = new TH1D *[2 ];
126+ TH2D ** hEffPions = new TH2D *[2 ];
127+ TH2D ** hEffKaons = new TH2D *[2 ];
128+ TH2D ** hEffProtons = new TH2D *[2 ];
129129
130130 // Correlation variables
131131 int triggSign, assocSign;
@@ -241,12 +241,12 @@ struct ThreeParticleCorrelations {
241241 ccdb->setURL (" http://alice-ccdb.cern.ch" );
242242 ccdb->setCaching (true );
243243 TList* efficiencyList = ccdb->getForTimeStamp <TList>(" Users/j/jstaa/Efficiency/ChargedParticles" , 1 );
244- hEffPions[0 ] = static_cast <TH1D *>(efficiencyList->FindObject (" hEfficiencyPionP" ));
245- hEffPions[1 ] = static_cast <TH1D *>(efficiencyList->FindObject (" hEfficiencyPionN" ));
246- hEffKaons[0 ] = static_cast <TH1D *>(efficiencyList->FindObject (" hEfficiencyKaonP" ));
247- hEffKaons[1 ] = static_cast <TH1D *>(efficiencyList->FindObject (" hEfficiencyKaonN" ));
248- hEffProtons[0 ] = static_cast <TH1D *>(efficiencyList->FindObject (" hEfficiencyProtonP" ));
249- hEffProtons[1 ] = static_cast <TH1D *>(efficiencyList->FindObject (" hEfficiencyProtonN" ));
244+ hEffPions[0 ] = static_cast <TH2D *>(efficiencyList->FindObject (" hEfficiencyPionP" ));
245+ hEffPions[1 ] = static_cast <TH2D *>(efficiencyList->FindObject (" hEfficiencyPionN" ));
246+ hEffKaons[0 ] = static_cast <TH2D *>(efficiencyList->FindObject (" hEfficiencyKaonP" ));
247+ hEffKaons[1 ] = static_cast <TH2D *>(efficiencyList->FindObject (" hEfficiencyKaonN" ));
248+ hEffProtons[0 ] = static_cast <TH2D *>(efficiencyList->FindObject (" hEfficiencyProtonP" ));
249+ hEffProtons[1 ] = static_cast <TH2D *>(efficiencyList->FindObject (" hEfficiencyProtonN" ));
250250 }
251251
252252 // ==========================================================================================================================================================================================================================================================================
@@ -278,15 +278,15 @@ struct ThreeParticleCorrelations {
278278 rQARegistry.fill (HIST (" hdEdx" ), track.pt (), track.tpcSignal ());
279279 rQARegistry.fill (HIST (" hBeta" ), track.pt (), track.beta ());
280280 if (assocPID[0 ] == pionID) { // Pions
281- rQARegistry.fill (HIST (" hPtPion" ), track.pt (), 1 . / trackEff (hEffPions, track. sign (), track. pt () ));
281+ rQARegistry.fill (HIST (" hPtPion" ), track.pt (), 1 . / trackEff (hEffPions, track));
282282 rQARegistry.fill (HIST (" hdEdxPion" ), track.pt (), track.tpcSignal ());
283283 rQARegistry.fill (HIST (" hBetaPion" ), track.pt (), track.beta ());
284284 } else if (assocPID[0 ] == kaonID) { // Kaons
285- rQARegistry.fill (HIST (" hPtKaon" ), track.pt (), 1 . / trackEff (hEffKaons, track. sign (), track. pt () ));
285+ rQARegistry.fill (HIST (" hPtKaon" ), track.pt (), 1 . / trackEff (hEffKaons, track));
286286 rQARegistry.fill (HIST (" hdEdxKaon" ), track.pt (), track.tpcSignal ());
287287 rQARegistry.fill (HIST (" hBetaKaon" ), track.pt (), track.beta ());
288288 } else if (assocPID[0 ] == protonID) { // Protons
289- rQARegistry.fill (HIST (" hPtProton" ), track.pt (), 1 . / trackEff (hEffProtons, track. sign (), track. pt () ));
289+ rQARegistry.fill (HIST (" hPtProton" ), track.pt (), 1 . / trackEff (hEffProtons, track));
290290 rQARegistry.fill (HIST (" hdEdxProton" ), track.pt (), track.tpcSignal ());
291291 rQARegistry.fill (HIST (" hBetaProton" ), track.pt (), track.beta ());
292292 }
@@ -318,19 +318,19 @@ struct ThreeParticleCorrelations {
318318
319319 if (candMass >= MassLambda0 - 4 * dGaussSigma && candMass <= MassLambda0 + 4 * dGaussSigma) {
320320 if (assocPID[0 ] == pionID) { // Pions
321- rSECorrRegistry.fill (HIST (" hSameLambdaPion_SGNL" ), deltaPhi, deltaEta, collision.centFT0C (), collision.posZ (), triggSign, associate.sign (), 1 . / trackEff (hEffPions, associate. sign (), associate. pt () ));
321+ rSECorrRegistry.fill (HIST (" hSameLambdaPion_SGNL" ), deltaPhi, deltaEta, collision.centFT0C (), collision.posZ (), triggSign, associate.sign (), 1 . / trackEff (hEffPions, associate));
322322 } else if (assocPID[0 ] == kaonID) { // Kaons
323- rSECorrRegistry.fill (HIST (" hSameLambdaKaon_SGNL" ), deltaPhi, deltaEta, collision.centFT0C (), collision.posZ (), triggSign, associate.sign (), 1 . / trackEff (hEffKaons, associate. sign (), associate. pt () ));
323+ rSECorrRegistry.fill (HIST (" hSameLambdaKaon_SGNL" ), deltaPhi, deltaEta, collision.centFT0C (), collision.posZ (), triggSign, associate.sign (), 1 . / trackEff (hEffKaons, associate));
324324 } else if (assocPID[0 ] == protonID) { // Protons
325- rSECorrRegistry.fill (HIST (" hSameLambdaProton_SGNL" ), deltaPhi, deltaEta, collision.centFT0C (), collision.posZ (), triggSign, associate.sign (), 1 . / trackEff (hEffProtons, associate. sign (), associate. pt () ));
325+ rSECorrRegistry.fill (HIST (" hSameLambdaProton_SGNL" ), deltaPhi, deltaEta, collision.centFT0C (), collision.posZ (), triggSign, associate.sign (), 1 . / trackEff (hEffProtons, associate));
326326 }
327327 } else if (candMass >= MassLambda0 - 8 * dGaussSigma && candMass <= MassLambda0 + 8 * dGaussSigma) {
328328 if (assocPID[0 ] == pionID) { // Pions
329- rSECorrRegistry.fill (HIST (" hSameLambdaPion_SB" ), deltaPhi, deltaEta, collision.centFT0C (), collision.posZ (), triggSign, associate.sign (), 1 . / trackEff (hEffPions, associate. sign (), associate. pt () ));
329+ rSECorrRegistry.fill (HIST (" hSameLambdaPion_SB" ), deltaPhi, deltaEta, collision.centFT0C (), collision.posZ (), triggSign, associate.sign (), 1 . / trackEff (hEffPions, associate));
330330 } else if (assocPID[0 ] == kaonID) { // Kaons
331- rSECorrRegistry.fill (HIST (" hSameLambdaKaon_SB" ), deltaPhi, deltaEta, collision.centFT0C (), collision.posZ (), triggSign, associate.sign (), 1 . / trackEff (hEffKaons, associate. sign (), associate. pt () ));
331+ rSECorrRegistry.fill (HIST (" hSameLambdaKaon_SB" ), deltaPhi, deltaEta, collision.centFT0C (), collision.posZ (), triggSign, associate.sign (), 1 . / trackEff (hEffKaons, associate));
332332 } else if (assocPID[0 ] == protonID) { // Protons
333- rSECorrRegistry.fill (HIST (" hSameLambdaProton_SB" ), deltaPhi, deltaEta, collision.centFT0C (), collision.posZ (), triggSign, associate.sign (), 1 . / trackEff (hEffProtons, associate. sign (), associate. pt () ));
333+ rSECorrRegistry.fill (HIST (" hSameLambdaProton_SB" ), deltaPhi, deltaEta, collision.centFT0C (), collision.posZ (), triggSign, associate.sign (), 1 . / trackEff (hEffProtons, associate));
334334 }
335335 }
336336 }
@@ -366,19 +366,19 @@ struct ThreeParticleCorrelations {
366366
367367 if (candMass >= MassLambda0 - 4 * dGaussSigma && candMass <= MassLambda0 + 4 * dGaussSigma) {
368368 if (assocPID[0 ] == pionID) { // Pions
369- rMECorrRegistry.fill (HIST (" hMixLambdaPion_SGNL" ), deltaPhi, deltaEta, coll_1.centFT0C (), coll_1.posZ (), triggSign, associate.sign (), 1 . / trackEff (hEffPions, associate. sign (), associate. pt () ));
369+ rMECorrRegistry.fill (HIST (" hMixLambdaPion_SGNL" ), deltaPhi, deltaEta, coll_1.centFT0C (), coll_1.posZ (), triggSign, associate.sign (), 1 . / trackEff (hEffPions, associate));
370370 } else if (assocPID[0 ] == kaonID) { // Kaons
371- rMECorrRegistry.fill (HIST (" hMixLambdaKaon_SGNL" ), deltaPhi, deltaEta, coll_1.centFT0C (), coll_1.posZ (), triggSign, associate.sign (), 1 . / trackEff (hEffKaons, associate. sign (), associate. pt () ));
371+ rMECorrRegistry.fill (HIST (" hMixLambdaKaon_SGNL" ), deltaPhi, deltaEta, coll_1.centFT0C (), coll_1.posZ (), triggSign, associate.sign (), 1 . / trackEff (hEffKaons, associate));
372372 } else if (assocPID[0 ] == protonID) { // Protons
373- rMECorrRegistry.fill (HIST (" hMixLambdaProton_SGNL" ), deltaPhi, deltaEta, coll_1.centFT0C (), coll_1.posZ (), triggSign, associate.sign (), 1 . / trackEff (hEffProtons, associate. sign (), associate. pt () ));
373+ rMECorrRegistry.fill (HIST (" hMixLambdaProton_SGNL" ), deltaPhi, deltaEta, coll_1.centFT0C (), coll_1.posZ (), triggSign, associate.sign (), 1 . / trackEff (hEffProtons, associate));
374374 }
375375 } else if (candMass >= MassLambda0 - 8 * dGaussSigma && candMass <= MassLambda0 + 8 * dGaussSigma) {
376376 if (assocPID[0 ] == pionID) { // Pions
377- rMECorrRegistry.fill (HIST (" hMixLambdaPion_SB" ), deltaPhi, deltaEta, coll_1.centFT0C (), coll_1.posZ (), triggSign, associate.sign (), 1 . / trackEff (hEffPions, associate. sign (), associate. pt () ));
377+ rMECorrRegistry.fill (HIST (" hMixLambdaPion_SB" ), deltaPhi, deltaEta, coll_1.centFT0C (), coll_1.posZ (), triggSign, associate.sign (), 1 . / trackEff (hEffPions, associate));
378378 } else if (assocPID[0 ] == kaonID) { // Kaons
379- rMECorrRegistry.fill (HIST (" hMixLambdaKaon_SB" ), deltaPhi, deltaEta, coll_1.centFT0C (), coll_1.posZ (), triggSign, associate.sign (), 1 . / trackEff (hEffKaons, associate. sign (), associate. pt () ));
379+ rMECorrRegistry.fill (HIST (" hMixLambdaKaon_SB" ), deltaPhi, deltaEta, coll_1.centFT0C (), coll_1.posZ (), triggSign, associate.sign (), 1 . / trackEff (hEffKaons, associate));
380380 } else if (assocPID[0 ] == protonID) { // Protons
381- rMECorrRegistry.fill (HIST (" hMixLambdaProton_SB" ), deltaPhi, deltaEta, coll_1.centFT0C (), coll_1.posZ (), triggSign, associate.sign (), 1 . / trackEff (hEffProtons, associate. sign (), associate. pt () ));
381+ rMECorrRegistry.fill (HIST (" hMixLambdaProton_SB" ), deltaPhi, deltaEta, coll_1.centFT0C (), coll_1.posZ (), triggSign, associate.sign (), 1 . / trackEff (hEffProtons, associate));
382382 }
383383 }
384384 }
@@ -598,17 +598,18 @@ struct ThreeParticleCorrelations {
598598 return 0.1 * (grpo->getNominalL3Field ()); // 1 T = 10 kG
599599 }
600600
601- double trackEff (TH1D** efficiencies, int sign, double pT)
601+ template <class TrackCand >
602+ double trackEff (TH2D** efficiencies, const TrackCand& track)
602603 {
603604
604605 int index = -999 ;
605- if (sign > 0 ) {
606+ if (track. sign () > 0 ) {
606607 index = 0 ;
607- } else if (sign < 0 ) {
608+ } else if (track. sign () < 0 ) {
608609 index = 1 ;
609610 }
610611
611- double efficiency = efficiencies[index]->GetBinContent (efficiencies[index]->FindBin (pT ));
612+ double efficiency = efficiencies[index]->GetBinContent (efficiencies[index]->FindBin (track. pt (), track. eta () ));
612613 if (efficiency > 0 ) {
613614 return efficiency;
614615 } else {
0 commit comments