18 150, 150, 150, 150, 150, 150, 150, 150, 150, 150,
19 150, 150, 150, 150, 150, 150, 150, 150, 150, 150,
20 150, 150, 150, 150, 150, 124.261, 111.448, 97.7357, 85.5616, 72.3294,
21 61.0017, 50.8592, 41.6827, 33.7413, 26.9884, 21.3822, 16.8352, 13.1081, 10.2368, 7.96723,
22 6.23636, 4.91757, 3.91519, 3.15519, 2.57768, 2.13622, 1.80524, 1.53102, 1.30677, 1.13582
28 const IInterface* p ) :
48 m_counter_picked.resize(50);
52 for(
size_t ip = 0; ip <= 50; ++ip ) {
53 m_pTbins.emplace_back(
pow( 10, 2.0 + 0.04 * ip ) );
59 return StatusCode::SUCCESS;
67 return StatusCode::SUCCESS;
74 const EventContext& ctx = Gaudi::Hive::currentContext();
81 size_t nTracks = importedTrackParticles->size();
82 if (nTracks==0)
return StatusCode::SUCCESS;
85 std::vector<bool> mask;
86 mask.assign(nTracks,
false);
88 std::lock_guard<std::mutex> lock(
m_mutex);
94 std::vector<int>
entries = m_parser->evaluateAsVector();
95 unsigned int nEntries =
entries.size();
97 if (nTracks != nEntries ) {
98 ATH_MSG_ERROR(
"Sizes incompatible! Are you sure your selection string used ID TrackParticles?");
99 return StatusCode::FAILURE;
102 for (
unsigned int i=0; i<nTracks; ++i)
if (
entries[i]==1) mask[i]=
true;
112 for(
const auto* vtx : *primaryVertices ) {
119 if( !priVtx )
return StatusCode::SUCCESS;
121 auto getBin = [&](
const double pT ) ->
size_t {
122 for(
size_t ip = 0; ip <
m_pTbins.size()-1; ip++ ) {
131 for (
size_t i=0; i<nTracks; ++i) {
133 const auto* trk = importedTrackParticles->at(i);
136 if( trk->numberOfIBLOverflowsdEdx() > 0 ) {
138 mask.at(i) =
true; ++
m_npass;
continue;
146 mask.at(i) =
true; ++
m_npass;
continue;
158 if( std::abs( trk->z0() - priVtx->
z() + trk->vz() ) >
m_z0Cut ) {
163 if( std::abs( trk->eta() ) >
m_etaCut ) {
168 auto bin =
getBin( std::abs( trk->pt() ) );
171 const auto preScale10 = std::max(
static_cast<unsigned long long>( std::floor(
m_preScales.at(
bin ) *
m_globalScale / 10. ) ), 1ull );
180 static const float dEdxThr {
static_cast<float>(
pow( 10, 0.1 )) };
181 if( dEdx > dEdxThr ) {
183 mask.at(i) = ( (m_counter.at(
bin) % preScale10) == 0 );
186 }
else if( dEdx > 0. ) {
188 mask.at(i) = ( (m_counter.at(
bin) % preScale) == 0 );
196 if( mask.back() ) { ++
m_npass; m_counter_picked.at(
bin)++; }
200 assert( importedTrackParticles->size() == mask.size() );
203 importedTrackParticles.
keep (mask);
205 return StatusCode::SUCCESS;
#define ATH_CHECK
Evaluate an expression and check for errors.
int getBin(double x, double min, double step, int clamp_max)
Handle for requesting thinning for a data object.
constexpr int pow(int base, int exp) noexcept
DoubleProperty m_globalScale
StringProperty m_streamName
virtual StatusCode finalize() override
static const std::vector< double > m_preScales
StringProperty m_selectionString
virtual StatusCode initialize() override
std::atomic< unsigned int > m_ntot
DoubleProperty m_unprescalePtCut
DoubleProperty m_d0SignifCut
PixeldEdxTrackParticleThinning(const std::string &t, const std::string &n, const IInterface *p)
SG::ReadHandleKey< xAOD::VertexContainer > m_vertexContainerKey
std::atomic< unsigned int > m_npass
virtual StatusCode doThinning() const override
std::vector< double > m_pTbins
SG::ThinningHandleKey< xAOD::TrackParticleContainer > m_inDetParticlesKey
virtual bool isValid() override final
Can the handle be successfully dereferenced?
void keep(size_t ndx)
Mark that index ndx in the container should be kept (not thinned away).
Handle for requesting thinning for a data object.
float z() const
Returns the z position.
double d0significance(const xAOD::TrackParticle *tp, double d0_uncert_beam_spot_2)
Vertex_v1 Vertex
Define the latest version of the vertex class.
@ pixeldEdx
the dE/dx estimate, calculated using the pixel clusters [?