Skip to content

Commit 956976c

Browse files
authored
[PWGJE] Making the code process events without using weight (AliceO2Group#8566)
1 parent 62227d2 commit 956976c

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

PWGJE/Tasks/bjetTaggingML.cxx

+8-3
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,10 @@
1414
///
1515
/// \author Hadi Hassan <hadi.hassan@cern.ch>, University of Jyväskylä
1616

17+
#include <string>
18+
#include <algorithm>
19+
#include <vector>
20+
1721
#include "Framework/AnalysisDataModel.h"
1822
#include "Framework/AnalysisTask.h"
1923
#include "Framework/ASoA.h"
@@ -84,6 +88,7 @@ struct BJetTaggingML {
8488
// event level configurables
8589
Configurable<float> vertexZCut{"vertexZCut", 10.0f, "Accepted z-vertex range"};
8690
Configurable<std::string> eventSelections{"eventSelections", "sel8", "choose event selection"};
91+
Configurable<bool> useEventWeight{"useEventWeight", true, "Flag whether to scale histograms with the event weight"};
8792

8893
Configurable<float> pTHatMaxMCD{"pTHatMaxMCD", 999.0, "maximum fraction of hard scattering for jet acceptance in detector MC"};
8994
Configurable<float> pTHatMaxMCP{"pTHatMaxMCP", 999.0, "maximum fraction of hard scattering for jet acceptance in particle MC"};
@@ -450,7 +455,7 @@ struct BJetTaggingML {
450455
continue;
451456
}
452457

453-
float eventWeight = analysisJet.eventWeight();
458+
float eventWeight = useEventWeight ? analysisJet.eventWeight() : 1.0;
454459
float pTHat = 10. / (std::pow(eventWeight, 1.0 / pTHatExponent));
455460
if (analysisJet.pt() > pTHatMaxMCD * pTHat) {
456461
continue;
@@ -535,7 +540,7 @@ struct BJetTaggingML {
535540
continue;
536541
}
537542

538-
float eventWeight = mcpjet.eventWeight();
543+
float eventWeight = useEventWeight ? mcpjet.eventWeight() : 1.0;
539544
float pTHat = 10. / (std::pow(eventWeight, 1.0 / pTHatExponent));
540545
if (mcpjet.pt() > pTHatMaxMCP * pTHat) {
541546
continue;
@@ -582,7 +587,7 @@ struct BJetTaggingML {
582587
continue;
583588
}
584589

585-
float eventWeight = mcpjet.eventWeight();
590+
float eventWeight = useEventWeight ? mcpjet.eventWeight() : 1.0;
586591
float pTHat = 10. / (std::pow(eventWeight, 1.0 / pTHatExponent));
587592
if (mcpjet.pt() > pTHatMaxMCP * pTHat) {
588593
continue;

0 commit comments

Comments
 (0)