Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improving the hit-time and cluster filter processors with proper input and output collections #19

Open
wants to merge 16 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 2 additions & 30 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# cmake file for building MarlinTrkProcessors
# - based on $MARLIN/example/mymarlin/CMakeLists.txt
# by @author Jan Engels, Desy IT
CMAKE_MINIMUM_REQUIRED(VERSION 2.6 FATAL_ERROR)
CMAKE_MINIMUM_REQUIRED(VERSION 3.15 FATAL_ERROR)
########################################################


Expand All @@ -20,23 +20,6 @@ cmake_policy(SET CMP0008 NEW)

FIND_PACKAGE( ILCUTIL REQUIRED COMPONENTS ILCSOFT_CMAKE_MODULES )

# load default settings from ILCSOFT_CMAKE_MODULES
INCLUDE( ilcsoft_default_settings )

SET( COMPILER_FLAGS "-Wno-effc++" )
MESSAGE( STATUS "FLAGS ${COMPILER_FLAGS}" )
FOREACH( FLAG ${COMPILER_FLAGS} )
CHECK_CXX_COMPILER_FLAG( "${FLAG}" CXX_FLAG_WORKS_${FLAG} )
IF( ${CXX_FLAG_WORKS_${FLAG}} )
MESSAGE ( STATUS "Adding ${FLAG} to CXX_FLAGS" )
### We append the flag, so they overwrite things from somewhere else
SET ( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${FLAG} ")
ELSE()
MESSAGE ( STATUS "NOT Adding ${FLAG} to CXX_FLAGS" )
ENDIF()
ENDFOREACH()

Comment on lines -23 to -38

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would keep these. With #20 the warnings should be fixed so that output should be manageable again.


FIND_PACKAGE( Marlin 1.0 REQUIRED ) # minimum required Marlin version
INCLUDE_DIRECTORIES( SYSTEM ${Marlin_INCLUDE_DIRS} )
LINK_LIBRARIES( ${Marlin_LIBRARIES} )
Expand Down Expand Up @@ -128,16 +111,5 @@ INCLUDE_DIRECTORIES( . ./source/Digitisers/include ./source/Refitting/include ./
# add library
FILE( GLOB_RECURSE library_sources "source/*.cc" )

# needed for adding header files to xcode project
IF(CMAKE_GENERATOR MATCHES "Xcode")
FILE( GLOB_RECURSE library_headers "*.h" )
ADD_SHARED_LIBRARY( ${PROJECT_NAME} ${library_sources} ${library_headers})
ELSE()
ADD_SHARED_LIBRARY( ${PROJECT_NAME} ${library_sources} )
ENDIF()

INSTALL_SHARED_LIBRARY( ${PROJECT_NAME} DESTINATION lib )

# display some variables and write them to cache
DISPLAY_STD_VARIABLES()
ADD_LIBRARY( ${PROJECT_NAME} SHARED ${library_sources} )
Comment on lines -131 to +114

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No strong opinion on removing this. It's still present in iLCSoft/MarlinTrkProcessors. However what definitely has to stay is the installation of the library that we build, as otherwise we will not be able to use the processors when we use this into a software stack.


26 changes: 21 additions & 5 deletions source/Utils/include/FilterClusters.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#pragma once

#include <marlin/Processor.h>
#include <TH1F.h>

//#include <ACTSTracking/GeometryIdMappingTool.hxx>

Expand Down Expand Up @@ -39,18 +40,33 @@ class FilterClusters : public marlin::Processor
//! Input track collection
std::string _InTrackerHitCollection {};
std::string _InRelationCollection {};
std::string _InSimTrackerHitCollection {};

//! Output track collection
std::string _OutTrackerHitCollection {};
std::string _OutRelationCollection {};
std::string _OutSimTrackerHitCollection {};

//! Ranges for theta
std::vector<std::string> _ThetaRanges;
std::vector<std::string> _ThetaRanges;

//! Cut-offs for cluster size in various theta ranges
std::vector<std::string> _ClusterSize;

//! Layers to be filtered
std::vector<std::string> _Layers;
std::vector<std::string> _ClusterSize;

//! Layers to be filtered
std::vector<std::string> _Layers;

//!Number of bins in theta
std::string _ThetaBins;

bool m_fillHistos{};

// --- Diagnostic histograms:
TH1F *m_clusterTheta_beforeCut = nullptr;
TH1F *m_clusterTheta_afterCut = nullptr;
TH1F *m_clusterLayer_beforeCut = nullptr;
TH1F *m_clusterLayer_afterCut = nullptr;
TH1F *m_clusterSize_beforeCut = nullptr;
TH1F *m_clusterSize_afterCut = nullptr;

};
20 changes: 16 additions & 4 deletions source/Utils/include/FilterTimeHits.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@
#include <string>
#include <vector>

#include <EVENT/TrackerHitPlane.h>
#include <EVENT/SimTrackerHit.h>

#include "DDRec/Surface.h"
#include "DDRec/SurfaceManager.h"

Expand Down Expand Up @@ -55,10 +58,12 @@ class FilterTimeHits : public Processor

protected:
// --- Input/output collection names:
std::vector<std::string> m_inputTrackerHitsCollNames{};
std::vector<std::string> m_inputTrackerSimHitsCollNames{};
std::vector<std::string> m_inputTrackerHitRelNames{};
std::vector<std::string> m_inputTrackerHitsCollNames{}; /// Reconstructed clusters
std::vector<std::string> m_inputTrackerHitsConstituentsCollNames{}; // Individual hits in clusters (if available)
std::vector<std::string> m_inputTrackerSimHitsCollNames{}; // Simulated energy deposits (if available)
std::vector<std::string> m_inputTrackerHitRelNames{}; // Relations between reconstructed clusters and simulated ones (if available)
std::vector<std::string> m_outputTrackerHitsCollNames{};
std::vector<std::string> m_outputTrackerHitsConstituentsCollNames{};
std::vector<std::string> m_outputTrackerSimHitsCollNames{};
std::vector<std::string> m_outputTrackerHitRelNames{};

Expand All @@ -69,7 +74,14 @@ class FilterTimeHits : public Processor
double m_time_max{};

// --- Diagnostic histograms:
TH1F *m_corrected_time = nullptr;
TH1F *m_corrected_time_before = nullptr;
TH1F *m_corrected_time_after = nullptr;

// ---- Utility functions
// Make a full copy of a TrackerHitPlane object (no copy-constructor defined)
TrackerHitPlane* copyTrackerHitPlane(TrackerHitPlane *hit);
// Make a fully copy of a SimTrackerHit object
SimTrackerHit* copySimTrackerHit(SimTrackerHit *hit);

// --- Run and event counters:
int _nRun{};
Expand Down
Loading
Loading