Skip to content

Commit

Permalink
Merge branch 'master' into mc
Browse files Browse the repository at this point in the history
  • Loading branch information
bartosik-hep committed Apr 17, 2023
2 parents 90bf13b + 618722f commit 2107da1
Show file tree
Hide file tree
Showing 20 changed files with 932 additions and 582 deletions.
21 changes: 21 additions & 0 deletions .github/workflows/coverity.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: coverity

on:
schedule:
- cron: '0 0 * * *'

jobs:
run-coverity:
runs-on: ubuntu-latest
if: github.repository == 'iLCSoft/MarlinTrkProcessors'
steps:
- uses: actions/checkout@v2
- uses: cvmfs-contrib/github-action-cvmfs@v2
- uses: aidasoft/run-lcg-view@v3
with:
coverity-cmake-command: 'cmake -C $ILCSOFT/ILCSoft.cmake ..'
coverity-project: 'iLCSoft%2FMarlinTrkProcessors'
coverity-project-token: ${{ secrets.MARLINTRKPROCESSORS_COVERITY_TOKEN }}
github-pat: ${{ secrets.READ_COVERITY_IMAGE }}
view-path: "/cvmfs/clicdp.cern.ch/iLCSoft/lcg/100/nightly/x86_64-centos7-gcc10-opt"
setup-script: "init_ilcsoft.sh"
26 changes: 26 additions & 0 deletions .github/workflows/linux.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: linux
on: [push, pull_request]

jobs:
centos7:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
COMPILER: [gcc10, clang11]
LCG: [100]

steps:
- uses: actions/checkout@v3
- uses: cvmfs-contrib/github-action-cvmfs@v3
- uses: aidasoft/run-lcg-view@v4
with:
view-path: "/cvmfs/clicdp.cern.ch/iLCSoft/lcg/${{ matrix.LCG }}/nightly/x86_64-centos7-${{ matrix.COMPILER }}-opt"
setup-script: "init_ilcsoft.sh"
run: |
mkdir build
cd build
cmake -GNinja -C ${ILCSOFT}/ILCSoft.cmake -DCMAKE_CXX_FLAGS=" -fdiagnostics-color=always " -DINSTALL_DOC=ON ..
ninja -k0
ctest --output-on-failure
ninja install
12 changes: 0 additions & 12 deletions .travis-ci.d/compile_and_test.sh

This file was deleted.

12 changes: 0 additions & 12 deletions .travis-ci.d/coverity_scan.sh

This file was deleted.

66 changes: 0 additions & 66 deletions .travis.yml

This file was deleted.

2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
v02-14-MC
- Add `FilterTracks` processor for filtering tracks.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ PROJECT( MarlinTrkProcessors )

# project version
SET( ${PROJECT_NAME}_VERSION_MAJOR 2 )
SET( ${PROJECT_NAME}_VERSION_MINOR 13 )
SET( ${PROJECT_NAME}_VERSION_MINOR 14 )
SET( ${PROJECT_NAME}_VERSION_PATCH 0 )

cmake_policy(SET CMP0008 NEW)
Expand Down
3 changes: 2 additions & 1 deletion doc/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ IF( DOXYGEN_FOUND )
# directories to search for documentation
SET( DOX_INPUT ../source )

FILE(GLOB DOXYGEN_SOURCES ../source/*/*/*)

# custom command to build documentation
ADD_CUSTOM_COMMAND(
Expand All @@ -26,7 +27,7 @@ IF( DOXYGEN_FOUND )
"${DOXYGEN_EXECUTABLE}"
WORKING_DIRECTORY "${DOC_SRC_DIR}"
COMMENT "Building API Documentation..."
DEPENDS Doxyfile CMakeLists.txt ../source/*/*/*
DEPENDS Doxyfile CMakeLists.txt ${DOXYGEN_SOURCES}
)

# add doc target
Expand Down
36 changes: 36 additions & 0 deletions doc/ReleaseNotes.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,39 @@
# v02-12-02

* 2022-11-23 Thomas Madlener ([PR#62](https://github.com/iLCSoft/MarlinTrkProcessors/pull/62))
- Make sure that the `_histos` pointer is at least initialized to a `nullptr` to avoid a spurious seg fault when trying to delete it uninitialized.

# v02-12-01

* 2022-06-28 Thomas Madlener ([PR#61](https://github.com/iLCSoft/MarlinTrkProcessors/pull/61))
- Make doxygen cmake config work with newer cmakes

# v02-12

* 2021-11-05 Bohdan Dudar ([PR#55](https://github.com/iLCSoft/MarlinTrkProcessors/pull/55))
- Center of the SET strips is now properly in the middle of the sensor modules.
- Removed unused `vertex_x`, `vertex_y`, `vertex_z` steering parameters.

* 2021-09-22 Nazar Bartosik ([PR#53](https://github.com/iLCSoft/MarlinTrkProcessors/pull/53))
- Added time smearing to the DDPlanarDigiProcessor
- Introduced a time window for digitized hits in the DDPlanarDigiProcessor
- Introduced TOF compensation for digitized hits in the DDPlanarDigiProcessor

* 2021-09-02 Placido Fernandez Declara ([PR#49](https://github.com/iLCSoft/MarlinTrkProcessors/pull/49))
- DDPlanarDigiProcessor: Add setting of the fromType and toType parameters for the LCRelation collection between TrackerHit and SimTrackerHit

* 2021-08-23 Andre Sailer ([PR#51](https://github.com/iLCSoft/MarlinTrkProcessors/pull/51))
- CI: build against LCG_99python2 gcc8 and LCG_100 gcc10, clang11

* 2020-06-02 Erica Brondolin ([PR#45](https://github.com/iLCSoft/MarlinTrkProcessors/pull/45))
- ClonesAndSplitTracksFinder
- If mergeSplitTracks set to `true`, pairs of tracks above a minimum pT requirements are compared in terms of pt, theta and phi
- For each pair of reconstructed tracks: calculate significance for each parameter, impose a cut on the significance for each parameter, remove possible common hits and sort them in r, fit the new merged track
- Results show positive effect on both single muons and complex events, with no significant increase of the run time ([Link to the slides](https://indico.cern.ch/event/920887/))

* 2020-01-27 Erica Brondolin ([PR#44](https://github.com/iLCSoft/MarlinTrkProcessors/pull/44))
- In case finaliseLCIOTrack fails in the RefitFinal, the track should not be saved

# v02-11

* 2019-08-21 Frank Gaede ([PR#43](https://github.com/iLCSoft/MarlinTrkProcessors/pull/43))
Expand Down
92 changes: 54 additions & 38 deletions source/Digitisers/src/DDPlanarDigiProcessor.cc
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
#include "UTIL/LCTrackerConf.h"
#include <UTIL/ILDConf.h>
#include <UTIL/BitSet32.h>
#include <UTIL/LCRelationNavigator.h>


#include "DD4hep/Detector.h"
Expand Down Expand Up @@ -70,10 +71,10 @@ DDPlanarDigiProcessor::DDPlanarDigiProcessor() : Processor("DDPlanarDigiProcesso
resVEx );

FloatVec resTEx ;
resTEx.push_back( 0.0 ) ;
resTEx.push_back( -1 ) ;

registerProcessorParameter( "ResolutionT" ,
"resolution of time - either one per layer or one for all layers " ,
"resolution of time - either one per layer or one for all layers. if the single entry is negative, disable time smearing. " ,
_resT ,
resTEx );

Expand Down Expand Up @@ -256,14 +257,12 @@ void DDPlanarDigiProcessor::processEvent( LCEvent * evt ) {

CellIDEncoder<TrackerHitPlaneImpl> cellid_encoder( lcio::LCTrackerCellID::encoding_string() , trkhitVec ) ;

LCCollectionVec* relCol = new LCCollectionVec(LCIO::LCRELATION);
// to store the weights
LCFlagImpl lcFlag(0) ;
lcFlag.setBit( LCIO::LCREL_WEIGHTED ) ;
relCol->setFlag( lcFlag.getFlag() ) ;

// Relation collection TrackerHit, SimTrackerHit
LCCollection* thsthcol = 0;
UTIL::LCRelationNavigator thitNav = UTIL::LCRelationNavigator( LCIO::TRACKERHITPLANE, LCIO::SIMTRACKERHIT );

CellIDDecoder<SimTrackerHit> cellid_decoder( STHcol) ;


int nSimHits = STHcol->getNumberOfElements() ;

Expand Down Expand Up @@ -353,30 +352,35 @@ void DDPlanarDigiProcessor::processEvent( LCEvent * evt ) {
// Smear time of the hit and apply the time window cut if needed
//***************************************************************

// Smearing time of the hit
float resT = _resT.size() > 1 ? _resT.at(layer) : _resT.at(0);
double tSmear = resT == 0.0 ? 0.0 : gsl_ran_gaussian( _rng, resT );
_h[hT]->Fill( resT == 0.0 ? 0.0 : tSmear / resT );
_h[diffT]->Fill( tSmear );

// Skipping the hit if its time is outside the acceptance time window
double hitT = simTHit->getTime() + tSmear;
streamlog_out(DEBUG3) << "smeared hit at T: " << simTHit->getTime() << " ns to T: " << hitT << " ns according to resolution: " << resT << " ns" << std::endl;
double hitT = simTHit->getTime();

float timeWindow_min = _timeWindow_min.size() > 1 ? _timeWindow_min.at(layer) : _timeWindow_min.at(0);
float timeWindow_max = _timeWindow_max.size() > 1 ? _timeWindow_max.at(layer) : _timeWindow_max.at(0);

// Smearing time of the hit
if (_resT.size() and _resT[0] > 0.0) {
float resT = _resT.size() > 1 ? _resT.at(layer) : _resT.at(0);
double tSmear = resT > 0.0 ? gsl_ran_gaussian( _rng, resT ) : 0.0;
_h[hT]->Fill( resT > 0.0 ? tSmear / resT : 0.0 );
_h[diffT]->Fill( tSmear );

hitT += tSmear;
streamlog_out(DEBUG3) << "smeared hit at T: " << simTHit->getTime() << " ns to T: " << hitT << " ns according to resolution: " << resT << " ns" << std::endl;
}

// Correcting for the propagation time
if (_correctTimesForPropagation) {
double dt = oldPos.r() / ( TMath::C() / 1e6 );
hitT -= dt;
streamlog_out(DEBUG3) << "corrected hit at R: " << oldPos.r() << " mm by propagation time: " << dt << " ns to T: " << hitT << " ns" << std::endl;
}

if (_useTimeWindow && ( hitT < timeWindow_min || hitT > timeWindow_max) ) {
streamlog_out(DEBUG4) << "hit at T: " << hitT << " smeared to: " << hitT << " is outside the time window: hit dropped" << std::endl;
++nDismissedHits;
continue;
// Skipping the hit if its time is outside the acceptance time window
if (_useTimeWindow) {
float timeWindow_min = _timeWindow_min.size() > 1 ? _timeWindow_min.at(layer) : _timeWindow_min.at(0);
float timeWindow_max = _timeWindow_max.size() > 1 ? _timeWindow_max.at(layer) : _timeWindow_max.at(0);
if ( hitT < timeWindow_min || hitT > timeWindow_max ) {
streamlog_out(DEBUG4) << "hit at T: " << simTHit->getTime() << " smeared to: " << hitT << " is outside the time window: hit dropped" << std::endl;
++nDismissedHits;
continue;
}
}


Expand Down Expand Up @@ -412,11 +416,25 @@ void DDPlanarDigiProcessor::processEvent( LCEvent * evt ) {
// dd4hep::rec::Vector3D newPosTmp = oldPos + uSmear * u ;
// if( ! _isStrip ) newPosTmp = newPosTmp + vSmear * v ;


dd4hep::rec::Vector3D newPosTmp = 1./dd4hep::mm * ( ! _isStrip ?
surf->localToGlobal( dd4hep::rec::Vector2D ( ( uL + uSmear ) * dd4hep::mm, ( vL + vSmear ) *dd4hep::mm ) ) :
surf->localToGlobal( dd4hep::rec::Vector2D ( ( uL + uSmear ) * dd4hep::mm, 0. ) )
) ;
dd4hep::rec::Vector3D newPosTmp;
if (_isStrip){
if (_subDetName == "SET"){
double xStripPos, yStripPos, zStripPos;
//Find intersection of the strip with the z=centerOfSensor plane to set it as the center of the SET strip
dd4hep::rec::Vector3D simHitPosSmeared = (1./dd4hep::mm) * ( surf->localToGlobal( dd4hep::rec::Vector2D( (uL+uSmear)*dd4hep::mm, 0.) ) );
zStripPos = surf->origin()[2] / dd4hep::mm ;
double lineParam = (zStripPos - simHitPosSmeared[2])/v[2];
xStripPos = simHitPosSmeared[0] + lineParam*v[0];
yStripPos = simHitPosSmeared[1] + lineParam*v[1];
newPosTmp = dd4hep::rec::Vector3D(xStripPos, yStripPos, zStripPos);
}
else{
newPosTmp = (1./dd4hep::mm) * ( surf->localToGlobal( dd4hep::rec::Vector2D( (uL+uSmear)*dd4hep::mm, 0. ) ) );
}
}
else{
newPosTmp = (1./dd4hep::mm) * ( surf->localToGlobal( dd4hep::rec::Vector2D( (uL+uSmear)*dd4hep::mm, (vL+vSmear)*dd4hep::mm ) ) );
}

streamlog_out( DEBUG1 ) << " hit at : " << oldPos
<< " smeared to: " << newPosTmp
Expand Down Expand Up @@ -507,14 +525,9 @@ void DDPlanarDigiProcessor::processEvent( LCEvent * evt ) {
//**************************************************************************
// Set Relation to SimTrackerHit
//**************************************************************************

LCRelationImpl* rel = new LCRelationImpl;

rel->setFrom (trkHit);
rel->setTo (simTHit);
rel->setWeight( 1.0 );
relCol->addElement(rel);

// Set relation with LCRelationNavigator
thitNav.addRelation(trkHit, simTHit);

//**************************************************************************
// Add hit to collection
Expand All @@ -527,6 +540,9 @@ void DDPlanarDigiProcessor::processEvent( LCEvent * evt ) {
streamlog_out(DEBUG3) << "-------------------------------------------------------" << std::endl;

}

// Create relation collection
thsthcol = thitNav.createLCCollection();

// Filling the fraction of accepted hits in the event
float accFraction = nSimHits > 0 ? float(nCreatedHits) / float(nSimHits) * 100.0 : 0.0;
Expand All @@ -537,7 +553,7 @@ void DDPlanarDigiProcessor::processEvent( LCEvent * evt ) {
//**************************************************************************

evt->addCollection( trkhitVec , _outColName ) ;
evt->addCollection( relCol , _outRelColName ) ;
evt->addCollection( thsthcol , _outRelColName ) ;

streamlog_out(DEBUG4) << "Created " << nCreatedHits << " hits, " << nDismissedHits << " hits dismissed\n";

Expand Down
Loading

0 comments on commit 2107da1

Please sign in to comment.