forked from AliceO2Group/O2Physics
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
134 changed files
with
6,530 additions
and
1,890 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
// Copyright 2019-2020 CERN and copyright holders of ALICE O2. | ||
// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders. | ||
// All rights not expressly granted are reserved. | ||
// | ||
// This software is distributed under the terms of the GNU General Public | ||
// License v3 (GPL Version 3), copied verbatim in the file "COPYING". | ||
// | ||
// In applying this license CERN does not waive the privileges and immunities | ||
// granted to it by virtue of its status as an Intergovernmental Organization | ||
// or submit itself to any jurisdiction. | ||
|
||
/// | ||
/// \file CollisionTypeHelper.h | ||
/// \author Nicolò Jacazio [email protected] | ||
/// \brief Utility to handle the collision type from the GRP information | ||
/// | ||
|
||
#include "Common/Core/CollisionTypeHelper.h" | ||
#include <fairlogger/Logger.h> | ||
#include <string> | ||
#include "DataFormatsParameters/GRPLHCIFData.h" | ||
|
||
std::string CollisionSystemType::getCollisionSystemName(collType collSys) | ||
{ | ||
switch (collSys) { | ||
case kCollSyspp: | ||
return "pp"; | ||
case kCollSysPbPb: | ||
return "PbPb"; | ||
case kCollSysXeXe: | ||
return "XeXe"; | ||
case kCollSyspPb: | ||
return "pPb"; | ||
default: | ||
return "Undefined"; | ||
} | ||
} | ||
|
||
int CollisionSystemType::getCollisionTypeFromGrp(o2::parameters::GRPLHCIFData* grplhcif) | ||
{ | ||
const int ZBeamA = grplhcif->getBeamZ(o2::constants::lhc::BeamDirection::BeamA); | ||
const int ZBeamC = grplhcif->getBeamZ(o2::constants::lhc::BeamDirection::BeamC); | ||
LOG(debug) << "Collision system: " << ZBeamA << " * " << ZBeamC << " detected"; | ||
switch (ZBeamA * ZBeamC) { | ||
case 1: // pp 1*1 | ||
return kCollSyspp; | ||
case 6724: // Pb-Pb 82*82 | ||
return kCollSysPbPb; | ||
case 225: // Xe-Xe 54*54 | ||
return kCollSysXeXe; | ||
case 82: // p-Pb 82*1 | ||
return kCollSyspPb; | ||
default: | ||
LOG(fatal) << "Undefined collision system in getCollisionTypeFromGrp with BeamA = " << ZBeamA << " and BeamC = " << ZBeamC; | ||
return kCollSysUndef; | ||
} | ||
return kCollSysUndef; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
// Copyright 2019-2020 CERN and copyright holders of ALICE O2. | ||
// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders. | ||
// All rights not expressly granted are reserved. | ||
// | ||
// This software is distributed under the terms of the GNU General Public | ||
// License v3 (GPL Version 3), copied verbatim in the file "COPYING". | ||
// | ||
// In applying this license CERN does not waive the privileges and immunities | ||
// granted to it by virtue of its status as an Intergovernmental Organization | ||
// or submit itself to any jurisdiction. | ||
|
||
/// | ||
/// \file CollisionTypeHelper.h | ||
/// \author Nicolò Jacazio [email protected] | ||
/// \brief Utility to handle the collision type from the GRP information | ||
/// | ||
|
||
#ifndef COMMON_CORE_COLLISIONTYPEHELPER_H_ | ||
#define COMMON_CORE_COLLISIONTYPEHELPER_H_ | ||
|
||
#include <string> | ||
#include "DataFormatsParameters/GRPLHCIFData.h" | ||
|
||
// Container for the collision system type | ||
struct CollisionSystemType { | ||
// Enum type for the collision system | ||
typedef int collType; | ||
|
||
static constexpr collType kCollSysUndef = -1; // Undefined collision system | ||
static constexpr collType kCollSyspp = 0; // pp | ||
static constexpr collType kCollSysPbPb = 1; // PbPb | ||
static constexpr collType kCollSysXeXe = 2; // XeXe | ||
static constexpr collType kCollSyspPb = 3; // pPb | ||
static constexpr collType kNCollSys = 4; // Number of collision systems | ||
|
||
static std::string getCollisionSystemName(collType collSys); | ||
|
||
static int getCollisionTypeFromGrp(o2::parameters::GRPLHCIFData* grplhcif); | ||
}; | ||
|
||
#endif // COMMON_CORE_COLLISIONTYPEHELPER_H_ |
Oops, something went wrong.