Skip to content

Commit dcb065a

Browse files
authored
[Common] Add Oxygen and Neon to CollisionTypeHelper (#11879)
1 parent f1da368 commit dcb065a

File tree

3 files changed

+55
-7
lines changed

3 files changed

+55
-7
lines changed

Common/Core/CollisionTypeHelper.cxx

Lines changed: 21 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
// or submit itself to any jurisdiction.
1111

1212
///
13-
/// \file CollisionTypeHelper.h
13+
/// \file CollisionTypeHelper.cxx
1414
/// \author Nicolò Jacazio nicolo.jacazio@cern.ch
1515
/// \brief Utility to handle the collision type from the GRP information
1616
///
@@ -34,17 +34,26 @@ std::string o2::common::core::CollisionSystemType::getCollisionSystemName(collTy
3434
return "XeXe";
3535
case kCollSyspPb:
3636
return "pPb";
37+
case kCollSysOO:
38+
return "OO";
39+
case kCollSyspO:
40+
return "pO";
41+
case kCollSysNeNe:
42+
return "NeNe";
43+
case kCollSysUndef:
44+
return "Undefined";
3745
default:
46+
LOG(warning) << "Undefined collision system type: " << collSys;
3847
return "Undefined";
3948
}
4049
}
4150

4251
int o2::common::core::CollisionSystemType::getCollisionTypeFromGrp(o2::parameters::GRPLHCIFData* grplhcif)
4352
{
44-
const int ZBeamA = grplhcif->getBeamZ(o2::constants::lhc::BeamDirection::BeamA);
45-
const int ZBeamC = grplhcif->getBeamZ(o2::constants::lhc::BeamDirection::BeamC);
46-
LOG(debug) << "Collision system: " << ZBeamA << " * " << ZBeamC << " detected";
47-
switch (ZBeamA * ZBeamC) {
53+
const int zBeamA = grplhcif->getBeamZ(o2::constants::lhc::BeamDirection::BeamA);
54+
const int zBeamC = grplhcif->getBeamZ(o2::constants::lhc::BeamDirection::BeamC);
55+
LOG(debug) << "Collision system Z: " << zBeamA << " * " << zBeamC << " detected = " << zBeamA * zBeamC;
56+
switch (zBeamA * zBeamC) {
4857
case 1: // pp 1*1
4958
return kCollSyspp;
5059
case 6724: // Pb-Pb 82*82
@@ -53,8 +62,14 @@ int o2::common::core::CollisionSystemType::getCollisionTypeFromGrp(o2::parameter
5362
return kCollSysXeXe;
5463
case 82: // p-Pb 82*1
5564
return kCollSyspPb;
65+
case 64: // O-O 8*8
66+
return kCollSysOO;
67+
case 8: // p-O 8*1
68+
return kCollSyspO;
69+
case 100: // Ne-Ne 10*10
70+
return kCollSysNeNe;
5671
default:
57-
LOG(fatal) << "Undefined collision system in getCollisionTypeFromGrp with BeamA = " << ZBeamA << " and BeamC = " << ZBeamC;
72+
LOG(fatal) << "Undefined collision system in getCollisionTypeFromGrp with Z of BeamA = " << zBeamA << " and Z of BeamC = " << zBeamC;
5873
return kCollSysUndef;
5974
}
6075
return kCollSysUndef;

Common/Core/CollisionTypeHelper.h

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,10 @@ struct CollisionSystemType {
3434
static constexpr collType kCollSysPbPb = 1; // PbPb
3535
static constexpr collType kCollSysXeXe = 2; // XeXe
3636
static constexpr collType kCollSyspPb = 3; // pPb
37-
static constexpr collType kNCollSys = 4; // Number of collision systems
37+
static constexpr collType kCollSysOO = 4; // OO (Oxygen-Oxygen)
38+
static constexpr collType kCollSyspO = 5; // pO (proton-Oxygen)
39+
static constexpr collType kCollSysNeNe = 6; // NeNe (Neon-Neon)
40+
static constexpr collType kNCollSys = 7; // Number of collision systems
3841

3942
static std::string getCollisionSystemName(collType collSys);
4043

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
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 testCollisionTypeHelper.C
13+
/// \author Nicolò Jacazio nicolo.jacazio@cern.ch
14+
/// \brief Test the CollisionTypeHelper functionality
15+
16+
#include "Common/Core/CollisionTypeHelper.h"
17+
18+
#include "CCDB/BasicCCDBManager.h"
19+
#include "DataFormatsParameters/GRPLHCIFData.h"
20+
21+
void testCollisionTypeHelper(int runNumber = 544124)
22+
{
23+
24+
auto& ccdb = o2::ccdb::BasicCCDBManager::instance();
25+
ccdb.setURL("http://alice-ccdb.cern.ch");
26+
o2::parameters::GRPLHCIFData* grpo = ccdb.getSpecificForRun<o2::parameters::GRPLHCIFData>("GLO/Config/GRPLHCIF",
27+
runNumber);
28+
grpo->print();
29+
int collsys = o2::common::core::CollisionSystemType::getCollisionTypeFromGrp(grpo);
30+
}

0 commit comments

Comments
 (0)