Skip to content
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions Configuration/ProcessModifiers/python/ticl_v3_cff.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import FWCore.ParameterSet.Config as cms

# This modifier is for running TICL v3.

ticl_v3 = cms.Modifier()
Original file line number Diff line number Diff line change
Expand Up @@ -507,6 +507,30 @@ def condition(self, fragment, stepList, key, hasHarvest):
upgradeWFs['ticl_FastJet'].step3 = {'--procModifiers': 'fastJetTICL'}
upgradeWFs['ticl_FastJet'].step4 = {'--procModifiers': 'fastJetTICL'}

class UpgradeWorkflow_ticl_v3(UpgradeWorkflow):
def setup_(self, step, stepName, stepDict, k, properties):
if 'RecoGlobal' in step:
stepDict[stepName][k] = merge([self.step3, stepDict[step][k]])
if 'HARVESTGlobal' in step:
stepDict[stepName][k] = merge([self.step4, stepDict[step][k]])
def condition(self, fragment, stepList, key, hasHarvest):
return (fragment=="TTbar_14TeV" or 'CloseByP' in fragment or 'Eta1p7_2p7' in fragment) and '2026' in key
upgradeWFs['ticl_v3'] = UpgradeWorkflow_ticl_v3(
steps = [
'RecoGlobal',
'HARVESTGlobal'
],
PU = [
'RecoGlobal',
'HARVESTGlobal'
],
suffix = '_ticl_v3',
offset = 0.203,
Copy link
Contributor

@srimanob srimanob Aug 26, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You should update also Configuration/PyReleaseValidation/README.md. It can be done later, no need to do in this PR.

)
upgradeWFs['ticl_v3'].step3 = {'--procModifiers': 'ticl_v3'}
upgradeWFs['ticl_v3'].step4 = {'--procModifiers': 'ticl_v3'}


# Track DNN workflows
class UpgradeWorkflow_trackdnn(UpgradeWorkflow):
def setup_(self, step, stepName, stepDict, k, properties):
Expand Down
2 changes: 1 addition & 1 deletion DataFormats/HGCalReco/interface/Trackster.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ namespace ticl {

Trackster()
: iterationIndex_(0),
seedIndex_(0),
seedIndex_(-1),
time_(0.f),
timeError_(-1.f),
regressed_energy_(0.f),
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import FWCore.ParameterSet.Config as cms

ticlTrackstersMerge = cms.EDProducer("TrackstersMergeProducer",
ticlTrackstersMerge = cms.EDProducer("TrackstersMergeProducerV3",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this mean HLT Phase-2 is running an old version of TICL? When will that version be removed? Is there a plan to update HLT to use TICL V4? @trtomei ?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @Martin-Grunewald , yes.
As I said during the HLT upgrade meeting, the plan is to switch HLT to TICLv4, but this might need some work from POGs to adjust the way they are consuming tracksters.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@felicepantaleo
OK, thanks!

cosangle_align = cms.double(0.9945),
debug = cms.bool(True),
e_over_h_threshold = cms.double(1),
Expand Down
41 changes: 4 additions & 37 deletions RecoHGCal/TICL/interface/commons.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@

namespace ticl {

//constants
constexpr double mpion = 0.13957;
constexpr float mpion2 = mpion * mpion;

inline Trackster::ParticleType tracksterParticleTypeFromPdgId(int pdgId, int charge) {
if (pdgId == 111) {
return Trackster::ParticleType::neutral_pion;
Expand All @@ -33,43 +37,6 @@ namespace ticl {
}
}

static void addTrackster(
const int& index,
const std::vector<std::pair<edm::Ref<reco::CaloClusterCollection>, std::pair<float, float>>>& lcVec,
const std::vector<float>& inputClusterMask,
const float& fractionCut_,
const float& energy,
const int& pdgId,
const int& charge,
const edm::ProductID& seed,
const Trackster::IterationIndex iter,
std::vector<float>& output_mask,
std::vector<Trackster>& result) {
if (lcVec.empty())
return;

Trackster tmpTrackster;
tmpTrackster.zeroProbabilities();
tmpTrackster.vertices().reserve(lcVec.size());
tmpTrackster.vertex_multiplicity().reserve(lcVec.size());
for (auto const& [lc, energyScorePair] : lcVec) {
if (inputClusterMask[lc.index()] > 0) {
double fraction = energyScorePair.first / lc->energy();
if (fraction < fractionCut_)
continue;
tmpTrackster.vertices().push_back(lc.index());
output_mask[lc.index()] -= fraction;
tmpTrackster.vertex_multiplicity().push_back(1. / fraction);
}
}

tmpTrackster.setIdProbability(tracksterParticleTypeFromPdgId(pdgId, charge), 1.f);
tmpTrackster.setRegressedEnergy(energy);
tmpTrackster.setIteration(iter);
tmpTrackster.setSeed(seed, index);
result.emplace_back(tmpTrackster);
}

} // namespace ticl

#endif
52 changes: 52 additions & 0 deletions RecoHGCal/TICL/plugins/LinkingAlgoBase.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
#ifndef RecoHGCal_TICL_LinkingAlgoBase_H__
#define RecoHGCal_TICL_LinkingAlgoBase_H__

#include <vector>
#include "FWCore/ParameterSet/interface/ParameterSetDescription.h"
#include "FWCore/Framework/interface/Event.h"
#include "FWCore/Framework/interface/EventSetup.h"
#include "DataFormats/HGCalReco/interface/Trackster.h"
#include "DataFormats/HGCalReco/interface/TICLCandidate.h"
#include "DataFormats/TrackReco/interface/Track.h"
#include "DataFormats/TrackReco/interface/TrackFwd.h"
#include "DataFormats/MuonReco/interface/Muon.h"
#include "MagneticField/Engine/interface/MagneticField.h"
#include "TrackingTools/GeomPropagators/interface/Propagator.h"
#include "RecoLocalCalo/HGCalRecAlgos/interface/RecHitTools.h"
#include "Geometry/HGCalCommonData/interface/HGCalDDDConstants.h"

namespace edm {
class Event;
class EventSetup;
} // namespace edm

namespace ticl {
class LinkingAlgoBase {
public:
LinkingAlgoBase(const edm::ParameterSet& conf) : algo_verbosity_(conf.getParameter<int>("algo_verbosity")) {}

virtual ~LinkingAlgoBase(){};

virtual void initialize(const HGCalDDDConstants* hgcons,
const hgcal::RecHitTools rhtools,
const edm::ESHandle<MagneticField> bfieldH,
const edm::ESHandle<Propagator> propH) = 0;

virtual void linkTracksters(const edm::Handle<std::vector<reco::Track>> tkH,
const edm::ValueMap<float>& tkTime,
const edm::ValueMap<float>& tkTimeErr,
const edm::ValueMap<float>& tkTimeQual,
const std::vector<reco::Muon>& muons,
const edm::Handle<std::vector<Trackster>> tsH,
std::vector<TICLCandidate>& resultTracksters) = 0;

static void fillPSetDescription(edm::ParameterSetDescription& desc) { desc.add<int>("algo_verbosity", 0); };

enum VerbosityLevel { None = 0, Basic, Advanced, Expert, Guru };
Copy link
Contributor

@jpata jpata Aug 15, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would rather prefer not to introduce a module-specific logging configuration and just stick with pure MessageLogger levels.

If you keep this, not only you today, but every future reader and maintainer will have two separate levels to keep in mind and get right, rather than one. If each class has it's own slightly different way of configuring logging, it becomes quite difficult to clean up.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @jpata , thanks for the comment. Eventually it would be nice to have it uniform across CMSSW with Message Logger levels.
I asked the active developers if this existing code is something they are actively using in their debugging workflows, and this module is still under heavy development. Do you mind if we keep it like this until the development of this module becomes maintenance and then we roll back not only linking but also other modules that are using these message levels?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Anything that is merged is already maintenance and someone other than the immediate developers may have to step in to work on it.
I doubt consistent logging will be implemented in the future, if it's already too troublesome to do now.

If you decide to keep this, you could consider using the same enum across different TICL modules, so at least it's possible to keep self consistent in TICL in the future?
Now I see redefinitions of this VerbosityLevel in PatternRecognitionAlgoBase, HGCGraph, SeedingRegionAlgoBase.
For modules in this PR that take a bool flag debug, you can prefer the enum, so all of them can be configured in the same way.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have replaced the class wise enums with something that is common for all the TICL modules where this is used


protected:
int algo_verbosity_;
};
} // namespace ticl

#endif
Loading