MyMarlinTPC
170316
|
#include <RowBasedHitFinderProcessor.h>
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 |
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.
Hit quality flag (including inheritance of pulse flags)
Handling of dead and noisy channels.
InputTrackerPulses | Name of input TrackerPulses collection (default: TPCPulses) |
OutputTrackerHits | Name of output TrackerHits collection (default: TPCHits) |
InputTPCConditions | OPTIONAL: Name of the input collection containing the TPC conditions data (default: tpcconddata::TPCConditions::getDefaultColName() ) |
WriteOutputToStorage:bool | If true the output collection is written to file (default: true) |
ChargeConversionIsCalibrated:bool | Set true, if the charge conversion factor from ADC values to primary electrons is known (default:true). |
MaxEmptyPadsOverride | Maximum number of consecutive empty pads in a row (default: 1) |
MinHitSizeOverride | Minimum size of hit in number of pads (default: 1) |
MinMaxPulseSliceHeightOverrid | Minimum size of the maximum pulse slice of the highest pulse in the hit (default: 12.) |
MaxTimeSpreadOverride | Maximum time between pulses in a hit [in ns] (default: 200) |
VDriftOverride | OPTIONAL: Set drift velocity in case there is no conditions data [in mm/us] (default: 0) |
DeadPadsOverride | OPTIONAL: a vector of geometry indices of dead channels, default should be conditions data |
ChargeConversionFactorOverride | OPTIONAL The factor to convert adc counts into number of primary electrons (-> should be conditions data) |
UseGlobalCoordinates | OPTIONAL 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.
marlintpc::RowBasedHitFinderProcessor::RowBasedHitFinderProcessor | ( | ) |
Definition at line 47 of file RowBasedHitFinderProcessor.cc.
References _channelCorrectionCollectionName, _chargeConversionFactorOverride, _chargeIsCalibrated, _deadChannelIndicesOverride, _deprecated, _driftVelocityOverride, _inputTPCConditionsCollectionName, _inputTrackerPulsesCollectionName, _maxDeadChannelsOverride, _maxTimeSpreadOverride, _minHitSizeOverride, _minMaxPulseSliceHeightOverride, _outputHitsPersistent, and _outputTrackerHitsCollectionName.
Referenced by newProcessor().
|
private |
Definition at line 474 of file RowBasedHitFinderProcessor.cc.
References _findBestNeighbourPulseMatch(), _getMaxDeadChannels(), _getMaxTimeSpread(), _padIsDead(), marlintpc::RowBasedHitFinderProcessor::hitCandidate::addPulse(), marlintpc::RowBasedHitFinderProcessor::hitCandidate::getMaximumPulse(), marlintpc::RowBasedHitFinderProcessor::hitCandidate::getMaxPulseHeight(), marlintpc::RowBasedHitFinderProcessor::hitCandidate::getWidth(), marlintpc::RowBasedHitFinderProcessor::hitCandidate::qualityFlag, marlintpc::hitflag::setAtModuleBorder(), marlintpc::hitflag::setDeadChannel(), marlintpc::hitflag::setMultipleHitCandidate(), and marlintpc::hitflag::setNextToDeadChannel().
Referenced by _findHitCandidates(), and _maxPulseHeightCheck().
|
private |
Definition at line 743 of file RowBasedHitFinderProcessor.cc.
References _getDriftVelocity(), marlintpc::RowBasedHitFinderProcessor::hitCandidate::getMaximumPulse(), and marlintpc::RowBasedHitFinderProcessor::hitCandidate::getPulses().
Referenced by _createHitCollection().
|
private |
Definition at line 899 of file RowBasedHitFinderProcessor.cc.
References _getChargeConversionFactor(), marlintpc::RowBasedHitFinderProcessor::hitCandidate::getCharge(), and marlintpc::RowBasedHitFinderProcessor::hitCandidate::hitCandidate().
Referenced by _createHitCollection().
|
private |
now loop over all hits on all modules and: 1) check their validity 2) calculate the first two coordinates 3) calculate the z coordinate 4) calculate the error matrix, which is diagonal in the local coordinate system 5) store the TrackerHit in the output collection
Definition at line 640 of file RowBasedHitFinderProcessor.cc.
References _calculatePositionsAndErrors(), _chargeIsCalibrated, _convertCharge(), _getChargeConversionFactor(), _hitIsValid(), marlintpc::hitflag::hasAnomalousPulseShape(), marlintpc::hitflag::hasDeadChannel(), marlintpc::hitflag::hasNoisyChannel(), marlintpc::hitflag::hasOverflowPulse(), marlintpc::hitflag::hasPlateauCutoffPulse(), marlintpc::hitflag::hasSplitPulse(), marlintpc::pulseflag::isAnomalousShape(), marlintpc::hitflag::isAtModuleBorder(), marlintpc::hitflag::isMultipleHitCandidate(), marlintpc::hitflag::isNextToDeadChannel(), marlintpc::pulseflag::isOverflow(), marlintpc::pulseflag::isPlateauCutoff(), marlintpc::pulseflag::isSplit(), marlintpc::hitflag::setAnomalousPulseShape(), marlintpc::hitflag::setOverflowPulse(), marlintpc::hitflag::setPlateauCutoffPulse(), and marlintpc::hitflag::setSplitPulse().
Referenced by _findBestNeighbourPulseMatch(), and processEvent().
|
private |
Definition at line 610 of file RowBasedHitFinderProcessor.cc.
References _createHitCollection().
Referenced by _addNeighbourPulses().
|
private |
Definition at line 444 of file RowBasedHitFinderProcessor.cc.
Referenced by _findHitCandidates().
|
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().
|
private |
Definition at line 1110 of file RowBasedHitFinderProcessor.cc.
References _chargeConversionFactorOverride, and _tpcConditionsListener.
Referenced by _convertCharge(), and _createHitCollection().
|
private |
Definition at line 1029 of file RowBasedHitFinderProcessor.cc.
References _driftVelocityOverride, and _tpcConditionsListener.
Referenced by _calculatePositionsAndErrors().
|
private |
Definition at line 971 of file RowBasedHitFinderProcessor.cc.
References _maxDeadChannelsOverride.
Referenced by _addNeighbourPulses().
|
private |
Definition at line 1014 of file RowBasedHitFinderProcessor.cc.
References _maxTimeSpreadOverride.
Referenced by _addNeighbourPulses().
|
private |
Definition at line 985 of file RowBasedHitFinderProcessor.cc.
References _minHitSizeOverride.
Referenced by _hitIsValid().
|
private |
Definition at line 999 of file RowBasedHitFinderProcessor.cc.
References _minMaxPulseSliceHeightOverride.
Referenced by _maxPulseHeightCheck().
|
private |
Definition at line 736 of file RowBasedHitFinderProcessor.cc.
References _getMinHitSize(), and marlintpc::RowBasedHitFinderProcessor::hitCandidate::getWidth().
Referenced by _createHitCollection().
|
private |
Definition at line 463 of file RowBasedHitFinderProcessor.cc.
References _addNeighbourPulses(), and _getMinMaxPulseSliceHeight().
Referenced by _findHitCandidates().
|
private |
Definition at line 1052 of file RowBasedHitFinderProcessor.cc.
References _channelCorrectionListener, and _deadChannelIndicesOverride.
Referenced by _addNeighbourPulses(), and _sortPulses().
|
private |
Definition at line 1083 of file RowBasedHitFinderProcessor.cc.
References _channelCorrectionListener, and _deadChannelIndicesOverride.
|
private |
Definition at line 964 of file RowBasedHitFinderProcessor.cc.
|
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().
|
virtual |
Definition at line 316 of file RowBasedHitFinderProcessor.cc.
Referenced by newProcessor().
|
virtual |
Called after data processing for clean up.
Definition at line 322 of file RowBasedHitFinderProcessor.cc.
References _channelCorrectionListener.
Referenced by newProcessor().
|
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().
|
inlinevirtual |
Definition at line 74 of file RowBasedHitFinderProcessor.h.
References check(), end(), init(), processEvent(), processRunHeader(), and RowBasedHitFinderProcessor().
|
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
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().
|
virtual |
Called for every run.
Definition at line 196 of file RowBasedHitFinderProcessor.cc.
Referenced by newProcessor().
|
private |
Definition at line 116 of file RowBasedHitFinderProcessor.h.
Referenced by init(), and RowBasedHitFinderProcessor().
|
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().
|
private |
conversion factor from ADC counts to number of primary electrons
Definition at line 163 of file RowBasedHitFinderProcessor.h.
Referenced by _getChargeConversionFactor(), and RowBasedHitFinderProcessor().
|
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().
|
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().
|
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().
|
private |
drift velocity in [mm/mu s]
Definition at line 155 of file RowBasedHitFinderProcessor.h.
Referenced by _getDriftVelocity(), and RowBasedHitFinderProcessor().
|
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().
|
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().
|
private |
maximum number of consecutive dead channels in a hit
Definition at line 139 of file RowBasedHitFinderProcessor.h.
Referenced by _getMaxDeadChannels(), and RowBasedHitFinderProcessor().
|
private |
maximum number of empty pads (noisy/dead) in a row
Definition at line 135 of file RowBasedHitFinderProcessor.h.
|
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().
|
private |
minimum size of hit in number of pads
Definition at line 143 of file RowBasedHitFinderProcessor.h.
Referenced by _getMinHitSize(), and RowBasedHitFinderProcessor().
|
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().
|
private |
Set the persistency flag of the output collection.
Definition at line 127 of file RowBasedHitFinderProcessor.h.
Referenced by processEvent(), and RowBasedHitFinderProcessor().
|
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().
|
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().