Skip to content
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
7 changes: 3 additions & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,8 @@ find_package( DD4hep REQUIRED COMPONENTS DDRec)
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${DD4hep_ROOT}/cmake )
include( DD4hep )

find_package( ROOT REQUIRED )
set( ROOT_COMPONENT_LIBRARIES Geom Reflex)
#find_package( ROOT REQUIRED )
#set( ROOT_COMPONENT_LIBRARIES Geom Reflex TMVA)

if(DD4HEP_USE_XERCESC)
find_package(XercesC)
Expand All @@ -78,8 +78,7 @@ include(DD4hep_XML_setup)
INCLUDE_DIRECTORIES( BEFORE SYSTEM ${DD4hep_INCLUDE_DIRS} )
LINK_LIBRARIES( ${DD4hep_LIBRARIES} ${DD4hep_COMPONENT_LIBRARIES} )

#FIND_PACKAGE( ROOT REQUIRED )

FIND_PACKAGE( ROOT REQUIRED COMPONENTS Geom TMVA)
INCLUDE_DIRECTORIES( SYSTEM ${ROOT_INCLUDE_DIRS} )
LINK_LIBRARIES( ${ROOT_LIBRARIES} )
ADD_DEFINITIONS( ${ROOT_DEFINITIONS} )
Expand Down
104 changes: 104 additions & 0 deletions source/Utils/include/FilterJetConeHits.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
#ifndef FilterJetConeHits_h
#define FilterJetConeHits_h 1

#include "marlin/Processor.h"
#include "lcio.h"
#include <string>
#include <vector>

#include <TH1F.h>

#include <EVENT/MCParticle.h>
#include <EVENT/ReconstructedParticle.h>
#include "IMPL/ReconstructedParticleImpl.h"

using namespace lcio ;
using namespace marlin ;


/** Utility processor that selects and saves the tracker hits that are included in
* a DeltaR cone around the jet direction direction along with the corresponding
* sim hits and the reco-sim relations.
*
* @parameter MCParticleCollection name of the MCParticle collection
* @parameter TrackerHitInputCollections name of the tracker hit input collections
* @parameter TrackerSimHitInputCollections name of the tracker simhit input collections
* @parameter TrackerHitInputRelations name of the tracker hit relation input collections
* @parameter TrackerHitOutputCollections name of the tracker hit output collections
* @parameter TrackerSimHitOutputCollections name of the tracker simhit output collections
* @parameter TrackerHitOutputRelations name of the tracker hit relation output collections
* @parameter DeltaRCut maximum angular distance between the hits and the particle direction
* @parameter FillHistograms flag to fill the diagnostic histograms
*
* @author L. Sestini, INFN Padova
* @date 18 March 2021
* @version $Id: $
*/

class FilterJetConeHits : public Processor {

public:

virtual Processor* newProcessor() { return new FilterJetConeHits ; }


FilterJetConeHits() ;

virtual void init() ;

virtual void processRunHeader( LCRunHeader* run ) ;

virtual void processEvent( LCEvent * evt ) ;

virtual void check( LCEvent * evt ) ;

virtual void end() ;

bool filterJetBib(ReconstructedParticle* jet);

void saveJet( ReconstructedParticle* jet, LCCollectionVec* jetsColl );

void directionCorrection( const double* p, double* pcorr ) ;

protected:

// --- Input/output collection names:
std::string m_inputJetCaloCollName{} ;
std::string m_filteredJetCaloCollName{} ;
std::vector<std::string> m_inputTrackerHitsCollNames{} ;
std::vector<std::string> m_inputTrackerSimHitsCollNames{} ;
std::vector<std::string> m_inputTrackerHitRelNames{} ;
std::vector<std::string> m_outputTrackerHitsCollNames{} ;
std::vector<std::string> m_outputTrackerSimHitsCollNames{} ;
std::vector<std::string> m_outputTrackerHitRelNames{} ;


// --- Processor parameters:
bool m_fillHistos{} ;
double m_deltaRCut{} ;

// Jet filter parameters with BIB:
double m_minDaughterMaxPt{} ;
int m_minNTracks{} ;
bool m_createFilteredJets{} ;

// Jet direction correction params
bool m_makeDirCorrection{} ;
double m_corrConst{};
double m_corrLin{};
double m_corrQuad{};
double m_corrCub{};

// --- Diagnostic histograms:
TH1F* m_dist = nullptr ;

// --- Run and event counters:
int _nRun{} ;
int _nEvt{} ;

} ;

#endif



43 changes: 41 additions & 2 deletions source/Utils/include/FilterTracks.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,13 @@ namespace TrackPerf
* @parameter NHitsVertex Minimum number of hits on vertex detector
* @parameter NHitsInner Minimum number of hits on inner tracker
* @parameter NHitsOuter Minimum number of hits on outer tracker
* @parameter MaxOutliers Maximum number of outliers hits on track
* @parameter MaxHoles Maximum number of holes on track
* @parameter MinNdf Minimum value for ndf
* @parameter MinPt Minimum transverse momentum
* @parameter MaxPt Max transverse momentum
* @parameter MinTheta Minimum theta
* @parameter MaxTheta Max theta
* @parameter Chi2Spatial Spatial chi squared
*
* @author N. Bruhwiler
Expand Down Expand Up @@ -70,14 +76,47 @@ class FilterTracks : public marlin::Processor
int _NHitsInner = 2;
//! Cut off for number of hits in outer tracker (barrel and endcap combined)
int _NHitsOuter = 1;
//! Cut off for number of holes
int _MaxHoles = 10;

//! Cut off for momentum (GeV)
float _MinPt = 1.0; //units GeV
float _MinPt = 0.5; //units GeV
float _MaxPt = 1000.0; //units GeV

//! Cut off for theta (rad)
float _MinTheta = 0;
float _MaxTheta = 3.14;

//! Cut off for the value ndf
int _MinNdf = 1;
float _MaxReducedChi2 = 1.e20;

//! Cut off for outliers number
int _MaxOutl = 10;

//! Cut off for ratio outliers/tot hits
float _MaxOutlOverHits = 1.;

//! Cut off for spatial and temporal chi squared values
float _Chi2Spatial = 0;

//! Cut off for all track parameters uncertainties
float _MaxSigD0 = 999;
float _MaxSigZ0 = 999;
float _MaxSigTheta = 999;
float _MaxSigPhi = 999;
float _MaxSigQoverP = 999;

float _MaxD0 = 999.;
float _MaxZ0 = 999.;

//! NN parameters
std::string _NNmethod = ""; // if defined apply the NN
std::string _NNweights = ""; // xml file with weights
std::vector<std::string> _NNvars; // sorted list of variables used by NN
float _NNthr = 0; // NN threshold

//! Default magnetic field value (Tesla)
float _Bz = 3.57;
float _Bz = 5.0;
};

Loading
Loading