Skip to content

Commit 02ccd6e

Browse files
authored
[PWGMM] init lumi PR (#371)
Lumi MM task
1 parent 3b309a0 commit 02ccd6e

2 files changed

Lines changed: 53 additions & 1 deletion

File tree

PWGMM/Tasks/CMakeLists.txt

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,9 @@ o2physics_add_dpl_workflow(dndeta
2222
o2physics_add_dpl_workflow(ue-charged
2323
SOURCES uecharged.cxx
2424
PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore
25-
COMPONENT_NAME Analysis)
25+
COMPONENT_NAME Analysis)
26+
27+
o2physics_add_dpl_workflow(lumi
28+
SOURCES lumi.cxx
29+
PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore
30+
COMPONENT_NAME Analysis)

PWGMM/Tasks/lumi.cxx

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
// Copyright 2019-2020 CERN and copyright holders of ALICE O2.
2+
// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders.
3+
// All rights not expressly granted are reserved.
4+
//
5+
// This software is distributed under the terms of the GNU General Public
6+
// License v3 (GPL Version 3), copied verbatim in the file "COPYING".
7+
//
8+
// In applying this license CERN does not waive the privileges and immunities
9+
// granted to it by virtue of its status as an Intergovernmental Organization
10+
// or submit itself to any jurisdiction.
11+
/// \author Junlee Kim (jikim1290@gmail.com)
12+
/// \since November 2021
13+
14+
#include "Framework/runDataProcessing.h"
15+
#include "Framework/AnalysisTask.h"
16+
#include "Framework/HistogramRegistry.h"
17+
18+
using namespace o2;
19+
using namespace o2::framework;
20+
using namespace o2::framework::expressions;
21+
22+
struct lumiTask {
23+
HistogramRegistry histos{"histos", {
24+
{"vertexx", "", {HistType::kTH1F, {{1000, -1, 1, "x"}}}}, //
25+
{"vertexy", "", {HistType::kTH1F, {{1000, -1, 1, "y"}}}}, //
26+
{"timestamp", "", {HistType::kTH1F, {{1000, 0, 5e7, "t"}}}}, //
27+
{"vertexx_timestamp", "", {HistType::kTH2F, {{1000, 0, 5e7, "t"}, {1000, -1, 1, "x"}}}}, //
28+
{"vertexy_timestamp", "", {HistType::kTH2F, {{1000, 0, 5e7, "t"}, {1000, -1, 1, "y"}}}} //
29+
}};
30+
uint64_t first_time = 1530314294062; // to be updated
31+
32+
void process(aod::Collision const& collision, aod::BCsWithTimestamps const&)
33+
{
34+
auto bc = collision.bc_as<aod::BCsWithTimestamps>();
35+
histos.fill(HIST("vertexx"), collision.posX());
36+
histos.fill(HIST("vertexy"), collision.posY());
37+
histos.fill(HIST("timestamp"), bc.timestamp() - first_time);
38+
// LOGP(info, "Got timestamp {}", bc.timestamp());
39+
histos.fill(HIST("vertexx_timestamp"), bc.timestamp() - first_time, collision.posX());
40+
histos.fill(HIST("vertexy_timestamp"), bc.timestamp() - first_time, collision.posY());
41+
} // need selections
42+
};
43+
44+
WorkflowSpec defineDataProcessing(ConfigContext const& cfgc)
45+
{
46+
return WorkflowSpec{adaptAnalysisTask<lumiTask>(cfgc)};
47+
}

0 commit comments

Comments
 (0)