|
| 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 | +// |
| 12 | +/// \file upcTestRctTables.cxx |
| 13 | +/// \brief Tests Rct Tables in UD tabl;es |
| 14 | +/// |
| 15 | +/// \author Roman Lavicka <roman.lavicka@cern.ch>, Austrian Academy of Sciences & SMI |
| 16 | +/// \since 27.06.2025 |
| 17 | +// |
| 18 | + |
| 19 | +// O2 headers |
| 20 | +#include "Framework/AnalysisDataModel.h" |
| 21 | +#include "Framework/AnalysisTask.h" |
| 22 | +#include "Framework/HistogramRegistry.h" |
| 23 | +#include "Framework/O2DatabasePDGPlugin.h" |
| 24 | +#include "Framework/runDataProcessing.h" |
| 25 | + |
| 26 | +// O2Physics headers |
| 27 | +#include "PWGUD/Core/SGSelector.h" |
| 28 | +#include "PWGUD/Core/UPCTauCentralBarrelHelperRL.h" |
| 29 | +#include "PWGUD/DataModel/UDTables.h" |
| 30 | + |
| 31 | +using namespace o2; |
| 32 | +using namespace o2::framework; |
| 33 | +using namespace o2::framework::expressions; |
| 34 | + |
| 35 | +struct UpcTestRctTables { |
| 36 | + |
| 37 | + // Global varialbes |
| 38 | + SGSelector sgSelector; |
| 39 | + |
| 40 | + HistogramRegistry histos{"histos", {}, OutputObjHandlingPolicy::AnalysisObject}; |
| 41 | + |
| 42 | + // declare configurables |
| 43 | + Configurable<bool> verboseInfo{"verboseInfo", false, {"Print general info to terminal; default it false."}}; |
| 44 | + |
| 45 | + using FullSGUDCollisions = soa::Join<aod::UDCollisions, aod::UDCollisionsSels, aod::UDCollisionSelExtras, aod::SGCollisions>; |
| 46 | + using FullSGUDCollision = FullSGUDCollisions::iterator; |
| 47 | + |
| 48 | + // init |
| 49 | + void init(InitContext&) |
| 50 | + { |
| 51 | + if (verboseInfo) |
| 52 | + printMediumMessage("INIT METHOD"); |
| 53 | + |
| 54 | + histos.add("OutputTable/hRCTflags", ";RCTflag (-);Number of passed collision (-)", HistType::kTH1D, {{5, -0.5, 4.5}}); |
| 55 | + |
| 56 | + } // end init |
| 57 | + |
| 58 | + void processDataSG(FullSGUDCollision const& reconstructedCollision) |
| 59 | + { |
| 60 | + |
| 61 | + histos.get<TH1>(HIST("OutputTable/hRCTflags"))->Fill(0); |
| 62 | + |
| 63 | + if (sgSelector.isCBTOk(reconstructedCollision)) |
| 64 | + histos.get<TH1>(HIST("OutputTable/hRCTflags"))->Fill(1); |
| 65 | + |
| 66 | + if (sgSelector.isCBTZdcOk(reconstructedCollision)) |
| 67 | + histos.get<TH1>(HIST("OutputTable/hRCTflags"))->Fill(2); |
| 68 | + |
| 69 | + if (sgSelector.isCBTHadronOk(reconstructedCollision)) |
| 70 | + histos.get<TH1>(HIST("OutputTable/hRCTflags"))->Fill(3); |
| 71 | + |
| 72 | + if (sgSelector.isCBTHadronZdcOk(reconstructedCollision)) |
| 73 | + histos.get<TH1>(HIST("OutputTable/hRCTflags"))->Fill(4); |
| 74 | + |
| 75 | + } // end processDataSG |
| 76 | + |
| 77 | + PROCESS_SWITCH(UpcTestRctTables, processDataSG, "Iterate UD tables with measured data created by SG-Candidate-Producer.", true); |
| 78 | +}; |
| 79 | + |
| 80 | +WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) |
| 81 | +{ |
| 82 | + return WorkflowSpec{ |
| 83 | + adaptAnalysisTask<UpcTestRctTables>(cfgc)}; |
| 84 | +} |
0 commit comments