Skip to content

Commit

Permalink
[format] Run whitespace cleanup and clang-format
Browse files Browse the repository at this point in the history
  • Loading branch information
tmadlener committed Apr 26, 2024
1 parent a1325ea commit c3656bf
Show file tree
Hide file tree
Showing 34 changed files with 8,283 additions and 8,785 deletions.
14 changes: 7 additions & 7 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ INCLUDE_DIRECTORIES( SYSTEM ${streamlog_INCLUDE_DIRS} )
LINK_LIBRARIES( ${streamlog_LIBRARIES} )
ADD_DEFINITIONS( ${streamlog_DEFINITIONS} )

FIND_PACKAGE( KalTest REQUIRED )
FIND_PACKAGE( KalTest REQUIRED )
INCLUDE_DIRECTORIES( SYSTEM ${KalTest_INCLUDE_DIRS} )
LINK_LIBRARIES( ${KalTest_LIBRARIES} )
ADD_DEFINITIONS( ${KalTest_DEFINITIONS} )
Expand All @@ -59,17 +59,17 @@ ADD_DEFINITIONS( ${KalTest_DEFINITIONS} )
# ( should be exported by KalTest really )
ADD_DEFINITIONS( -D __NOT0__ )

FIND_PACKAGE( KalDet REQUIRED )
FIND_PACKAGE( KalDet REQUIRED )
INCLUDE_DIRECTORIES( SYSTEM ${KalDet_INCLUDE_DIRS} )
LINK_LIBRARIES( ${KalDet_LIBRARIES} )
ADD_DEFINITIONS( ${KalDet_DEFINITIONS} )

FIND_PACKAGE( ROOT REQUIRED )
FIND_PACKAGE( ROOT REQUIRED )
INCLUDE_DIRECTORIES( SYSTEM ${ROOT_INCLUDE_DIRS} )
LINK_LIBRARIES( ${ROOT_LIBRARIES} )
ADD_DEFINITIONS( ${ROOT_DEFINITIONS} )

FIND_PACKAGE( DDKalTest REQUIRED )
FIND_PACKAGE( DDKalTest REQUIRED )
INCLUDE_DIRECTORIES( SYSTEM ${DDKalTest_INCLUDE_DIRS} )
LINK_LIBRARIES( ${DDKalTest_LIBRARIES} )
ADD_DEFINITIONS( ${DDKalTest_DEFINITIONS} )
Expand All @@ -81,13 +81,13 @@ INCLUDE_DIRECTORIES( SYSTEM ${CLHEP_INCLUDE_DIRS} )
LINK_LIBRARIES( ${CLHEP_LIBRARIES} )
ADD_DEFINITIONS( ${CLHEP_DEFINITIONS} )

FIND_PACKAGE( DD4hep REQUIRED COMPONENTS DDRec )
FIND_PACKAGE( DD4hep REQUIRED COMPONENTS DDRec )
INCLUDE_DIRECTORIES( SYSTEM ${DD4hep_INCLUDE_DIRS} )
LINK_LIBRARIES( ${DD4hep_LIBRARIES} ${DD4hep_COMPONENT_LIBRARIES} )
ADD_DEFINITIONS( ${DD4hep_DEFINITIONS} )

FIND_PACKAGE( aidaTT REQUIRED )
ADD_DEFINITIONS( "-D AIDATT_USE_DD4HEP -DUSE_GBL -DUSE_LCIO" )
ADD_DEFINITIONS( "-D AIDATT_USE_DD4HEP -DUSE_GBL -DUSE_LCIO" )
INCLUDE_DIRECTORIES( SYSTEM ${aidaTT_INCLUDE_DIRS} )
LINK_LIBRARIES( ${aidaTT_LIBRARIES} )
ADD_DEFINITIONS( ${aidaTT_DEFINITIONS} )
Expand Down Expand Up @@ -134,7 +134,7 @@ IF(CMAKE_GENERATOR MATCHES "Xcode")
ADD_SHARED_LIBRARY( ${PROJECT_NAME} ${library_sources} ${library_headers})
ELSE()
ADD_SHARED_LIBRARY( ${PROJECT_NAME} ${library_sources} )
ENDIF()
ENDIF()

INSTALL_SHARED_LIBRARY( ${PROJECT_NAME} DESTINATION lib )

Expand Down
2 changes: 1 addition & 1 deletion cmake/MarlinTrkConfig.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ INCLUDE( "@ILCSOFT_CMAKE_MODULES_ROOT@/MacroCheckPackageLibs.cmake" )
# additional components are set by cmake in variable PKG_FIND_COMPONENTS
# first argument should be the package name
CHECK_PACKAGE_LIBS( MarlinTrk MarlinTrk )

# ---------- final checking ---------------------------------------------------
INCLUDE( FindPackageHandleStandardArgs )
# set MARLINTRK_FOUND to TRUE if all listed variables are TRUE and not empty
Expand Down
2 changes: 1 addition & 1 deletion doc/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ IF( DOXYGEN_FOUND )
# build documentation out-of-source
SET( DOC_SRC_DIR "${PROJECT_SOURCE_DIR}/doc" )
SET( DOC_BIN_DIR "${PROJECT_BINARY_DIR}/docbuild" )

# directories to search for documentation
SET( DOX_INPUT ../include ../src )

Expand Down
1,026 changes: 513 additions & 513 deletions doc/Doxyfile

Large diffs are not rendered by default.

158 changes: 74 additions & 84 deletions include/MarlinTrk/ConfigFlags.h
Original file line number Diff line number Diff line change
@@ -1,94 +1,84 @@
#ifndef ConfigFlags_h
#define ConfigFlags_h

#include <string>
#include <iostream>
#include <exception>
#include <iostream>
#include <map>
#include <string>

namespace MarlinTrk {

class ConfigFlags ;

inline std::ostream& operator<<(std::ostream& os, const ConfigFlags& cf) ;

class ConfigFlags{

friend std::ostream& operator<<(std::ostream& os, const ConfigFlags& flags) ;

typedef std::pair<std::string, bool> Flag ;
typedef std::map< unsigned, Flag > Map ;


public:

/** Helper class that holds a number of boolean properties for configuration.
* The property keys (type: unsigned) have to be defined in the class using
* this class.
*/
ConfigFlags() {}

~ConfigFlags(){}


void registerOption( unsigned key, const std::string& name, bool defaultValue=false ){

_map[ key ] = std::make_pair( name , defaultValue ) ;
}

bool option(unsigned key) const {

Map::const_iterator it = _map.find( key ) ;

if( it == _map.end() )
return false ;

return it->second.second ;
}

bool operator[](unsigned key) const {
return option( key ) ;
}

void setOption(unsigned key , bool val) {

Map::iterator it = _map.find( key ) ;

if( it !=_map.end() )
it->second.second = val ;
}


std::string& optionName(unsigned key) {

static std::string empty("UNKNOWN") ;

Map::iterator it = _map.find( key ) ;

if( it == _map.end() )
return empty ;

return it->second.first ;
}

protected:
Map _map{};

};


inline std::ostream& operator<<(std::ostream& os, const MarlinTrk::ConfigFlags& cf) {

for( ConfigFlags::Map::const_iterator it = cf._map.begin(); it != cf._map.end() ; ++it){

os << " option: " << it->second.first << "\t: " << it->second.second << std::endl ;
}

return os ;
}

} // namespace

class ConfigFlags;

#endif
inline std::ostream& operator<<(std::ostream& os, const ConfigFlags& cf);

class ConfigFlags {

friend std::ostream& operator<<(std::ostream& os, const ConfigFlags& flags);

typedef std::pair<std::string, bool> Flag;
typedef std::map<unsigned, Flag> Map;

public:
/** Helper class that holds a number of boolean properties for configuration.
* The property keys (type: unsigned) have to be defined in the class using
* this class.
*/
ConfigFlags() {}

~ConfigFlags() {}

void registerOption(unsigned key, const std::string& name, bool defaultValue = false) {

_map[key] = std::make_pair(name, defaultValue);
}

bool option(unsigned key) const {

Map::const_iterator it = _map.find(key);

if (it == _map.end())
return false;

return it->second.second;
}

bool operator[](unsigned key) const { return option(key); }

void setOption(unsigned key, bool val) {

Map::iterator it = _map.find(key);

if (it != _map.end())
it->second.second = val;
}

std::string& optionName(unsigned key) {

static std::string empty("UNKNOWN");

Map::iterator it = _map.find(key);

if (it == _map.end())
return empty;

return it->second.first;
}

protected:
Map _map{};
};

inline std::ostream& operator<<(std::ostream& os, const MarlinTrk::ConfigFlags& cf) {

for (ConfigFlags::Map::const_iterator it = cf._map.begin(); it != cf._map.end(); ++it) {

os << " option: " << it->second.first << "\t: " << it->second.second << std::endl;
}

return os;
}

} // namespace MarlinTrk

#endif
125 changes: 59 additions & 66 deletions include/MarlinTrk/DiagnosticsController.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#ifndef DiagnosticsController_h
#define DiagnosticsController_h
#define DiagnosticsController_h

#include "MarlinTrk/MarlinTrkDiagnostics.h"

Expand All @@ -11,79 +11,72 @@ class TTree;
class TKalMatrix;

namespace EVENT {
class MCParticle;
class MCParticle;
}

class ILDVTrackHit;
class TKalTrackSite;
class MarlinTrkNtuple;

namespace MarlinTrk{

class MarlinKalTestTrack;
class IMarlinTrack;


class DiagnosticsController {

public:

/** constructor */
DiagnosticsController();

/** Destructor */
virtual ~DiagnosticsController();


void init(std::string root_file_name, std::string root_Tree_name, bool _recording_on=true ) ;

void new_track(MarlinKalTestTrack* trk) ;

void set_intial_track_parameters(double d0, double phi0, double omega, double z0, double tanL, double pivot_x, double pivot_y, double pivot_z, TKalMatrix& cov);

void record_site(ILDVTrackHit* hit, TKalTrackSite* site);

void record_rejected_site(ILDVTrackHit* hit, TKalTrackSite* site);

void skip_current_track();

void end_track() ;

void end();


private:

DiagnosticsController(const DiagnosticsController&) ; // Prevent copy-construction
DiagnosticsController& operator=(const DiagnosticsController&) ; // Prevent assignment

void clear_track_record();

bool _initialised;
bool _recording_on;

int _ntracks_written;
int _ntracks_skipped;

std::string _root_file_name;
std::string _root_tree_name;

TFile* _root_file;
TTree* _tree;
MarlinTrkNtuple* _track_record;

MarlinKalTestTrack* _current_track;

EVENT::MCParticle* _currentMCP;

bool _mcpInfoStored;
bool _skip_track;


};
namespace MarlinTrk {

class MarlinKalTestTrack;
class IMarlinTrack;

}
class DiagnosticsController {

public:
/** constructor */
DiagnosticsController();

/** Destructor */
virtual ~DiagnosticsController();

void init(std::string root_file_name, std::string root_Tree_name, bool _recording_on = true);

void new_track(MarlinKalTestTrack* trk);

void set_intial_track_parameters(double d0, double phi0, double omega, double z0, double tanL, double pivot_x,
double pivot_y, double pivot_z, TKalMatrix& cov);

void record_site(ILDVTrackHit* hit, TKalTrackSite* site);

void record_rejected_site(ILDVTrackHit* hit, TKalTrackSite* site);

void skip_current_track();

void end_track();

void end();

private:
DiagnosticsController(const DiagnosticsController&); // Prevent copy-construction
DiagnosticsController& operator=(const DiagnosticsController&); // Prevent assignment

void clear_track_record();

bool _initialised;
bool _recording_on;

int _ntracks_written;
int _ntracks_skipped;

std::string _root_file_name;
std::string _root_tree_name;

TFile* _root_file;
TTree* _tree;
MarlinTrkNtuple* _track_record;

MarlinKalTestTrack* _current_track;

EVENT::MCParticle* _currentMCP;

bool _mcpInfoStored;
bool _skip_track;
};

} // namespace MarlinTrk

#endif

Expand Down
Loading

0 comments on commit c3656bf

Please sign in to comment.