Skip to content
Snippets Groups Projects
Commit f25d1232 authored by Sevda Esen's avatar Sevda Esen Committed by Christoph Hasse
Browse files

Follow LHCb!3225

parent dc21c8c0
No related branches found
No related tags found
1 merge request!2533Follow LHCb!3225
......@@ -20,28 +20,25 @@ DECLARE_COMPONENT( PrGECFilter )
/// Standard constructor, initializes variables
PrGECFilter::PrGECFilter( const std::string& name, ISvcLocator* pSvcLocator )
: FilterPredicate(
name, pSvcLocator,
{KeyValue{"RawEventLocations", Gaudi::Functional::concat_alternatives( LHCb::RawEventLocation::Tracker,
LHCb::RawEventLocation::Other,
LHCb::RawEventLocation::Default )}} ) {
: FilterPredicate( name, pSvcLocator,
{KeyValue{"FTRawBanks", "DAQ/RawBanks/FTCluster"}, KeyValue{"UTRawBanks", "DAQ/RawBanks/UT"}} ) {
}
bool PrGECFilter::operator()( const LHCb::RawEvent& rawEvt ) const {
bool PrGECFilter::operator()( const LHCb::RawBank::View& ftBanks, const LHCb::RawBank::View& utBanks ) const {
++m_eventsProcessedCounter;
// do not work for nothing !
if ( m_nFTUTClusters <= 0 ) { return true; }
// check UT clusters
auto nbUTClusters = LHCb::UTDAQ::nbUTClusters( rawEvt.banks( LHCb::RawBank::UT ), m_nFTUTClusters );
auto nbUTClusters = LHCb::UTDAQ::nbUTClusters( utBanks, m_nFTUTClusters );
if ( !nbUTClusters ) {
++m_eventsRejectedCounter;
return false;
}
// check FT clusters
auto nbFTClusters = LHCb::FTDAQ::nbFTClusters( rawEvt.banks( LHCb::RawBank::FTCluster ) );
auto nbFTClusters = LHCb::FTDAQ::nbFTClusters( ftBanks );
if ( nbFTClusters + nbUTClusters.value() < m_nFTUTClusters ) { return true; }
++m_eventsRejectedCounter;
return false;
......
......@@ -19,14 +19,15 @@
/** @class PrGECFilter PrGECFilter.h
* \brief give decision concerning GEC
*/
class PrGECFilter : public Gaudi::Functional::FilterPredicate<bool( const LHCb::RawEvent& )> {
class PrGECFilter
: public Gaudi::Functional::FilterPredicate<bool( const LHCb::RawBank::View&, const LHCb::RawBank::View& )> {
public:
/// Standard constructor
PrGECFilter( const std::string& name, ISvcLocator* pSvcLocator );
/// Algorithm execution
bool operator()( const LHCb::RawEvent& ) const override;
bool operator()( const LHCb::RawBank::View&, const LHCb::RawBank::View& ) const override;
private:
Gaudi::Property<unsigned int> m_nFTUTClusters{this, "NumberFTUTClusters", 0};
......
......@@ -11,7 +11,6 @@
#include "DetDesc/Condition.h"
#include "DetDesc/ConditionAccessorHolder.h"
#include "Event/RawBank.h"
#include "Event/RawEvent.h"
#include "GaudiAlg/Transformer.h"
#include "Kernel/IUTReadoutTool.h"
#include "Kernel/UTDAQBoard.h"
......@@ -59,7 +58,7 @@ namespace LHCb::Pr::UT {
template <typename HANDLER>
using Transformer =
Gaudi::Functional::Transformer<HANDLER( const EventContext&, const RawEvent&, const UTGeomCache& ),
Gaudi::Functional::Transformer<HANDLER( const EventContext&, const RawBank::View&, const UTGeomCache& ),
LHCb::DetDesc::usesConditions<UTGeomCache>>;
template <typename HANDLER>
......@@ -70,9 +69,7 @@ namespace LHCb::Pr::UT {
StoreHit( const std::string& name, ISvcLocator* pSvcLocator )
: Transformer<HANDLER>( name, pSvcLocator,
{KeyValue{"RawEventLocations", Gaudi::Functional::concat_alternatives(
RawEventLocation::Tracker, RawEventLocation::Other,
RawEventLocation::Default )},
{KeyValue{"RawBanks", "DAQ/RawBanks/UT"},
KeyValue{"GeomCache", "AlgorithmSpecific-" + name + "-UTGeomCache"}},
KeyValue{"UTHitsLocation", ::UT::Info::HitLocation} ) {}
......@@ -86,14 +83,13 @@ namespace LHCb::Pr::UT {
} );
}
HANDLER operator()( const EventContext& /*evtCtx*/, const LHCb::RawEvent& rawEvt,
HANDLER operator()( const EventContext& /*evtCtx*/, const LHCb::RawBank::View& tBanks,
const UTGeomCache& cache ) const override {
HANDLER hitHandler{};
hitHandler.reserve( 10000 );
try {
const auto tBanks = rawEvt.banks( RawBank::UT );
for ( const auto& bank : tBanks ) {
// make local decoder
if ( bank->size() == 0 ) continue;
......
......@@ -19,6 +19,8 @@ from DDDB.CheckDD4Hep import UseDD4Hep
if UseDD4Hep:
from Configurables import LHCb__Det__LbDD4hep__IOVProducer as IOVProducer
from Configurables import LHCb__UnpackRawEvent
# Sanity checks
def CheckTrackTypes(trackTypes, subDets, seqType):
......@@ -92,8 +94,18 @@ def DecodeTracking(subDets):
UT = UTOfflinePosition('ToolSvc.UTClusterPosition')
if "FT" in subDets:
decs += decodersForBank(DecoderDB, "FTCluster")
bank_types = ["FTCluster", "UT"]
bank_locations = ['/Event/DAQ/RawBanks/%s' % (rb) for rb in bank_types]
unpacker = LHCb__UnpackRawEvent(
'UnpackRawEvent',
BankTypes=bank_types,
RawBankLocations=bank_locations)
algs = [d.setup() for d in decs]
algs.insert(0, unpacker)
# add DD4hep IOV lock producer if needed
if UseDD4Hep:
algs.insert(0, IOVProducer('IOVProducer'))
......@@ -103,7 +115,7 @@ def DecodeTracking(subDets):
GecFilter = PrGECFilter()
if TrackSys().getProp("ConfigHLT1")["GEC"] > 0:
GecFilter.NumberFTUTClusters = TrackSys().getProp("ConfigHLT1")["GEC"]
algs.insert(0, GecFilter)
algs.insert(1, GecFilter)
#if not TrackSys().getProp("VeloUpgradeOnly"):
if "UT" in subDets:
from Configurables import PrStoreUTHit, PrStorePrUTHits
......@@ -114,7 +126,8 @@ def DecodeTracking(subDets):
algs.append(storeUTSOA)
if "FT" in subDets:
from Configurables import PrStoreFTHit, PrStoreSciFiHits
from Configurables import FTRawBankDecoder, PrStoreFTHit, PrStoreSciFiHits
algs.append(FTRawBankDecoder("createFTClusters"))
algs.append(PrStoreFTHit())
algs.append(PrStoreSciFiHits())
......
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