diff --git a/Trigger/TrigAlgorithms/TrigFastTrackFinder/src/TrigFastTrackFinder.cxx b/Trigger/TrigAlgorithms/TrigFastTrackFinder/src/TrigFastTrackFinder.cxx index fd07ed871b7ae93238f728e402df2611631ef227..e4126da6a71e08556d97dc2a467948deb857263f 100644 --- a/Trigger/TrigAlgorithms/TrigFastTrackFinder/src/TrigFastTrackFinder.cxx +++ b/Trigger/TrigAlgorithms/TrigFastTrackFinder/src/TrigFastTrackFinder.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration */ ///////////////////////////////////////////////////////////////////////////////// @@ -21,11 +21,11 @@ #include "TrkRIO_OnTrack/RIO_OnTrack.h" #include "InDetPrepRawData/SCT_Cluster.h" #include "InDetPrepRawData/PixelCluster.h" -#include "InDetRIO_OnTrack/SiClusterOnTrack.h" +#include "InDetRIO_OnTrack/SiClusterOnTrack.h" #include "xAODTrigger/TrigCompositeAuxContainer.h" -#include "TrkParameters/TrackParameters.h" -#include "TrkTrack/Track.h" +#include "TrkParameters/TrackParameters.h" +#include "TrkTrack/Track.h" #include "CxxUtils/phihelper.h" @@ -34,23 +34,23 @@ #include "PathResolver/PathResolver.h" -TrigFastTrackFinder::TrigFastTrackFinder(const std::string& name, ISvcLocator* pSvcLocator) : +TrigFastTrackFinder::TrigFastTrackFinder(const std::string& name, ISvcLocator* pSvcLocator) : - AthReentrantAlgorithm(name, pSvcLocator), - m_numberingTool("TrigL2LayerNumberTool"), + AthReentrantAlgorithm(name, pSvcLocator), + m_numberingTool("TrigL2LayerNumberTool"), m_spacePointTool("TrigSpacePointConversionTool"), m_trackMaker("InDet::SiTrackMaker_xk/InDetTrigSiTrackMaker"), m_trigInDetTrackFitter("TrigInDetTrackFitter"), m_trigZFinder("TrigZFinder/TrigZFinder", this ), m_trackSummaryTool("Trk::ITrackSummaryTool/ITrackSummaryTool"), - m_accelTool("TrigInDetAccelerationTool"), + m_accelTool("TrigInDetAccelerationTool"), m_accelSvc("TrigInDetAccelerationSvc", name), m_doCloneRemoval(true), m_useBeamSpot(true), m_doZFinder(false), m_doZFinderOnly(false), m_storeZFinderVertices(false), - m_nfreeCut(5), + m_nfreeCut(5), m_countTotalRoI(0), m_countRoIwithEnoughHits(0), m_countRoIwithTracks(0), @@ -58,7 +58,7 @@ TrigFastTrackFinder::TrigFastTrackFinder(const std::string& name, ISvcLocator* p m_sctId(0), m_idHelper(0), m_particleHypothesis(Trk::pion), - m_useNewLayerNumberScheme(false), + m_useNewLayerNumberScheme(false), m_useGPU(false), m_LRTmode(false), m_trigseedML_LUT(""), @@ -107,16 +107,16 @@ TrigFastTrackFinder::TrigFastTrackFinder(const std::string& name, ISvcLocator* p declareProperty( "MinHits", m_minHits = 5 ); - declareProperty("TracksName", + declareProperty("TracksName", m_outputTracksKey = std::string("TrigFastTrackFinder_Tracks"), "TrackCollection name"); - declareProperty("inputTracksName", + declareProperty("inputTracksName", m_inputTracksKey = std::string(""), "TrackCollection name"); declareProperty("RoIs", m_roiCollectionKey = std::string("OutputRoIs"), "RoIs to read in"); - + declareProperty( "UseBeamSpot", m_useBeamSpot = true); declareProperty( "FreeClustersCut" ,m_nfreeCut ); declareProperty( "SpacePointProviderTool", m_spacePointTool ); @@ -160,15 +160,15 @@ StatusCode TrigFastTrackFinder::initialize() { } // optional PRD to track association map ATH_CHECK(m_prdToTrackMap.initialize( !m_prdToTrackMap.key().empty() )); - - + + ATH_CHECK(m_beamSpotKey.initialize()); ATH_MSG_DEBUG(" TrigFastTrackFinder : MinHits set to " << m_minHits); - ATH_CHECK(m_numberingTool.retrieve()); + ATH_CHECK(m_numberingTool.retrieve()); ATH_CHECK(m_spacePointTool.retrieve()); @@ -187,12 +187,11 @@ StatusCode TrigFastTrackFinder::initialize() { //Get ID helper ATH_CHECK(detStore()->retrieve(m_idHelper, "AtlasID")); - + ATH_CHECK(detStore()->retrieve(m_pixelId, "PixelID")); - + ATH_CHECK(detStore()->retrieve(m_sctId, "SCT_ID")); - // Run3 monitoring if ( !m_monTool.empty() ) { ATH_CHECK(m_monTool.retrieve() ); @@ -224,7 +223,7 @@ StatusCode TrigFastTrackFinder::initialize() { int lut_h = 45; float lut_range[4] = {0.0,3.0,0.0,9.0}; TrigSeedML_LUT L(1,lut_w,lut_h,lut_range); - //read data from LUT file + //read data from LUT file std::string lut_fileName = PathResolver::find_file(m_trigseedML_LUT, "DATAPATH"); if (lut_fileName.empty()) { ATH_MSG_ERROR("Cannot find TrigSeedML LUT file " << lut_fileName); @@ -253,7 +252,7 @@ StatusCode TrigFastTrackFinder::initialize() { ATH_CHECK(m_hitDVSPKey.initialize()); } - ATH_MSG_DEBUG(" Initialized successfully"); + ATH_MSG_DEBUG(" Initialized successfully"); return StatusCode::SUCCESS; } @@ -265,7 +264,7 @@ StatusCode TrigFastTrackFinder::start() //getting magic numbers from the layer numbering tool m_tcs.m_maxBarrelPix = m_numberingTool->offsetBarrelSCT(); - m_tcs.m_minEndcapPix = m_numberingTool->offsetEndcapPixels(); + m_tcs.m_minEndcapPix = m_numberingTool->offsetEndcapPixels(); m_tcs.m_maxEndcapPix = m_numberingTool->offsetEndcapSCT(); m_tcs.m_maxSiliconLayer = m_numberingTool->maxSiliconLayerNum(); m_tcs.m_layerGeometry.clear(); @@ -283,7 +282,7 @@ StatusCode TrigFastTrackFinder::start() StatusCode TrigFastTrackFinder::execute(const EventContext& ctx) const { - //RoI preparation/update + //RoI preparation/update SG::ReadHandle<TrigRoiDescriptorCollection> roiCollection(m_roiCollectionKey, ctx); @@ -291,7 +290,7 @@ StatusCode TrigFastTrackFinder::execute(const EventContext& ctx) const { TrigRoiDescriptor internalRoI; - if ( roiCollection->size()>1 ) ATH_MSG_WARNING( "More than one Roi in the collection: " << m_roiCollectionKey << ", this is not supported - use a composite Roi" ); + if ( roiCollection->size()>1 ) ATH_MSG_WARNING( "More than one Roi in the collection: " << m_roiCollectionKey << ", this is not supported - use a composite Roi" ); if ( roiCollection->size()>0 ) internalRoI = **roiCollection->begin(); // internalRoI.manageConstituents(false);//Don't try to delete RoIs at the end @@ -315,6 +314,7 @@ StatusCode TrigFastTrackFinder::execute(const EventContext& ctx) const { } + StatusCode TrigFastTrackFinder::findTracks(InDet::SiTrackMakerEventData_xk &trackEventData, const TrigRoiDescriptor& roi, const TrackCollection* inputTracks, @@ -322,7 +322,7 @@ StatusCode TrigFastTrackFinder::findTracks(InDet::SiTrackMakerEventData_xk &trac const EventContext& ctx) const { ATH_MSG_DEBUG("Input RoI " << roi); - + // Run3 monitoring ----------> auto mnt_roi_nTracks = Monitored::Scalar<int>("roi_nTracks", 0); auto mnt_roi_nSPs = Monitored::Scalar<int>("roi_nSPs", 0); @@ -346,7 +346,7 @@ StatusCode TrigFastTrackFinder::findTracks(InDet::SiTrackMakerEventData_xk &trac mnt_timer_Total.start(); // Run3 monitoring mnt_timer_SpacePointConversion.start(); // Run3 monitoring - + mnt_roi_lastStageExecuted = 1; // Run3 monitoring std::vector<TrigSiSpacePointBase> convertedSpacePoints; @@ -407,14 +407,14 @@ StatusCode TrigFastTrackFinder::findTracks(InDet::SiTrackMakerEventData_xk &trac ATH_MSG_DEBUG("vertices->size(): " << vertices->size()); - if ( m_doFastZVseeding ) { + if ( m_doFastZVseeding ) { vZv.reserve(vertices->size()); for (const auto vertex : *vertices) { ATH_MSG_DEBUG("REGTEST / ZFinder vertex: " << *vertex); float z = vertex->z(); float zMinus = z - 7.0; float zPlus = z + 7.0; - TrigRoiDescriptor* newRoi = new TrigRoiDescriptor(roi.eta(), roi.etaMinus(), roi.etaPlus(), + TrigRoiDescriptor* newRoi = new TrigRoiDescriptor(roi.eta(), roi.etaMinus(), roi.etaPlus(), roi.phi(), roi.phiMinus(), roi.phiPlus(), z, zMinus, zPlus); tmpRoi->push_back(newRoi); vZv.push_back(z); @@ -422,13 +422,13 @@ StatusCode TrigFastTrackFinder::findTracks(InDet::SiTrackMakerEventData_xk &trac ATH_MSG_DEBUG("REGTEST / tmpRoi: " << *tmpRoi); } - + mnt_timer_ZFinder.stop(); // Run3 monitoring - - if ( m_doZFinderOnly ) { - /// write vertex collection ... + + if ( m_doZFinderOnly ) { + /// write vertex collection ... /// TODO: add vertices collection handling here, - /// should not be 0 at this point unless fastZVseeding + /// should not be 0 at this point unless fastZVseeding /// is enabled return StatusCode::SUCCESS; } @@ -465,7 +465,7 @@ StatusCode TrigFastTrackFinder::findTracks(InDet::SiTrackMakerEventData_xk &trac //GPU offloading ends ... } - + ATH_MSG_DEBUG("number of triplets: " << triplets.size()); mnt_timer_TripletMaking.stop(); mnt_roi_lastStageExecuted = 4; @@ -513,14 +513,14 @@ StatusCode TrigFastTrackFinder::findTracks(InDet::SiTrackMakerEventData_xk &trac for(std::list<Trk::Track*>::const_iterator t=tracks.begin(); t!=tracks.end(); ++t) { if((*t)) { - float d0 = (*t)->perigeeParameters()==0 ? 10000.0 : (*t)->perigeeParameters()->parameters()[Trk::d0]; + float d0 = (*t)->perigeeParameters()==0 ? 10000.0 : (*t)->perigeeParameters()->parameters()[Trk::d0]; if (fabs(d0) > m_initialD0Max) { ATH_MSG_DEBUG("REGTEST / Reject track with d0 = " << d0 << " > " << m_initialD0Max); qualityTracks.push_back(std::make_tuple(false,0,(*t)));//Flag track as bad, but keep in vector for later deletion continue; } if(m_checkSeedRedundancy) { - //update clusterMap + //update clusterMap updateClusterMap(trackIndex++, (*t), siClusterMap); } if(m_doCloneRemoval) { @@ -530,7 +530,7 @@ StatusCode TrigFastTrackFinder::findTracks(InDet::SiTrackMakerEventData_xk &trac qualityTracks.push_back(std::make_tuple(true, 0, (*t))); } } - } + } ATH_MSG_VERBOSE("Found "<<tracks.size()<<" tracks using triplet"); } @@ -572,16 +572,21 @@ StatusCode TrigFastTrackFinder::findTracks(InDet::SiTrackMakerEventData_xk &trac size_t counter(1); for (auto fittedTrack = outputTracks.begin(); fittedTrack!=outputTracks.end(); ) { if ((*fittedTrack)->perigeeParameters()){ - float d0 = (*fittedTrack)->perigeeParameters()->parameters()[Trk::d0]; - float z0 = (*fittedTrack)->perigeeParameters()->parameters()[Trk::z0]; + float d0 = (*fittedTrack)->perigeeParameters()->parameters()[Trk::d0]; + float z0 = (*fittedTrack)->perigeeParameters()->parameters()[Trk::z0]; if (fabs(d0) > m_initialD0Max || fabs(z0) > m_Z0Max) { - ATH_MSG_WARNING("REGTEST / Reject track after fit with d0 = " << d0 << " z0= " << z0 - << " larger than limits (" << m_initialD0Max << ", " << m_Z0Max << ")"); + if(m_LRTmode){ + ATH_MSG_DEBUG("REGTEST / Reject track after fit with d0 = " << d0 << " z0= " << z0 + << " larger than limits (" << m_initialD0Max << ", " << m_Z0Max << ")"); + }else{ + ATH_MSG_WARNING("REGTEST / Reject track after fit with d0 = " << d0 << " z0= " << z0 + << " larger than limits (" << m_initialD0Max << ", " << m_Z0Max << ")"); + } ATH_MSG_DEBUG(**fittedTrack); fittedTrack = outputTracks.erase(fittedTrack); continue; } - } + } (*fittedTrack)->info().setPatternRecognitionInfo(Trk::TrackInfo::FastTrackFinderSeed); ATH_MSG_VERBOSE("Updating fitted track: " << counter); @@ -625,8 +630,8 @@ StatusCode TrigFastTrackFinder::findTracks(InDet::SiTrackMakerEventData_xk &trac double TrigFastTrackFinder::trackQuality(const Trk::Track* Tr) const { - DataVector<const Trk::TrackStateOnSurface>::const_iterator - m = Tr->trackStateOnSurfaces()->begin(), + DataVector<const Trk::TrackStateOnSurface>::const_iterator + m = Tr->trackStateOnSurfaces()->begin(), me = Tr->trackStateOnSurfaces()->end (); double quality = 0. ; @@ -638,7 +643,7 @@ double TrigFastTrackFinder::trackQuality(const Trk::Track* Tr) const { double x2 = fq->chiSquared(); double q; - if(fq->numberDoF() == 2) q = (1.2*(W-x2*.5)); + if(fq->numberDoF() == 2) q = (1.2*(W-x2*.5)); else q = (W-x2 ); if(q < 0.) q = 0.; quality+=q; @@ -657,11 +662,11 @@ void TrigFastTrackFinder::filterSharedTracks(std::vector<std::tuple<bool, double return std::get<1>(lhs) < std::get<1>(rhs); } ); for (auto& q : QT) { - DataVector<const Trk::MeasurementBase>::const_iterator - m = std::get<2>(q)->measurementsOnTrack()->begin(), + DataVector<const Trk::MeasurementBase>::const_iterator + m = std::get<2>(q)->measurementsOnTrack()->begin(), me = std::get<2>(q)->measurementsOnTrack()->end (); - int nf = 0, nc = 0; + int nf = 0, nc = 0; for(; m!=me; ++m ) { const Trk::PrepRawData* pr = ((const Trk::RIO_OnTrack*)(*m))->prepRawData(); @@ -697,13 +702,13 @@ StatusCode TrigFastTrackFinder::finalize() void TrigFastTrackFinder::updateClusterMap(long int trackIdx, const Trk::Track* pTrack, std::map<Identifier, std::vector<long int> >& clusterMap) const { //loop over clusters - for(auto tMOT = pTrack->measurementsOnTrack()->begin(); tMOT != pTrack->measurementsOnTrack()->end(); ++tMOT) { + for(auto tMOT = pTrack->measurementsOnTrack()->begin(); tMOT != pTrack->measurementsOnTrack()->end(); ++tMOT) { - const InDet::SiClusterOnTrack* siCLOT = dynamic_cast<const InDet::SiClusterOnTrack*>(*tMOT); + const InDet::SiClusterOnTrack* siCLOT = dynamic_cast<const InDet::SiClusterOnTrack*>(*tMOT); if (siCLOT==nullptr) continue; - const InDet::SiCluster* siCL = dynamic_cast<const InDet::SiCluster*>(siCLOT->prepRawData()); + const InDet::SiCluster* siCL = dynamic_cast<const InDet::SiCluster*>(siCLOT->prepRawData()); if (siCL==nullptr) continue; - Identifier id = siCL->identify(); + Identifier id = siCL->identify(); clusterMap[id].push_back(trackIdx); //no sorting is needed as the vectors are sorted by the algorithm design //due to monotonically increasing trackIdx @@ -759,7 +764,8 @@ void TrigFastTrackFinder::getBeamSpot(float& shift_x, float& shift_y, const Even ATH_MSG_VERBOSE("Beam center position: " << shift_x <<" "<< shift_y); } -void TrigFastTrackFinder::fillMon(const TrackCollection& tracks, const TrigVertexCollection& vertices, + +void TrigFastTrackFinder::fillMon(const TrackCollection& tracks, const TrigVertexCollection& vertices, const TrigRoiDescriptor& roi, const EventContext& ctx) const { float shift_x = 0; float shift_y = 0; @@ -820,7 +826,7 @@ void TrigFastTrackFinder::fillMon(const TrackCollection& tracks, const TrigVerte for (const auto vertex : vertices) { mnt_roi_zVertices.push_back(vertex->z()); } - mnt_roi_nTracks = tracks.size(); + mnt_roi_nTracks = tracks.size(); for (auto track : tracks) { @@ -833,11 +839,11 @@ void TrigFastTrackFinder::fillMon(const TrackCollection& tracks, const TrigVerte continue; } - float a0 = trackPars->parameters()[Trk::d0]; - float z0 = trackPars->parameters()[Trk::z0]; - float phi0 = trackPars->parameters()[Trk::phi0]; - float theta = trackPars->parameters()[Trk::theta]; - float eta = -log(tan(0.5*theta)); + float a0 = trackPars->parameters()[Trk::d0]; + float z0 = trackPars->parameters()[Trk::z0]; + float phi0 = trackPars->parameters()[Trk::phi0]; + float theta = trackPars->parameters()[Trk::theta]; + float eta = -log(tan(0.5*theta)); // Run3 monitoring ----------> mnt_trk_a0.push_back(a0); mnt_trk_z0.push_back(z0); @@ -850,7 +856,7 @@ void TrigFastTrackFinder::fillMon(const TrackCollection& tracks, const TrigVerte } // <---------- Run3 monitoring - float qOverP = trackPars->parameters()[Trk::qOverP]; + float qOverP = trackPars->parameters()[Trk::qOverP]; if (qOverP==0) { ATH_MSG_DEBUG("REGTEST / q/p == 0, adjusting to 1e-12"); qOverP = 1e-12; @@ -871,27 +877,27 @@ void TrigFastTrackFinder::fillMon(const TrackCollection& tracks, const TrigVerte int nPix=0, nSct=0; - for(auto tSOS = track->trackStateOnSurfaces()->begin(); - tSOS!=track->trackStateOnSurfaces()->end(); ++tSOS) { + for(auto tSOS = track->trackStateOnSurfaces()->begin(); + tSOS!=track->trackStateOnSurfaces()->end(); ++tSOS) { if ((*tSOS)->type(Trk::TrackStateOnSurface::Perigee) == false) { - const Trk::FitQualityOnSurface* fq = (*tSOS)->fitQualityOnSurface(); - if(!fq) continue; - int nd = fq->numberDoF(); + const Trk::FitQualityOnSurface* fq = (*tSOS)->fitQualityOnSurface(); + if(!fq) continue; + int nd = fq->numberDoF(); if(nd==2) nPix++; if(nd==1) nSct++; } } mnt_trk_nPIXHits.push_back(nPix); - mnt_trk_nSCTHits.push_back(nSct/2); - mnt_trk_nSiHits.push_back(nPix + nSct/2); + mnt_trk_nSCTHits.push_back(nSct/2); + mnt_trk_nSiHits.push_back(nPix + nSct/2); // <---------- Run3 monitoring ATH_MSG_DEBUG("REGTEST / track npix/nsct/phi0/pt/eta/d0/z0/chi2: " << - nPix << " / " << - nSct/2 << " / " << - phi0 << " / " << - pT << " / " << - eta << " / " << + nPix << " / " << + nSct/2 << " / " << + phi0 << " / " << + pT << " / " << + eta << " / " << a0 << " / " << z0 << " / " << chi2); @@ -1134,7 +1140,7 @@ void TrigFastTrackFinder::runResidualMonitoring(const Trk::Track& track, const E void TrigFastTrackFinder::makeSeedsOnGPU(const TrigCombinatorialSettings& tcs, const IRoiDescriptor* roi, const std ::vector<TrigSiSpacePointBase>& vsp, std::vector<TrigInDetTriplet>& output) const { - + output.clear(); TrigAccel::DATA_EXPORT_BUFFER* dataBuffer = new TrigAccel::DATA_EXPORT_BUFFER(5000);//i.e. 5KB @@ -1144,19 +1150,19 @@ void TrigFastTrackFinder::makeSeedsOnGPU(const TrigCombinatorialSettings& tcs, c ATH_MSG_DEBUG("SeedMakingJob is ready, data size for transfer = " <<actualSize); std::shared_ptr<TrigAccel::OffloadBuffer> pBuff = std::make_shared<TrigAccel::OffloadBuffer>(dataBuffer); - + TrigAccel::Work* pJob = m_accelSvc->createWork(TrigAccel::InDetJobControlCode::MAKE_SEEDS, pBuff); if(pJob) { ATH_MSG_DEBUG("Work item created for task "<<TrigAccel::InDetJobControlCode::MAKE_SEEDS); - + pJob->run(); - - + + std::shared_ptr<TrigAccel::OffloadBuffer> pOB = pJob->getOutput(); - + TrigAccel::OUTPUT_SEED_STORAGE* pOutput = reinterpret_cast<TrigAccel::OUTPUT_SEED_STORAGE *>(pOB->m_rawBuffer); - + ATH_MSG_DEBUG("Found "<<pOutput->m_nSeeds<<" triplets on GPU"); int nTriplets = pOutput->m_nSeeds; @@ -1216,7 +1222,7 @@ StatusCode TrigFastTrackFinder::findJseedHitDV(const EventContext& ctx, const st xAOD::TrigComposite *hitDVSeed = new xAOD::TrigComposite(); hitDVSeed->makePrivateStore(); float l1j_eta = recRoI->eta(); float l1j_phi = recRoI->phi(); - int l1j_et_small = recRoI->etSmall(); int l1j_et_large = recRoI->etLarge(); + int l1j_et_small = recRoI->etSmall(); int l1j_et_large = recRoI->etLarge(); hitDVSeed->setDetail("seed_eta", l1j_eta); hitDVSeed->setDetail("seed_phi", l1j_phi); hitDVSeed->setDetail("seed_et_small", l1j_et_small); @@ -1226,7 +1232,7 @@ StatusCode TrigFastTrackFinder::findJseedHitDV(const EventContext& ctx, const st } ATH_MSG_DEBUG("UTT: Nr of J30 RoIs = " << recJetRoiVector.size()); - // if no J30 RoI, return + // if no J30 RoI, return if( recJetRoiVector.size() == 0 ) { ATH_CHECK(hitDVSeedHandle.record(std::move(hitDVSeedContainer), std::move(hitDVSeedContainerAux))); ATH_CHECK(hitDVTrkHandle.record(std::move(hitDVTrkContainer), std::move(hitDVTrkContainerAux))); @@ -1238,35 +1244,35 @@ StatusCode TrigFastTrackFinder::findJseedHitDV(const EventContext& ctx, const st const float TRKCUT_PT = 0.5; const float TRKCUT_A0BEAM = 2.5; const int TRKCUT_N_HITS_INNER = 1; - const int TRKCUT_N_HITS_PIX = 2; + const int TRKCUT_N_HITS_PIX = 2; const int TRKCUT_N_HITS = 4; const float TRKCUT_DELTA_R_TO_JET = 1.0; std::vector< const Trk::Track* > fittedTrackVector; std::unordered_map<const Trk::PrepRawData*, int> umap_fittedTrack_prd; int fittedTrack_id = -1; for (auto track : outputTracks) { - if ( ! track->perigeeParameters() ) continue; - if ( ! track->trackSummary() ) continue; - int n_hits_innermost = track->trackSummary()->get(Trk::SummaryType::numberOfInnermostPixelLayerHits); - int n_hits_next_to_innermost = track->trackSummary()->get(Trk::SummaryType::numberOfNextToInnermostPixelLayerHits); + if ( ! track->perigeeParameters() ) continue; + if ( ! track->trackSummary() ) continue; + int n_hits_innermost = track->trackSummary()->get(Trk::SummaryType::numberOfInnermostPixelLayerHits); + int n_hits_next_to_innermost = track->trackSummary()->get(Trk::SummaryType::numberOfNextToInnermostPixelLayerHits); int n_hits_inner = n_hits_innermost + n_hits_next_to_innermost; int n_hits_pix = track->trackSummary()->get(Trk::SummaryType::numberOfPixelHits); int n_hits_sct = track->trackSummary()->get(Trk::SummaryType::numberOfSCTHits); if( n_hits_inner < TRKCUT_N_HITS_INNER ) continue; if( n_hits_pix < TRKCUT_N_HITS_PIX ) continue; if( (n_hits_pix+n_hits_sct) < TRKCUT_N_HITS ) continue; - float theta = track->perigeeParameters()->parameters()[Trk::theta]; + float theta = track->perigeeParameters()->parameters()[Trk::theta]; float pt = fabs(1./track->perigeeParameters()->parameters()[Trk::qOverP]) * sin(theta); pt /= 1000.0; if( pt < TRKCUT_PT ) continue; - float a0 = track->perigeeParameters()->parameters()[Trk::d0]; - float phi0 = track->perigeeParameters()->parameters()[Trk::phi0]; + float a0 = track->perigeeParameters()->parameters()[Trk::d0]; + float phi0 = track->perigeeParameters()->parameters()[Trk::phi0]; float shift_x = 0; float shift_y = 0; if( m_useBeamSpot ) getBeamSpot(shift_x, shift_y, ctx); float a0beam = a0 + shift_x*sin(phi0)-shift_y*cos(phi0); if( fabs(a0beam) > TRKCUT_A0BEAM ) continue; // - float phi = track->perigeeParameters()->parameters()[Trk::phi]; + float phi = track->perigeeParameters()->parameters()[Trk::phi]; TVector3 p3Trk; p3Trk.SetPtThetaPhi(pt,theta,phi); float eta = p3Trk.Eta(); bool isNearJet = false; @@ -1297,8 +1303,8 @@ StatusCode TrigFastTrackFinder::findJseedHitDV(const EventContext& ctx, const st hitDVTrk->setDetail("trk_a0beam", a0beam); hitDVTrkContainer->push_back(hitDVTrk); - DataVector<const Trk::MeasurementBase>::const_iterator - m = track->measurementsOnTrack()->begin(), + DataVector<const Trk::MeasurementBase>::const_iterator + m = track->measurementsOnTrack()->begin(), me = track->measurementsOnTrack()->end (); for(; m!=me; ++m ) { const Trk::PrepRawData* prd = ((const Trk::RIO_OnTrack*)(*m))->prepRawData(); @@ -1316,7 +1322,7 @@ StatusCode TrigFastTrackFinder::findJseedHitDV(const EventContext& ctx, const st int n_sp = 0; int n_sp_usedByTrk = 0; for(unsigned int iSp=0; iSp<convertedSpacePoints.size(); iSp++) { - + const Trk::SpacePoint* sp = convertedSpacePoints[iSp].offlineSpacePoint(); const Amg::Vector3D& pos_sp = sp->globalPosition(); float sp_x = pos_sp[Amg::x]; @@ -1325,7 +1331,7 @@ StatusCode TrigFastTrackFinder::findJseedHitDV(const EventContext& ctx, const st TVector3 p3Sp(sp_x,sp_y,sp_z); float sp_eta = p3Sp.Eta(); float sp_phi = p3Sp.Phi(); - + bool isNearJet = false; for (unsigned int iRoi=0; iRoi<recJetRoiVector.size(); iRoi++){ const LVL1::RecJetRoI* recRoI = recJetRoiVector[iRoi]; diff --git a/Trigger/TrigAlgorithms/TrigFastTrackFinder/src/components/TrigFastTrackFinder_entries.cxx b/Trigger/TrigAlgorithms/TrigFastTrackFinder/src/components/TrigFastTrackFinder_entries.cxx index 23dba9e3cdc17f8af99b068c78fa7ac8a26d1024..169be6c4fda9a65ccaa5de82d54a7b2f5684404d 100644 --- a/Trigger/TrigAlgorithms/TrigFastTrackFinder/src/components/TrigFastTrackFinder_entries.cxx +++ b/Trigger/TrigAlgorithms/TrigFastTrackFinder/src/components/TrigFastTrackFinder_entries.cxx @@ -1,6 +1,3 @@ - #include "../TrigFastTrackFinder.h" DECLARE_COMPONENT( TrigFastTrackFinder ) - - diff --git a/Trigger/TrigHypothesis/TrigLongLivedParticlesHypo/TrigLongLivedParticlesHypo/FastTrackFinderLRTHypoAlg.h b/Trigger/TrigHypothesis/TrigLongLivedParticlesHypo/TrigLongLivedParticlesHypo/FastTrackFinderLRTHypoAlg.h new file mode 100644 index 0000000000000000000000000000000000000000..41c02f4ffe6390154c3af7f79affa33306945e2a --- /dev/null +++ b/Trigger/TrigHypothesis/TrigLongLivedParticlesHypo/TrigLongLivedParticlesHypo/FastTrackFinderLRTHypoAlg.h @@ -0,0 +1,39 @@ +/* +Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration +*/ +#ifndef TRIGFTFLRTHYPOALG_H +#define TRIGFTFLRTHYPOALG_H + +// Framework includes +#include "DecisionHandling/HypoBase.h" +#include "xAODTrigger/TrigCompositeContainer.h" +#include "FastTrackFinderLRTHypoTool.h" +#include "TrigCompositeUtils/TrigCompositeUtils.h" +#include "xAODTracking/TrackParticleContainer.h" +#include "AthenaMonitoringKernel/Monitored.h" +#include <map> +#include "Gaudi/Property.h" +#include "AthViews/View.h" + +// STL includes +#include <string> +class FastTrackFinderLRTHypoAlg : public ::HypoBase { +public: + FastTrackFinderLRTHypoAlg(const std::string& name, ISvcLocator* pSvcLocator); + + virtual ~FastTrackFinderLRTHypoAlg() = default; + virtual StatusCode initialize() override; + virtual StatusCode execute(const EventContext& context) const override; + +private: + FastTrackFinderLRTHypoAlg(); + ToolHandleArray< FastTrackFinderLRTHypoTool > m_hypoTools {this, "HypoTools", {},"Tools that perform actual selection"}; + SG::ReadHandleKey<xAOD::TrackParticleContainer> m_tracksKey{this,"tracksKey","Undefined",""}; + SG::WriteHandleKey<xAOD::TrigCompositeContainer> m_trackCountKey{this,"trackCountKey","Undefined",""}; + Gaudi::Property<std::vector<float>> m_min_pt{this, "min_pt",{0}, "Accept events with momentum higher than this limit"}; + Gaudi::Property<std::vector<float>> m_min_d0{this, "min_d0",{0}, "Accept events with d0 above this limit"}; + Gaudi::Property<std::vector<float>> m_max_d0{this, "max_d0",{900}, "Accept events with d0 below this limit"}; + Gaudi::Property<std::vector<float>> m_max_xi2{this, "max_xi2",{10}, "Accept events with Xi2 of the track less than this limit"}; + ToolHandle<GenericMonitoringTool> m_monTool{this,"MonTool","","Monitoring tool"}; +}; +#endif // TRIGT2MINBIAS_TRACKCOUNTHYPOALGMT_H diff --git a/Trigger/TrigHypothesis/TrigLongLivedParticlesHypo/TrigLongLivedParticlesHypo/FastTrackFinderLRTHypoTool.h b/Trigger/TrigHypothesis/TrigLongLivedParticlesHypo/TrigLongLivedParticlesHypo/FastTrackFinderLRTHypoTool.h new file mode 100644 index 0000000000000000000000000000000000000000..4acfe2cd9fd308dbd3219b1c0962010bf548fd92 --- /dev/null +++ b/Trigger/TrigHypothesis/TrigLongLivedParticlesHypo/TrigLongLivedParticlesHypo/FastTrackFinderLRTHypoTool.h @@ -0,0 +1,45 @@ +/* +Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration +*/ +#ifndef TRIGT2MINBIAS_TRACKCOUNTHYPOTOOL_H +#define TRIGT2MINBIAS_TRACKCOUNTHYPOTOOL_H + +#include "Gaudi/Property.h" +#include "AthenaBaseComps/AthAlgTool.h" +#include "TrigCompositeUtils/HLTIdentifier.h" +#include "TrigCompositeUtils/TrigCompositeUtils.h" + +class FastTrackFinderLRTHypoTool : virtual public ::AthAlgTool +{ +public: + + FastTrackFinderLRTHypoTool( const std::string& type, + const std::string& name, + const IInterface* parent ); + + virtual ~FastTrackFinderLRTHypoTool() = default; + virtual StatusCode initialize() override; + + struct TrkCountsInfo { + TrigCompositeUtils::Decision* decision; + const xAOD::TrigComposite* counts; + const TrigCompositeUtils::DecisionIDContainer previousDecisionIDs; + }; + + StatusCode decide( TrkCountsInfo& decisions ) const; + + private: + + HLT::Identifier m_decisionId; + Gaudi::Property<float> m_min_pt{this, "min_pt",{0}, "Accept events with momentum higher than this limit"}; + Gaudi::Property<float> m_min_d0{this, "min_d0",{0}, "Accept events with d0 above this limit"}; + Gaudi::Property<float> m_max_d0{this, "max_d0",{900}, "Accept events with d0 below this limit"}; + Gaudi::Property<float> m_max_xi2{this, "max_xi2",{10}, "Accept events with Xi2 of the track less than this limit"}; + Gaudi::Property<float> m_required_ntrks{this, "required_ntrks", 1, "Accept events with minimum of this number of tracks"}; + Gaudi::Property<float> m_max_required_ntrks{this, "max_required_ntrks", -1, "Accept events with maximum of this number of tracks"}; + Gaudi::Property<bool> m_acceptAll{this, "acceptAll", false, "Accept all events"}; + Gaudi::Property<bool> m_cutMinAndMax{this, "cutMinAndMax", false, "take events within the given higher and lower limt/cut"}; + Gaudi::Property<bool> m_logicAnd{this, "TriggerTypeAnd", true, "And/Or Logic"}; + }; + + #endif //> !TRIGT2MINBIAS_TRACKCOUNTHYPOTOOL_H diff --git a/Trigger/TrigHypothesis/TrigLongLivedParticlesHypo/python/TrigFullScanLRTHypoTool.py b/Trigger/TrigHypothesis/TrigLongLivedParticlesHypo/python/TrigFullScanLRTHypoTool.py new file mode 100644 index 0000000000000000000000000000000000000000..faf5f326d3e15bf3e1944d33042c87d8ffc9723d --- /dev/null +++ b/Trigger/TrigHypothesis/TrigLongLivedParticlesHypo/python/TrigFullScanLRTHypoTool.py @@ -0,0 +1,39 @@ +# Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration + +from AthenaCommon.SystemOfUnits import GeV +from AthenaCommon.Logging import logging +log = logging.getLogger("TrigLongLivedParticlesHypo.TrigLRTHypoTool") +from AthenaMonitoringKernel.GenericMonitoringTool import GenericMonitoringTool + + + +log = logging.getLogger('TrigLRTHypoTool') + +def TrigLRTHypoToolFromDict( chainDict ): + """ Use menu decoded chain dictionary to configure the tool """ + + name = chainDict['chainName'] + from AthenaConfiguration.ComponentFactory import CompFactory + tool = CompFactory.FastTrackFinderLRTHypoTool(name) + + return tool + + +def TrigLRTHypoToolFromName( name, conf ): + """ provides configuration of the hypo tool giben the chain name + The argument will be replaced by "parsed" chain dict. For now it only serves simplest chain HLT_eXYZ. + """ + from TriggerMenuMT.HLTMenuConfig.Menu.DictFromChainName import dictFromChainName + + decodedDict = dictFromChainName(conf) + + return TrigLRTHypoToolFromDict( decodedDict ) + + + +if __name__ == "__main__": + tool = TrigLRTHypoToolFromDict("HLT_unconvtrk50_isohpttrack_imedium_L1XE50", "HLT_unconvtrk50_isohpttrack_imedium_L1XE50") + assert tool, "Not configured simple tool" + + + log.info("ALL OK") diff --git a/Trigger/TrigHypothesis/TrigLongLivedParticlesHypo/python/TrigLongLivedParticlesHypoConfig.py b/Trigger/TrigHypothesis/TrigLongLivedParticlesHypo/python/TrigLongLivedParticlesHypoConfig.py index cd608cc9c1f8cc5856ac5e474ae0bc824a2bb9ad..e102c89258cf31905ea685381f2991507eec1dcf 100755 --- a/Trigger/TrigHypothesis/TrigLongLivedParticlesHypo/python/TrigLongLivedParticlesHypoConfig.py +++ b/Trigger/TrigHypothesis/TrigLongLivedParticlesHypo/python/TrigLongLivedParticlesHypoConfig.py @@ -15,9 +15,9 @@ def getCaloRatioHypoInstance( instance, threshold, logratio, dotrackiso): else: name=instance+"_"+str(threshold)+"GeV_reversed_notrackiso" - return CaloRatioHypo( threshold=threshold, - logratio=logratio, - dotrackiso=dotrackiso, + return CaloRatioHypo( threshold=threshold, + logratio=logratio, + dotrackiso=dotrackiso, name=name ) @@ -29,8 +29,8 @@ class MuonClusterHypoConfig (Conf.MuonClusterHypo): # AcceptAll flag: if true take events regardless of cuts self.AcceptAll = False - self.nRoIEndCap = 4 - self.nRoIBarrel = 3 + self.nRoIEndCap = 4 + self.nRoIBarrel = 3 self.maxEta = maxEta self.midEta = midEta @@ -236,7 +236,7 @@ class CaloRatioHypo (Conf.TrigCaloRatioHypo): self.EtaCut = 2.5 self.Reversed = True self.DoTrackIso = dotrackiso - + from TrigLongLivedParticlesHypo.TrigLongLivedParticlesHypoMonitoring import TrigCaloRatioHypoValidationMonitoring, TrigCaloRatioHypoOnlineMonitoring, TrigCaloRatioHypoCosmicMonitoring validation = TrigCaloRatioHypoValidationMonitoring() online = TrigCaloRatioHypoOnlineMonitoring() @@ -247,4 +247,11 @@ class CaloRatioHypo (Conf.TrigCaloRatioHypo): self.AthenaMonTools = [ time, validation, online, cosmic ] +#LRT hypothesis, configuration for tool +_lrt_pt_min = {"default": 0.1} + +class FastTrackFinderLRTHypoTool (Conf.FastTrackFinderLRTHypoTool): + def __init__(self, name, threshold_name): + super( FastTrackFinderLRTHypoTool, self ).__init__( name ) + self.pt_min = _lrt_pt_min[threshold_name] diff --git a/Trigger/TrigHypothesis/TrigLongLivedParticlesHypo/src/FastTrackFinderLRTHypoAlg.cxx b/Trigger/TrigHypothesis/TrigLongLivedParticlesHypo/src/FastTrackFinderLRTHypoAlg.cxx new file mode 100644 index 0000000000000000000000000000000000000000..5557c815ccac02b5f48d284330d9e00a2d32fc84 --- /dev/null +++ b/Trigger/TrigHypothesis/TrigLongLivedParticlesHypo/src/FastTrackFinderLRTHypoAlg.cxx @@ -0,0 +1,138 @@ +/* +Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration +*/ + +#include "TrigLongLivedParticlesHypo/FastTrackFinderLRTHypoAlg.h" +#include "TrigLongLivedParticlesHypo/FastTrackFinderLRTHypoTool.h" +#include "xAODTracking/TrackParticleAuxContainer.h" +#include "AthViews/ViewHelper.h" + +using TrigCompositeUtils::createAndStore; +using TrigCompositeUtils::DecisionContainer; +using TrigCompositeUtils::DecisionAuxContainer; +using TrigCompositeUtils::DecisionIDContainer; +using TrigCompositeUtils::decisionIDs; +using TrigCompositeUtils::newDecisionIn; +using TrigCompositeUtils::linkToPrevious; +using TrigCompositeUtils::viewString; +using TrigCompositeUtils::featureString; +using TrigCompositeUtils::findLink; +using TrigCompositeUtils::LinkInfo; + +FastTrackFinderLRTHypoAlg::FastTrackFinderLRTHypoAlg(const std::string& name, ISvcLocator* pSvcLocator) : +::HypoBase(name, pSvcLocator) +{ +} + +StatusCode FastTrackFinderLRTHypoAlg::initialize() +{ + ATH_CHECK(m_tracksKey.initialize()); + ATH_CHECK(m_trackCountKey.initialize()); + renounce(m_tracksKey); + ATH_CHECK(m_min_pt.size()==m_min_d0.size()); + + if (m_tracksKey.key() == "Undefined" || m_trackCountKey.key() == "Undefined") { + ATH_MSG_ERROR("either track Key name or track count key name is undefined " ); + return StatusCode::FAILURE; + } + + ATH_CHECK(m_hypoTools.retrieve()); + if (!m_monTool.empty()) ATH_CHECK(m_monTool.retrieve()); + + return StatusCode::SUCCESS; +} + +StatusCode FastTrackFinderLRTHypoAlg::execute(const EventContext& context) const +{ + ATH_MSG_DEBUG ( "Executing " << name() << "..." ); + auto previousDecisionsHandle = SG::makeHandle( decisionInput(), context ); + + if( not previousDecisionsHandle.isValid() ) {//implicit + ATH_MSG_DEBUG( "No implicit RH for previous decisions "<< decisionInput().key()<<": is this expected?" ); + return StatusCode::SUCCESS; + } + + if (previousDecisionsHandle->size() == 0) { + ATH_MSG_DEBUG( "No previous decision, nothing to do."); + return StatusCode::SUCCESS; + } else if (previousDecisionsHandle->size() > 1) { + ATH_MSG_ERROR("Found " << previousDecisionsHandle->size() <<" previous decisions."); + return StatusCode::FAILURE; + } + + ATH_MSG_DEBUG( "Running with "<< previousDecisionsHandle->size() <<" implicit ReadHandles for previous decisions. Looking for :"<<viewString()); + + std::vector<int> counts(m_min_pt.size()); + + + //taken from isohightpt + + ATH_MSG_DEBUG( "Getting Track Handle "<<m_tracksKey); + // get tracks from the key : + auto trackHandle = SG::makeHandle(m_tracksKey, context ); + + ATH_CHECK( trackHandle.isValid() ); + ATH_MSG_DEBUG ( "track handle size: " << trackHandle->size() << "..." ); + + int ntrks = trackHandle->size(); + + const xAOD::TrackParticleContainer * AllTracks = trackHandle.get(); //Later this could be updated to run with tracks above a certain threshold + + // Loop over all tracks and get a track decision associated with it and create the input + for ( const xAOD::TrackParticle_v1* track : *AllTracks) { + const double pT = track->pt(); + const float d0 = track->d0(); + const double xi2 = 0.0; //fq.chiSquared(); + const float abs_d0 = std::fabs(d0); + for (long unsigned int i=0;i<m_min_pt.size();i++){ + if(pT >= m_min_pt[i] && abs_d0 < m_max_d0[i] && abs_d0 >= m_min_d0[i] && std::fabs(xi2) < m_max_xi2[i]) counts[i]++; + } + } + + //end taken section + + // Recording Data + auto trackCountContainer = std::make_unique< xAOD::TrigCompositeContainer>(); + auto trackCountContainerAux = std::make_unique< xAOD::TrigCompositeAuxContainer>(); + trackCountContainer->setStore(trackCountContainerAux.get()); + + xAOD::TrigComposite * trackCount = new xAOD::TrigComposite(); + trackCountContainer->push_back(trackCount); + trackCount->setDetail("ntrks", ntrks); + trackCount->setDetail("pTcuts", static_cast<std::vector<float>>(m_min_pt)); + trackCount->setDetail("d0mincuts", static_cast<std::vector<float>>(m_min_d0)); + trackCount->setDetail("d0maxcuts", static_cast<std::vector<float>>(m_max_d0)); + trackCount->setDetail("xi2cuts", static_cast<std::vector<float>>(m_max_xi2)); + trackCount->setDetail("counts", counts); + + // TODO revisit + + auto mon_ntrks = Monitored::Scalar<int>("ntrks",ntrks); + Monitored::Group(m_monTool,mon_ntrks); + for(long unsigned int i=0;i<counts.size();i++){ + auto mon_counts = Monitored::Scalar<int>("counts"+std::to_string(i),counts[i]); + Monitored::Group(m_monTool,mon_counts); + } + + SG::WriteHandle<DecisionContainer> outputHandle = createAndStore(decisionOutput(), context ); + auto decisions = outputHandle.ptr(); + + auto d = newDecisionIn( decisions); + linkToPrevious( d, decisionInput().key(), 0 ); + + TrigCompositeUtils::DecisionIDContainer prev; + TrigCompositeUtils::decisionIDs( previousDecisionsHandle->at(0), prev ); + + FastTrackFinderLRTHypoTool::TrkCountsInfo trkinfo{d, trackCount, prev}; + + for(auto &tool:m_hypoTools) + { + ATH_CHECK(tool->decide(trkinfo)); + } + + SG::WriteHandle<xAOD::TrigCompositeContainer> trackCountHandle(m_trackCountKey, context); + ATH_CHECK(trackCountHandle.record( std::move( trackCountContainer ), std::move( trackCountContainerAux ) ) ); + d->setObjectLink( featureString(), ElementLink<xAOD::TrigCompositeContainer>( m_trackCountKey.key(), 0) ); + //ATH_CHECK( hypoBaseOutputProcessing(outputHandle) ); + return StatusCode::SUCCESS; +} diff --git a/Trigger/TrigHypothesis/TrigLongLivedParticlesHypo/src/FastTrackFinderLRTHypoTool.cxx b/Trigger/TrigHypothesis/TrigLongLivedParticlesHypo/src/FastTrackFinderLRTHypoTool.cxx new file mode 100644 index 0000000000000000000000000000000000000000..c7bde317a70d9181a10b30066adca3e9ab8e5117 --- /dev/null +++ b/Trigger/TrigHypothesis/TrigLongLivedParticlesHypo/src/FastTrackFinderLRTHypoTool.cxx @@ -0,0 +1,76 @@ + +/* +Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration +*/ + + +#include "TrigCompositeUtils/HLTIdentifier.h" +#include "AthenaMonitoringKernel/Monitored.h" + +#include "TrigLongLivedParticlesHypo/FastTrackFinderLRTHypoTool.h" + +using namespace TrigCompositeUtils; + +FastTrackFinderLRTHypoTool::FastTrackFinderLRTHypoTool( const std::string& type,const std::string& name,const IInterface* parent ) +: AthAlgTool( type, name, parent ), +m_decisionId( HLT::Identifier::fromToolName( name ) ) {} + +StatusCode FastTrackFinderLRTHypoTool::initialize() { + return StatusCode::SUCCESS; +} + +StatusCode FastTrackFinderLRTHypoTool::decide( TrkCountsInfo& trkinfo ) const { + if ( trkinfo.previousDecisionIDs.count( m_decisionId.numeric() ) == 0 ) { + ATH_MSG_DEBUG("Already rejected"); + return StatusCode::SUCCESS; + } + + std::vector<int> counts; + + std::vector<float> pTcuts; + std::vector<float> d0mincuts; + std::vector<float> d0maxcuts; + std::vector<float> xi2maxcuts; + trkinfo.counts->getDetail<std::vector<int>>("counts", counts); + trkinfo.counts->getDetail<std::vector<float>>("pTcuts", pTcuts); + trkinfo.counts->getDetail<std::vector<float>>("d0mincuts", d0mincuts); + trkinfo.counts->getDetail<std::vector<float>>("d0maxcuts", d0maxcuts); + trkinfo.counts->getDetail<std::vector<float>>("xi2cuts", xi2maxcuts); + + float countForConfiguredPtThreshold{}; + bool found{false}; + ATH_MSG_DEBUG("nCounts: "<<counts.size()); + ATH_MSG_DEBUG("this tool is configured for pT"<< m_min_pt<<" have nPt:"<<pTcuts.size()<<" nd0min: "<<d0mincuts.size()<<" nd0max: "<<d0maxcuts.size()<<" xi2cuts "<<xi2maxcuts.size()); + + for ( size_t i = 0; i < counts.size(); ++i ) { + if ( std::abs( pTcuts[i] - m_min_pt ) < 0.001 && std::abs( d0mincuts[i] - m_min_d0 ) < 0.001 && std::abs( d0maxcuts[i] - m_max_d0 ) < 0.001 && std::abs( xi2maxcuts[i] - m_max_xi2 ) < 0.001 ) { + found = true; + countForConfiguredPtThreshold = counts[i]; + } + } + if (!found ) { + ATH_MSG_ERROR ("Unable to find tracks count for requested pT threshold " << m_min_pt << " need to fix hypo tool configuratio or add new threshold in tracks counting"); + for ( float pt : pTcuts ) { + ATH_MSG_ERROR( "Count of tracks of pT above " << pt << " is available"); + } + return StatusCode::FAILURE; + } + else{ + ATH_MSG_DEBUG ("REGTEST found "<<countForConfiguredPtThreshold <<" tracks for "<<m_min_pt); + } + std::vector<bool> decisionCuts({ + (m_required_ntrks != -1 ? m_required_ntrks <= countForConfiguredPtThreshold : (bool)m_logicAnd), + (m_max_required_ntrks != -1 ? m_max_required_ntrks > countForConfiguredPtThreshold : (bool)m_logicAnd) + }); + + if(m_logicAnd && !std::all_of(decisionCuts.begin(),decisionCuts.end(),[](bool k ){return k; }) ){ + + return StatusCode::SUCCESS; + }else if(m_logicAnd==false && !std::any_of(decisionCuts.begin(),decisionCuts.end(),[](bool k ){return k; }) ){ + return StatusCode::SUCCESS; + }else{ + addDecisionID( m_decisionId.numeric(), trkinfo.decision ); + ATH_MSG_DEBUG ("REGTEST event accepted"); + } + return StatusCode::SUCCESS; +} diff --git a/Trigger/TrigHypothesis/TrigLongLivedParticlesHypo/src/components/TrigLongLivedParticlesHypo_entries.cxx b/Trigger/TrigHypothesis/TrigLongLivedParticlesHypo/src/components/TrigLongLivedParticlesHypo_entries.cxx index b77427baa2e1c8b60740f32860dd92cb7c77e2b4..05048d6b3a628a6c94e41aec8b4fd17045abac02 100644 --- a/Trigger/TrigHypothesis/TrigLongLivedParticlesHypo/src/components/TrigLongLivedParticlesHypo_entries.cxx +++ b/Trigger/TrigHypothesis/TrigLongLivedParticlesHypo/src/components/TrigLongLivedParticlesHypo_entries.cxx @@ -7,7 +7,6 @@ #include "TrigLongLivedParticlesHypo/TrigNewLoFHypo.h" #include "TrigLongLivedParticlesHypo/TrigCaloRatioHypo.h" #include "TrigLongLivedParticlesHypo/TrigLLPInnerDetectorHypo.h" - #include "../TrigIsoHPtTrackTriggerHypoAlgMT.h" #include "../TrigIsoHPtTrackTriggerHypoTool.h" @@ -15,7 +14,8 @@ DECLARE_COMPONENT (TrigIsoHPtTrackTriggerHypoAlgMT ) DECLARE_COMPONENT (TrigIsoHPtTrackTriggerHypoTool ) - +#include "TrigLongLivedParticlesHypo/FastTrackFinderLRTHypoTool.h" +#include "TrigLongLivedParticlesHypo/FastTrackFinderLRTHypoAlg.h" DECLARE_COMPONENT( TrigL2HVJetHypoAllCuts ) DECLARE_COMPONENT( TrigL2HVJetHypo ) @@ -26,3 +26,5 @@ DECLARE_COMPONENT( TrigLoFRemovalHypo ) DECLARE_COMPONENT( TrigNewLoFHypo ) DECLARE_COMPONENT( TrigCaloRatioHypo ) +DECLARE_COMPONENT( FastTrackFinderLRTHypoTool ) +DECLARE_COMPONENT( FastTrackFinderLRTHypoAlg ) diff --git a/Trigger/TrigTools/TrigInDetConfig/python/ConfigSettings.py b/Trigger/TrigTools/TrigInDetConfig/python/ConfigSettings.py index 3007664b6e654ccaed47882caba44d9339823914..aebdf285603172bb06e71e18a15aeaa33f975902 100644 --- a/Trigger/TrigTools/TrigInDetConfig/python/ConfigSettings.py +++ b/Trigger/TrigTools/TrigInDetConfig/python/ConfigSettings.py @@ -677,6 +677,23 @@ class _Settings_fullScan( _GlobalSettings ): self._configFT = _FastTracking( signatureType = 'fullScan', nameSuffix = 'FS' ) # self._doRecord = False +class _Settings_fullScanCustomName( _GlobalSettings ): + def __init__( self, name ): + _GlobalSettings.__init__(self) + self._name = name #To be appended to alg names + self._roi = "HLT_Roi_FS" #FIXME: possibly different! + self._configFT = _FastTracking( signatureType = 'fullScan', nameSuffix = 'FS' ) # + self._doRecord = False + +class _Settings_fullScanPreLRT( _GlobalSettings ): + def __init__( self ): + _GlobalSettings.__init__(self) + self._name = "fullScanPreLRT" #To be appended to alg names + self._roi = "HLT_Roi_FS" #FIXME: possibly different! + self._configFT = _FastTracking( signatureType = 'fullScan', nameSuffix = 'FS' ) # + self._doRecord = False + + class _Settings_fullScanUTT( _GlobalSettings ): def __init__( self ): _GlobalSettings.__init__(self) @@ -704,7 +721,6 @@ class _Settings_bmumux( _GlobalSettings ): self._configPT = _PrecisionTracking( signatureType = 'bphysics', nameSuffix = 'Bmumux' ) self._doRecord = True #Allow recording of track collections - class _Settings_electronLRT( _GlobalSettings ): def __init__( self ): _GlobalSettings.__init__(self) @@ -752,7 +768,7 @@ class _Settings_fullScanLRT( _GlobalSettings ): self._name = "fullScanLrt" #To be appended to alg names self._roi = "HLT_Roi_FS" #FIXME ATR-22755 self._configFT = _FastTracking( signatureType = 'fullScanLRT', nameSuffix = 'FSLRT' ) # - self._doRecord = False + self._doRecord = True #record track collections self._isLRT = True _ConfigSettings = { @@ -774,11 +790,12 @@ _ConfigSettings = { "jetUTT" : _Settings_jetUTT(), "fullScan" : _Settings_fullScan(), + "fullScanPreLRT": _Settings_fullScanPreLRT(), "beamSpot" : _Settings_beamSpot(), + "beamSpotFS" : _Settings_fullScanCustomName("beamSpotFS"), "cosmics" : _Settings_cosmics(), "bmumux" : _Settings_bmumux(), - "minBias" : _Settings_minBias(), "electronLRT" : _Settings_electronLRT(), diff --git a/Trigger/TrigTools/TrigInDetConfig/python/InDetSetup.py b/Trigger/TrigTools/TrigInDetConfig/python/InDetSetup.py index e087e7aebb0dff2c80058a9059a0a13b0429cf6b..37aef220f34759abf9fb61f04042d2cedc48cfda 100644 --- a/Trigger/TrigTools/TrigInDetConfig/python/InDetSetup.py +++ b/Trigger/TrigTools/TrigInDetConfig/python/InDetSetup.py @@ -12,12 +12,12 @@ from AthenaCommon.AthenaCommonFlags import athenaCommonFlags # noqa: F401 include("InDetTrigRecExample/InDetTrigRec_jobOptions.py") -def makeInDetAlgsNoView( config = None, rois = 'EMViewRoIs', doFTF = True ): +def makeInDetAlgsNoView( config = None, rois = 'EMViewRoIs', doFTF = True, secondStageConfig = None ): - viewAlgs, viewVerify = makeInDetAlgs( config, rois, doFTF, None) + viewAlgs, viewVerify = makeInDetAlgs( config, rois, doFTF, None, secondStageConfig) return viewAlgs -def makeInDetAlgs( config = None, rois = 'EMViewRoIs', doFTF = True, viewVerifier='IDViewDataVerifier'): +def makeInDetAlgs( config = None, rois = 'EMViewRoIs', doFTF = True, viewVerifier='IDViewDataVerifier', secondStageConfig = None): if config is None : raise ValueError('makeInDetAlgs() No config provided!') #Add suffix to the algorithms @@ -335,5 +335,31 @@ def makeInDetAlgs( config = None, rois = 'EMViewRoIs', doFTF = True, viewVerifie viewAlgs.append(theTrackParticleCreatorAlg) + if secondStageConfig is not None: + #have been supplied with a second stage config, create another instance of FTF + theFTF2 = TrigFastTrackFinderBase("TrigFastTrackFinder_" + secondStageConfig.name, secondStageConfig.FT.signatureType ) + theFTF2.RoIs = rois + theFTF2.TracksName = secondStageConfig.FT.trkTracksFTF() + theFTF2.inputTracksName = config.FT.trkTracksFTF() + theFTF2.doCloneRemoval = secondStageConfig.FT.setting.doCloneRemoval + + viewAlgs.append(theFTF2) + + + from TrigInDetConf.TrigInDetPostTools import InDetTrigParticleCreatorToolFTF + from InDetTrigParticleCreation.InDetTrigParticleCreationConf import InDet__TrigTrackingxAODCnvMT + + + + theTrackParticleCreatorAlg2 = InDet__TrigTrackingxAODCnvMT(name = "InDetTrigTrackParticleCreatorAlg_" + secondStageConfig.FT.signatureType, + TrackName = secondStageConfig.FT.trkTracksFTF(), + ParticleCreatorTool = InDetTrigParticleCreatorToolFTF) + + + #In general all FTF trackParticle collections are recordable except beamspot to save space + theTrackParticleCreatorAlg2.TrackParticlesName = secondStageConfig.FT.tracksFTF( doRecord = secondStageConfig.isRecordable ) + + viewAlgs.append(theTrackParticleCreatorAlg2) + return viewAlgs, ViewDataVerifier diff --git a/Trigger/TrigValidation/TrigAnalysisTest/share/ref_RDOtoRDOTrig_v1Dev_build.ref b/Trigger/TrigValidation/TrigAnalysisTest/share/ref_RDOtoRDOTrig_v1Dev_build.ref index 11db6ee245afeae5789f572995dd540571eb5f4b..45b6218fdbad3e95ce2888c0153c4b1432b43a49 100644 --- a/Trigger/TrigValidation/TrigAnalysisTest/share/ref_RDOtoRDOTrig_v1Dev_build.ref +++ b/Trigger/TrigValidation/TrigAnalysisTest/share/ref_RDOtoRDOTrig_v1Dev_build.ref @@ -4110,10 +4110,26 @@ HLT_tilecalib_laser_TilePEB_L1CALREQ2: eventCount: 0 HLT_timeburner_L1All: eventCount: 0 -HLT_unconvtrk120_isohpttrack_iaggrmedium_L1XE50: - eventCount: 0 -HLT_unconvtrk120_isohpttrack_imedium_L1XE50: - eventCount: 0 +HLT_unconvtrk120_fslrt_L1All: + eventCount: 20 + stepCounts: + 0: 20 + stepFeatures: + 0: 20 +HLT_unconvtrk120_fslrt_L1XE50: + eventCount: 10 + stepCounts: + 0: 10 + stepFeatures: + 0: 10 +HLT_unconvtrk50_isohpttrack_L1XE50: + eventCount: 4 + stepCounts: + 0: 10 + 1: 4 + stepFeatures: + 0: 10 + 1: 5 HLT_xe100_cvfpufit_L1XE50: eventCount: 6 stepCounts: @@ -4324,24 +4340,6 @@ HLT_xe65_cell_xe110_tcpufit_L1XE50: 0: 5 stepFeatures: 0: 13 -HLT_xe80_tcpufit_unconvtrk120_isohpttrack_iaggrloose_L1XE50: - eventCount: 0 - stepFeatures: - 0: 9 -HLT_xe80_tcpufit_unconvtrk120_isohpttrack_iaggrmedium_L1XE50: - eventCount: 0 - stepFeatures: - 0: 9 -HLT_xe80_tcpufit_unconvtrk120_isohpttrack_imedium_L1XE50: - eventCount: 0 - stepFeatures: - 0: 9 -HLT_xe80_tcpufit_unconvtrk80_isohpttrack_imedium_L1XE50: - eventCount: 1 - stepCounts: - 0: 1 - stepFeatures: - 0: 10 HLT_xe95_trkmht_xe90_tcpufit_xe75_cell_L1XE50: eventCount: 4 stepCounts: diff --git a/Trigger/TrigValidation/TriggerTest/share/ref_data_v1Dev_build.ref b/Trigger/TrigValidation/TriggerTest/share/ref_data_v1Dev_build.ref index 3ec8f37297dff9b92b94317bf0c7e648ce55fc65..23f369aec5ed138715977044d91cc88add362bd6 100644 --- a/Trigger/TrigValidation/TriggerTest/share/ref_data_v1Dev_build.ref +++ b/Trigger/TrigValidation/TriggerTest/share/ref_data_v1Dev_build.ref @@ -2785,10 +2785,24 @@ HLT_tilecalib_laser_TilePEB_L1CALREQ2: 0: 20 HLT_timeburner_L1All: eventCount: 0 -HLT_unconvtrk120_isohpttrack_iaggrmedium_L1XE50: - eventCount: 0 -HLT_unconvtrk120_isohpttrack_imedium_L1XE50: +HLT_unconvtrk120_fslrt_L1All: + eventCount: 19 + stepCounts: + 0: 19 + stepFeatures: + 0: 19 +HLT_unconvtrk120_fslrt_L1XE50: + eventCount: 19 + stepCounts: + 0: 19 + stepFeatures: + 0: 19 +HLT_unconvtrk50_isohpttrack_L1XE50: eventCount: 0 + stepCounts: + 0: 20 + stepFeatures: + 0: 20 HLT_xe100_cvfpufit_L1XE50: eventCount: 0 stepCounts: @@ -2957,22 +2971,6 @@ HLT_xe65_cell_L1XE50: eventCount: 0 HLT_xe65_cell_xe110_tcpufit_L1XE50: eventCount: 0 -HLT_xe80_tcpufit_unconvtrk120_isohpttrack_iaggrloose_L1XE50: - eventCount: 0 - stepFeatures: - 0: 1 -HLT_xe80_tcpufit_unconvtrk120_isohpttrack_iaggrmedium_L1XE50: - eventCount: 0 - stepFeatures: - 0: 1 -HLT_xe80_tcpufit_unconvtrk120_isohpttrack_imedium_L1XE50: - eventCount: 0 - stepFeatures: - 0: 1 -HLT_xe80_tcpufit_unconvtrk80_isohpttrack_imedium_L1XE50: - eventCount: 0 - stepFeatures: - 0: 1 HLT_xe95_trkmht_xe90_tcpufit_xe75_cell_L1XE50: eventCount: 0 stepFeatures: diff --git a/Trigger/TriggerCommon/TrigEDMConfig/python/TriggerEDMRun3.py b/Trigger/TriggerCommon/TrigEDMConfig/python/TriggerEDMRun3.py index a7678194f0ed0b4df05c58e1599275ae822037bd..1b77b1653bd139e486df5c4fea6318e4bb7e3369 100644 --- a/Trigger/TriggerCommon/TrigEDMConfig/python/TriggerEDMRun3.py +++ b/Trigger/TriggerCommon/TrigEDMConfig/python/TriggerEDMRun3.py @@ -146,7 +146,7 @@ TriggerHLTListRun3 = [ ('xAOD::TrackParticleContainer#HLT_IDTrack_Electron_IDTrig', 'BS ESD AODFULL', 'Egamma', 'inViews:precisionEtcutViews'), ('xAOD::TrackParticleAuxContainer#HLT_IDTrack_Electron_IDTrigAux.', 'BS ESD AODFULL', 'Egamma'), - + ('xAOD::TrackParticleContainer#HLT_IDTrack_Electron_GSF', 'BS ESD AODFULL', 'Egamma', 'inViews:precisionElectronViews_GSF'), ('xAOD::TrackParticleAuxContainer#HLT_IDTrack_Electron_GSFAux.', 'BS ESD AODFULL', 'Egamma'), @@ -314,10 +314,10 @@ TriggerHLTListRun3 = [ ('xAOD::JetContainer#HLT_AntiKt4EMTopoJets_subjesIS_ftf', 'BS ESD AODFULL', 'Jet', 'alias:JetContainerShallowCopy'), ('xAOD::ShallowAuxContainer#HLT_AntiKt4EMTopoJets_subjesIS_ftfAux.'+JetCopyVars, 'BS ESD AODFULL', 'Jet'), - + ('xAOD::JetContainer#HLT_AntiKt4EMTopoJets_subjesgscIS_ftf', 'BS ESD AODFULL AODSLIM AODVERYSLIM', 'Jet', 'alias:JetContainerShallowCopy'), ('xAOD::ShallowAuxContainer#HLT_AntiKt4EMTopoJets_subjesgscIS_ftfAux.'+JetCopyVars, 'BS ESD AODFULL AODSLIM AODVERYSLIM', 'Jet'), - + ('xAOD::JetContainer#HLT_AntiKt4EMTopoJets_subresjesgscIS_ftf', 'BS ESD AODFULL AODSLIM AODVERYSLIM', 'Jet', 'alias:JetContainerShallowCopy'), ('xAOD::ShallowAuxContainer#HLT_AntiKt4EMTopoJets_subresjesgscIS_ftfAux.'+JetCopyVars, 'BS ESD AODFULL AODSLIM AODVERYSLIM', 'Jet'), @@ -394,6 +394,15 @@ TriggerHLTListRun3 = [ ('xAOD::VertexContainer#HLT_IDVertex_FS', 'BS ESD AODFULL', 'Jet'), ('xAOD::VertexAuxContainer#HLT_IDVertex_FSAux.', 'BS ESD AODFULL', 'Jet'), + #FSLRT + ('xAOD::TrackParticleContainer#HLT_IDTrack_FSLRT_FTF', 'BS ESD AODFULL', 'Jet'), + ('xAOD::TrackParticleAuxContainer#HLT_IDTrack_FSLRT_FTFAux.', 'BS ESD AODFULL', 'Jet'), + + ('xAOD::VertexContainer#HLT_IDVertex_FSLRT', 'BS ESD AODFULL', 'Jet'), + ('xAOD::VertexAuxContainer#HLT_IDVertex_FSLRTAux.', 'BS ESD AODFULL', 'Jet'), + + ('xAOD::TrigCompositeContainer#HLT_FSLRT_TrackCount', 'BS ESD AODFULL AODSLIM', 'Jet'), + ('xAOD::TrigCompositeAuxContainer#HLT_FSLRT_TrackCountAux.ntrks.pTcuts.z0cuts.counts', 'BS ESD AODFULL AODSLIM', 'Jet'), # custom BeamSpot tracks - we don't want to write these out in general so this # is commented, if we want to write them out at some point, then these lines diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/CalibCosmicMon/BeamspotChainConfiguration.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/CalibCosmicMon/BeamspotChainConfiguration.py index a597710ea80610fcbf7fb347fda2579037bdd18a..5ad3b0f0d02e13438b76a216b61547a3696718a6 100644 --- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/CalibCosmicMon/BeamspotChainConfiguration.py +++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/CalibCosmicMon/BeamspotChainConfiguration.py @@ -14,13 +14,13 @@ from DecisionHandling.DecisionHandlingConf import ViewCreatorInitialROITool #---------------------------------------------------------------- -# fragments generating configuration will be functions in New JO, +# fragments generating configuration will be functions in New JO, # so let's make them functions already now #---------------------------------------------------------------- def trkFS_trkfast_Cfg( flags ): return allTE_trkfast( signature="FS" ) - + def allTE_trkfast_Cfg( flags ): return allTE_trkfast( signature="BeamSpot" ) @@ -39,6 +39,9 @@ def allTE_trkfast( signature="FS" ): from TrigInDetConfig.ConfigSettings import getInDetTrigConfig IDTrigConfig = getInDetTrigConfig( signature ) + if(signature == "FS"): + IDTrigConfig = getInDetTrigConfig("beamSpotFS") + viewAlgs, viewVerify = makeInDetAlgs( config = IDTrigConfig, rois=inputMakerAlg.InViewRoIs) vertexAlg = T2VertexBeamSpot_activeAllTE( "vertex_"+signature ) @@ -81,25 +84,25 @@ class BeamspotChainConfiguration(ChainConfigurationBase): # ---------------------- # Assemble the chain depending on information from chainName # ---------------------- - def assembleChain(self): + def assembleChain(self): chainSteps = [] log.debug("Assembling chain for %s", self.chainName) stepDictionary = self.getStepDictionary() - + #key = self.chainPart['EFrecoAlg'] key = self.chainPart['addInfo'][0] + "_" + self.chainPart['l2IDAlg'][0]#TODO: hardcoded index steps=stepDictionary[key] for step in steps: chainstep = getattr(self, step)() chainSteps+=[chainstep] - + myChain = self.buildChain(chainSteps) return myChain def getStepDictionary(self): # -------------------- - # define here the names of the steps and obtain the chainStep configuration + # define here the names of the steps and obtain the chainStep configuration # -------------------- stepDictionary = { "allTE_trkfast":['getAllTEStep'], @@ -107,7 +110,7 @@ class BeamspotChainConfiguration(ChainConfigurationBase): "trkFS_trkfast":['getTrkFSStep'] } return stepDictionary - + # -------------------- # Configuration of costmonitor (costmonitor ?? but isn't this is the actua chain configuration ??) # -------------------- diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/LS2_v1.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/LS2_v1.py index 4cac3f8997b80186b8f18264fa63b9d54fb07357..52b0a231e2f2b60284d93c171d6310def444e4f3 100644 --- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/LS2_v1.py +++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/LS2_v1.py @@ -47,7 +47,7 @@ def setupMenu(): # commented because it is conflict with dimuon noL1 serial chain # ChainProp(name='HLT_mu6noL1_L1MU6', l1SeedThresholds=['FSNOSEED'], groups=SingleMuonGroup), - + ChainProp(name='HLT_mu6_msonly_L1MU6', groups=SingleMuonGroup, monGroups=['muonMon:shifter','muonMon:val','idMon:t0']), ChainProp(name='HLT_2mu6_10invm70_L1MU6', groups=SingleMuonGroup), @@ -58,7 +58,7 @@ def setupMenu(): # ChainProp(name='HLT_mu6_Dr_mu4_Dr_L12MU4', l1SeedThresholds=['MU4']*2, groups=MultiMuonGroup), # ATR-20049 ChainProp(name='HLT_mu6_mu4_L12MU4', l1SeedThresholds=['MU4']*2, groups=MultiMuonGroup), - + # in planned primary as an option ChainProp(name='HLT_mu24_ivarmedium_L1MU20', groups=SingleMuonGroup, monGroups=['muonMon:shifter','idMon:t0']), @@ -110,7 +110,7 @@ def setupMenu(): ChainProp(name='HLT_e5_lhtight_L1EM3', groups=SingleElectronGroup), ChainProp(name='HLT_e5_lhtight_gsf_L1EM3', groups=SingleElectronGroup), ChainProp(name='HLT_e5_lhtight_nod0_L1EM3', groups=SingleElectronGroup), - + # Primary ChainProp(name='HLT_e17_lhvloose_nod0_L1EM15VH', groups=SingleElectronGroup), ChainProp(name='HLT_e17_lhvloose_nod0_L1EM15VHI', groups=SingleElectronGroup), @@ -139,13 +139,12 @@ def setupMenu(): ChainProp(name='HLT_e140_lhloose_L1EM22VHI', groups=SingleElectronGroup), ChainProp(name='HLT_e140_lhloose_nod0_L1EM22VHI', groups=SingleElectronGroup), ChainProp(name='HLT_e300_etcut_L1EM22VHI', groups=SingleElectronGroup), - + ChainProp(name='HLT_2e17_lhvloose_L12EM3', stream=[PhysicsStream], groups=MultiElectronGroup), ChainProp(name='HLT_2e17_lhvloose_L12EM15VH', stream=[PhysicsStream], groups=MultiElectronGroup), ChainProp(name='HLT_2e17_lhvloose_L12EM15VHI', stream=[PhysicsStream], groups=MultiElectronGroup), ChainProp(name='HLT_2e24_lhvloose_L12EM20VH', stream=[PhysicsStream], groups=MultiElectronGroup), ChainProp(name='HLT_e24_lhvloose_2e12_lhvloose_L1EM20VH_3EM10VH', stream=[PhysicsStream], groups=MultiElectronGroup), - ## ATR-22109 ChainProp(name='HLT_e20_lhtight_ivarloose_L1ZAFB-25DPHI-EM18I', l1SeedThresholds=['EM12'], stream=[PhysicsStream], groups=MultiElectronGroup), @@ -164,11 +163,11 @@ def setupMenu(): ChainProp(name='HLT_e9_lhtight_noringer_e4_etcut_Jpsiee_L1JPSI-1M5-EM7',l1SeedThresholds=['EM7','EM3'],groups=MultiElectronGroup), ChainProp(name='HLT_e5_lhtight_noringer_e9_etcut_Jpsiee_L1JPSI-1M5-EM7',l1SeedThresholds=['EM3','EM7'],groups=MultiElectronGroup), ChainProp(name='HLT_e14_lhtight_noringer_e4_etcut_Jpsiee_L1JPSI-1M5-EM12',l1SeedThresholds=['EM12','EM3'],groups=MultiElectronGroup), - ChainProp(name='HLT_e5_lhtight_noringer_e14_etcut_Jpsiee_L1JPSI-1M5-EM12',l1SeedThresholds=['EM3','EM12'],groups=MultiElectronGroup), + ChainProp(name='HLT_e5_lhtight_noringer_e14_etcut_Jpsiee_L1JPSI-1M5-EM12',l1SeedThresholds=['EM3','EM12'],groups=MultiElectronGroup), # for moving to PhysicsP1, ATR-21242 # ChainProp(name='HLT_2e17_etcut_L12EM15VHI', stream=[PhysicsStream], groups=MultiElectronGroup), - + # PhotonChains------------ # these are to debug photon working points should be removed in production ChainProp(name='HLT_g5_etcut_L1EM3', groups=SinglePhotonGroup), @@ -332,8 +331,8 @@ def setupMenu(): - # TLA test chain, ATR-20395 - ChainProp(name='HLT_JetDS_j0_L1J100', stream=['JetDS'], groups=SingleJetGroup), + # TLA test chain, ATR-20395 + ChainProp(name='HLT_JetDS_j0_L1J100', stream=['JetDS'], groups=SingleJetGroup), # ATR-22096 ChainProp(name='HLT_j420_subresjesgscIS_ftf_L1J100', groups=SingleJetGroup), @@ -490,6 +489,7 @@ def setupMenu(): ChainProp(name="HLT_tau35_mediumRNN_tracktwo_L1TAU12IM", groups=SingleTauGroup), ChainProp(name="HLT_tau35_mediumRNN_tracktwoEF_L1TAU12IM", groups=SingleTauGroup), ChainProp(name="HLT_tau35_mediumRNN_tracktwoMVA_L1TAU12IM", groups=SingleTauGroup), + ChainProp(name="HLT_tau35_mediumRNN_tracktwoMVABDT_L1TAU12IM", groups=SingleTauGroup), ChainProp(name="HLT_tau35_tightRNN_track_L1TAU12IM", groups=SingleTauGroup), ChainProp(name="HLT_tau35_tightRNN_tracktwo_L1TAU12IM", groups=SingleTauGroup), @@ -599,14 +599,14 @@ def setupMenu(): ChainProp(name='HLT_e24_lhmedium_ivarloose_tau20_mediumRNN_tracktwoMVA_03dRtt_L1EM22VHI', l1SeedThresholds=['EM22VHI','TAU8'], stream=[PhysicsStream], groups=EgammaTauGroup), # This is the next one to implement #ChainProp(name="HLT_tau25_mediumRNN_tracktwoMVA_tau20_mediumRNN_tracktwoMVA_j70_j50_L1MJJ-500-NFF", l1SeedThresholds=['TAU8','TAU8','J20','J20'], stream=[PhysicsStream], groups=['MultiTauGroup','MultiJetGroup']), - + #ATR-22108: combined tau+X chains: TODO: add dRtt, need T&P-like merging #ChainProp(name='HLT_tau60_mediumRNN_tracktwoMVA_tau25_mediumRNN_tracktwoMVA_xe50_cell_L1TAU40_2TAU12IM_XE40', l1SeedThresholds=['TAU40','TAU12IM','XE40'], stream=[PhysicsStream], groups=TauMETGroup), ChainProp(name='HLT_e17_lhmedium_tau25_mediumRNN_tracktwoMVA_xe50_cell_L1EM15VHI_2TAU12IM_XE35', l1SeedThresholds=['EM15VHI','TAU12IM','XE35'], stream=[PhysicsStream], groups=TauMETGroup), ChainProp(name='HLT_mu14_tau25_mediumRNN_tracktwoMVA_xe50_cell_L1MU10_TAU12IM_XE35', l1SeedThresholds=['MU10','TAU12IM','XE35'], stream=[PhysicsStream], groups=TauMETGroup), ChainProp(name='HLT_e17_lhmedium_ivarloose_tau25_mediumRNN_tracktwoMVA_03dRtt_L1EM15VHI_2TAU12IM_4J12', l1SeedThresholds=['EM15VHI','TAU12IM'], stream=[PhysicsStream], groups=EgammaTauGroup), - + #these can be uncommented once ivarloose exists as a muon iso WP #ChainProp(name='HLT_mu20_ivarloose_tau20_mediumRNN_tracktwoMVA_03dRtt_L1MU20', l1SeedThresholds=['MU20','TAU8'], stream=[PhysicsStream], groups=MuonTauGroup), #ChainProp(name='HLT_mu14_ivarloose_tau35_mediumRNN_tracktwoMVA_03dRtt_L1MU10_TAU20IM', l1SeedThresholds=['MU10','TAU20IM'], stream=[PhysicsStream], groups=MuonTauGroup), @@ -619,13 +619,13 @@ def setupMenu(): ChainProp(name='HLT_g90_loose_xe90_cell_L1EM22VHI',l1SeedThresholds=['EM22VHI','FSNOSEED'],stream=[PhysicsStream], groups=EgammaMETGroup), # electron + MET (ATR-22594) - ChainProp(name='HLT_e70_lhloose_xe70_cell_L1EM22VHI',l1SeedThresholds=['EM22VHI','FSNOSEED'],stream=[PhysicsStream], groups=EgammaMETGroup), + ChainProp(name='HLT_e70_lhloose_xe70_cell_L1EM22VHI',l1SeedThresholds=['EM22VHI','FSNOSEED'],stream=[PhysicsStream], groups=EgammaMETGroup), # VBF triggers (ATR-22594) #these chains do not have properly formatted dijet selection strings #ChainProp(name='HLT_2mu6_2j50_0eta490_dijetSEP50j1etSEP50j2etSEP900djmass_L1MJJ-500-NFF',l1SeedThresholds=['MU6','FSNOSEED'],stream=[PhysicsStream], groups=MuonJetGroup), #ChainProp(name='HLT_g25_medium_4j35_0eta490_dijetSEP35j1etSEP35j2etSEP1000djmass_L1EM22VHI',l1SeedThresholds=['EM22VHI','FSNOSEED'],stream=[PhysicsStream], groups=EgammaJetGroup), - + ] TriggerFlags.HeavyIonSlice.signatures = TriggerFlags.HeavyIonSlice.signatures() + [] @@ -673,11 +673,29 @@ def setupMenu(): TriggerFlags.UnconventionalTrackingSlice.signatures = TriggerFlags.UnconventionalTrackingSlice.signatures() + [ - ChainProp(name='HLT_unconvtrk120_isohpttrack_imedium_L1XE50', groups=SingleMETGroup, l1SeedThresholds=['XE50']), - ChainProp(name='HLT_unconvtrk120_isohpttrack_iaggrmedium_L1XE50', groups=SingleMETGroup, l1SeedThresholds=['XE50']), - ChainProp(name='HLT_xe80_tcpufit_unconvtrk120_isohpttrack_imedium_L1XE50', groups=SingleMETGroup, l1SeedThresholds=['XE50','FSNOSEED']), - ChainProp(name='HLT_xe80_tcpufit_unconvtrk80_isohpttrack_imedium_L1XE50', groups=SingleMETGroup, l1SeedThresholds=['XE50','FSNOSEED']), - ChainProp(name='HLT_xe80_tcpufit_unconvtrk120_isohpttrack_iaggrmedium_L1XE50', groups=SingleMETGroup, l1SeedThresholds=['XE50','FSNOSEED']), - ChainProp(name='HLT_xe80_tcpufit_unconvtrk120_isohpttrack_iaggrloose_L1XE50', groups=SingleMETGroup, l1SeedThresholds=['XE50','FSNOSEED']), - ] + ChainProp(name='HLT_unconvtrk50_isohpttrack_L1XE50', groups=SingleMETGroup, l1SeedThresholds=['XE50']), + # ChainProp(name='HLT_xe80_tcpufit_unconvtrk50_isohpttrack_L1XE50', groups=SingleMETGroup, l1SeedThresholds=['XE50','FSNOSEED'],mergingStrategy='serial'), + # ChainProp(name='HLT_xe80_tcpufit_unconvtrk50_isohpttrack_loose_L1XE50', groups=SingleMETGroup, l1SeedThresholds=['XE50','FSNOSEED'],mergingStrategy='serial'), + # + # + # ChainProp(name='HLT_xe80_tcpufit_unconvtrk80_isohpttrack_tight_imedium_L1XE50', groups=SingleMETGroup, l1SeedThresholds=['XE50','FSNOSEED'],mergingStrategy='serial'), + # + # ChainProp(name='HLT_xe80_tcpufit_unconvtrk120_isohpttrack_tight_imedium_L1XE50', groups=SingleMETGroup, l1SeedThresholds=['XE50','FSNOSEED'],mergingStrategy='serial'), + # ChainProp(name='HLT_xe80_tcpufit_unconvtrk120_isohpttrack_medium_imedium_L1XE50', groups=SingleMETGroup, l1SeedThresholds=['XE50','FSNOSEED'],mergingStrategy='serial'), + # ChainProp(name='HLT_xe80_tcpufit_unconvtrk120_isohpttrack_loose_imedium_L1XE50', groups=SingleMETGroup, l1SeedThresholds=['XE50','FSNOSEED'],mergingStrategy='serial'), + # ChainProp(name='HLT_xe80_tcpufit_unconvtrk120_isohpttrack_tight_iaggrmedium_L1XE50', groups=SingleMETGroup, l1SeedThresholds=['XE50','FSNOSEED'],mergingStrategy='serial'), + # ChainProp(name='HLT_xe80_tcpufit_unconvtrk120_isohpttrack_medium_iaggrmedium_L1XE50', groups=SingleMETGroup, l1SeedThresholds=['XE50','FSNOSEED'],mergingStrategy='serial'), + # ChainProp(name='HLT_xe80_tcpufit_unconvtrk120_isohpttrack_loose_iaggrmedium_L1XE50', groups=SingleMETGroup, l1SeedThresholds=['XE50','FSNOSEED'],mergingStrategy='serial'), + # + # + # ChainProp(name='HLT_xe80_tcpufit_unconvtrk120_isohpttrack_tight_iloose_L1XE50', groups=SingleMETGroup, l1SeedThresholds=['XE50','FSNOSEED'],mergingStrategy='serial'), + # ChainProp(name='HLT_xe80_tcpufit_unconvtrk120_isohpttrack_medium_iloose_L1XE50', groups=SingleMETGroup, l1SeedThresholds=['XE50','FSNOSEED'],mergingStrategy='serial'), + # ChainProp(name='HLT_xe80_tcpufit_unconvtrk120_isohpttrack_loose_iloose_L1XE50', groups=SingleMETGroup, l1SeedThresholds=['XE50','FSNOSEED'],mergingStrategy='serial'), + # ChainProp(name='HLT_xe80_tcpufit_unconvtrk120_isohpttrack_tight_iaggrloose_L1XE50', groups=SingleMETGroup, l1SeedThresholds=['XE50','FSNOSEED'],mergingStrategy='serial'), + # ChainProp(name='HLT_xe80_tcpufit_unconvtrk120_isohpttrack_medium_iaggrloose_L1XE50', groups=SingleMETGroup, l1SeedThresholds=['XE50','FSNOSEED'],mergingStrategy='serial'), + # ChainProp(name='HLT_xe80_tcpufit_unconvtrk120_isohpttrack_loose_iaggrloose_L1XE50', groups=SingleMETGroup, l1SeedThresholds=['XE50','FSNOSEED'],mergingStrategy='serial'), + + ChainProp(name='HLT_unconvtrk120_fslrt_L1All', groups=SingleMETGroup, l1SeedThresholds=['FSNOSEED']), + ChainProp(name='HLT_unconvtrk120_fslrt_L1XE50', groups=SingleMETGroup, l1SeedThresholds=['XE50']), + ] diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/SignatureDicts.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/SignatureDicts.py index e0ea5c6d9668d6ab78b3925d34bd66c84b42dd5c..84057de6055da9d24820f655216dd39277d7ac78 100644 --- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/SignatureDicts.py +++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Menu/SignatureDicts.py @@ -468,7 +468,7 @@ PhotonChainParts = { 'signature' : ['Photon'], 'alignmentGroup' : ['Photon','Egamma'], 'chainPartName' : '', - 'multiplicity' : '', + 'multiplicity' : '', 'trigType' : ['g'], 'threshold' : '', 'extra' : [], @@ -491,7 +491,7 @@ PhotonChainParts_Default = { 'signature' : ['Photon'], 'alignmentGroup' : ['Photon'], 'L1threshold' : '', - 'multiplicity' : '', + 'multiplicity' : '', 'trigType' : '', 'threshold' : '', 'extra' : '', @@ -499,7 +499,7 @@ PhotonChainParts_Default = { 'isoInfo' : '', 'reccalibInfo' : '', 'trkInfo' : '', - 'caloInfo' : '', + 'caloInfo' : '', 'hypoInfo' : '', 'recoAlg' : '', 'FSinfo' : '', @@ -517,7 +517,7 @@ MinBiasChainParts = { 'alignmentGroup' : ['MinBias'], 'L1threshold' : '', 'chainPartName' : '', - 'multiplicity' : '', + 'multiplicity' : '', 'trigType' : ['mb'], 'threshold' : '', 'extra' : ['noisesup', 'vetombts2in', 'vetombts1side2in', 'vetospmbts2in', "vetosp" ,'ion', 'ncb', 'blayer', 'exclusiveloose', 'exclusivetight'], #ncb = non collision background, blayer = only sum innermost pix layer @@ -525,13 +525,13 @@ MinBiasChainParts = { 'ZDCinfo' : ['lg', 'hg'], 'trkInfo' : ['hlttr', 'ftk', 'costr'], 'hypoL2Info' : ['sp2', 'sp3', 'sp5', 'sp10', 'sp15', 'sp100', 'sp300', 'sp400', 'sp500', 'sp600', 'sp700', 'sp800', 'sp900', - 'sp1000', 'sp1200', 'sp1300', 'sp1400', 'sp1500', 'sp1600', 'sp1700', 'sp1800', + 'sp1000', 'sp1200', 'sp1300', 'sp1400', 'sp1500', 'sp1600', 'sp1700', 'sp1800', 'sp2000', 'sp2100', 'sp2200', 'sp2300', 'sp2400', 'sp2500', 'sp2700', 'sp2800', 'sp2900', 'sp3000', 'sp3100', 'sp3500', 'sp4100', 'sp4500', 'sp4800', 'sp5000', 'sp5200',], 'pileupInfo' : ['pusup200','pusup300','pusup350', 'pusup400', 'pusup450', 'pusup500', 'pusup550', 'pusup600', 'pusup700', 'pusup750', 'pusup800', 'pusup900', 'pusup1000', 'pusup1100', 'pusup1200', 'pusup1300', 'pusup1400', 'pusup1500',], 'hypoEFInfo' : ['trk3','trk5','trk10','trk15', 'trk20', 'trk30', 'trk40', 'trk45', 'trk50', 'trk55', 'trk60', 'trk65', 'trk70', 'trk75', 'trk80', 'trk90', - 'trk100', 'trk110', 'trk120', 'trk130', 'trk140', 'trk150', 'trk160', 'trk180', 'trk200', 'trk220', 'trk240', 'trk260', 'trk280', + 'trk100', 'trk110', 'trk120', 'trk130', 'trk140', 'trk150', 'trk160', 'trk180', 'trk200', 'trk220', 'trk240', 'trk260', 'trk280', 'pt2', 'pt4', 'pt6', 'pt8', ], 'hypoEFsumEtInfo': ['sumet40', 'sumet50', 'sumet60', 'sumet70', 'sumet80', 'sumet90', 'sumet110', 'sumet150',], 'recoAlg' : ['mbts', 'sptrk', 'sp', 'noalg', 'perf', 'hmt', 'hmtperf', 'idperf', 'zdcperf'], @@ -545,17 +545,17 @@ MinBiasChainParts_Default = { 'alignmentGroup' : ['MinBias'], 'L1threshold' : '', 'chainPartName' : '', - 'multiplicity' : '', + 'multiplicity' : '', 'trigType' : ['mb'], 'threshold' : '', - 'extra' : '', + 'extra' : '', 'IDinfo' : '', - 'ZDCinfo' : '', - 'trkInfo' : '', + 'ZDCinfo' : '', + 'trkInfo' : '', 'hypoL2Info' : '', 'pileupInfo' : '', 'hypoEFInfo' : '', - 'hypoEFsumEtInfo': '', + 'hypoEFsumEtInfo': '', 'recoAlg' : [], 'addInfo' : [], 'sigFolder' : 'MinBias', @@ -577,7 +577,7 @@ HeavyIonChainParts = { 'extra' : [], 'IDinfo' : [], 'trkInfo' : [], - 'eventShape' : [], + 'eventShape' : [], 'eventShapeVeto' : [], 'hypoL2Info' : [], 'pileupInfo' : [], @@ -591,7 +591,7 @@ HeavyIonChainParts = { } # ---- HeavyIonDictionary of default Values ---- -HeavyIonChainParts_Default = { +HeavyIonChainParts_Default = { 'signature' : ['HeavyIon'], 'alignmentGroup' : ['HeavyIon'], 'L1threshold' : '', @@ -607,7 +607,7 @@ HeavyIonChainParts_Default = { 'hypoL2Info' : '', 'pileupInfo' : '', 'hypoEFInfo' : '', - 'hypoEFsumEtInfo': '', + 'hypoEFsumEtInfo': '', 'recoAlg' : [], 'addInfo' : [], 'gap' : '', @@ -619,7 +619,7 @@ HeavyIonChainParts_Default = { # ---- CosmicDef chains ----- #========================================================== AllowedCosmicChainIdentifiers = ['larps','larhec', - 'tilecalib', + 'tilecalib', 'sct', 'id',] # ---- Cosmic Chain Dictionary of all allowed Values ---- @@ -634,7 +634,7 @@ CosmicChainParts = { 'hits' : ['4hits'], 'threshold' : '', 'multiplicity' : '', - 'trigType' : 'cosmic', + 'trigType' : 'cosmic', 'extra' : '', 'sigFolder' : 'CalibCosmicMon', 'subSigs' : ['Cosmic'] @@ -652,7 +652,7 @@ CosmicChainParts_Default = { 'hits' : [], 'threshold' : '', 'multiplicity' : '', - 'trigType' : '', + 'trigType' : '', 'extra' : '', 'sigFolder' : 'CalibCosmicMon', 'subSigs' : ['Cosmic'] @@ -672,10 +672,10 @@ StreamingChainParts = { 'threshold' : '', 'multiplicity' : '', 'streamingInfo' : ['bkg', 'idmon', 'mb', 'eb', 'zb','to','standby', - 'jettauetmiss', 'larcells', + 'jettauetmiss', 'larcells', 'cosmiccalo', 'cosmicmuons','idcosmic', 'dcmmon', 'zb', 'l1calo', 'l1topo','ftk'], - 'trigType' : 'streamer', + 'trigType' : 'streamer', 'extra' : '', 'streamType' : AllowedStreamingChainIdentifiers, 'algo' : ['NoAlg'], @@ -692,7 +692,7 @@ StreamingChainParts_Default = { 'threshold' : '', 'multiplicity' : '', 'streamingInfo' : '', - 'trigType' : '', + 'trigType' : '', 'extra' : '', 'streamType' : '', 'algo' : [], @@ -703,10 +703,10 @@ StreamingChainParts_Default = { #========================================================== # ---- CalibDef chains ----- #========================================================== -AllowedCalibChainIdentifiers = ['csccalib', 'larcalib', - 'idcalib', 'l1calocalib', +AllowedCalibChainIdentifiers = ['csccalib', 'larcalib', + 'idcalib', 'l1calocalib', 'tilelarcalib', 'alfacalib', - 'larnoiseburst','ibllumi', + 'larnoiseburst','ibllumi', 'l1satmon', 'zdcpeb', 'calibAFP', 'larpebcalib', ] @@ -726,7 +726,7 @@ CalibChainParts = { 'streamingInfo' : ['vdm',], 'threshold' : '', 'multiplicity' : '', - 'trigType' : ['trk'], + 'trigType' : ['trk'], 'extra' : ['bs',''], 'sigFolder' : 'CalibCosmicMon', 'subSigs' : ['Calib'] @@ -747,7 +747,7 @@ CalibChainParts_Default = { 'threshold' : '', 'multiplicity' : '', 'location' : '', - 'trigType' : '', + 'trigType' : '', 'extra' : '', 'sigFolder' : 'CalibCosmicMon', 'subSigs' : ['Calib'] @@ -789,7 +789,7 @@ MonitorChainParts_Default = { 'hypo' : '', 'threshold' : '', 'multiplicity' : '', - 'trigType' : '', + 'trigType' : '', 'extra' : '', 'sigFolder' : 'CalibCosmicMon', 'subSigs' : ['Monitor'] @@ -824,7 +824,7 @@ EnhancedBiasChainParts_Default = { 'algType' : 'physics', 'threshold' : '', 'multiplicity' : '', - 'trigType' : '', + 'trigType' : '', 'extra' : '', 'sigFolder' : 'CalibCosmicMon', 'subSigs' : ['EnhancedBias'] @@ -865,7 +865,7 @@ BeamspotChainParts_Default = { 'threshold' : '', 'multiplicity' : '', 'location' : 'vtx', - 'trigType' : 'beamspot', + 'trigType' : 'beamspot', 'extra' : '', 'sigFolder' : 'CalibCosmicMon', 'subSigs' : ['Beamspot'] @@ -884,7 +884,7 @@ UnconventionalTrackingChainParts = { 'trigType' : ['unconvtrk'], 'threshold' : '', 'isoInfo' : ['iaggrmedium','iaggrloose','imedium','iloose'], - 'extra' : ["isohpttrack"], + 'extra' : ["isohpttrack", "fslrt"], 'addInfo' : [], 'sigFolder' : 'UnconventionalTracking', 'subSigs' : ['UnconventionalTracking'] @@ -949,7 +949,7 @@ def getSignatureNameFromToken(chainpart): #========================================================== # Signature dictionaries to use -#========================================================== +#========================================================== def getSignatureInformation(signature): if signature == 'Electron': return [ElectronChainParts_Default, ElectronChainParts] @@ -960,7 +960,7 @@ def getSignatureInformation(signature): if signature == "Bjet": return [bJetChainParts_Default, JetChainParts] if signature == "Tau": - return [TauChainParts_Default, TauChainParts] + return [TauChainParts_Default, TauChainParts] if (signature == "Muon"): return [MuonChainParts_Default, MuonChainParts] if (signature == "Bphysics"): @@ -998,14 +998,10 @@ def getSignatureInformation(signature): #========================================================== # Analysis the base pattern: <mult><signatureType><threshold><extraInfo> -#========================================================== +#========================================================== def getBasePattern(): import re allTrigTypes = SliceIDDict.values() possibleTT = '|'.join(allTrigTypes) pattern = re.compile("(?P<multiplicity>\d*)(?P<trigType>(%s))(?P<threshold>\d+)(?P<extra>\w*)" % (possibleTT)) # noqa: W605 return pattern - - - - diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/UnconventionalTracking/FullScanLRTTrackingConfiguration.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/UnconventionalTracking/FullScanLRTTrackingConfiguration.py new file mode 100644 index 0000000000000000000000000000000000000000..b6f0dc26ed63be918e21b7b8877e3e4a91fe3d1f --- /dev/null +++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/UnconventionalTracking/FullScanLRTTrackingConfiguration.py @@ -0,0 +1,64 @@ +# Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration +from AthenaCommon.CFElements import parOR +from ..CommonSequences.FullScanDefs import trkFSRoI +from TriggerMenuMT.HLTMenuConfig.Menu.MenuComponents import MenuSequence, RecoFragmentsPool +from AthenaCommon.Logging import logging +from ViewAlgs.ViewAlgsConf import EventViewCreatorAlgorithm +from DecisionHandling.DecisionHandlingConf import ViewCreatorInitialROITool + +logging.getLogger().info("Importing %s",__name__) +log = logging.getLogger("TriggerMenuMT.HLTMenuConfig.UnconventionalTracking.FullScanLRTConfiguration") + + +def FullScanLRTTriggerSequence(ConfigFlags): + from TrigInDetConfig.ConfigSettings import getInDetTrigConfig + fscfg = getInDetTrigConfig("jet") + lrtcfg = getInDetTrigConfig( 'fullScanLRT' ) + + + from TrigEDMConfig.TriggerEDMRun3 import recordable + from TrigInDetConfig.InDetSetup import makeInDetAlgsNoView, makeInDetAlgs + view_algs = makeInDetAlgsNoView( config = fscfg, rois=trkFSRoI, secondStageConfig = lrtcfg) + + from TriggerMenuMT.HLTMenuConfig.Jet.JetMenuSequences import getTrackingInputMaker + im_alg = getTrackingInputMaker() + + + from TrigInDetConfig.TrigInDetPriVtxConfig import makeVertices + + verticesname = recordable("HLT_IDVertex_FSLRT") + vtxAlgs = makeVertices( "fullScanLRT", lrtcfg.FT.tracksFTF( doRecord = lrtcfg.isRecordable ) , verticesname, lrtcfg ) + prmVtx = vtxAlgs[-1] + + + TrkSeq = parOR("UncTrkrecoSeqFSLRT", [im_alg, view_algs, prmVtx]) + sequenceOut = lrtcfg.FT.tracksFTF( doRecord = lrtcfg.isRecordable ) + + + + return (TrkSeq,im_alg, sequenceOut) + + + + + +def FullScanLRTTriggerMenuSequence(): + from TrigLongLivedParticlesHypo.TrigFullScanLRTHypoTool import TrigLRTHypoToolFromDict + from TrigLongLivedParticlesHypo.TrigLongLivedParticlesHypoConf import (FastTrackFinderLRTHypoAlg) + + from AthenaConfiguration.AllConfigFlags import ConfigFlags + ( TrkSeq,im_alg, sequenceOut) = RecoFragmentsPool.retrieve(FullScanLRTTriggerSequence,ConfigFlags) + + theHypoAlg = FastTrackFinderLRTHypoAlg("FullScanLRTHypoAlg") + + from TrigEDMConfig.TriggerEDMRun3 import recordable + theHypoAlg.trackCountKey=recordable("HLT_FSLRT_TrackCount") + theHypoAlg.tracksKey = recordable(sequenceOut) + + + log.info("Building the Step dictinary for FullScanLRT!") + return MenuSequence( Sequence = TrkSeq, + Maker = im_alg, + Hypo = theHypoAlg, + HypoToolGen = TrigLRTHypoToolFromDict, + ) diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/UnconventionalTracking/UnconventionalTrackingChainConfiguration.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/UnconventionalTracking/UnconventionalTrackingChainConfiguration.py index 8748c672f2a7a546858229f8d10dad173bcc89f7..042531170718a36671b0dd1d335753bf288121d1 100644 --- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/UnconventionalTracking/UnconventionalTrackingChainConfiguration.py +++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/UnconventionalTracking/UnconventionalTrackingChainConfiguration.py @@ -1,13 +1,14 @@ -# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration +# Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration from AthenaCommon.Logging import logging logging.getLogger().info("Importing %s",__name__) log = logging.getLogger("TriggerMenuMT.HLTMenuConfig.UnconventionalTracking.UnconventionalTrackingDef") from TriggerMenuMT.HLTMenuConfig.Menu.ChainConfigurationBase import ChainConfigurationBase -from TriggerMenuMT.HLTMenuConfig.Menu.MenuComponents import MenuSequence, RecoFragmentsPool -from AthenaCommon.CFElements import parOR +from TriggerMenuMT.HLTMenuConfig.Menu.MenuComponents import MenuSequence, RecoFragmentsPool, EmptyMenuSequence +from AthenaCommon.CFElements import parOR, seqAND from ..CommonSequences.FullScanDefs import caloFSRoI +from ..Menu.ChainMerging import mergeChainDefs def unconventionalTrackingChainParts(chainParts): unconvtrkChainParts = [] @@ -28,23 +29,35 @@ class UnconventionalTrackingChainConfiguration(ChainConfigurationBase): # ---------------------- # Assemble the chain depending on information from chainName # ---------------------- - def assembleChain(self): + def assembleChain(self): log.debug("Assembling chain %s", self.chainName) chainSteps = [] stepDictionary = self.getStepDictionary() - key = self.chainPart['extra'] + key = self.chainPart['extra'] + import re + #Work around to run isohpttrack with an alternative step without skip when there is an HLT_MET trigger + # if key=="isohpttrack" and (re.match(".*_xe\d*_*",(self.chainName))): + # steps=stepDictionary["isohpttrackWithHLTMET"] + # else: steps=stepDictionary[key] + for step_level in steps: for step in step_level: chainstep = getattr(self, step)() chainSteps+=[chainstep] - + + + # from ..MET.METChainConfiguration import METChainConfiguration + # METChain = METChainConfiguration(self.chainDict).assembleChain() + + # myChain = mergeChainDefs([METChain] + [self.buildChain(chainSteps)]) myChain = self.buildChain(chainSteps) + return myChain def getStepDictionary(self): @@ -59,29 +72,44 @@ class UnconventionalTrackingChainConfiguration(ChainConfigurationBase): # -------------------- stepDictionary = { - "isohpttrack" : [['getIsoHPtTrackTrigger']] + "isohpttrack" : [['getSkipStep'],['getFTFTrackReco'],['getIsoHPtTrackTrigger']], + "isohpttrackWithHLTMET" : [['getFTFTrackReco'],['getIsoHPtTrackTrigger']], + "fslrt": [['getFSLRTEmpty'], ['getFSLRTTrigger']] } return stepDictionary - - # -------------------- def getIsoHPtTrackTrigger(self): - return self.getStep(3,'IsoHPtTrackTrigger',[IsoHPtTrackTriggerCfg]) + return self.getStep(7,'IsoHPtTrackTriggerCfg',[IsoHPtTrackTriggerCfg]) + + def getFTFTrackReco(self): + return self.getStep(6,'FTFRecoOnlyCfg',[FTFRecoOnlyCfg]) + + def getSkipStep(self): + return self.getEmptyStep(1,"EmptyUncTrk") + def getFSLRTTrigger(self): + return self.getStep(2,'FSLRTTrigger',[FSLRTTriggerCfg]) + def getFSLRTEmpty(self): + return self.getEmptyStep(1, 'FSLRTEmptyStep') -def IsoHPtTrackTriggerSequence(ConfigFlags): - from TrigT2CaloCommon.CaloDef import clusterFSInputMaker - InputMakerAlg= clusterFSInputMaker() +def FTFTrackSequence(ConfigFlags): + + + # from TrigT2CaloCommon.CaloDef import clusterFSInputMaker + # InputMakerAlg= clusterFSInputMaker() + + from TriggerMenuMT.HLTMenuConfig.Jet.JetMenuSequences import getTrackingInputMaker + InputMakerAlg=getTrackingInputMaker() + - from TrigInDetConfig.ConfigSettings import getInDetTrigConfig IDTrigConfig = getInDetTrigConfig( 'jet' ) @@ -92,17 +120,17 @@ def IsoHPtTrackTriggerSequence(ConfigFlags): from TrigInDetConfig.InDetSetup import makeInDetAlgsNoView TrkInputNoViewAlg = makeInDetAlgsNoView( config = IDTrigConfig, rois=caloFSRoI) - + from TrigInDetConfig.TrigInDetPriVtxConfig import makeVertices - + verticesname = recordable("HLT_IDVertex_FS") vtxAlgs = makeVertices( "jet", IDTrigConfig.FT.tracksFTF( doRecord = IDTrigConfig.isRecordable ) , verticesname, IDTrigConfig ) prmVtx = vtxAlgs[-1] - TrkSeq = parOR("UncTrkrecoSeq", [InputMakerAlg,TrkInputNoViewAlg, prmVtx]) - sequenceOut = IDTrigConfig.FT.tracksFTF( doRecord = IDTrigConfig.isRecordable ) + TrkSeq = [InputMakerAlg,TrkInputNoViewAlg, prmVtx] + sequenceOut = IDTrigConfig.FT.tracksFTF( doRecord = IDTrigConfig.isRecordable ) # from .JetTrackingConfig import JetTrackingSequence @@ -117,27 +145,76 @@ def IsoHPtTrackTriggerSequence(ConfigFlags): -def IsoHPtTrackTriggerMenuSequence(): - - +def IsoHPtTrackTriggerHypoSequence(): from TrigLongLivedParticlesHypo.TrigIsoHPtTrackTriggerHypoTool import TrigIsoHPtTrackTriggerHypoToolFromDict from TrigLongLivedParticlesHypo.TrigLongLivedParticlesHypoConf import (TrigIsoHPtTrackTriggerHypoAlgMT) - from AthenaConfiguration.AllConfigFlags import ConfigFlags - ( TrkSeq, InputMakerAlg, sequenceOut) = RecoFragmentsPool.retrieve(IsoHPtTrackTriggerSequence,ConfigFlags) - + + # from AthenaConfiguration.AllConfigFlags import ConfigFlags + # ( TrkSeq, InputMakerAlg, sequenceOut) = RecoFragmentsPool.retrieve(FTFTrackSequence,ConfigFlags) + + + # Get sequence name + from TrigInDetConfig.ConfigSettings import getInDetTrigConfig + IDTrigConfig = getInDetTrigConfig( 'jet' ) + sequenceOut = IDTrigConfig.FT.tracksFTF( doRecord = IDTrigConfig.isRecordable ) + + #Setup the hypothesis algorithm theIsoHPtTrackTriggerHypo = TrigIsoHPtTrackTriggerHypoAlgMT("L2IsoHPtTrack") theIsoHPtTrackTriggerHypo.trackKey = sequenceOut + from AthenaConfiguration.ComponentAccumulator import conf2toConfigurable + from AthenaConfiguration.ComponentFactory import CompFactory + DummyInputMakerAlg = conf2toConfigurable(CompFactory.InputMakerForRoI( "IM_IsoHPtTrack_HypoOnlyStep" )) + DummyInputMakerAlg.RoITool = conf2toConfigurable(CompFactory.ViewCreatorInitialROITool()) + + log.info("Building the Step dictinary for IsoHPt!") + return MenuSequence( Sequence = seqAND("UncTrkEmptySeq",[DummyInputMakerAlg]), + Maker = DummyInputMakerAlg, + Hypo = theIsoHPtTrackTriggerHypo, + HypoToolGen = TrigIsoHPtTrackTriggerHypoToolFromDict, + ) + + # log.info("Building the Step dictinary for IsoHPt!") + # return MenuSequence( Sequence = seqAND("UncTrkEmptySeq",TrkSeq), #,parOR("UncTrkEmptySeq",[InputMakerAlg]), + # Maker = InputMakerAlg,# DummyInputMakerAlg, + # Hypo = theIsoHPtTrackTriggerHypo, + # HypoToolGen = TrigIsoHPtTrackTriggerHypoToolFromDict, + # ) + + + + + +def FTFRecoOnlySequence(): + from TrigStreamerHypo.TrigStreamerHypoConf import TrigStreamerHypoAlgMT + from TrigStreamerHypo.TrigStreamerHypoConfigMT import StreamerHypoToolMTgenerator + + from AthenaConfiguration.AllConfigFlags import ConfigFlags + ( TrkSeq, InputMakerAlg, sequenceOut) = RecoFragmentsPool.retrieve(FTFTrackSequence,ConfigFlags) + + HypoAlg = TrigStreamerHypoAlgMT("UncTrkDummyStream") log.info("Building the Step dictinary for IsoHPt!") - return MenuSequence( Sequence = TrkSeq, + return MenuSequence( Sequence = seqAND("UncTrkrecoSeq", TrkSeq), Maker = InputMakerAlg, - Hypo = theIsoHPtTrackTriggerHypo, - HypoToolGen = TrigIsoHPtTrackTriggerHypoToolFromDict, + Hypo = HypoAlg, + HypoToolGen = StreamerHypoToolMTgenerator ) + + + + + + def IsoHPtTrackTriggerCfg(flags): - return IsoHPtTrackTriggerMenuSequence() + return IsoHPtTrackTriggerHypoSequence() +def FTFRecoOnlyCfg(flags): + return FTFRecoOnlySequence() + +def FSLRTTriggerCfg(flags): + from TriggerMenuMT.HLTMenuConfig.UnconventionalTracking.FullScanLRTTrackingConfiguration import FullScanLRTTriggerMenuSequence + return FullScanLRTTriggerMenuSequence()