Skip to content

Commit

Permalink
added selection on existence of extrapolation at calorimeter
Browse files Browse the repository at this point in the history
  • Loading branch information
Federico Meloni committed Jul 16, 2024
1 parent 84676e1 commit e44c841
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
1 change: 1 addition & 0 deletions source/Utils/include/FilterTracks.h
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ class FilterTracks : public marlin::Processor
std::string _OutputTrackCollection {};

bool _BarrelOnly = false;
bool _HasCaloState = false;

//! Cut off for total number of hits
int _NHitsTotal = 7;
Expand Down
17 changes: 17 additions & 0 deletions source/Utils/src/FilterTracks.cc
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,12 @@ FilterTracks::FilterTracks()
_BarrelOnly
);

registerProcessorParameter("HasCaloState",
"If true, just keep tracks that have a TrackState at the Calorimeter surface",
_HasCaloState,
_HasCaloState
);

registerProcessorParameter("NHitsTotal",
"Minimum number of hits on track",
_NHitsTotal,
Expand Down Expand Up @@ -140,6 +146,17 @@ void FilterTracks::processEvent( LCEvent * evt )

int nholes = trk->getNholes();

bool foundCaloState = false;
// Check if a TrackState at the calo surface exists
const std::vector<EVENT::TrackState*>& trackStates = trk->getTrackStates();
for (const auto& state : trackStates) {
if (state->getLocation() == EVENT::TrackState::AtCalorimeter) {
foundCaloState = true;
break;
}
}
if (_HasCaloState && !foundCaloState) { continue; }

if(_BarrelOnly == true) {
bool endcaphits = false;
for(int j=0; j<nhittotal; ++j) {
Expand Down

0 comments on commit e44c841

Please sign in to comment.