Skip to content
Snippets Groups Projects
Commit e59811a8 authored by Sebastien Ponce's avatar Sebastien Ponce
Browse files

Merge branch 'velomon_master_dd4hep' into 'master'

Track Monitoring histograms

See merge request lhcb/Rec!3269
parents 854c6127 732782b8
No related branches found
No related tags found
No related merge requests found
......@@ -18,6 +18,7 @@
#include "GaudiKernel/IAlgTool.h"
#include "IHitExpectation.h"
/** @class IHitExpectation IDetailedHitExpectation.h TrackInterfaces/IDetailedHitExpectation
*
* How many hits (of a given type) do we expect on a track ?
......@@ -32,8 +33,10 @@ struct IDetailedHitExpectation : extend_interfaces<IAlgTool> {
*/
struct DetailedLayerInfo {
LHCb::LHCbID id{}; // = 0; ///< detector-specific ID identifying layer/sensor/...
unsigned int global_id{}; // detector specific ID identifying a group of layer/sensor/...
bool found = false; ///< bool indicating if hit was found in layer/sensor/...
constexpr DetailedLayerInfo( LHCb::LHCbID _id, bool _found ) : id( _id ), found( _found ) {}
constexpr DetailedLayerInfo( LHCb::LHCbID _id, unsigned int _global_id, bool _found )
: id( _id ), global_id( _global_id ), found( _found ) {}
};
using DetailedInfo = std::vector<DetailedLayerInfo>;
......
This diff is collapsed.
......@@ -137,11 +137,9 @@ IDetailedHitExpectation::DetailedInfo LHCb::VPHitExpectation::detailedExpectatio
const DeVP& det ) const {
const auto geom = geometry;
// work out the first and last z on the track
const auto zStart =
std::min( zMin( aTrack, det ) - 1e-3,
aTrack.closestState( 0 ).z() - 1e-3 ); // 1e-3 is chosen to ensure that even if the sensor is tilted we
// are counting the z cordinate of it
const auto zStop = std::max( zMax( aTrack, det ) + 1e-3, aTrack.closestState( 0 ).z() + 1e-3 );
const auto zStart = zMin( aTrack, det ) - 1e-3; // 1e-3 is chosen to ensure that even if the sensor is tilted we
// are counting the z cordinate of it
const auto zStop = zMax( aTrack, det ) + 1e-3;
IDetailedHitExpectation::DetailedInfo info;
const auto& trkIDs = aTrack.lhcbIDs();
std::vector<LHCbID> collectedIDs;
......@@ -149,6 +147,7 @@ IDetailedHitExpectation::DetailedInfo LHCb::VPHitExpectation::detailedExpectatio
info.reserve( 208 );
std::copy_if( begin( trkIDs ), end( trkIDs ), back_inserter( collectedIDs ),
[]( auto i ) -> bool { return i.isVP(); } );
det.runOnAllSensors( [&]( const DeVPSensor& sensor ) {
if ( isInside( aTrack, sensor, zStart, zStop ) ) {
const Detector::VPChannelID channelID = findIntersectingChannelID( aTrack, sensor );
......@@ -159,7 +158,9 @@ IDetailedHitExpectation::DetailedInfo LHCb::VPHitExpectation::detailedExpectatio
static_cast<Detector::VPChannelID::ColumnID>( 0 ),
static_cast<Detector::VPChannelID::RowID>( 0 ) );
const LHCbID lhcbid( chanid );
info.emplace_back( lhcbid, false );
const unsigned int moduleNumber = sensor.module();
info.emplace_back( lhcbid, moduleNumber, false );
if ( std::find_if( begin( collectedIDs ), end( collectedIDs ), [sensorNumber, chipNumber]( auto i ) -> bool {
return ( sensorNumber == i.vpID().sensor() ) && ( chipNumber == unsigned( i.vpID().chip() ) );
} ) != end( collectedIDs ) ) {
......@@ -205,8 +206,8 @@ double LHCb::VPHitExpectation::zMin( const Track& aTrack, const DeVP& det ) cons
void LHCb::VPHitExpectation::collect( const LHCb::Track& aTrack, std::vector<LHCb::LHCbID>& ids,
IGeometryInfo const& geometry, const DeVP& det ) const {
const auto zStart = std::min( zMin( aTrack, det ) - 1e-3, aTrack.closestState( 0 ).z() - 1e-3 );
const auto zStop = std::max( zMax( aTrack, det ) + 1e-3, aTrack.closestState( 0 ).z() + 1e-3 );
const auto zStart = zMin( aTrack, det ) - 1e-3;
const auto zStop = zMax( aTrack, det ) + 1e-3;
const auto geom = geometry;
std::vector<LHCbID> collectedIDs;
const auto& trkIDs = ids;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment