Skip to content

Commit cc2903a

Browse files
authored
Merge pull request #47576 from AuroraPerego/fixDumper_pre3
Fix the python configuration for the TICLDumper
2 parents c9f83a5 + 2c7d3ad commit cc2903a

File tree

3 files changed

+70
-2
lines changed

3 files changed

+70
-2
lines changed

Configuration/PyReleaseValidation/python/upgradeWorkflowComponents.py

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -856,6 +856,46 @@ def condition(self, fragment, stepList, key, hasHarvest):
856856
upgradeWFs['ticl_v5_superclustering_mustache_pf'].step3 = {'--procModifiers': 'ticl_v5,ticl_superclustering_mustache_pf'}
857857
upgradeWFs['ticl_v5_superclustering_mustache_pf'].step4 = {'--procModifiers': 'ticl_v5,ticl_superclustering_mustache_pf'}
858858

859+
class UpgradeWorkflow_TICLdumper(UpgradeWorkflow):
860+
def setup_(self, step, stepName, stepDict, k, properties):
861+
if 'RecoGlobal' in step:
862+
stepDict[stepName][k] = merge([self.step3, stepDict[step][k]])
863+
def condition(self, fragment, stepList, key, hasHarvest):
864+
return (fragment=="TTbar_14TeV" or 'CloseByP' in fragment or 'Eta1p7_2p7' in fragment) and 'Run4' in key
865+
866+
upgradeWFs['enableTICLdumper'] = UpgradeWorkflow_TICLdumper(
867+
steps = [
868+
'RecoGlobal',
869+
],
870+
PU = [
871+
'RecoGlobal',
872+
],
873+
suffix = '_enableTICLdumper',
874+
offset = 0.206,
875+
)
876+
upgradeWFs['enableTICLdumper'].step3 = {'--customise': 'RecoHGCal/TICL/customiseTICLFromReco.customiseTICLForDumper'}
877+
878+
upgradeWFs['ticl_v5_withDumper'] = UpgradeWorkflow_ticl_v5(
879+
steps = [
880+
'HLTOnly',
881+
'DigiTrigger',
882+
'RecoGlobal',
883+
'HARVESTGlobal'
884+
],
885+
PU = [
886+
'HLTOnly',
887+
'DigiTrigger',
888+
'RecoGlobal',
889+
'HARVESTGlobal'
890+
],
891+
suffix = '_ticl_v5_withDumper',
892+
offset = 0.207,
893+
)
894+
upgradeWFs['ticl_v5_withDumper'].step2 = {'--procModifiers': 'ticl_v5'}
895+
upgradeWFs['ticl_v5_withDumper'].step3 = {'--procModifiers': 'ticl_v5',
896+
'--customise': 'RecoHGCal/TICL/customiseTICLFromReco.customiseTICLForDumper'}
897+
upgradeWFs['ticl_v5_withDumper'].step4 = {'--procModifiers': 'ticl_v5'}
898+
859899
# Improved L2 seeding from L1Tk Muons and L3 Tracker Muon Inside-Out reconstruction first (Phase-2 Muon default)
860900
class UpgradeWorkflow_phase2L2AndL3Muons(UpgradeWorkflow):
861901
def setup_(self, step, stepName, stepDict, k, properties):

RecoHGCal/TICL/plugins/TICLDumper.cc

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -666,6 +666,9 @@ class TICLDumper : public edm::one::EDAnalyzer<edm::one::WatchRuns, edm::one::Sh
666666
std::vector<float> simTICLCandidate_boundaryPx;
667667
std::vector<float> simTICLCandidate_boundaryPy;
668668
std::vector<float> simTICLCandidate_boundaryPz;
669+
std::vector<float> simTICLCandidate_pt;
670+
std::vector<float> simTICLCandidate_phi;
671+
std::vector<float> simTICLCandidate_eta;
669672
std::vector<float> simTICLCandidate_caloParticleMass;
670673
std::vector<float> simTICLCandidate_time;
671674
std::vector<int> simTICLCandidate_pdgId;
@@ -681,6 +684,9 @@ class TICLDumper : public edm::one::EDAnalyzer<edm::one::WatchRuns, edm::one::Sh
681684
std::vector<double> candidate_px;
682685
std::vector<double> candidate_py;
683686
std::vector<double> candidate_pz;
687+
std::vector<float> candidate_pt;
688+
std::vector<float> candidate_phi;
689+
std::vector<float> candidate_eta;
684690
std::vector<float> candidate_time;
685691
std::vector<float> candidate_time_err;
686692
std::vector<std::vector<float>> candidate_id_probabilities;
@@ -715,6 +721,7 @@ class TICLDumper : public edm::one::EDAnalyzer<edm::one::WatchRuns, edm::one::Sh
715721
std::vector<float> track_hgcal_phi;
716722
std::vector<float> track_hgcal_pt;
717723
std::vector<float> track_pt;
724+
std::vector<float> track_p;
718725
std::vector<int> track_quality;
719726
std::vector<int> track_missing_outer_hits;
720727
std::vector<int> track_missing_inner_hits;
@@ -767,6 +774,9 @@ void TICLDumper::clearVariables() {
767774
simTICLCandidate_boundaryPx.clear();
768775
simTICLCandidate_boundaryPy.clear();
769776
simTICLCandidate_boundaryPz.clear();
777+
simTICLCandidate_pt.clear();
778+
simTICLCandidate_phi.clear();
779+
simTICLCandidate_eta.clear();
770780
simTICLCandidate_time.clear();
771781
simTICLCandidate_caloParticleMass.clear();
772782
simTICLCandidate_pdgId.clear();
@@ -781,6 +791,9 @@ void TICLDumper::clearVariables() {
781791
candidate_px.clear();
782792
candidate_py.clear();
783793
candidate_pz.clear();
794+
candidate_pt.clear();
795+
candidate_phi.clear();
796+
candidate_eta.clear();
784797
candidate_time.clear();
785798
candidate_time_err.clear();
786799
candidate_id_probabilities.clear();
@@ -818,6 +831,7 @@ void TICLDumper::clearVariables() {
818831
track_hgcal_pt.clear();
819832
track_quality.clear();
820833
track_pt.clear();
834+
track_p.clear();
821835
track_missing_outer_hits.clear();
822836
track_missing_inner_hits.clear();
823837
track_charge.clear();
@@ -969,6 +983,9 @@ void TICLDumper::beginJob() {
969983
candidate_tree_->Branch("candidate_px", &candidate_px);
970984
candidate_tree_->Branch("candidate_py", &candidate_py);
971985
candidate_tree_->Branch("candidate_pz", &candidate_pz);
986+
candidate_tree_->Branch("candidate_pt", &candidate_pt);
987+
candidate_tree_->Branch("candidate_phi", &candidate_phi);
988+
candidate_tree_->Branch("candidate_eta", &candidate_eta);
972989
candidate_tree_->Branch("track_in_candidate", &track_in_candidate);
973990
candidate_tree_->Branch("tracksters_in_candidate", &tracksters_in_candidate);
974991
}
@@ -1013,6 +1030,7 @@ void TICLDumper::beginJob() {
10131030
tracks_tree_->Branch("track_hgcal_phi", &track_hgcal_phi);
10141031
tracks_tree_->Branch("track_hgcal_pt", &track_hgcal_pt);
10151032
tracks_tree_->Branch("track_pt", &track_pt);
1033+
tracks_tree_->Branch("track_p", &track_p);
10161034
tracks_tree_->Branch("track_missing_outer_hits", &track_missing_outer_hits);
10171035
tracks_tree_->Branch("track_missing_inner_hits", &track_missing_inner_hits);
10181036
tracks_tree_->Branch("track_quality", &track_quality);
@@ -1041,6 +1059,9 @@ void TICLDumper::beginJob() {
10411059
simTICLCandidate_tree->Branch("simTICLCandidate_boundaryPx", &simTICLCandidate_boundaryPx);
10421060
simTICLCandidate_tree->Branch("simTICLCandidate_boundaryPy", &simTICLCandidate_boundaryPy);
10431061
simTICLCandidate_tree->Branch("simTICLCandidate_boundaryPz", &simTICLCandidate_boundaryPz);
1062+
simTICLCandidate_tree->Branch("simTICLCandidate_pt", &simTICLCandidate_pt);
1063+
simTICLCandidate_tree->Branch("simTICLCandidate_phi", &simTICLCandidate_phi);
1064+
simTICLCandidate_tree->Branch("simTICLCandidate_eta", &simTICLCandidate_eta);
10441065
simTICLCandidate_tree->Branch("simTICLCandidate_time", &simTICLCandidate_time);
10451066
simTICLCandidate_tree->Branch("simTICLCandidate_caloParticleMass", &simTICLCandidate_caloParticleMass);
10461067
simTICLCandidate_tree->Branch("simTICLCandidate_pdgId", &simTICLCandidate_pdgId);
@@ -1185,6 +1206,9 @@ void TICLDumper::analyze(const edm::Event& event, const edm::EventSetup& setup)
11851206
simTICLCandidate_pdgId.push_back(cand.pdgId());
11861207
simTICLCandidate_charge.push_back(cand.charge());
11871208
simTICLCandidate_time.push_back(cand.time());
1209+
simTICLCandidate_pt.push_back(cand.pt());
1210+
simTICLCandidate_phi.push_back(cand.phi());
1211+
simTICLCandidate_eta.push_back(cand.eta());
11881212
std::vector<int> tmpIdxVec;
11891213
for (auto const& simTS : cand.tracksters()) {
11901214
auto trackster_idx = simTS.get() - (edm::Ptr<ticl::Trackster>(simTrackstersSC_h, 0)).get();
@@ -1265,6 +1289,9 @@ void TICLDumper::analyze(const edm::Event& event, const edm::EventSetup& setup)
12651289
candidate_px.push_back(candidate.px());
12661290
candidate_py.push_back(candidate.py());
12671291
candidate_pz.push_back(candidate.pz());
1292+
candidate_pt.push_back(candidate.pt());
1293+
candidate_phi.push_back(candidate.phi());
1294+
candidate_eta.push_back(candidate.eta());
12681295
candidate_time.push_back(candidate.time());
12691296
candidate_time_err.push_back(candidate.timeError());
12701297
std::vector<float> id_probs;
@@ -1316,6 +1343,7 @@ void TICLDumper::analyze(const edm::Event& event, const edm::EventSetup& setup)
13161343
track_hgcal_pz.push_back(globalMom.z());
13171344
track_hgcal_pt.push_back(globalMom.perp());
13181345
track_pt.push_back(track.pt());
1346+
track_p.push_back(track.p());
13191347
track_quality.push_back(track.quality(reco::TrackBase::highPurity));
13201348
track_missing_outer_hits.push_back(track.missingOuterHits());
13211349
track_missing_inner_hits.push_back(track.missingInnerHits());

RecoHGCal/TICL/python/ticlDumper_cff.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,13 +39,13 @@
3939
tracksterType=cms.string("SimTracksterCP")
4040
),
4141
],
42-
42+
4343
associators=dumperAssociators.copy(),
4444
saveSuperclustering = cms.bool(False)
4545
)
4646

4747
ticl_v5.toModify(ticlDumper, ticlcandidates = cms.InputTag("ticlCandidate"), recoSuperClusters_sourceTracksterCollection=cms.InputTag("ticlCandidate"))
48-
ticl_v5.toModify(ticlDumper, saveSuperclustering = cms.bool(True))
48+
ticl_v5.toModify(ticlDumper, saveSuperclustering = cms.bool(True), trackstersInCand=cms.InputTag("ticlCandidate"))
4949

5050

5151

0 commit comments

Comments
 (0)