Skip to content

Commit

Permalink
Fix pre-commit
Browse files Browse the repository at this point in the history
  • Loading branch information
Katerina Kostova authored and jmcarcell committed Aug 8, 2024
1 parent aab8817 commit 0a0cf93
Show file tree
Hide file tree
Showing 25 changed files with 5,040 additions and 4,943 deletions.
42 changes: 30 additions & 12 deletions k4GaudiPandora/include/DDBFieldPlugin.h
Original file line number Diff line number Diff line change
@@ -1,36 +1,54 @@
/*
* Copyright (c) 2020-2024 Key4hep-Project.
*
* This file is part of Key4hep.
* See https://key4hep.github.io/key4hep-doc/ for further info.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

/**
* @file DDMarlinPandora/include/DDBFieldPlugin.h
*
*
* @brief Header file for the BField plugin class.
*
*
* $Log: $
*/

#ifndef DDBFIELD_PLUGIN_H
#define DDBFIELD_PLUGIN_H 1

#include "Plugins/BFieldPlugin.h"
#include "Objects/CartesianVector.h"
#include "Plugins/BFieldPlugin.h"

#include "DD4hep/Fields.h"
#include "DD4hep/Detector.h"
#include "DD4hep/Fields.h"

//------------------------------------------------------------------------------------------------------------------------------------------

/**
* @brief DDBFieldPlugin class
*/
class DDBFieldPlugin : public pandora::BFieldPlugin
{
class DDBFieldPlugin : public pandora::BFieldPlugin {
public:
DDBFieldPlugin(const dd4hep::Detector &detector);
float GetBField(const pandora::CartesianVector &positionVector) const;
DDBFieldPlugin(const dd4hep::Detector& detector);
float GetBField(const pandora::CartesianVector& positionVector) const;

private:
pandora::StatusCode Initialize();
pandora::StatusCode ReadSettings(const pandora::TiXmlHandle xmlHandle);
pandora::StatusCode Initialize();
pandora::StatusCode ReadSettings(const pandora::TiXmlHandle xmlHandle);

dd4hep::OverlayedField m_field; ///< The field instance from DD4hep
dd4hep::OverlayedField m_field; ///< The field instance from DD4hep
};

#endif // #ifndef DDBFIELD_PLUGIN_H
#endif // #ifndef DDBFIELD_PLUGIN_H
633 changes: 367 additions & 266 deletions k4GaudiPandora/include/DDCaloDigi.h

Large diffs are not rendered by default.

329 changes: 168 additions & 161 deletions k4GaudiPandora/include/DDCaloHitCreator.h

Large diffs are not rendered by default.

62 changes: 40 additions & 22 deletions k4GaudiPandora/include/DDExternalClusteringAlgorithm.h
Original file line number Diff line number Diff line change
@@ -1,54 +1,72 @@
/*
* Copyright (c) 2020-2024 Key4hep-Project.
*
* This file is part of Key4hep.
* See https://key4hep.github.io/key4hep-doc/ for further info.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

/**
* @file DDMarlinPandora/include/DDExternalClusteringAlgorithm.h
*
*
* @brief Header file for the external clustering algorithm class.
*
*
* $Log: $
*/
#ifndef DDEXTERNALCLUSTERINGALGORITHM_H
#define DDEXTERNALCLUSTERINGALGORITHM_H 1

#include "Pandora/Algorithm.h"

namespace pandora { class CaloHit; }
namespace pandora {
class CaloHit;
}

//------------------------------------------------------------------------------------------------------------------------------------------

/**
* @brief DDExternalClusteringAlgorithm class
*/
class DDExternalClusteringAlgorithm : public pandora::Algorithm
{
class DDExternalClusteringAlgorithm : public pandora::Algorithm {
public:
/**
/**
* @brief Factory class for instantiating algorithm
*/
class Factory : public pandora::AlgorithmFactory
{
public:
pandora::Algorithm *CreateAlgorithm() const;
};
class Factory : public pandora::AlgorithmFactory {
public:
pandora::Algorithm* CreateAlgorithm() const;
};

/**
/**
* @brief Default constructor
*/
DDExternalClusteringAlgorithm();
DDExternalClusteringAlgorithm();

private:
pandora::StatusCode Run();
pandora::StatusCode ReadSettings(const pandora::TiXmlHandle xmlHandle);
pandora::StatusCode Run();
pandora::StatusCode ReadSettings(const pandora::TiXmlHandle xmlHandle);

typedef std::map<const void *, const pandora::CaloHit *> ParentAddressToCaloHitMap;
typedef std::map<const void*, const pandora::CaloHit*> ParentAddressToCaloHitMap;

std::string m_externalClusterCollectionName = ""; ///< The collection name for the external clusters
bool m_flagClustersAsPhotons = true; ///< Whether to automatically flag new clusters as fixed photons
std::string m_externalClusterCollectionName = ""; ///< The collection name for the external clusters
bool m_flagClustersAsPhotons = true; ///< Whether to automatically flag new clusters as fixed photons
};

//------------------------------------------------------------------------------------------------------------------------------------------

inline pandora::Algorithm *DDExternalClusteringAlgorithm::Factory::CreateAlgorithm() const
{
return new DDExternalClusteringAlgorithm();
inline pandora::Algorithm* DDExternalClusteringAlgorithm::Factory::CreateAlgorithm() const {
return new DDExternalClusteringAlgorithm();
}

#endif // #ifndef DDEXTERNALCLUSTERINGALGORITHM_H
#endif // #ifndef DDEXTERNALCLUSTERINGALGORITHM_H
132 changes: 76 additions & 56 deletions k4GaudiPandora/include/DDGeometryCreator.h
Original file line number Diff line number Diff line change
@@ -1,8 +1,27 @@
/*
* Copyright (c) 2020-2024 Key4hep-Project.
*
* This file is part of Key4hep.
* See https://key4hep.github.io/key4hep-doc/ for further info.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

/**
* @file DDMarlinPandora/include/DDGeometryCreator.h
*
*
* @brief Header file for the geometry creator class.
*
*
* $Log: $
*/

Expand All @@ -18,107 +37,106 @@
/**
* @brief DDGeometryCreator class
*/
class DDGeometryCreator
{
class DDGeometryCreator {
public:
/**
/**
* @brief Settings class
*/
class Settings
{
public:
/**
class Settings {
public:
/**
* @brief Default constructor
*/
Settings();
//NN: Material properties obtained from geometry; relevant variables removed
///NN: Extra geometry variables removed since all accessible from DDRec
//NN: Detector names not needed anymore since accessible by type flags
///Added by Nikiforos
bool m_createGaps; ///< Whether should create gaps


};

/**
Settings();
//NN: Material properties obtained from geometry; relevant variables removed
///NN: Extra geometry variables removed since all accessible from DDRec
//NN: Detector names not needed anymore since accessible by type flags
///Added by Nikiforos
bool m_createGaps; ///< Whether should create gaps
};

/**
* @brief Constructor
*
*
* @param settings the creator settings
* @param pPandora address of the relevant pandora instance
*/
DDGeometryCreator(const Settings &settings, const pandora::Pandora *const pPandora);
DDGeometryCreator(const Settings& settings, const pandora::Pandora* const pPandora);

/**
/**
* @brief Destructor
*/
~DDGeometryCreator();
~DDGeometryCreator();

/**
/**
* @brief Create geometry
*/
pandora::StatusCode CreateGeometry() const;
pandora::StatusCode CreateGeometry() const;

private:
typedef std::map<pandora::SubDetectorType, PandoraApi::Geometry::SubDetector::Parameters> SubDetectorTypeMap;
typedef std::map<std::string, PandoraApi::Geometry::SubDetector::Parameters> SubDetectorNameMap;
typedef std::map<pandora::SubDetectorType, PandoraApi::Geometry::SubDetector::Parameters> SubDetectorTypeMap;
typedef std::map<std::string, PandoraApi::Geometry::SubDetector::Parameters> SubDetectorNameMap;

/**
/**
* @brief Set mandatory sub detector parameters
*
*
* @param subDetectorTypeMap the sub detector type map
*/
void SetMandatorySubDetectorParameters(SubDetectorTypeMap &subDetectorTypeMap) const;
void SetMandatorySubDetectorParameters(SubDetectorTypeMap& subDetectorTypeMap) const;

/**
/**
* @brief Set additional sub detector parameters
*
*
* @param subDetectorNameMap the sub detector name map (for smaller sub detectors, identified uniquely only by name)
*/
void SetAdditionalSubDetectorParameters(SubDetectorNameMap &subDetectorNameMap) const;
void SetAdditionalSubDetectorParameters(SubDetectorNameMap& subDetectorNameMap) const;

/**
/**
* @brief Set sub detector parameters to their gear default values
*
*
* @param inputParameters input parameters, from gear
* @param subDetectorName the sub detector name
* @param subDetectorType the sub detector type
* @param parameters the sub detector parameters
*/
void SetDefaultSubDetectorParameters(const dd4hep::rec::LayeredCalorimeterData &inputParameters, const std::string &subDetectorName,
const pandora::SubDetectorType subDetectorType, PandoraApi::Geometry::SubDetector::Parameters &parameters) const;
void SetDefaultSubDetectorParameters(const dd4hep::rec::LayeredCalorimeterData& inputParameters,
const std::string& subDetectorName,
const pandora::SubDetectorType subDetectorType,
PandoraApi::Geometry::SubDetector::Parameters& parameters) const;

/**
/**
* @brief Set positions of gaps in ILD detector and add information missing from GEAR parameters file
*
*
* @param subDetectorTypeMap the sub detector type map
* @param subDetectorNameMap the sub detector name map (for smaller sub detectors, identified uniquely only by name)
*/
pandora::StatusCode SetILDSpecificGeometry(SubDetectorTypeMap &subDetectorTypeMap, SubDetectorNameMap &subDetectorNameMap) const;
pandora::StatusCode SetILDSpecificGeometry(SubDetectorTypeMap& subDetectorTypeMap,
SubDetectorNameMap& subDetectorNameMap) const;

/**
/**
* @brief Add information missing from GEAR parameters file for ILD SDHCAL detector
*
*
* @param subDetectorTypeMap the sub detector type map
*/

/**
/**
* @brief Specify positions of hcal barrel box gaps - ILD specific
*/
pandora::StatusCode CreateHCalBarrelBoxGaps() const;
pandora::StatusCode CreateHCalBarrelBoxGaps() const;

/**
/**
* @brief Specify positions of hcal end cap box gaps - ILD specific
*/
pandora::StatusCode CreateHCalEndCapBoxGaps() const;
pandora::StatusCode CreateHCalEndCapBoxGaps() const;

/**
/**
* @brief Specify positions of hcal barrel concentric polygon gaps - ILD specific
*/
pandora::StatusCode CreateHCalBarrelConcentricGaps() const;
pandora::StatusCode CreateHCalBarrelConcentricGaps() const;

/**
/**
* @brief Create box gaps at regular positions on polygonal prism, oriented along main z axis - ILD specific
*
*
* @param symmetryOrder the pandora geometry parameters
* @param phi0 the phi coordinate
* @param innerRadius the inner r coordinate
Expand All @@ -128,11 +146,13 @@ class DDGeometryCreator
* @param gapWidth the gap width
* @param vertexOffset position offset for vertex that doesn't point back to origin of xy plane
*/
pandora::StatusCode CreateRegularBoxGaps(unsigned int symmetryOrder, float phi0, float innerRadius, float outerRadius, float minZ,
float maxZ, float gapWidth, pandora::CartesianVector vertexOffset = pandora::CartesianVector(0, 0, 0)) const;
pandora::StatusCode CreateRegularBoxGaps(unsigned int symmetryOrder, float phi0, float innerRadius, float outerRadius,
float minZ, float maxZ, float gapWidth,
pandora::CartesianVector vertexOffset = pandora::CartesianVector(0, 0,
0)) const;

const Settings m_settings; ///< The geometry creator settings
const pandora::Pandora &m_pPandora; ///< Address of the pandora object to create the geometry
const Settings m_settings; ///< The geometry creator settings
const pandora::Pandora& m_pPandora; ///< Address of the pandora object to create the geometry
};

#endif // #ifndef GEOMETRY_CREATOR_H
#endif // #ifndef GEOMETRY_CREATOR_H
Loading

0 comments on commit 0a0cf93

Please sign in to comment.