Skip to content

Commit fa9495d

Browse files
Add pass name to every get collection instance (#1708)
1 parent 9180222 commit fa9495d

File tree

101 files changed

+827
-182
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

101 files changed

+827
-182
lines changed

DQM/include/DQM/DarkBremInteraction.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,8 @@ class DarkBremInteraction : public framework::Producer {
5454
*/
5555
virtual void produce(framework::Event& e) override;
5656

57+
void configure(framework::config::Parameters& parameters) override;
58+
5759
private:
5860
/**
5961
* Set the labels of the histogram of the input name with the input labels
@@ -139,6 +141,8 @@ class DarkBremInteraction : public framework::Producer {
139141
*/
140142
std::map<int, int> known_elements_ = {{1, 1}, {6, 2}, {8, 3}, {11, 4},
141143
{14, 5}, {20, 6}, {29, 7}, {74, 8}};
144+
145+
std::string particle_passname_;
142146
};
143147

144148
} // namespace dqm

DQM/include/DQM/EcalClusterAnalyzer.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,8 @@ class EcalClusterAnalyzer : public framework::Analyzer {
4545

4646
// Pass Name for clusters
4747
std::string cluster_pass_name_;
48+
49+
std::string ecal_sp_hits_passname_;
4850
};
4951

5052
} // namespace dqm

DQM/include/DQM/HcalVetoResults.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,8 @@ class HcalVetoResults : public framework::Analyzer {
4848

4949
/// Pass Name for veto object
5050
std::string hcal_veto_pass_;
51+
52+
std::string hcal_veto_passname_;
5153
};
5254
} // namespace dqm
5355

DQM/include/DQM/PhotoNuclearDQM.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,8 @@ class PhotoNuclearDQM : public framework::Analyzer {
9090
EventType classifyEvent(
9191
const std::vector<const ldmx::SimParticle *> daughters, double threshold);
9292

93+
std::string sim_particles_passname_;
94+
9395
/** Method used to classify events in a compact manner. */
9496
CompactEventType classifyCompactEvent(
9597
const ldmx::SimParticle *pnGamma,

DQM/include/DQM/SampleValidation.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,10 @@ class SampleValidation : public framework::Analyzer {
2121
int pdgid_label(const int pdgid);
2222
/// Method executed before processing of events begins.
2323
void onProcessStart() override;
24+
25+
private:
26+
std::string target_scoring_plane_passname_;
27+
std::string sim_particles_passname_;
2428
};
2529
} // namespace dqm
2630

DQM/include/DQM/SimObjects.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,8 @@ class SimObjects : public framework::Analyzer {
4646
private:
4747
/// Pass Name for sim objects
4848
std::string sim_pass_;
49+
50+
std::string sim_particles_map_passname_;
4951
};
5052
} // namespace dqm
5153

DQM/include/DQM/TrigScintDQM.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ class TrigScintDQM : public framework::Analyzer {
5959

6060
/// Name of Pad
6161
std::string padName_{"_up"};
62+
std::string hit_passname_;
6263
};
6364

6465
} // namespace dqm

DQM/include/DQM/TrigScintHitDQM.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ class TrigScintHitDQM : public framework::Analyzer {
4545
/** Name of trigger pad hit collection. */
4646
std::string hitCollectionName_{"TriggerPadUpDigiHits"};
4747
std::string padName_{"_up"};
48+
std::string trig_scint_passname_;
4849
};
4950

5051
} // namespace dqm

DQM/python/dqm.py

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,16 @@ def __init__(self,name="hcal_dqm", pe_threshold=8, section=0, max_hit_time = 50.
9595
self.rec_pass_name = ''
9696
self.sim_coll_name = 'HcalSimHits'
9797
self.sim_pass_name = ''
98+
99+
self.particle_passname = ''
100+
self.ecal_sp_hits_passname = ''
101+
self.hcal_veto_passname = ''
102+
self.sim_particles_passname = ''
103+
self.target_scoring_plane_passname = ''
104+
self.sim_particles_passname = ''
105+
self.sim_particles_map_passname = ''
106+
self.hit_passname = ''
107+
self.trig_scint_passname = ''
98108

99109
pe_bins = [1500, 0, 1500]
100110
time_bins = [100, -100, 500]
@@ -181,6 +191,7 @@ def __init__(self,name="HcalVetoResults") :
181191

182192
self.hcal_veto_name = 'HcalVeto'
183193
self.hcal_veto_pass = ''
194+
self.hcal_veto_passname = ''
184195

185196
self.build1DHistogram('max_pe',
186197
'Maximal PE hit PE', 500, -0.5, 499.5)
@@ -454,11 +465,17 @@ class SimObjects(ldmxcfg.Analyzer) :
454465
def __init__(self,name='sim_dqm',sim_pass='') :
455466
super().__init__(name,'dqm::SimObjects','DQM')
456467
self.sim_pass = sim_pass
468+
469+
self.sim_particles_passname = ''
470+
self.sim_particles_map_passname = ''
471+
457472

458473

459474
class DarkBremInteraction(ldmxcfg.Producer) :
460475
def __init__(self) :
461476
super().__init__('db_kinematics','dqm::DarkBremInteraction','DQM')
477+
478+
self.particle_passname = ''
462479

463480
self.build1DHistogram('aprime_energy',
464481
'Dark Photon Energy [MeV]',101,0,8080)
@@ -547,6 +564,10 @@ class PhotoNuclearDQM(ldmxcfg.Analyzer) :
547564

548565
def __init__(self,name='PN', count_light_ions=True) :
549566
super().__init__(name,'dqm::PhotoNuclearDQM','DQM')
567+
568+
569+
self.sim_particles_passname = ''
570+
550571

551572
self.count_light_ions=count_light_ions
552573
self.build1DHistogram("event_type" , "", 24, -1, 23)
@@ -692,6 +713,7 @@ def __init__(self,name='TrigScintSimUp',hit_coll='TriggerPadUpSimHits',pad='up')
692713

693714
self.hit_collection = hit_coll
694715
self.pad = pad
716+
self.hit_passname = ''
695717

696718
class TrigScintDigiDQM(ldmxcfg.Analyzer) :
697719
"""Configured TrigScintDigiDQM python object
@@ -712,7 +734,7 @@ def __init__(self,name='TrigScintDigiUp',hit_coll='trigScintDigisUp',pad='up') :
712734

713735
self.hit_collection = hit_coll
714736
self.pad = pad
715-
737+
self.trig_scint_passname = ''
716738

717739
class TrigScintClusterDQM(ldmxcfg.Analyzer) :
718740
"""Configured TrigScintClusterDQM python object
@@ -786,6 +808,9 @@ class SampleValidation(ldmxcfg.Analyzer) :
786808
"""
787809
def __init__(self, name='SampleValidation') :
788810
super().__init__(name, 'dqm::SampleValidation', 'DQM')
811+
812+
self.sim_particles_passname = ''
813+
self.target_scoring_plane_passname = ''
789814

790815
# primary histograms
791816
self.build1DHistogram("pdgid_primaries", "ID of primary particles", 20, 0, 20)
@@ -822,6 +847,8 @@ def __init__(self,name='EcalClusterAnalyzer') :
822847
self.cluster_coll_name = 'ecalClusters'
823848
self.cluster_pass_name = ''
824849

850+
self.ecal_sp_hits_passname = ''
851+
825852
# Need to mod for more than two electrons
826853
self.build1DHistogram("ancestors", "Ancestors of particles", 4, 0, 3)
827854

DQM/src/DQM/DarkBremInteraction.cxx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22

33
namespace dqm {
44

5+
void DarkBremInteraction::configure(framework::config::Parameters& parameters) {
6+
particle_passname_ =
7+
parameters.getParameter<std::string>("particle_passname");
8+
}
59
/**
610
* calculate total energy from 3-momentum and mass
711
*
@@ -56,7 +60,7 @@ void DarkBremInteraction::onProcessStart() {
5660
void DarkBremInteraction::produce(framework::Event& event) {
5761
histograms_.setWeight(event.getEventHeader().getWeight());
5862
const auto& particle_map{
59-
event.getMap<int, ldmx::SimParticle>("SimParticles")};
63+
event.getMap<int, ldmx::SimParticle>("SimParticles", particle_passname_)};
6064
const ldmx::SimParticle *recoil{nullptr}, *aprime{nullptr}, *beam{nullptr};
6165
for (const auto& [track_id, particle] : particle_map) {
6266
if (track_id == 1) beam = &particle;

0 commit comments

Comments
 (0)