MyMarlinTPC  170316
Classes | Public Member Functions | Private Member Functions | Private Attributes | List of all members
marlintpc::RowBasedHitFinderProcessor Class Reference

#include <RowBasedHitFinderProcessor.h>

Inheritance diagram for marlintpc::RowBasedHitFinderProcessor:

Classes

class  hitCandidate
 

Public Member Functions

virtual Processor * newProcessor ()
 
 RowBasedHitFinderProcessor ()
 
virtual void init ()
 
virtual void processRunHeader (lcio::LCRunHeader *run)
 
virtual void processEvent (lcio::LCEvent *evt)
 
virtual void check (lcio::LCEvent *evt)
 
virtual void end ()
 

Private Member Functions

void _sortPulses (EVENT::LCCollection *, const gear::TPCParameters &, std::map< int, std::map< int, std::vector< EVENT::TrackerPulse *> * > * > &)
 
void _findHitCandidates (std::map< int, std::map< int, std::vector< EVENT::TrackerPulse *> * > * > &, const gear::TPCParameters &, std::map< int, std::vector< RowBasedHitFinderProcessor::hitCandidate > > &)
 
void _createHitCollection (std::map< int, std::vector< RowBasedHitFinderProcessor::hitCandidate > > &, const gear::TPCParameters &, IMPL::LCCollectionVec *)
 
bool _pulseComparator (EVENT::TrackerPulse *, EVENT::TrackerPulse *)
 
EVENT::TrackerPulse * _findHighestPulseInRow (std::vector< EVENT::TrackerPulse *> &)
 
bool _maxPulseHeightCheck (EVENT::TrackerPulse *)
 
void _addNeighbourPulses (hitCandidate &, const gear::TPCParameters &, std::vector< EVENT::TrackerPulse *> &)
 
std::vector< EVENT::TrackerPulse * >::iterator _findBestNeighbourPulseMatch (std::vector< std::vector< EVENT::TrackerPulse *>::iterator > &, float)
 
bool _hitIsValid (const RowBasedHitFinderProcessor::hitCandidate &)
 
gear::Vector3D _calculatePositionsAndErrors (const RowBasedHitFinderProcessor::hitCandidate &, const gear::TPCParameters &, float *)
 
double _convertCharge (const RowBasedHitFinderProcessor::hitCandidate &)
 
unsigned int _getMaxDeadChannels ()
 
int _getMinHitSize ()
 
double _getMinMaxPulseSliceHeight ()
 
double _getMaxTimeSpread ()
 
double _getDriftVelocity ()
 
bool _padIsDead (const int, const int)
 
bool _padIsNoisy (const int, const int)
 
double _getChargeConversionFactor ()
 

Private Attributes

std::string _inputTrackerPulsesCollectionName
 
std::string _outputTrackerHitsCollectionName
 
std::string _inputTPCConditionsCollectionName
 
std::string _channelCorrectionCollectionName
 
std::vector< int > _deadChannelIndicesOverride
 
bool _outputHitsPersistent
 
int _deprecated
 
int _maxEmptyChannelsOverride
 
int _maxDeadChannelsOverride
 
int _minHitSizeOverride
 
float _minMaxPulseSliceHeightOverride
 
float _maxTimeSpreadOverride
 
float _driftVelocityOverride
 
bool _chargeIsCalibrated
 
float _chargeConversionFactorOverride
 
ChannelCorrectionListener * _channelCorrectionListener
 
TPCConditionsListener * _tpcConditionsListener
 

Detailed Description

A hit finder for row based (pad) geometries It searches for connected pulses in a row and combines them into a hit. The position inside the row is calculated by a center-of-gravity w.r.t. to the charge of the individual pulses. The position on the row is fixed by the r/y coordinate of the row. The z-position is inherited from the pulse with the highest charge within the hit.

Author
Christoph Rosemann, DESY

Input - Prerequisites

Output

Parameters
InputTrackerPulsesName of input TrackerPulses collection (default: TPCPulses)
OutputTrackerHitsName of output TrackerHits collection (default: TPCHits)
InputTPCConditionsOPTIONAL: Name of the input collection containing the TPC conditions data (default: tpcconddata::TPCConditions::getDefaultColName() )
WriteOutputToStorage:boolIf true the output collection is written to file (default: true)
ChargeConversionIsCalibrated:boolSet true, if the charge conversion factor from ADC values to primary electrons is known (default:true).
MaxEmptyPadsOverrideMaximum number of consecutive empty pads in a row (default: 1)
MinHitSizeOverrideMinimum size of hit in number of pads (default: 1)
MinMaxPulseSliceHeightOverridMinimum size of the maximum pulse slice of the highest pulse in the hit (default: 12.)
MaxTimeSpreadOverrideMaximum time between pulses in a hit [in ns] (default: 200)
VDriftOverrideOPTIONAL: Set drift velocity in case there is no conditions data [in mm/us] (default: 0)
DeadPadsOverrideOPTIONAL: a vector of geometry indices of dead channels, default should be conditions data
ChargeConversionFactorOverrideOPTIONAL The factor to convert adc counts into number of primary electrons (-> should be conditions data)
UseGlobalCoordinatesOPTIONAL If set to true, the output coordinate system will be forced to global/cartesian; otherwise it is the local coordinate system of the pad plan (either polar or cartesian) (default: false)

List of open issues/questions:

Definition at line 70 of file RowBasedHitFinderProcessor.h.

Constructor & Destructor Documentation

◆ RowBasedHitFinderProcessor()

marlintpc::RowBasedHitFinderProcessor::RowBasedHitFinderProcessor ( )

Member Function Documentation

◆ _addNeighbourPulses()

void marlintpc::RowBasedHitFinderProcessor::_addNeighbourPulses ( hitCandidate ,
const gear::TPCParameters &  ,
std::vector< EVENT::TrackerPulse *> &   
)
private

◆ _calculatePositionsAndErrors()

Vector3D marlintpc::RowBasedHitFinderProcessor::_calculatePositionsAndErrors ( const RowBasedHitFinderProcessor::hitCandidate cand,
const gear::TPCParameters &  tpcParameters,
float *  covMatrix 
)
private

◆ _convertCharge()

double marlintpc::RowBasedHitFinderProcessor::_convertCharge ( const RowBasedHitFinderProcessor::hitCandidate cand)
private

◆ _createHitCollection()

void marlintpc::RowBasedHitFinderProcessor::_createHitCollection ( std::map< int, std::vector< RowBasedHitFinderProcessor::hitCandidate > > &  ,
const gear::TPCParameters &  ,
IMPL::LCCollectionVec *   
)
private

◆ _findBestNeighbourPulseMatch()

vector< TrackerPulse * >::iterator marlintpc::RowBasedHitFinderProcessor::_findBestNeighbourPulseMatch ( std::vector< std::vector< EVENT::TrackerPulse *>::iterator > &  ,
float   
)
private

Definition at line 610 of file RowBasedHitFinderProcessor.cc.

References _createHitCollection().

Referenced by _addNeighbourPulses().

◆ _findHighestPulseInRow()

TrackerPulse * marlintpc::RowBasedHitFinderProcessor::_findHighestPulseInRow ( std::vector< EVENT::TrackerPulse *> &  )
private

Definition at line 444 of file RowBasedHitFinderProcessor.cc.

Referenced by _findHitCandidates().

◆ _findHitCandidates()

void marlintpc::RowBasedHitFinderProcessor::_findHitCandidates ( std::map< int, std::map< int, std::vector< EVENT::TrackerPulse *> * > * > &  ,
const gear::TPCParameters &  ,
std::map< int, std::vector< RowBasedHitFinderProcessor::hitCandidate > > &   
)
private

now search in each row (of each module) a) for the highest pulse b) look for neighboring pulses c) store it in a candidate d) remove the stored pulses and redo from a)

Definition at line 380 of file RowBasedHitFinderProcessor.cc.

References _addNeighbourPulses(), _findHighestPulseInRow(), and _maxPulseHeightCheck().

Referenced by _sortPulses(), and processEvent().

◆ _getChargeConversionFactor()

double marlintpc::RowBasedHitFinderProcessor::_getChargeConversionFactor ( )
private

◆ _getDriftVelocity()

double marlintpc::RowBasedHitFinderProcessor::_getDriftVelocity ( )
private

◆ _getMaxDeadChannels()

unsigned int marlintpc::RowBasedHitFinderProcessor::_getMaxDeadChannels ( )
private

Definition at line 971 of file RowBasedHitFinderProcessor.cc.

References _maxDeadChannelsOverride.

Referenced by _addNeighbourPulses().

◆ _getMaxTimeSpread()

double marlintpc::RowBasedHitFinderProcessor::_getMaxTimeSpread ( )
private

Definition at line 1014 of file RowBasedHitFinderProcessor.cc.

References _maxTimeSpreadOverride.

Referenced by _addNeighbourPulses().

◆ _getMinHitSize()

int marlintpc::RowBasedHitFinderProcessor::_getMinHitSize ( )
private

Definition at line 985 of file RowBasedHitFinderProcessor.cc.

References _minHitSizeOverride.

Referenced by _hitIsValid().

◆ _getMinMaxPulseSliceHeight()

double marlintpc::RowBasedHitFinderProcessor::_getMinMaxPulseSliceHeight ( )
private

Definition at line 999 of file RowBasedHitFinderProcessor.cc.

References _minMaxPulseSliceHeightOverride.

Referenced by _maxPulseHeightCheck().

◆ _hitIsValid()

bool marlintpc::RowBasedHitFinderProcessor::_hitIsValid ( const RowBasedHitFinderProcessor::hitCandidate cand)
private

◆ _maxPulseHeightCheck()

bool marlintpc::RowBasedHitFinderProcessor::_maxPulseHeightCheck ( EVENT::TrackerPulse *  )
private

◆ _padIsDead()

bool marlintpc::RowBasedHitFinderProcessor::_padIsDead ( const int  padID,
const int  moduleID 
)
private

◆ _padIsNoisy()

bool marlintpc::RowBasedHitFinderProcessor::_padIsNoisy ( const int  moduleID,
const int  padID 
)
private

◆ _pulseComparator()

bool marlintpc::RowBasedHitFinderProcessor::_pulseComparator ( EVENT::TrackerPulse *  ,
EVENT::TrackerPulse *   
)
private

Definition at line 964 of file RowBasedHitFinderProcessor.cc.

◆ _sortPulses()

void marlintpc::RowBasedHitFinderProcessor::_sortPulses ( EVENT::LCCollection *  ,
const gear::TPCParameters &  ,
std::map< int, std::map< int, std::vector< EVENT::TrackerPulse *> * > * > &   
)
private

helper functions:

put the pulses in a real container in principle the idea is easy: every unique row on a unique module gets another pulse added keep in mind that more than one pulse can occur on a single pad!

practically this tends to be a bit /lengthy/ to write in stl containers, please refer to the stl documentation

Definition at line 331 of file RowBasedHitFinderProcessor.cc.

References _findHitCandidates(), and _padIsDead().

Referenced by processEvent().

◆ check()

void marlintpc::RowBasedHitFinderProcessor::check ( lcio::LCEvent *  evt)
virtual

Definition at line 316 of file RowBasedHitFinderProcessor.cc.

Referenced by newProcessor().

◆ end()

void marlintpc::RowBasedHitFinderProcessor::end ( )
virtual

Called after data processing for clean up.

Definition at line 322 of file RowBasedHitFinderProcessor.cc.

References _channelCorrectionListener.

Referenced by newProcessor().

◆ init()

void marlintpc::RowBasedHitFinderProcessor::init ( )
virtual

Called at the begin of the job before anything is read. Use to initialize the processor, e.g. book histograms.

Definition at line 128 of file RowBasedHitFinderProcessor.cc.

References _channelCorrectionCollectionName, _channelCorrectionListener, _inputTPCConditionsCollectionName, and _tpcConditionsListener.

Referenced by newProcessor().

◆ newProcessor()

virtual Processor* marlintpc::RowBasedHitFinderProcessor::newProcessor ( )
inlinevirtual

◆ processEvent()

void marlintpc::RowBasedHitFinderProcessor::processEvent ( lcio::LCEvent *  evt)
virtual

Called for every event - the working horse.

the processor is supposed to find "hits" in "rows" input are pulses: (charge,time,moduleID,cellID + qualityFlag) output are hits: ( [x,y,z] + covariance matrix, charge + qualityFlag )

steering input: - minimal hit size

  • max number of dead/empty pads within a hit
  • max distance in z/time between pulses external input: - dead pads
  • drift velocity
  • charge conversion factor
structurally this happens in a decomposition of:
(A) sort the pulses by module & row
(B) LOOP: look for pulses that belong together in a row (for all rows in a module, for all modules)
(C) create the "Hit" by calculating all numbers
********************************************************************************

the basic data structure for the hit search is a single row; the row is a simple vector of the Pulse pointers: vector<TrackerPulse*>

this is repeated for every (unique) row on a module -> use a map of these repeat this for every possible module, since the module id is unique use a map

so the final data structure for the hit search is: map<int moduleID, map<int rowID, vector<TrackerPulse*>* > (no typedef is introduced, although arguably this might improve the readability)

a helper class is instantiated to hold the hit candidates: "hitCandidate" the temporary result of the hit candidate finding is stored in a vector of these the key is again a map – since it is stored per /unique/ module

Definition at line 209 of file RowBasedHitFinderProcessor.cc.

References _createHitCollection(), _findHitCandidates(), _inputTrackerPulsesCollectionName, _outputHitsPersistent, _outputTrackerHitsCollectionName, and _sortPulses().

Referenced by newProcessor().

◆ processRunHeader()

void marlintpc::RowBasedHitFinderProcessor::processRunHeader ( lcio::LCRunHeader *  run)
virtual

Called for every run.

Definition at line 196 of file RowBasedHitFinderProcessor.cc.

Referenced by newProcessor().

Member Data Documentation

◆ _channelCorrectionCollectionName

std::string marlintpc::RowBasedHitFinderProcessor::_channelCorrectionCollectionName
private

Definition at line 116 of file RowBasedHitFinderProcessor.h.

Referenced by init(), and RowBasedHitFinderProcessor().

◆ _channelCorrectionListener

ChannelCorrectionListener* marlintpc::RowBasedHitFinderProcessor::_channelCorrectionListener
private

the standard way to access pad/channel based data: corrections, noisy/dead flag, etc.

Definition at line 167 of file RowBasedHitFinderProcessor.h.

Referenced by _padIsDead(), _padIsNoisy(), end(), and init().

◆ _chargeConversionFactorOverride

float marlintpc::RowBasedHitFinderProcessor::_chargeConversionFactorOverride
private

conversion factor from ADC counts to number of primary electrons

Definition at line 163 of file RowBasedHitFinderProcessor.h.

Referenced by _getChargeConversionFactor(), and RowBasedHitFinderProcessor().

◆ _chargeIsCalibrated

bool marlintpc::RowBasedHitFinderProcessor::_chargeIsCalibrated
private

true if calibration from ADC counts to number of primary electrons is known. Value influences error calculation of the charge.

Definition at line 159 of file RowBasedHitFinderProcessor.h.

Referenced by _createHitCollection(), and RowBasedHitFinderProcessor().

◆ _deadChannelIndicesOverride

std::vector<int> marlintpc::RowBasedHitFinderProcessor::_deadChannelIndicesOverride
private

a list of dead channels, given in the GearPadIndex, for now: just a single module this is deprecated from the beginning, just a workaround until the conditions object is there

Definition at line 123 of file RowBasedHitFinderProcessor.h.

Referenced by _padIsDead(), _padIsNoisy(), and RowBasedHitFinderProcessor().

◆ _deprecated

int marlintpc::RowBasedHitFinderProcessor::_deprecated
private

deprecated var to store some unused value – will be removed in the next release

Definition at line 131 of file RowBasedHitFinderProcessor.h.

Referenced by RowBasedHitFinderProcessor().

◆ _driftVelocityOverride

float marlintpc::RowBasedHitFinderProcessor::_driftVelocityOverride
private

drift velocity in [mm/mu s]

Definition at line 155 of file RowBasedHitFinderProcessor.h.

Referenced by _getDriftVelocity(), and RowBasedHitFinderProcessor().

◆ _inputTPCConditionsCollectionName

std::string marlintpc::RowBasedHitFinderProcessor::_inputTPCConditionsCollectionName
private

the name of the collection the TPC conditions are stored with- the name of the pedestal collection

Definition at line 113 of file RowBasedHitFinderProcessor.h.

Referenced by init(), and RowBasedHitFinderProcessor().

◆ _inputTrackerPulsesCollectionName

std::string marlintpc::RowBasedHitFinderProcessor::_inputTrackerPulsesCollectionName
private

the name of the collection the input pulses will be stored under

Definition at line 105 of file RowBasedHitFinderProcessor.h.

Referenced by processEvent(), and RowBasedHitFinderProcessor().

◆ _maxDeadChannelsOverride

int marlintpc::RowBasedHitFinderProcessor::_maxDeadChannelsOverride
private

maximum number of consecutive dead channels in a hit

Definition at line 139 of file RowBasedHitFinderProcessor.h.

Referenced by _getMaxDeadChannels(), and RowBasedHitFinderProcessor().

◆ _maxEmptyChannelsOverride

int marlintpc::RowBasedHitFinderProcessor::_maxEmptyChannelsOverride
private

maximum number of empty pads (noisy/dead) in a row

Definition at line 135 of file RowBasedHitFinderProcessor.h.

◆ _maxTimeSpreadOverride

float marlintpc::RowBasedHitFinderProcessor::_maxTimeSpreadOverride
private

maximum time between pulses belonging to a single hit [in ns]

Definition at line 151 of file RowBasedHitFinderProcessor.h.

Referenced by _getMaxTimeSpread(), and RowBasedHitFinderProcessor().

◆ _minHitSizeOverride

int marlintpc::RowBasedHitFinderProcessor::_minHitSizeOverride
private

minimum size of hit in number of pads

Definition at line 143 of file RowBasedHitFinderProcessor.h.

Referenced by _getMinHitSize(), and RowBasedHitFinderProcessor().

◆ _minMaxPulseSliceHeightOverride

float marlintpc::RowBasedHitFinderProcessor::_minMaxPulseSliceHeightOverride
private

minimum height for the maximal pulse in a hit to be accepted

Definition at line 147 of file RowBasedHitFinderProcessor.h.

Referenced by _getMinMaxPulseSliceHeight(), and RowBasedHitFinderProcessor().

◆ _outputHitsPersistent

bool marlintpc::RowBasedHitFinderProcessor::_outputHitsPersistent
private

Set the persistency flag of the output collection.

Definition at line 127 of file RowBasedHitFinderProcessor.h.

Referenced by processEvent(), and RowBasedHitFinderProcessor().

◆ _outputTrackerHitsCollectionName

std::string marlintpc::RowBasedHitFinderProcessor::_outputTrackerHitsCollectionName
private

the name of the collection the output hits will be stored under

Definition at line 109 of file RowBasedHitFinderProcessor.h.

Referenced by processEvent(), and RowBasedHitFinderProcessor().

◆ _tpcConditionsListener

TPCConditionsListener* marlintpc::RowBasedHitFinderProcessor::_tpcConditionsListener
private

the standard way to access TPC conditions: the TPCConditions object via listening

Definition at line 171 of file RowBasedHitFinderProcessor.h.

Referenced by _getChargeConversionFactor(), _getDriftVelocity(), and init().


The documentation for this class was generated from the following files: