Project
Loading...
Searching...
No Matches
test_O2DatabasePDG.cxx
Go to the documentation of this file.
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.
15
19
20#include <TDatabasePDG.h>
21#include <cmath>
22
23using namespace o2;
24using namespace o2::framework;
25using namespace o2::framework::expressions;
26
27#define ASSERT_ERROR(condition) \
28 if ((condition) == false) { \
29 LOG(fatal) << R"(Test condition ")" #condition R"(" failed)"; \
30 }
31
32struct PdgTest {
36
38 {
39 // Hardcoded from DataFormats/simulation/include/SimulationDataFormat/O2DatabasePDG.h
40 TParticlePDG* p = pdgOld->GetParticle(300553);
41 ASSERT_ERROR(p != nullptr);
42 ASSERT_ERROR(p->Mass() == 10.580);
43 ASSERT_ERROR(p->Stable() == kFALSE);
44 ASSERT_ERROR(p->Charge() == 0);
45 ASSERT_ERROR(p->Width() == 0.000);
46
47 TParticlePDG* pNew = pdgNew->GetParticle(300553);
48 ASSERT_ERROR(pNew != nullptr);
49 ASSERT_ERROR(pNew->Mass() == 10.580);
50 ASSERT_ERROR(pNew->Stable() == kFALSE);
51 ASSERT_ERROR(pNew->Charge() == 0);
52 ASSERT_ERROR(pNew->Width() == 0.000);
53 control->readyToQuit(QuitRequest::Me);
54 }
55};
56
58{
59 return WorkflowSpec{
60 adaptAnalysisTask<PdgTest>(cfgc),
61 };
62}
Defining PrimaryVertex explicitly as messageable.
Definition TFIDInfo.h:20
std::vector< DataProcessorSpec > WorkflowSpec
a couple of static helper functions to create timestamp values for CCDB queries or override obsolete ...
void process(Enumeration< 0, 1 > &e)
Service< o2::framework::ControlService > control
Service< o2::framework::O2DatabasePDG > pdgNew
Service< TDatabasePDG > pdgOld
WorkflowSpec defineDataProcessing(ConfigContext const &cfgc)
This function hooks up the the workflow specifications into the DPL driver.
#define ASSERT_ERROR(condition)