|
14 | 14 | ///
|
15 | 15 | /// \author Hadi Hassan <hadi.hassan@cern.ch>, University of Jyväskylä
|
16 | 16 |
|
| 17 | +#include <string> |
| 18 | +#include <algorithm> |
| 19 | +#include <vector> |
| 20 | + |
17 | 21 | #include "Framework/AnalysisDataModel.h"
|
18 | 22 | #include "Framework/AnalysisTask.h"
|
19 | 23 | #include "Framework/ASoA.h"
|
@@ -84,6 +88,7 @@ struct BJetTaggingML {
|
84 | 88 | // event level configurables
|
85 | 89 | Configurable<float> vertexZCut{"vertexZCut", 10.0f, "Accepted z-vertex range"};
|
86 | 90 | Configurable<std::string> eventSelections{"eventSelections", "sel8", "choose event selection"};
|
| 91 | + Configurable<bool> useEventWeight{"useEventWeight", true, "Flag whether to scale histograms with the event weight"}; |
87 | 92 |
|
88 | 93 | Configurable<float> pTHatMaxMCD{"pTHatMaxMCD", 999.0, "maximum fraction of hard scattering for jet acceptance in detector MC"};
|
89 | 94 | Configurable<float> pTHatMaxMCP{"pTHatMaxMCP", 999.0, "maximum fraction of hard scattering for jet acceptance in particle MC"};
|
@@ -450,7 +455,7 @@ struct BJetTaggingML {
|
450 | 455 | continue;
|
451 | 456 | }
|
452 | 457 |
|
453 |
| - float eventWeight = analysisJet.eventWeight(); |
| 458 | + float eventWeight = useEventWeight ? analysisJet.eventWeight() : 1.0; |
454 | 459 | float pTHat = 10. / (std::pow(eventWeight, 1.0 / pTHatExponent));
|
455 | 460 | if (analysisJet.pt() > pTHatMaxMCD * pTHat) {
|
456 | 461 | continue;
|
@@ -535,7 +540,7 @@ struct BJetTaggingML {
|
535 | 540 | continue;
|
536 | 541 | }
|
537 | 542 |
|
538 |
| - float eventWeight = mcpjet.eventWeight(); |
| 543 | + float eventWeight = useEventWeight ? mcpjet.eventWeight() : 1.0; |
539 | 544 | float pTHat = 10. / (std::pow(eventWeight, 1.0 / pTHatExponent));
|
540 | 545 | if (mcpjet.pt() > pTHatMaxMCP * pTHat) {
|
541 | 546 | continue;
|
@@ -582,7 +587,7 @@ struct BJetTaggingML {
|
582 | 587 | continue;
|
583 | 588 | }
|
584 | 589 |
|
585 |
| - float eventWeight = mcpjet.eventWeight(); |
| 590 | + float eventWeight = useEventWeight ? mcpjet.eventWeight() : 1.0; |
586 | 591 | float pTHat = 10. / (std::pow(eventWeight, 1.0 / pTHatExponent));
|
587 | 592 | if (mcpjet.pt() > pTHatMaxMCP * pTHat) {
|
588 | 593 | continue;
|
|
0 commit comments