|
| 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