Skip to content
Merged
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
4 changes: 2 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ PROJECT( MarlinTrkProcessors )

# project version
SET( ${PROJECT_NAME}_VERSION_MAJOR 2 )
SET( ${PROJECT_NAME}_VERSION_MINOR 15 )
SET( ${PROJECT_NAME}_VERSION_PATCH 2 )
SET( ${PROJECT_NAME}_VERSION_MINOR 17 )
SET( ${PROJECT_NAME}_VERSION_PATCH 0 )

cmake_policy(SET CMP0008 NEW)

Expand Down
11 changes: 5 additions & 6 deletions source/Refitting/include/RefitFinal.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,10 @@ class IMarlinTrack;
} // namespace MarlinTrk

class RefitFinal : public marlin::Processor {

/// Nhits cut struct
struct NHitsCut{
std::vector<int> detIDs {} ; // list of detectors IDs from which hits will be summed
int nHits_min {}; // minimum number of hits
struct NHitsCut {
std::vector<int> detIDs{}; // list of detectors IDs from which hits will be summed
int nHits_min{}; // minimum number of hits
};

public:
Expand Down Expand Up @@ -80,8 +79,8 @@ class RefitFinal : public marlin::Processor {
bool _MSOn = true;
bool _ElossOn = true;

StringVec _NHitsCutsStr {};
std::vector<NHitsCut> _NHitsCuts {};
StringVec _NHitsCutsStr{};
std::vector<NHitsCut> _NHitsCuts{};
double _ReducedChi2Cut = -1.0;

bool _SmoothOn = false;
Expand Down
10 changes: 4 additions & 6 deletions source/Refitting/src/RefitFinal.cc
Original file line number Diff line number Diff line change
Expand Up @@ -232,10 +232,10 @@ void RefitFinal::processEvent(LCEvent* evt) {
auto lcioTrkPtr = lcio_trk.release();

// if required apply the ReducedChi2 cut
if (_ReducedChi2Cut > 0. && lcioTrkPtr->getChi2()/lcioTrkPtr->getNdf() > _ReducedChi2Cut) {
if (_ReducedChi2Cut > 0. && lcioTrkPtr->getChi2() / lcioTrkPtr->getNdf() > _ReducedChi2Cut) {
streamlog_out(DEBUG5) << "Skip track " << lcioTrkPtr->id() << ": "
<< "Chi2/ndof " << lcioTrkPtr->getChi2()/lcioTrkPtr->getNdf() << std::endl;
counter++;
<< "Chi2/ndof " << lcioTrkPtr->getChi2() / lcioTrkPtr->getNdf() << std::endl;
counter++;
continue;
}

Expand All @@ -251,10 +251,9 @@ void RefitFinal::processEvent(LCEvent* evt) {
}

} // for loop to the tracks
streamlog_out(MESSAGE4) << " Final number of tracks " << trackVec->getNumberOfElements()
streamlog_out(MESSAGE4) << " Final number of tracks " << trackVec->getNumberOfElements()
<< " Skipped tracks: " << counter << std::endl;


evt->addCollection(trackVec, _output_track_col_name);
if (input_rel_col) {
evt->addCollection(trackRelationCollection, _output_track_rel_name);
Expand Down Expand Up @@ -299,4 +298,3 @@ int RefitFinal::FitInit2(Track* track, MarlinTrk::IMarlinTrack* marlinTrk) {

return MarlinTrk::IMarlinTrack::success;
}

95 changes: 53 additions & 42 deletions source/Utils/include/FilterClusters.h
Original file line number Diff line number Diff line change
@@ -1,56 +1,67 @@
#pragma once

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

//#include <ACTSTracking/GeometryIdMappingTool.hxx>
// #include <ACTSTracking/GeometryIdMappingTool.hxx>

namespace TrackPerf
{
}
namespace TrackPerf {}

class FilterClusters : public marlin::Processor
{
class FilterClusters : public marlin::Processor {
public:
virtual Processor* newProcessor() { return new FilterClusters ; }
virtual Processor* newProcessor() { return new FilterClusters; }

FilterClusters(const FilterClusters &) = delete ;
FilterClusters& operator =(const FilterClusters &) = delete ;
FilterClusters() ;
FilterClusters(const FilterClusters&) = delete;
FilterClusters& operator=(const FilterClusters&) = delete;
FilterClusters();

/** Called at the begin of the job before anything is read.
* Use to initialize the processor, e.g. book histograms.
*/
virtual void init() ;
/** Called at the begin of the job before anything is read.
* Use to initialize the processor, e.g. book histograms.
*/
virtual void init();

/** Called for every run.
*/
virtual void processRunHeader( LCRunHeader* run ) ;
/** Called for every run.
*/
virtual void processRunHeader(LCRunHeader* run);

/** Called for every event - the working horse.
*/
virtual void processEvent(LCEvent* evt) ;
/** Called for every event - the working horse.
*/
virtual void processEvent(LCEvent* evt);


/** Called after data processing for clean up.
*/
virtual void end() ;
/** Called after data processing for clean up.
*/
virtual void end();

private:
//! Input track collection
std::string _InTrackerHitCollection {};
std::string _InRelationCollection {};

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

//! Ranges for theta
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 {};

};
//! 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{};

//! Cut-offs for cluster size in various theta ranges
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;
};
88 changes: 39 additions & 49 deletions source/Utils/include/FilterConeHits.h
Original file line number Diff line number Diff line change
@@ -1,16 +1,15 @@
#ifndef FilterConeHits_h
#define FilterConeHits_h 1

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

#include <TH1F.h>

using namespace lcio ;
using namespace marlin ;

using namespace lcio;
using namespace marlin;

/** Utility processor that selects and saves the tracker hits that are included in
* a DeltaR cone around the MC particle direction along with the corresponding
Expand All @@ -32,62 +31,53 @@ using namespace marlin ;
*/

class FilterConeHits : public Processor {

public:

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


FilterConeHits() ;
public:
virtual Processor* newProcessor() { return new FilterConeHits; }

FilterConeHits();
FilterConeHits(const FilterConeHits&) = delete;
FilterConeHits& operator=(const FilterConeHits&) = delete;

virtual void init() ;

virtual void processRunHeader( LCRunHeader* run ) ;

virtual void processEvent( LCEvent * evt ) ;

virtual void check( LCEvent * evt ) ;

virtual void end() ;


protected:

// --- Input/output collection names:
std::string m_inputMCParticlesCollName{} ;
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{} ;
virtual void init();

virtual void processRunHeader(LCRunHeader* run);

virtual void processEvent(LCEvent* evt);

virtual void check(LCEvent* evt);

virtual void end();

protected:
// --- Input/output collection names:
std::string m_inputMCParticlesCollName{};
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{} ;
bool m_fillHistos{};
double m_deltaRCut{};
double m_dist3DCut{};

// --- Diagnostic histograms:
TH1F* m_distXY = nullptr ;
TH1F* m_distZ = nullptr ;
TH1F* m_dist3D = nullptr ;
TH1F* m_angle = nullptr ;
TH1F* m_pathLength = nullptr ;
TH1F* m_time = nullptr ;
TH1F* m_distXY = nullptr;
TH1F* m_distZ = nullptr;
TH1F* m_dist3D = nullptr;
TH1F* m_angle = nullptr;
TH1F* m_pathLength = nullptr;
TH1F* m_time = nullptr;

// --- Magneti field value
double m_magneticField{} ;
double m_magneticField{};
const double trackerOuterRadius = 1500.; // mm

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

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

#endif



Loading