Skip to content

Commit a912731

Browse files
committed
Improve SimTauCPLinkProducer debug printouts.
1 parent 2271dfb commit a912731

File tree

2 files changed

+32
-24
lines changed

2 files changed

+32
-24
lines changed

SimCalorimetry/HGCalAssociatorProducers/plugins/SimTauCPLinkProducer.cc

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,9 @@ void SimTauProducer::buildSimTau(SimTauCPLink& t,
6969
bool is_leaf = (daughters.empty());
7070

7171
if (is_leaf) {
72-
LogDebug("SimTauProducer").format(" TO BE SAVED {} ", resonance_idx);
7372
auto const& gen_particle_barcode = gen_particle_barcodes[gen_particle_key];
73+
LogDebug("SimTauProducer")
74+
.format(" TO BE SAVED {}, key {}, barcode {}", resonance_idx, gen_particle_key, gen_particle_barcode);
7475
auto const& found_in_caloparticles = std::find_if(caloPartVec.begin(), caloPartVec.end(), [&](const auto& p) {
7576
return p.g4Tracks()[0].genpartIndex() == gen_particle_barcode;
7677
});
@@ -87,13 +88,13 @@ void SimTauProducer::buildSimTau(SimTauCPLink& t,
8788
} else if (generation != 0) {
8889
t.resonances.push_back({gen_particle.pdgId(), resonance_idx});
8990
resonance_idx = t.resonances.size() - 1;
90-
LogDebug("SimTauProducer").format(" RESONANCE/INTERMEDIATE {} ", resonance_idx);
91+
LogDebug("SimTauProducer").format(" RESONANCE/INTERMEDIATE {}", resonance_idx);
9192
}
9293

9394
++generation;
9495
for (auto daughter = daughters.begin(); daughter != daughters.end(); ++daughter) {
9596
int gen_particle_key = (*daughter).key();
96-
LogDebug("SimTauProducer").format(" gen {} {} {} ", generation, gen_particle_key, (*daughter)->pdgId());
97+
LogDebug("SimTauProducer").format(" gen {} {} {}", generation, gen_particle_key, (*daughter)->pdgId());
9798
buildSimTau(t, generation, resonance_idx, *(*daughter), gen_particle_key, calo_particle_h, gen_particle_barcodes);
9899
}
99100
}

SimDataFormats/CaloAnalysis/interface/SimTauCPLink.h

Lines changed: 28 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -31,31 +31,38 @@ class SimTauCPLink {
3131

3232
enum decayModes {
3333
kNull = -1,
34-
kOneProng0PiZero,
35-
kOneProng1PiZero,
36-
kOneProng2PiZero,
37-
kOneProng3PiZero,
38-
kOneProngNPiZero,
39-
kTwoProng0PiZero,
40-
kTwoProng1PiZero,
41-
kTwoProng2PiZero,
42-
kTwoProng3PiZero,
43-
kTwoProngNPiZero,
44-
kThreeProng0PiZero,
45-
kThreeProng1PiZero,
46-
kThreeProng2PiZero,
47-
kThreeProng3PiZero,
48-
kThreeProngNPiZero,
49-
kRareDecayMode,
50-
kElectron,
51-
kMuon
34+
kOneProng0PiZero, // 0
35+
kOneProng1PiZero, // 1
36+
kOneProng2PiZero, // 2
37+
kOneProng3PiZero, // 3
38+
kOneProngNPiZero, // 4
39+
kTwoProng0PiZero, // 5
40+
kTwoProng1PiZero, // 6
41+
kTwoProng2PiZero, // 7
42+
kTwoProng3PiZero, // 8
43+
kTwoProngNPiZero, // 9
44+
kThreeProng0PiZero, // 10
45+
kThreeProng1PiZero, // 11
46+
kThreeProng2PiZero, // 12
47+
kThreeProng3PiZero, // 13
48+
kThreeProngNPiZero, // 14
49+
kRareDecayMode, // 15
50+
kElectron, // 16
51+
kMuon // 17
5252
};
5353

5454
void dump(void) const {
55+
LogDebug("SimTauProducer")
56+
.format("Decay mode: {} ", buildDecayModes())
57+
.format("Leaves: {} ", leaves.size())
58+
.format("Resonances: {}", resonances.size());
5559
for (auto const &l : leaves) {
5660
LogDebug("SimTauProducer")
57-
.format(
58-
"L {} {} CP: {} GenP idx: {}", l.pdgId(), l.resonance_idx(), l.calo_particle_idx(), l.gen_particle_idx());
61+
.format("L {} {} CP: {} GenP idx: {}",
62+
l.pdgId(),
63+
l.resonance_idx(),
64+
(int)((l.calo_particle_idx() == -1) ? -1 : calo_particle_leaves[l.calo_particle_idx()].key()),
65+
l.gen_particle_idx());
5966
}
6067
for (auto const &r : resonances) {
6168
LogDebug("SimTauProducer").format("R {} {}", r.first, r.second);
@@ -78,7 +85,7 @@ class SimTauCPLink {
7885
}
7986
}
8087

81-
int buildDecayModes() {
88+
int buildDecayModes() const {
8289
int numElectrons = 0;
8390
int numMuons = 0;
8491
int numHadrons = 0;

0 commit comments

Comments
 (0)