diff --git a/Rec/GlobalReco/root/MakeRichPlots.C b/Rec/GlobalReco/root/MakeRichPlots.C index f94d99d7a6aebfcfd5f029558ba83d543e2ca465..3621f0ee34c7214bafc9e635ed5700439752e64c 100755 --- a/Rec/GlobalReco/root/MakeRichPlots.C +++ b/Rec/GlobalReco/root/MakeRichPlots.C @@ -16,22 +16,30 @@ void MakeRichPlots() const std::string imageType = "pdf"; //const std::string dir = "/Users/chris/LHCb/RootFiles/Run2"; - const std::string dir = "/usera/jonesc/LHCbCMake/Brunel/output/future"; + const std::string dir = "/usera/jonesc/LHCbCMake/Feature/Brunel/output/Upgrade/RICH12"; const std::vector<std::string> nametags = { - "Quartic100R1R2-AllHypos", - "Quartic50R1R2-AllHypos", - "Quartic50R1R2-KaPi", - "Quartic100R1-AllHypos", - "Quartic100R2-AllHypos" + //"Scale0.25", + //"Scale0.5", + //"Scale0.75", + //"Scale0.85", + //"Scale1.0" + "Scale-R1_0.75-R2_0.40", + "Scale-R1_0.75-R2_0.45", + "Scale-R1_0.75-R2_0.50", + "Scale-R1_0.75-R2_0.75", + "Scale-R1_0.75-R2_0.83", + "Scale-R1_0.75-R2_0.90", + "Scale-R1_0.75-R2_1.00", + "Scale-R1_1.00-R2_1.00" }; for ( const auto& nametag : nametags ) { // load the file and TTree - TFile * f = TFile::Open((dir+"/"+nametag+"/protoparticles.tuples.root").c_str()); + TFile * f = TFile::Open((dir+"/"+nametag+"/Feature-x86_64+avx2+fma-centos7-gcc7-opt-Expert-ProtoTuple.root").c_str()); if ( !f ) continue; TTree * tree = (TTree*)gDirectory->Get("ChargedProtoTuple/protoPtuple"); if ( !tree ) continue; diff --git a/Rec/GlobalReco/root/RichKaonIDCompareFiles.C b/Rec/GlobalReco/root/RichKaonIDCompareFiles.C index 3973f6f3693aa9927168d0c87d1fa1eae5f8fcf4..9e5d2af4b893c50b11553d776c1fba85d41e7821 100755 --- a/Rec/GlobalReco/root/RichKaonIDCompareFiles.C +++ b/Rec/GlobalReco/root/RichKaonIDCompareFiles.C @@ -20,14 +20,14 @@ void RichKaonIDCompareFiles() // Histo range defaultConfig.useFixedGraphRange = true; - //defaultConfig.minGraphX = 93; - //defaultConfig.maxGraphX = 97; - //defaultConfig.minGraphY = 3; - //defaultConfig.maxGraphY = 8; - defaultConfig.minGraphX = 88; + defaultConfig.minGraphX = 80; defaultConfig.maxGraphX = 100; defaultConfig.minGraphY = 1; defaultConfig.maxGraphY = 20; + //defaultConfig.minGraphX = 80; + //defaultConfig.maxGraphX = 100; + //defaultConfig.minGraphY = 40; + //defaultConfig.maxGraphY = 80; // Stepping options defaultConfig.maxCut = 35; defaultConfig.nSteps = 100; @@ -53,18 +53,37 @@ void RichKaonIDCompareFiles() //const std::string dir = "/home/chris/LHCb/future"; const std::string dir = "/usera/jonesc/LHCbCMake/Feature/Brunel/output/Upgrade"; - typedef std::vector< std::tuple<std::string,std::string,Color_t> > PlotData; + using PlotData = std::vector< std::tuple<std::string,std::string,Color_t> >; // colours... // kBlack kRed-6 kBlue+1 kGreen+2 kYellow+3 kRed+1 kMagenta+2 kCyan+2 const PlotData plotdata = - { - std::make_tuple ( dir+"/Saved/Master.protos.tuple.root", "Master", kBlack ), - std::make_tuple ( dir+"/Saved/NormalNSigma.protos.tuple.root", "Feature Nominal #sigma", kRed-6 ), - std::make_tuple ( dir+"/Saved/TightNSigma.protos.tuple.root", "Feature Tight #sigma", kBlue+1 ), - std::make_tuple ( dir+"/Saved/FastGlobal.protos.tuple.root", "Feature FastGlobal", kYellow+3 ) - }; + { + std::make_tuple ( dir+"/RICH12/Scale-R1_1.00-R2_1.00/Feature-x86_64+avx2+fma-centos7-gcc7-opt-Expert-ProtoTuple.root", "Scale R1-1.00 R2-1.00", kBlack ), + std::make_tuple ( dir+"/RICH12/Scale-R1_0.75-R2_1.00/Feature-x86_64+avx2+fma-centos7-gcc7-opt-Expert-ProtoTuple.root", "Scale R1-0.75 R2-1.00", kRed-6 ), + std::make_tuple ( dir+"/RICH12/Scale-R1_0.75-R2_0.90/Feature-x86_64+avx2+fma-centos7-gcc7-opt-Expert-ProtoTuple.root", "Scale R1-0.75 R2-0.90", kMagenta+2 ), + std::make_tuple ( dir+"/RICH12/Scale-R1_0.75-R2_0.83/Feature-x86_64+avx2+fma-centos7-gcc7-opt-Expert-ProtoTuple.root", "Scale R1-0.75 R2-0.83", kCyan+2 ), + std::make_tuple ( dir+"/RICH12/Scale-R1_0.75-R2_0.75/Feature-x86_64+avx2+fma-centos7-gcc7-opt-Expert-ProtoTuple.root", "Scale R1-0.75 R2-0.75", kRed+1 ), + std::make_tuple ( dir+"/RICH12/Scale-R1_0.75-R2_0.50/Feature-x86_64+avx2+fma-centos7-gcc7-opt-Expert-ProtoTuple.root", "Scale R1-0.75 R2-0.50", kYellow+3 ), + std::make_tuple ( dir+"/RICH12/Scale-R1_0.75-R2_0.45/Feature-x86_64+avx2+fma-centos7-gcc7-opt-Expert-ProtoTuple.root", "Scale R1-0.75 R2-0.45", kBlue+1 ), + std::make_tuple ( dir+"/RICH12/Scale-R1_0.75-R2_0.40/Feature-x86_64+avx2+fma-centos7-gcc7-opt-Expert-ProtoTuple.root", "Scale R1-0.75 R2-0.40", kGreen+2 ) + + //std::make_tuple ( dir+"/RichTTFUStudies/ProtoTuple.root", "RichTTFUStudies", kRed-6 ) + + //std::make_tuple ( dir+"/RICH1/Scale0.25/Feature-x86_64+avx2+fma-centos7-gcc7-opt-Expert-ProtoTuple.root", "RICH1 Scale 0.25", kBlack ), + //std::make_tuple ( dir+"/RICH1/Scale0.5/Feature-x86_64+avx2+fma-centos7-gcc7-opt-Expert-ProtoTuple.root", "RICH1 Scale 0.50", kRed-6 ), + //std::make_tuple ( dir+"/RICH1/Scale0.75/Feature-x86_64+avx2+fma-centos7-gcc7-opt-Expert-ProtoTuple.root", "RICH1 Scale 0.75", kBlue+1 ), + //std::make_tuple ( dir+"/RICH1/Scale0.85/Feature-x86_64+avx2+fma-centos7-gcc7-opt-Expert-ProtoTuple.root", "RICH2 Scale 0.85", kYellow+3 ), + //std::make_tuple ( dir+"/RICH1/Scale1.0/Feature-x86_64+avx2+fma-centos7-gcc7-opt-Expert-ProtoTuple.root", "RICH1 Scale 1.00", kGreen+2 ) + + //std::make_tuple ( dir+"/RICH2/Scale0.25/Feature-x86_64+avx2+fma-centos7-gcc7-opt-Expert-ProtoTuple.root", "RICH2 Scale 0.25", kBlack ), + //std::make_tuple ( dir+"/RICH2/Scale0.35/Feature-x86_64+avx2+fma-centos7-gcc7-opt-Expert-ProtoTuple.root", "RICH2 Scale 0.35", kYellow+3 ), + //std::make_tuple ( dir+"/RICH2/Scale0.5/Feature-x86_64+avx2+fma-centos7-gcc7-opt-Expert-ProtoTuple.root", "RICH2 Scale 0.50", kRed-6 ), + //std::make_tuple ( dir+"/RICH2/Scale0.75/Feature-x86_64+avx2+fma-centos7-gcc7-opt-Expert-ProtoTuple.root", "RICH2 Scale 0.75", kBlue+1 ), + //std::make_tuple ( dir+"/RICH2/Scale1.0/Feature-x86_64+avx2+fma-centos7-gcc7-opt-Expert-ProtoTuple.root", "RICH2 Scale 1.00", kGreen+2 ) + + }; unsigned int iPlot = 0; for ( const auto& pd : plotdata ) diff --git a/Rich/RichFutureGlobalPID/src/RichGlobalPIDWriteRichPIDs.cpp b/Rich/RichFutureGlobalPID/src/RichGlobalPIDWriteRichPIDs.cpp index 4bd11ba0d98f1bea63b72e85ff19ab1c52487fe0..df445a0e52d6702550705b2cc6cf970e45ce1b4c 100644 --- a/Rich/RichFutureGlobalPID/src/RichGlobalPIDWriteRichPIDs.cpp +++ b/Rich/RichFutureGlobalPID/src/RichGlobalPIDWriteRichPIDs.cpp @@ -119,6 +119,9 @@ WriteRichPIDs::operator()( const InTracks& tracks, if ( !pidOK && !msgLevel(MSG::VERBOSE) ) { _ri_debug << " " << *pid << endmsg; } else { _ri_verbo << " " << *pid << endmsg; } } + + _ri_verbo << "Created " << rPIDs.size() + << " RichPIDs : Version " << (unsigned int)rPIDs.version() << endmsg; // return the PID objects return rPIDs; diff --git a/Rich/RichFutureRecMonitors/python/RichFutureRecMonitors/ConfiguredRecoMonitors.py b/Rich/RichFutureRecMonitors/python/RichFutureRecMonitors/ConfiguredRecoMonitors.py index 918c6d3377ebbcdc3334a9adb022e31399e50858..d5d8eab76f3319084c61b45953b54109e6bb99f5 100644 --- a/Rich/RichFutureRecMonitors/python/RichFutureRecMonitors/ConfiguredRecoMonitors.py +++ b/Rich/RichFutureRecMonitors/python/RichFutureRecMonitors/ConfiguredRecoMonitors.py @@ -14,6 +14,13 @@ def RichRecMonitors( GroupName = "", # Optional name given to this group. # radiators to process radiators = ["Rich1Gas","Rich2Gas"], + + #=========================================================== + # Pixel treatment options + #=========================================================== + + # Should pixel clustering be run, for either ( RICH1, RICH2 ) + applyPixelClustering = ( False, False ), #=========================================================== # Input / Output options @@ -35,7 +42,7 @@ def RichRecMonitors( GroupName = "", # Optional name given to this group. # Dictionary setting the histograms for each set monitors = { "Expert" : [ "DecodingErrors", "RecoStats", "RichHits", "PixelClusters", - "RichMaterial", + "RichMaterial", "PixelBackgrounds", "TrackSelEff", "PhotonCherenkovAngles" ], "OfflineFull" : [ "DecodingErrors", "RecoStats", "RichHits", "PixelClusters", @@ -59,7 +66,7 @@ def RichRecMonitors( GroupName = "", # Optional name given to this group. ) : from Configurables import GaudiSequencer - from RichFutureRecSys.ConfiguredRichReco import RichTESTrackMap, makeRichAlg, CheckConfig + from RichFutureRecSys.ConfiguredRichReco import RichTESPixelMap, RichTESTrackMap, makeRichAlg, CheckConfig # Check the configuration CheckConfig( inputTrackLocations, outputPIDLocations ) @@ -75,9 +82,28 @@ def RichRecMonitors( GroupName = "", # Optional name given to this group. ppTool = "Rich::Future::ParticleProperties/RichPartProp"+GroupName+":PUBLIC" algprops["ParticlePropertiesTool"] = ppTool + # Radiators ( Aerogel not supported here ) + radsF = ( False, "Rich1Gas" in radiators, "Rich2Gas" in radiators ) + algprops["Radiators"] = radsF + # Detectors + algprops["Detectors"] = ( radsF[0] or radsF[1], radsF[2] ) + # Units GeV = 1000 + # Name for pixel locations + pixname = "" + if algprops["Detectors"][0] : pixname += "RICH1" + if algprops["Detectors"][1] : pixname += "RICH2" + + # Clustering name extension + clusName = "" + if applyPixelClustering[0] : clusName += "R1ClusON" + if applyPixelClustering[1] : clusName += "R2ClusON" + + # Pixel TES locations + cLocs = RichTESPixelMap(pixname+clusName) + # The complete sequence all = GaudiSequencer( "RichMoni"+GroupName, MeasureTime = MeasureTime ) @@ -201,6 +227,15 @@ def RichRecMonitors( GroupName = "", # Optional name given to this group. # Add to sequence tkSeq.Members += [tkMat] + if "PixelBackgrounds" in monitors[histograms] : + from Configurables import Rich__Future__Rec__Moni__PixelBackgrounds as PixBackgrds + # The monitor + bkgMoni = makeRichAlg( PixBackgrds, "RichRecPixBkgs"+name, algprops ) + bkgMoni.RichSIMDPixelSummariesLocation = cLocs["RichSIMDPixelSummariesLocation"] + bkgMoni.PixelBackgroundsLocation = "Rec/Rich/PixelBackgrounds/It1/"+name + # Add to the sequence + tkSeq.Members += [ bkgMoni ] + # return the full monitoring sequence return all diff --git a/Rich/RichFutureRecMonitors/src/RichPixelBackgrounds.cpp b/Rich/RichFutureRecMonitors/src/RichPixelBackgrounds.cpp new file mode 100644 index 0000000000000000000000000000000000000000..8ee432a997cd57b0484bb2a2eaf63e8fe1e631a6 --- /dev/null +++ b/Rich/RichFutureRecMonitors/src/RichPixelBackgrounds.cpp @@ -0,0 +1,76 @@ + +// local +#include "RichPixelBackgrounds.h" + +using namespace Rich::Future::Rec::Moni; + +//----------------------------------------------------------------------------- +// Implementation file for class : PixelBackgrounds +// +// 2016-12-06 : Chris Jones +//----------------------------------------------------------------------------- + +PixelBackgrounds::PixelBackgrounds( const std::string& name, + ISvcLocator* pSvcLocator ) + : Consumer( name, pSvcLocator, + { KeyValue{ "RichSIMDPixelSummariesLocation", SIMDPixelSummariesLocation::Default }, + KeyValue{ "PixelBackgroundsLocation", SIMDPixelBackgroundsLocation::Default } } ) +{ + // Default number of bins + setProperty ( "NBins1DHistos", 25 ); + setProperty ( "NBins2DHistos", 20 ); + // debug + //setProperty( "OutputLevel", MSG::VERBOSE ); +} + +//----------------------------------------------------------------------------- + +StatusCode PixelBackgrounds::prebookHistograms() +{ + bool ok = true; + + // The max background value for each RICH for plots + DetectorArray<float> maxBkg = { 0.6, 0.3 }; + + for ( const auto rich : Rich::detectors() ) + { + ok &= richHisto1D( HID( "pixBkg", rich ), + "Pixel Likelihood Background", -0.001, maxBkg[rich], nBins1D() ) != nullptr; + } + + return ( ok ? StatusCode::SUCCESS : StatusCode::FAILURE ); +} + +//----------------------------------------------------------------------------- + +void PixelBackgrounds::operator()( const SIMDPixelSummaries& pixels, + const SIMDPixelBackgrounds& backgrounds ) const +{ + // the lock + std::lock_guard<std::mutex> lock(m_updateLock); + + for ( auto && data : Ranges::ConstZip(pixels,backgrounds) ) + { + const auto & pix = std::get<0>(data); + const auto & bkg = std::get<1>(data); + + // which rich + const auto rich = pix.rich(); + + // Loop over the scalar entries for this SIMD pixel + for ( std::size_t i = 0; i < SIMDFP::Size; ++i ) + { + // pixel background + richHisto1D( HID("pixBkg",rich) ) -> fill( bkg[i] ); + } + + } + +} + +//----------------------------------------------------------------------------- + +// Declaration of the Algorithm Factory +DECLARE_COMPONENT( PixelBackgrounds ) + +//----------------------------------------------------------------------------- diff --git a/Rich/RichFutureRecMonitors/src/RichPixelBackgrounds.h b/Rich/RichFutureRecMonitors/src/RichPixelBackgrounds.h new file mode 100644 index 0000000000000000000000000000000000000000..0f2f8e27c34bcf1308b488625deb1634a41cad64 --- /dev/null +++ b/Rich/RichFutureRecMonitors/src/RichPixelBackgrounds.h @@ -0,0 +1,80 @@ + +#pragma once + +// STD +#include <mutex> +#include <array> + +// base class +#include "RichFutureRecBase/RichRecHistoAlgBase.h" + +// Gaudi Functional +#include "GaudiAlg/Consumer.h" + +// Rich Utils +#include "RichUtils/ZipRange.h" + +// Rec Event +#include "RichFutureRecEvent/RichRecPixelBackgrounds.h" +#include "RichFutureRecEvent/RichRecSIMDPixels.h" + +namespace Rich +{ + namespace Future + { + namespace Rec + { + namespace Moni + { + + // Use the functional framework + using namespace Gaudi::Functional; + + /** @class PixelBackgrounds RichPixelBackgrounds.h + * + * Monitors the RICH pixel backgrounds. + * + * @author Chris Jones + * @date 2016-12-06 + */ + + class PixelBackgrounds final + : public Consumer< void( const SIMDPixelSummaries&, + const SIMDPixelBackgrounds& ), + Traits::BaseClass_t<HistoAlgBase> > + { + + public: + + /// Standard constructor + PixelBackgrounds( const std::string& name, ISvcLocator* pSvcLocator ); + + public: + + /// Functional operator + void operator()( const SIMDPixelSummaries& pixels, + const SIMDPixelBackgrounds& backgrounds ) const override; + + protected: + + /// Pre-Book all histograms + StatusCode prebookHistograms() override; + + private: + + /// Scalar type for SIMD data + using FP = SIMD::DefaultScalarFP; + /// SIMD floating point type + using SIMDFP = SIMD::FP<Rich::SIMD::DefaultScalarFP>; + + private: + + /// mutex lock + mutable std::mutex m_updateLock; + + }; + + } + } + } +} diff --git a/Rich/RichFutureRecMonitors/src/RichPixelClusters.cpp b/Rich/RichFutureRecMonitors/src/RichPixelClusters.cpp index ba4fd5416d25fb9d67fa31874b9295da9d6a9795..1665e132f88565c823f0087d6e3decf0f4fbf9b7 100644 --- a/Rich/RichFutureRecMonitors/src/RichPixelClusters.cpp +++ b/Rich/RichFutureRecMonitors/src/RichPixelClusters.cpp @@ -19,13 +19,15 @@ PixelClusters::PixelClusters( const std::string& name, ISvcLocator* pSvcLocator StatusCode PixelClusters::prebookHistograms() { - StatusCode sc = StatusCode::SUCCESS; + bool ok = true; + for ( const auto rich : Rich::detectors() ) { - if ( sc ) sc = StatusCode{richHisto1D( Rich::HistogramID( "clusterSize", rich ), - "Pixel Cluster Sizes", -0.5, 100.5, 101 ) != nullptr}; + ok &= richHisto1D( Rich::HistogramID( "clusterSize", rich ), + "Pixel Cluster Sizes", -0.5, 100.5, 101 ) != nullptr; } - return sc; + + return ( ok ? StatusCode::SUCCESS : StatusCode::FAILURE ); } //----------------------------------------------------------------------------- diff --git a/Rich/RichFutureRecPixelAlgorithms/src/RichSIMDPixelBackgroundsEstiAvHPD.cpp b/Rich/RichFutureRecPixelAlgorithms/src/RichSIMDPixelBackgroundsEstiAvHPD.cpp index 1a18e0574a570bc181cd625f33f32d162f7743af..590856524874cca99cf67ba984a99c494487ffdc 100644 --- a/Rich/RichFutureRecPixelAlgorithms/src/RichSIMDPixelBackgroundsEstiAvHPD.cpp +++ b/Rich/RichFutureRecPixelAlgorithms/src/RichSIMDPixelBackgroundsEstiAvHPD.cpp @@ -13,16 +13,16 @@ using namespace Rich::Future::Rec; SIMDPixelBackgroundsEstiAvHPD:: SIMDPixelBackgroundsEstiAvHPD( const std::string& name, ISvcLocator* pSvcLocator ) : Transformer( name, pSvcLocator, - { KeyValue{ "TrackToSegmentsLocation", Relations::TrackToSegmentsLocation::Selected }, - KeyValue{ "TrackPIDHyposLocation", TrackPIDHyposLocation::Default }, - KeyValue{ "TrackSegmentsLocation", LHCb::RichTrackSegmentLocation::Default }, - KeyValue{ "GeomEffsPerPDLocation", GeomEffsPerPDLocation::Default }, - KeyValue{ "DetectablePhotonYieldLocation", PhotonYieldsLocation::Detectable }, + { KeyValue{ "TrackToSegmentsLocation", Relations::TrackToSegmentsLocation::Selected }, + KeyValue{ "TrackPIDHyposLocation", TrackPIDHyposLocation::Default }, + KeyValue{ "TrackSegmentsLocation", LHCb::RichTrackSegmentLocation::Default }, + KeyValue{ "GeomEffsPerPDLocation", GeomEffsPerPDLocation::Default }, + KeyValue{ "DetectablePhotonYieldLocation", PhotonYieldsLocation::Detectable }, KeyValue{ "RichSIMDPixelSummariesLocation", SIMDPixelSummariesLocation::Default } }, { KeyValue{ "PixelBackgroundsLocation", SIMDPixelBackgroundsLocation::Default } } ) { // debug - //setProperty( "OutputLevel", MSG::VERBOSE ); + //setProperty( "OutputLevel", MSG::DEBUG ); } //----------------------------------------------------------------------------- @@ -36,31 +36,8 @@ StatusCode SIMDPixelBackgroundsEstiAvHPD::initialize() // Rich System m_richSys = getDet<DeRichSystem>( DeRichLocations::RichSystem ); - // Make the default working data object - m_pdData = { PanelArray<PDData::Vector>{ PDData::Vector(maxPdIndex(Rich::Rich1,Rich::top)), - PDData::Vector(maxPdIndex(Rich::Rich1,Rich::bottom)) }, - PanelArray<PDData::Vector>{ PDData::Vector(maxPdIndex(Rich::Rich2,Rich::left)), - PDData::Vector(maxPdIndex(Rich::Rich2,Rich::right)) } }; - // initialise the static data in the working object - for ( const auto rich : Rich::detectors() ) - { - auto & richD = m_pdData[rich]; - for ( const auto side : Rich::sides() ) - { - auto & panelD = richD[side]; - unsigned int index(0); - for ( auto & pd : panelD ) - { - // Create the Copy Number for this entry - const Rich::DAQ::PDPanelIndex copyN(index++); - // Get the DePD - // try / catch needed for MaPMTs as not all indices are valid... - // To be improved ... - try { pd.dePD = dePD( rich, side, copyN ); } - catch ( const GaudiException & ) { pd.dePD = nullptr; } - } - } - } + // Make sure the PD data is initialised here, before things get multi-threaded + getPDData(); if ( m_ignoreExpSignal ) { _ri_debug << "Will ignore expected signals when computing backgrounds" << endmsg; } @@ -70,6 +47,91 @@ StatusCode SIMDPixelBackgroundsEstiAvHPD::initialize() //----------------------------------------------------------------------------- +const SIMDPixelBackgroundsEstiAvHPD::RichPDData & +SIMDPixelBackgroundsEstiAvHPD::getPDData() const +{ + // The default data + static RichPDData pdData; + + // If needed initialise the PD data. + // Data is static as does not vary across algorithm instances and + // is heavy on memory usage, so best to only have one copy. + // This works even when threaded as long as the initialisation is + // triggered during the initialize(), as this is always called + // sequentially for all instances. + // Once initialised, access is thread safe. + static bool isReady = false; + if ( UNLIKELY( !isReady ) ) + { + // flag init as done + isReady = true; + + // initialise the data for each PD + for ( const auto rich : Rich::detectors() ) + { + auto & richD = pdData[rich]; + for ( const auto side : Rich::sides() ) + { + auto & panelD = richD[side]; + + // Total number of PDs for this panel + const auto nPDs = maxPdIndex( rich, side ); + + // number of PD groups + // NB : This is a poor mans attempt to group the PDs together, using + // their copy numbers. This will be correlated to grouping spatially, + // but is not perfect. To be addressed once a better PD numbering + // scheme is available from RichDet. + const auto nPDGs = 1 + ( nPDs / m_pdGroupSize[rich] ); + + // Initalise the PD vector + panelD.resize( nPDGs ); + + // Loop over PDs + for ( unsigned int index = 0; index < nPDs; ++index ) + { + // The group ID + const auto groupID = index / m_pdGroupSize[rich]; + + // get the entry in the group vector + auto & pd = panelD[groupID]; + + // Get the DePD + // try / catch needed for MaPMTs as not all indices are valid... + // To be improved ... + try + { + const auto PD = dePD( rich, side, Rich::DAQ::PDPanelIndex(index) ); + if ( PD ) + { + // sanity check on rich... + if ( UNLIKELY( rich != PD->rich() ) ) { Exception("RICH mis-match"); } + + // add to pixel group size + pd.effNumPixs += PD->effectiveNumActivePixels(); + + _ri_debug << "RICH Data : index " << index + << " Group ID " << groupID + << " Eff NumPixs " << pd.effNumPixs << endmsg; + } + } + catch ( const GaudiException & ) + { + _ri_debug << " -> No PD found for " + << rich << " " << side << " index " << index << endmsg; + } + } + + } // side loop + } // RICH loop + + } // isready check + + return pdData; +} + +//----------------------------------------------------------------------------- + SIMDPixelBackgrounds SIMDPixelBackgroundsEstiAvHPD::operator()( const Relations::TrackToSegments::Vector& tkToSegs, const TrackPIDHypos& tkHypos, @@ -78,9 +140,6 @@ SIMDPixelBackgroundsEstiAvHPD::operator()( const Relations::TrackToSegments::Vec const PhotonYields::Vector& detYieldsV, const SIMDPixelSummaries& pixels ) const { - // scalar type - using ScType = Rich::SIMD::DefaultScalarFP; - // the backgrounds to return. Initialize to 0 SIMDPixelBackgrounds backgrounds( pixels.size(), SIMDFP::Zero() ); @@ -88,7 +147,7 @@ SIMDPixelBackgroundsEstiAvHPD::operator()( const Relations::TrackToSegments::Vec SIMD::STDVector<SIMDPDCopyNumber> indices( pixels.size(), SIMDPDCopyNumber::Zero() ); // The working data, copied from the default instance - auto pdData = m_pdData; + RichPDData pdData = getPDData(); // Zip the segment data together const auto segRange = Ranges::ConstZip(segments,geomEffsPerPD,detYieldsV); @@ -116,14 +175,14 @@ SIMDPixelBackgroundsEstiAvHPD::operator()( const Relations::TrackToSegments::Vec const auto pd = (pixel.smartID()[i]).pdID(); // Get the PD copy number index - index[i] = pdCopyNumber(pd).data(); + index[i] = pdIndex(pd,rich); // Sanity check if ( index[i] < dataV.size() ) { - // the working data object for this HPD + // the working data object for this PD group auto & data = dataV[ index[i] ]; - // count the number of hits in each HPD, in each RICH + // count the number of hits in each PD, in each RICH ++(data.obsSignal); } else @@ -133,7 +192,7 @@ SIMDPixelBackgroundsEstiAvHPD::operator()( const Relations::TrackToSegments::Vec } // pixel scalar loop - } + } // SIMD pixels // ----------------------------------------------------------- // Now the expected signals, based on the track information @@ -171,13 +230,13 @@ SIMDPixelBackgroundsEstiAvHPD::operator()( const Relations::TrackToSegments::Vec { // expected signal for this PD const auto sig = detYield[tkHypo] * PD.second; - // HPD ID + // PD ID const auto & pdID = PD.first; // index - const auto index = pdCopyNumber(pdID).data(); + const auto index = pdIndex(pdID,rich); // panel data vector auto & dataV = (pdData[rich])[pdID.panel()]; - // Update the HPD data map with this value + // Update the PD data map with this value if ( index < dataV.size() ) { auto & data = dataV[index]; @@ -200,17 +259,17 @@ SIMDPixelBackgroundsEstiAvHPD::operator()( const Relations::TrackToSegments::Vec // Obtain background term PD by PD for ( const auto rich : Rich::detectors() ) { - //_ri_debug << "Computing HPD backgrounds in " << rich << endmsg; + //_ri_debug << "Computing PD backgrounds in " << rich << endmsg; - int iter = 1; + unsigned int iter = 1; bool cont = true; - ScType rnorm = 0.0; + FP rnorm = 0.0; while ( cont ) { //_ri_debug << " -> Iteration " << iter << endmsg; - int nBelow(0), nAbove(0); - ScType tBelow = 0.0; + unsigned int nBelow(0), nAbove(0); + FP tBelow = 0.0; // loop over panels for ( auto& panelData : pdData[rich] ) { @@ -226,10 +285,10 @@ SIMDPixelBackgroundsEstiAvHPD::operator()( const Relations::TrackToSegments::Vec if ( 1 == iter ) { - // First iteration, just set background for this HPD to the difference - // between the observed and and expected number of hits in the HPD - //_ri_debug << " -> HPD " << pd << " obs. = " << obs << " exp. = " << exp << endmsg; - bkg = (ScType)iPD.obsSignal - iPD.expSignal; + // First iteration, just set background for this PD to the difference + // between the observed and and expected number of hits in the PD + //_ri_debug << " -> PD " << pd << " obs. = " << obs << " exp. = " << exp << endmsg; + bkg = static_cast<FP>(iPD.obsSignal) - iPD.expSignal; } else { @@ -239,14 +298,14 @@ SIMDPixelBackgroundsEstiAvHPD::operator()( const Relations::TrackToSegments::Vec if ( bkg < 0.0 ) { - // Count the number of HPDs below expectation for this iteration + // Count the number of PDs below expectation for this iteration ++nBelow; // save the total amount below expectation tBelow += fabs( bkg ); } else if ( bkg > 0.0 ) { - // count the number of HPDs above expectation + // count the number of PDs above expectation ++nAbove; } @@ -259,10 +318,10 @@ SIMDPixelBackgroundsEstiAvHPD::operator()( const Relations::TrackToSegments::Vec if ( nBelow > 0 && nAbove > 0 ) { - // we have some HPDs above and below expectation - // calculate the amount of signal below per above HPD - rnorm = tBelow / ( static_cast<ScType>(nAbove) ); - //_ri_debug << " -> Correction factor per HPD above = " << rnorm << endmsg; + // we have some PDs above and below expectation + // calculate the amount of signal below per above PD + rnorm = tBelow / ( static_cast<FP>(nAbove) ); + //_ri_debug << " -> Correction factor per PD above = " << rnorm << endmsg; } else { @@ -282,21 +341,23 @@ SIMDPixelBackgroundsEstiAvHPD::operator()( const Relations::TrackToSegments::Vec // ----------------------------------------------------------- // Loop over the RICH data maps - for ( auto & richData : pdData ) + for ( const auto rich : Rich::detectors() ) { // loop over panels - for ( auto & panel : richData ) + for ( auto & panel : pdData[rich] ) { // Loop over the PD data objects for ( auto & pd : panel ) { - if ( pd.obsSignal > 0 && pd.dePD ) + if ( pd.obsSignal > 0 ) { - // normalise background for this HPD - pd.expBackgrd = - std::max( ( pd.expBackgrd > 0 ? - pd.expBackgrd/pd.dePD->effectiveNumActivePixels() : 0 ), - m_minPixBkg.value() ); + // normalise background for this PD + pd.expBackgrd = ( pd.expBackgrd > 0 ? pd.expBackgrd / pd.effNumPixs : 0 ); + // rescale by the overall weight factor for the RICH this PD is in + pd.expBackgrd *= m_bkgWeight[rich]; + // apply min and max pixel background limits + pd.expBackgrd = std::max( pd.expBackgrd, m_minPixBkg[rich] ); + pd.expBackgrd = std::min( pd.expBackgrd, m_maxPixBkg[rich] ); } } } @@ -324,17 +385,21 @@ SIMDPixelBackgroundsEstiAvHPD::operator()( const Relations::TrackToSegments::Vec for ( std::size_t i = 0; i < SIMDPixel::SIMDFP::Size; ++i ) { + // index for this PD + const auto indx = index[i]; + // get the data object for this PD - if ( index[i] < dataV.size() ) + if ( indx < dataV.size() ) { // data for this PD - auto & data = dataV[ index[i] ]; + auto & data = dataV[indx]; // update the pixel background bkg[i] = data.expBackgrd; + _ri_verbo << rich << " Pix Bkg " << bkg[i] << endmsg; } else { - Error( "Bkg : PD index " + std::to_string(index[i]) + " out of range !!" ).ignore(); + Error( "Bkg : PD index " + std::to_string(indx) + " out of range !!" ).ignore(); bkg[i] = 0; } diff --git a/Rich/RichFutureRecPixelAlgorithms/src/RichSIMDPixelBackgroundsEstiAvHPD.h b/Rich/RichFutureRecPixelAlgorithms/src/RichSIMDPixelBackgroundsEstiAvHPD.h index 3dbd239c0d8971a930614f14efdd4d181bc7f171..7dc9e2850fd48be2fc391bcd3993474c44caa7f1 100644 --- a/Rich/RichFutureRecPixelAlgorithms/src/RichSIMDPixelBackgroundsEstiAvHPD.h +++ b/Rich/RichFutureRecPixelAlgorithms/src/RichSIMDPixelBackgroundsEstiAvHPD.h @@ -5,13 +5,15 @@ #include <algorithm> #include <vector> #include <ostream> +#include <cstdint> + +// Gaudi +#include "GaudiKernel/StdArrayAsProperty.h" +#include "GaudiAlg/Transformer.h" // base class #include "RichFutureRecBase/RichRecAlgBase.h" -// Gaudi Functional -#include "GaudiAlg/Transformer.h" - // Rec Event #include "RichFutureRecEvent/RichRecPixelBackgrounds.h" #include "RichFutureRecEvent/RichRecTrackPIDInfo.h" @@ -90,41 +92,60 @@ namespace Rich /// Data values for a single PD struct PDData { - unsigned int obsSignal{0}; ///< Number of observed hits in this PD - double expSignal{0}; ///< Expected signal in this PD - double expBackgrd{0}; ///< Expected background in this PD - const DeRichPD * dePD{nullptr}; ///< The PD detector element + std::uint16_t obsSignal{0}; ///< Number of observed hits in this PD + FP expSignal{0}; ///< Expected signal in this PD + FP expBackgrd{0}; ///< Expected background in this PD + FP effNumPixs{0}; ///< Effective number of pixels using Vector = std::vector<PDData>; ///< Vector type }; + private: + + /// Per Rich Data Structure + using RichPDData = DetectorArray< PanelArray<PDData::Vector> >; + + /// Access the static data structure + const RichPDData & getPDData() const; + private : // methods /// Gets the per RICH index for the given PD ID - decltype(auto) pdCopyNumber( const LHCb::RichSmartID pdID ) const + inline decltype(auto) pdCopyNumber( const LHCb::RichSmartID pdID ) const { // Panel index return m_richSys->dePDPanel(pdID)->pdNumber(pdID); } + /// Gets the working data index for the given PD ID + inline decltype(auto) pdIndex( const LHCb::RichSmartID pdID, + const Rich::DetectorType rich ) const noexcept + { + // NB : This is a poor mans attempt to group the PDs together, using + // their copy numbers. This will be correlated to grouping spatially, + // but is not perfect. To be addressed once a better PD numbering + // scheme is available from RichDet. + return ( pdCopyNumber(pdID).data() / m_pdGroupSize[rich] ); + } + /// Get the max Index value for each panel - decltype(auto) maxPdIndex( const Rich::DetectorType rich, - const Rich::Side side ) const + inline decltype(auto) maxPdIndex( const Rich::DetectorType rich, + const Rich::Side side ) const { // Need to add one to handle fact for MaPMTs numbering scheme starts at 1... - return m_richSys->dePDPanel(rich,side)->maxPdNumber().data() + 1; + return ( m_richSys->dePDPanel(rich,side)->maxPdNumber().data() + 1 ); } /// Get the DePD object - inline const DeRichPD * dePD( const Rich::DetectorType rich, - const Rich::Side side , - Rich::DAQ::PDPanelIndex copyN ) const + inline decltype(auto) dePD( const Rich::DetectorType rich, + const Rich::Side side, + const Rich::DAQ::PDPanelIndex copyN ) const { return m_richSys->dePDPanel(rich,side)->dePD(copyN); } - + /// Get the DePD object - inline const DeRichPD * dePD( LHCb::RichSmartID pdID, - Rich::DAQ::PDPanelIndex copyN ) const + inline decltype(auto) dePD( const LHCb::RichSmartID pdID, + const Rich::DAQ::PDPanelIndex copyN ) const noexcept { return dePD(pdID.rich(),pdID.panel(),copyN); } @@ -132,27 +153,39 @@ namespace Rich private : // data /// Maximum number of iterations in background normalisation - Gaudi::Property<int> m_maxBkgIterations + Gaudi::Property<unsigned int> m_maxBkgIterations { this, "MaxBackgroundNormIterations", 10, "Maximum number of iterations in background normalisation" }; - /** Minimum pixel background value. - * Any value below this will be set to this value */ - Gaudi::Property<double> m_minPixBkg - { this, "MinPixelBackground", 0, "Minimum pixel background" }; + /// Minimum pixel background value, for each RICH + Gaudi::Property< DetectorArray<FP> > m_minPixBkg + { this, "MinPixelBackground", { 0.0f, 0.0f }, + "Minimum pixel background for each RICH" }; + + /// Maximum pixel background value, for each RICH + Gaudi::Property< DetectorArray<FP> > m_maxPixBkg + { this, "MaxPixelBackground", { 9e9f, 9e9f }, + "Maximum pixel background for each RICH" }; /** Ignore the expected signal when computing the background terms. - Effectively, will assume all observed hists are background */ + Effectively, will assume all observed hits are background */ Gaudi::Property<bool> m_ignoreExpSignal { this, "IgnoreExpectedSignals", false, "Ignore expectations when calculating backgrounds" }; + /// Background 'weight' for each RICH + Gaudi::Property< DetectorArray<float> > m_bkgWeight + { this, "PDBckWeights", { 1.0f, 1.0f }, + "Weights to apply to the background terms for each RICH" }; + + /// PD Group Size for each RICH + Gaudi::Property< DetectorArray<unsigned int> > m_pdGroupSize + { this, "PDGroupSize", { 1u, 1u }, + "The number of PDs to group together for the background calculation" }; + /// Rich System detector element const DeRichSystem * m_richSys = nullptr; - /// Default working data object - DetectorArray< PanelArray<PDData::Vector> > m_pdData; - }; } diff --git a/Rich/RichFutureRecSys/examples/IntelProfiler.py b/Rich/RichFutureRecSys/examples/IntelProfiler.py index bcd38576eae679467c17e7280b58136c42b56ef2..8d370e99212d3e1a7dd78423e6a39d81e14e2a69 100644 --- a/Rich/RichFutureRecSys/examples/IntelProfiler.py +++ b/Rich/RichFutureRecSys/examples/IntelProfiler.py @@ -12,6 +12,8 @@ AuditorSvc().Auditors += [ profiler ] ApplicationMgr().AuditAlgorithms = True # Sequence which we need to profile. If empty, we profile all algorithms profiler.IncludeAlgorithms = [ ] +# Pixels and decoding +profiler.IncludeAlgorithms += [ "RichFutureDecode", "RichPixels" ] # Photon reco profiler.IncludeAlgorithms += [ "RichPhotonsDown", "RichPhotonsUp", "RichPhotonsLong" ] # ray tracing @@ -29,10 +31,10 @@ profiler.IncludeAlgorithms += [ "RichGeomEffDown", "RichGeomEffUp", "RichGeomEff # To avoid filling up /tmp # export TMPDIR=/group/rich/jonesc/IntelProfile/tmp -# sudo sh -c 'echo 0 >/proc/sys/kernel/perf_event_paranoid' +# sudo sh -c 'echo 0 > /proc/sys/kernel/perf_event_paranoid' # Example command line for the Intel profiler -# amplxe-cl --collect hotspots -start-paused -follow-child -target-duration-type=short -no-allow-multiple-runs -no-analyze-system -data-limit=800 -q -- gaudirun.py -T ~/LHCbCMake/Feature/Rec/Rich/RichFutureRecSys/examples/{RichFuture.py,IntelProfiler.py,data/MCXDstUpgradeFiles.py} +# amplxe-cl --collect advanced-hotspots -start-paused -follow-child -target-duration-type=short -no-allow-multiple-runs -no-analyze-system -data-limit=800 -q -- gaudirun.py -T ~/LHCbCMake/Feature/Rec/Rich/RichFutureRecSys/examples/{RichFuture.py,IntelProfiler.py,data/MCXDstUpgradeFiles.py} # Kernel drivers diff --git a/Rich/RichFutureRecSys/examples/RichFuture.py b/Rich/RichFutureRecSys/examples/RichFuture.py index 1e469247f904381e470c53d4821aefbd00cd4f2a..195822935c2bb66fe6b1b715e3a033b9040a746e 100644 --- a/Rich/RichFutureRecSys/examples/RichFuture.py +++ b/Rich/RichFutureRecSys/examples/RichFuture.py @@ -27,7 +27,7 @@ rootFileBaseName = myBuild + "-" + myConf + "-" + histos HistogramPersistencySvc().OutputFile = rootFileBaseName + "-Histos.root" # Event numbers -nEvents = -1 +nEvents = 10000 EventSelector().PrintFreq = 100 #LHCbApp().SkipEvents = 3550 @@ -111,21 +111,26 @@ preloadGeom = True workAroundTrackTools = True # Input tracks -tkLocs = { "Long" : tkFilt.OutLongTracksLocation, - "Down" : tkFilt.OutDownTracksLocation, - "Up" : tkFilt.OutUpTracksLocation } +#tkLocs = { "Long" : tkFilt.OutLongTracksLocation, +# "Down" : tkFilt.OutDownTracksLocation, +# "Up" : tkFilt.OutUpTracksLocation } #tkLocs = { "All" : "Rec/Track/Best" } -#tkLocs = { "Long" : tkFilt.OutLongTracksLocation } +tkLocs = { "Long" : tkFilt.OutLongTracksLocation } #tkLocs = { "Up" : tkFilt.OutUpTracksLocation } # Output PID -pidLocs = { "Long" : "Rec/Rich/LongPIDs", - "Down" : "Rec/Rich/DownPIDs", - "Up" : "Rec/Rich/UpPIDs" } +#pidLocs = { "Long" : "Rec/Rich/LongPIDs", +# "Down" : "Rec/Rich/DownPIDs", +# "Up" : "Rec/Rich/UpPIDs" } #pidLocs = { "All" : "Rec/Rich/PIDs" } -#pidLocs = { "Long" : "Rec/Rich/LongPIDs" } +pidLocs = { "Long" : "Rec/Rich/LongPIDs" } #pidLocs = { "Up" : "Rec/Rich/UpPIDs" } +# RICH radiators to use +#rads = ["Rich1Gas","Rich2Gas"] +rads = ["Rich1Gas"] +#rads = ["Rich2Gas"] + # Merged output finalPIDLoc = "Rec/Rich/PIDs" @@ -137,6 +142,9 @@ dType = "Upgrade" #online = True online = False +# PD Grouping for backgrounds +pdGroupSize = (12,12) + # -------------------------------------------------------------------------------------- # UnpackMC from Configurables import UnpackMCParticle, UnpackMCVertex @@ -152,7 +160,9 @@ RichRec = RichRecoSequence( dataType = dType, onlineBrunelMode = online, photonReco = photoRecoType, preloadGeometry = preloadGeom, + radiators = rads, makeTkToolsThreadSafe = workAroundTrackTools, + PDGroupSize = pdGroupSize, inputTrackLocations = tkLocs, outputPIDLocations = pidLocs, mergedOutputPIDLocation = finalPIDLoc ) @@ -165,6 +175,7 @@ all.Members += [ RichRec ] # Monitoring from RichFutureRecMonitors.ConfiguredRecoMonitors import RichRecMonitors RichMoni = RichRecMonitors( inputTrackLocations = tkLocs, + radiators = rads, onlineBrunelMode = online, outputPIDLocations = pidLocs, histograms = histos ) @@ -175,7 +186,8 @@ all.Members += [ RichMoni ] # -------------------------------------------------------------------------------------- # MC Checking from RichFutureRecMonitors.ConfiguredRecoMonitors import RichRecCheckers -RichCheck = RichRecCheckers( inputTrackLocations = tkLocs, +RichCheck = RichRecCheckers( inputTrackLocations = tkLocs, + radiators = rads, onlineBrunelMode = online, outputPIDLocations = pidLocs, histograms = histos ) diff --git a/Rich/RichFutureRecSys/examples/brunel-baseline-qmtest.py b/Rich/RichFutureRecSys/examples/brunel-baseline-qmtest.py index 0d2426fee1290d03c9dab426a03834dab4f7a5f0..f935a498e1bb15b122029bc23baf4188c6b3e266 100644 --- a/Rich/RichFutureRecSys/examples/brunel-baseline-qmtest.py +++ b/Rich/RichFutureRecSys/examples/brunel-baseline-qmtest.py @@ -2,24 +2,22 @@ from Gaudi.Configuration import * importOptions("$APPCONFIGOPTS/Brunel/MC-WithTruth.py") -from Configurables import L0Conf -L0Conf().EnsureKnownTCK = False +#importOptions("$BRUNELROOT/tests/options/testBrunel-defaults.py") -#from PRConfig import TestFileDB -#TestFileDB.test_file_db['upgrade-baseline-FT61-digi'].run() +from Configurables import TrackBestTrackCreator, TrackVectorFitter +TrackBestTrackCreator().addTool(TrackVectorFitter, 'Fitter') -importOptions("$APPCONFIGOPTS/Persistency/Compression-ZLIB-1.py") +from Configurables import Brunel +Brunel().DataType = "Upgrade" -from Configurables import Brunel, LHCbApp +from PRConfig import TestFileDB +TestFileDB.test_file_db['upgrade-baseline-FT61-digi'].run() -LHCbApp().Simulation = True -#Brunel().Monitors = ["SC","FPE"] +Brunel().EvtMax = 1 +Brunel().PrintFreq = 1 -Brunel().EvtMax = -1 -Brunel().PrintFreq = 100 - -Brunel().OutputType = 'XDST' -Brunel().FilterTrackStates = False +Brunel().OutputType = 'NONE' +#Brunel().FilterTrackStates = False msgSvc = getConfigurable("MessageSvc") #msgSvc.setVerbose += [ "DeRichGasRadiator" ] diff --git a/Rich/RichFutureRecSys/examples/data/MCXDstUpgradeFiles.py b/Rich/RichFutureRecSys/examples/data/MCXDstUpgradeFiles.py index e8eaa932045adb9c8a9648a64fd9c98c87bc5310..e478861d345b2dded62a551f137dad4133f396be 100644 --- a/Rich/RichFutureRecSys/examples/data/MCXDstUpgradeFiles.py +++ b/Rich/RichFutureRecSys/examples/data/MCXDstUpgradeFiles.py @@ -9,7 +9,7 @@ searchPaths = [ # CRJ's CernVM "/home/chris/LHCb/Data/MC/Upgrade/Sim09c-Up02/30000000/XDST/", # the pit - "/group/rich/jonesc/LHCb/Data/MC/Upgrade/XDST/" + "/group/rich/jonesc/LHCb/Data/MC/Upgrade/Sim09c-Up02/30000000/XDST/" ] print "Data Files :-" diff --git a/Rich/RichFutureRecSys/python/RichFutureRecSys/ConfiguredRichReco.py b/Rich/RichFutureRecSys/python/RichFutureRecSys/ConfiguredRichReco.py index 0eb0e7d2dfc4392840940f8538f302ad06c968e2..23a67b87cc0ee5a5aff18b78423d28605f5ebce1 100644 --- a/Rich/RichFutureRecSys/python/RichFutureRecSys/ConfiguredRichReco.py +++ b/Rich/RichFutureRecSys/python/RichFutureRecSys/ConfiguredRichReco.py @@ -171,10 +171,16 @@ def RichRecoSequence( GroupName = "", # Optional name given to this group. # Pixel background options # Ignore the expected signals based on the track information - HPDBackIgnoreExpSignals = [ True, False, False, False ], + PDBackIgnoreExpSignals = [ True, False, False, False ], - # Minimum allowed pixel background value - HPDBackMinPixBackground = [ 0, 0, 0, 0 ], + # Minimum allowed pixel background value (RICH1,RICH2) + PDBackMinPixBackground = [ (0,0), (0,0), (0,0), (0,0) ], + + # Maximum allowed pixel background value (RICH1,RICH2) + PDBackMaxPixBackground = [ (999,999), (999,999), (999,999), (999,999) ], + + # Group Size for PDs RICH1 RICH2 + PDGroupSize = ( 8, 8 ), # Likelihood minimizer options @@ -639,8 +645,13 @@ def RichRecoSequence( GroupName = "", # Optional name given to this group. # Output pixBkgs.PixelBackgroundsLocation = "Rec/Rich/PixelBackgrounds/"+itN+"/"+name # Settings - pixBkgs.IgnoreExpectedSignals = HPDBackIgnoreExpSignals[it] - pixBkgs.MinPixelBackground = HPDBackMinPixBackground[it] + pixBkgs.IgnoreExpectedSignals = PDBackIgnoreExpSignals[it] + pixBkgs.MinPixelBackground = PDBackMinPixBackground[it] + pixBkgs.MaxPixelBackground = PDBackMaxPixBackground[it] + if isUpgrade : + # Weights for background terms for ( RICH1 RICH2 ) + pixBkgs.PDBckWeights = ( 0.75, 0.75 ) + pixBkgs.PDGroupSize = PDGroupSize # Likelihood minimiser like = makeRichAlg( LikelihoodMinimiser, "RichGPIDLikelihood"+itN+name, algprops )