Skip to content
Snippets Groups Projects

Add the possibility not to decode large clusters as such

Merged Louis Henry requested to merge lohenry-addSimpleDecoding2 into master
All threads resolved!
1 file
+ 33
21
Compare changes
  • Side-by-side
  • Inline
@@ -56,6 +56,8 @@ public:
private:
// Force decoding of v5 as v4 for testing of v5 encoding; expert use only
Gaudi::Property<bool> m_decodeV5AsV4{this, "DecodeV5AsV4", false, "Decode v5 as v4"};
// Force not doing anything with large clusters to study saturation effects
Gaudi::Property<bool> m_ignoreLarge{this, "IgnoreLarge", false, "IgnoreLarge"};
ConditionAccessor<DeFT> m_det{this, DeFTDetectorLocation::Default};
@@ -582,30 +584,40 @@ FTLiteClusters FTRawBankDecoder::decode( const EventContext& evtCtx, LHCb::RawBa
};
// Make clusters between two channels
auto make_clusters = [&]( unsigned firstChannel, short int c, short int c2 ) {
unsigned int widthClus = ( cell( c2 ) - cell( c ) + 2 ); // lastCh-firstCh+4/2
// fragmented clusters, size > 2*max size
// only edges were saved, add middles now
if ( widthClus > 2 * LHCb::Detector::FT::RawBank::maxClusterWidth ) {
// add the first edge cluster, and then the middle clusters
unsigned int i = 0;
for ( ; i < widthClus - LHCb::Detector::FT::RawBank::maxClusterWidth;
i += LHCb::Detector::FT::RawBank::maxClusterWidth ) {
// all middle clusters will have same size as the first cluster,
// for max size 4, fractions is always 1
make_cluster( firstChannel + i, 1, 0 );
}
std::function<void( unsigned, short int, short int )> make_clusters;
if ( m_ignoreLarge ) {
make_clusters = [&]( unsigned, short int c, short int c2 ) {
unsigned int widthClus = ( cell( c2 ) - cell( c ) + 2 ); // lastCh-firstCh+4/2
unsigned int size = ( widthClus > 2 * LHCb::Detector::FT::RawBank::maxClusterWidth ) ? 0 : widthClus;
make_cluster( cell( c ), 1, size );
make_cluster( cell( c2 ), 1, size );
}; // End lambda make_clusters
} else {
make_clusters = [&]( unsigned firstChannel, short int c, short int c2 ) {
unsigned int widthClus = ( cell( c2 ) - cell( c ) + 2 ); // lastCh-firstCh+4/2
// fragmented clusters, size > 2*max size
// only edges were saved, add middles now
if ( widthClus > 2 * LHCb::Detector::FT::RawBank::maxClusterWidth ) {
// add the first edge cluster, and then the middle clusters
unsigned int i = 0;
for ( ; i < widthClus - LHCb::Detector::FT::RawBank::maxClusterWidth;
i += LHCb::Detector::FT::RawBank::maxClusterWidth ) {
// all middle clusters will have same size as the first cluster,
// for max size 4, fractions is always 1
make_cluster( firstChannel + i, 1, 0 );
}
// add the last edge
unsigned int lastChannel = firstChannel + i + std::floor( ( widthClus - i - 1 ) / 2 ) - 1;
make_cluster( lastChannel, ( widthClus - 1 ) % 2, 0 );
} else { // big cluster size upto size 8
// add the last edge
unsigned int lastChannel = firstChannel + i + std::floor( ( widthClus - i - 1 ) / 2 ) - 1;
make_cluster( lastChannel, ( widthClus - 1 ) % 2, 0 );
} else { // big cluster size upto size 8
make_cluster( firstChannel + ( widthClus - 1 ) / 2 - 1, ( widthClus - 1 ) % 2, widthClus );
make_cluster( firstChannel + ( widthClus - 1 ) / 2 - 1, ( widthClus - 1 ) % 2, widthClus );
} // end if adjacent clusters
}; // End lambda make_clusters
} // end if adjacent clusters
}; // End lambda make_clusters
}
clusters = clusters.subspan( 2 ); // skip first 32b of header
if ( !clusters.empty() && clusters.back() == 0 )
Loading