CMS 3D CMS Logo

List of all members | Public Member Functions | Static Public Member Functions | Private Attributes
PFBlockProducer Class Reference

Producer for particle flow blocks. More...

Inheritance diagram for PFBlockProducer:
edm::stream::EDProducer<>

Public Member Functions

void beginLuminosityBlock (edm::LuminosityBlock const &, edm::EventSetup const &) override
 
 PFBlockProducer (const edm::ParameterSet &)
 
void produce (edm::Event &, const edm::EventSetup &) override
 
- Public Member Functions inherited from edm::stream::EDProducer<>
 EDProducer ()=default
 
 EDProducer (const EDProducer &)=delete
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginProcessBlocks () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndProcessBlocks () const final
 
bool hasAbilityToProduceInEndRuns () const final
 
const EDProduceroperator= (const EDProducer &)=delete
 

Static Public Member Functions

static void fillDescriptions (edm::ConfigurationDescriptions &descriptions)
 

Private Attributes

PFBlockAlgo pfBlockAlgo_
 Particle flow block algorithm. More...
 
const edm::EDPutTokenT< reco::PFBlockCollectionputToken_
 
const bool verbose_
 verbose ? More...
 

Additional Inherited Members

- Public Types inherited from edm::stream::EDProducer<>
using CacheTypes = CacheContexts< T... >
 
using GlobalCache = typename CacheTypes::GlobalCache
 
using HasAbility = AbilityChecker< T... >
 
using InputProcessBlockCache = typename CacheTypes::InputProcessBlockCache
 
using LuminosityBlockCache = typename CacheTypes::LuminosityBlockCache
 
using LuminosityBlockContext = LuminosityBlockContextT< LuminosityBlockCache, RunCache, GlobalCache >
 
using LuminosityBlockSummaryCache = typename CacheTypes::LuminosityBlockSummaryCache
 
using RunCache = typename CacheTypes::RunCache
 
using RunContext = RunContextT< RunCache, GlobalCache >
 
using RunSummaryCache = typename CacheTypes::RunSummaryCache
 

Detailed Description

Producer for particle flow blocks.

This producer makes use of PFBlockAlgo, the particle flow block algorithm. Particle flow itself consists in reconstructing particles from the particle flow blocks This is done at a later stage, see PFProducer and PFAlgo.

Author
Colin Bernet
Date
April 2007

Definition at line 21 of file PFBlockProducer.cc.

Constructor & Destructor Documentation

◆ PFBlockProducer()

PFBlockProducer::PFBlockProducer ( const edm::ParameterSet iConfig)
explicit

Definition at line 357 of file PFBlockProducer.cc.

References edm::ParameterSet::getUntrackedParameter().

358  : verbose_{iConfig.getUntrackedParameter<bool>("verbose", false)}, putToken_{produces<reco::PFBlockCollection>()} {
359  bool debug_ = iConfig.getUntrackedParameter<bool>("debug", false);
360  pfBlockAlgo_.setDebug(debug_);
361 
362  edm::ConsumesCollector cc = consumesCollector();
363  const std::vector<edm::ParameterSet>& importers = iConfig.getParameterSetVector("elementImporters");
364  pfBlockAlgo_.setImporters(importers, cc);
365 
366  const std::vector<edm::ParameterSet>& linkdefs = iConfig.getParameterSetVector("linkDefinitions");
367  pfBlockAlgo_.setLinkers(linkdefs);
368 }
const edm::EDPutTokenT< reco::PFBlockCollection > putToken_
uint32_t cc[maxCellsPerHit]
Definition: gpuFishbone.h:49
T getUntrackedParameter(std::string const &, T const &) const
PFBlockAlgo pfBlockAlgo_
Particle flow block algorithm.
void setDebug(bool debug)
sets debug printout flag
Definition: PFBlockAlgo.h:59
void setImporters(const std::vector< edm::ParameterSet > &, edm::ConsumesCollector &)
Definition: PFBlockAlgo.cc:124
const bool verbose_
verbose ?
VParameterSet const & getParameterSetVector(std::string const &name) const
void setLinkers(const std::vector< edm::ParameterSet > &)
Definition: PFBlockAlgo.cc:84

Member Function Documentation

◆ beginLuminosityBlock()

void PFBlockProducer::beginLuminosityBlock ( edm::LuminosityBlock const &  lb,
edm::EventSetup const &  es 
)
override

Definition at line 370 of file PFBlockProducer.cc.

370  {
372 }
PFBlockAlgo pfBlockAlgo_
Particle flow block algorithm.
void updateEventSetup(const edm::EventSetup &)
Definition: PFBlockAlgo.cc:275

◆ fillDescriptions()

void PFBlockProducer::fillDescriptions ( edm::ConfigurationDescriptions descriptions)
static

Definition at line 41 of file PFBlockProducer.cc.

References edm::ParameterSetDescription::add(), edm::ConfigurationDescriptions::addWithDefaultLabel(), submitPVResolutionJobs::desc, muonDTDigis_cfi::pset, and AlCaHLTBitMon_QueryRunRegistry::string.

41  {
43  // verbosity
44  desc.addUntracked<bool>("verbose", false);
45  // Debug flag
46  desc.addUntracked<bool>("debug", false);
47  //define what we are importing into particle flow
48  //from the various subdetectors
49  // importers are executed in the order they are defined here!!!
50  //order matters for some modules (it is pointed out where this is important)
51  // you can find a list of all available importers in:
52  // plugins/importers
53  {
54  std::vector<edm::ParameterSet> vpset;
55  vpset.reserve(12);
56  {
58  pset.addParameter<std::string>("importerName", "GSFTrackImporter");
59  pset.addParameter<edm::InputTag>("source", {"pfTrackElec"});
60  pset.addParameter<bool>("gsfsAreSecondary", false);
61  pset.addParameter<bool>("superClustersArePF", true);
62  vpset.emplace_back(pset);
63  }
64  {
66  pset.addParameter<std::string>("importerName", "ConvBremTrackImporter");
67  pset.addParameter<edm::InputTag>("source", {"pfTrackElec"});
68  pset.addParameter<bool>("vetoEndcap", false);
69  vpset.emplace_back(pset);
70  }
71  {
73  pset.addParameter<std::string>("importerName", "SuperClusterImporter");
74  pset.addParameter<edm::InputTag>("source_eb",
75  {"particleFlowSuperClusterECAL:particleFlowSuperClusterECALBarrel"});
76  pset.addParameter<edm::InputTag>(
77  "source_ee", {"particleFlowSuperClusterECAL:particleFlowSuperClusterECALEndcapWithPreshower"});
78  pset.addParameter<double>("maximumHoverE", 0.5);
79  pset.addParameter<double>("minSuperClusterPt", 10.0);
80  pset.addParameter<double>("minPTforBypass", 100.0);
81  pset.addParameter<edm::InputTag>("hbheRecHitsTag", {"hbhereco"});
82  pset.addParameter<int>("maxSeverityHB", 9);
83  pset.addParameter<int>("maxSeverityHE", 9);
84  pset.addParameter<bool>("usePFThresholdsFromDB", false);
85  pset.addParameter<bool>("superClustersArePF", true);
86  vpset.emplace_back(pset);
87  }
88  {
90  pset.addParameter<std::string>("importerName", "ConversionTrackImporter");
91  pset.addParameter<edm::InputTag>("source", {"pfConversions"});
92  pset.addParameter<bool>("vetoEndcap", false);
93  vpset.emplace_back(pset);
94  }
95  // V0's not actually used in particle flow block building so far
96  //NuclearInteraction's also come in Loose and VeryLoose varieties
97  {
99  pset.addParameter<std::string>("importerName", "NuclearInteractionTrackImporter");
100  pset.addParameter<edm::InputTag>("source", {"pfDisplacedTrackerVertex"});
101  pset.addParameter<bool>("vetoEndcap", false);
102  vpset.emplace_back(pset);
103  }
104  //for best timing GeneralTracksImporter should come after
105  // all secondary track importers
106  {
108  pset.addParameter<std::string>("importerName", "GeneralTracksImporter");
109  pset.addParameter<edm::InputTag>("source", {"pfTrack"});
110  pset.addParameter<bool>("vetoEndcap", false);
111  pset.addParameter<edm::InputTag>("muonSrc", {"muons1stStep"});
112  pset.addParameter<std::string>("trackQuality", "highPurity");
113  pset.addParameter<bool>("cleanBadConvertedBrems", true);
114  pset.addParameter<bool>("useIterativeTracking", true);
115  pset.addParameter<std::vector<double>>("DPtOverPtCuts_byTrackAlgo", {10.0, 10.0, 10.0, 10.0, 10.0, 5.0});
116  pset.addParameter<std::vector<uint32_t>>("NHitCuts_byTrackAlgo", {3, 3, 3, 3, 3, 3});
117  pset.addParameter<double>("muonMaxDPtOPt", 1);
118  vpset.emplace_back(pset);
119  }
120  // secondary GSF tracks are also turned off
121  // to properly set SC based links you need to run ECAL importer
122  // after you've imported all SCs to the block
123  {
125  pset.addParameter<std::string>("importerName", "ECALClusterImporter");
126  pset.addParameter<edm::InputTag>("source", {"particleFlowClusterECAL"});
127  pset.addParameter<edm::InputTag>("BCtoPFCMap", {"particleFlowSuperClusterECAL:PFClusterAssociationEBEE"});
128  vpset.emplace_back(pset);
129  }
130  {
132  pset.addParameter<std::string>("importerName", "GenericClusterImporter");
133  pset.addParameter<edm::InputTag>("source", {"particleFlowClusterHCAL"});
134  vpset.emplace_back(pset);
135  }
136  {
138  pset.addParameter<std::string>("importerName", "GenericClusterImporter");
139  pset.addParameter<edm::InputTag>("source", {"particleFlowBadHcalPseudoCluster"});
140  vpset.emplace_back(pset);
141  }
142  {
144  pset.addParameter<std::string>("importerName", "GenericClusterImporter");
145  pset.addParameter<edm::InputTag>("source", {"particleFlowClusterHO"});
146  vpset.emplace_back(pset);
147  }
148  {
150  pset.addParameter<std::string>("importerName", "GenericClusterImporter");
151  pset.addParameter<edm::InputTag>("source", {"particleFlowClusterHF"});
152  vpset.emplace_back(pset);
153  }
154  {
156  pset.addParameter<std::string>("importerName", "GenericClusterImporter");
157  pset.addParameter<edm::InputTag>("source", {"particleFlowClusterPS"});
158  vpset.emplace_back(pset);
159  }
161  psd.add<std::string>("importerName", "");
162  psd.add<edm::InputTag>("source", {});
163  psd.add<bool>("gsfsAreSecondary", false);
164  psd.add<bool>("superClustersArePF", false);
165  psd.add<edm::InputTag>("source_eb", {});
166  psd.add<edm::InputTag>("source_ee", {});
167  psd.add<double>("maximumHoverE", 0);
168  psd.add<double>("minSuperClusterPt", 0);
169  psd.add<double>("minPTforBypass", 0);
170  psd.add<edm::InputTag>("hbheRecHitsTag", {});
171  psd.add<int>("maxSeverityHB", 0);
172  psd.add<int>("maxSeverityHE", 0);
173  psd.add<bool>("usePFThresholdsFromDB", false);
174  psd.add<bool>("vetoEndcap", false);
175  psd.add<edm::InputTag>("muonSrc", {});
176  psd.add<std::string>("trackQuality", "");
177  psd.add<bool>("cleanBadConvertedBrems", false);
178  psd.add<bool>("useIterativeTracking", false);
179  psd.add<std::vector<double>>("DPtOverPtCuts_byTrackAlgo", {});
180  psd.add<std::vector<uint32_t>>("NHitCuts_byTrackAlgo", {});
181  psd.add<double>("muonMaxDPtOPt", 0);
182  psd.add<edm::InputTag>("BCtoPFCMap", {});
183  psd.add<double>("maxDPtOPt", 0);
184  psd.add<uint32_t>("vetoMode", 0);
185  psd.add<edm::InputTag>("vetoSrc", {});
186  psd.add<edm::InputTag>("timeValueMap", {});
187  psd.add<edm::InputTag>("timeErrorMap", {});
188  psd.add<edm::InputTag>("timeQualityMap", {});
189  psd.add<double>("timeQualityThreshold", 0);
190  psd.add<edm::InputTag>("timeValueMapGsf", {});
191  psd.add<edm::InputTag>("timeErrorMapGsf", {});
192  psd.add<edm::InputTag>("timeQualityMapGsf", {});
193  psd.add<bool>("useTimeQuality", false);
194  desc.addVPSet("elementImporters", psd, vpset);
195  }
196  //linking definitions
197  // you can find a list of all available linkers in:
198  // plugins/linkers
199  // see : plugins/kdtrees for available KDTree Types
200  // to enable a KDTree for a linking pair, write a KDTree linker
201  // and set useKDTree = True in the linker PSet
202  //order does not matter here since we are defining a lookup table
203  {
204  std::vector<edm::ParameterSet> vpset;
205  vpset.reserve(18);
206  {
208  pset.addParameter<std::string>("linkerName", "PreshowerAndECALLinker");
209  pset.addParameter<std::string>("linkType", "PS1:ECAL");
210  pset.addParameter<bool>("useKDTree ", true);
211  vpset.emplace_back(pset);
212  }
213  {
215  pset.addParameter<std::string>("linkerName", "PreshowerAndECALLinker");
216  pset.addParameter<std::string>("linkType", "PS2:ECAL");
217  pset.addParameter<bool>("useKDTree ", true);
218  vpset.emplace_back(pset);
219  }
220  {
222  pset.addParameter<std::string>("linkerName", "TrackAndECALLinker");
223  pset.addParameter<std::string>("linkType", "TRACK:ECAL");
224  pset.addParameter<bool>("useKDTree ", true);
225  vpset.emplace_back(pset);
226  }
227  {
229  pset.addParameter<std::string>("linkerName", "TrackAndHCALLinker");
230  pset.addParameter<std::string>("linkType", "TRACK:HCAL");
231  pset.addParameter<bool>("useKDTree", true);
232  pset.addParameter<std::string>("trajectoryLayerEntrance", "HCALEntrance");
233  pset.addParameter<std::string>("trajectoryLayerExit", "HCALExit");
234  pset.addParameter<int>("nMaxHcalLinksPerTrack",
235  1); // the max hcal links per track (negative values: no restriction)
236  vpset.emplace_back(pset);
237  }
238  {
240  pset.addParameter<std::string>("linkerName", "TrackAndHOLinker");
241  pset.addParameter<std::string>("linkType", "TRACK:HO");
242  pset.addParameter<bool>("useKDTree", false);
243  vpset.emplace_back(pset);
244  }
245  {
247  pset.addParameter<std::string>("linkerName", "ECALAndHCALLinker");
248  pset.addParameter<std::string>("linkType", "ECAL:HCAL");
249  pset.addParameter<double>("minAbsEtaEcal", 2.5);
250  pset.addParameter<bool>("useKDTree", false);
251  vpset.emplace_back(pset);
252  }
253  {
255  pset.addParameter<std::string>("linkerName", "HCALAndHOLinker");
256  pset.addParameter<std::string>("linkType", "HCAL:HO");
257  pset.addParameter<bool>("useKDTree", false);
258  vpset.emplace_back(pset);
259  }
260  {
262  pset.addParameter<std::string>("linkerName", "HFEMAndHFHADLinker");
263  pset.addParameter<std::string>("linkType", "HFEM:HFHAD");
264  pset.addParameter<bool>("useKDTree", false);
265  vpset.emplace_back(pset);
266  }
267  {
269  pset.addParameter<std::string>("linkerName", "TrackAndTrackLinker");
270  pset.addParameter<std::string>("linkType", "TRACK:TRACK");
271  pset.addParameter<bool>("useKDTree", false);
272  vpset.emplace_back(pset);
273  }
274  {
276  pset.addParameter<std::string>("linkerName", "ECALAndECALLinker");
277  pset.addParameter<std::string>("linkType", "ECAL:ECAL");
278  pset.addParameter<bool>("useKDTree", false);
279  vpset.emplace_back(pset);
280  }
281  {
283  pset.addParameter<std::string>("linkerName", "GSFAndECALLinker");
284  pset.addParameter<std::string>("linkType", "GSF:ECAL");
285  pset.addParameter<bool>("useKDTree", false);
286  vpset.emplace_back(pset);
287  }
288  {
290  pset.addParameter<std::string>("linkerName", "TrackAndGSFLinker");
291  pset.addParameter<std::string>("linkType", "TRACK:GSF");
292  pset.addParameter<bool>("useKDTree", false);
293  pset.addParameter<bool>("useConvertedBrems", true);
294  vpset.emplace_back(pset);
295  }
296  {
298  pset.addParameter<std::string>("linkerName", "GSFAndBREMLinker");
299  pset.addParameter<std::string>("linkType", "GSF:BREM");
300  pset.addParameter<bool>("useKDTree", false);
301  vpset.emplace_back(pset);
302  }
303  {
305  pset.addParameter<std::string>("linkerName", "GSFAndGSFLinker");
306  pset.addParameter<std::string>("linkType", "GSF:GSF");
307  pset.addParameter<bool>("useKDTree", false);
308  vpset.emplace_back(pset);
309  }
310  {
312  pset.addParameter<std::string>("linkerName", "ECALAndBREMLinker");
313  pset.addParameter<std::string>("linkType", "ECAL:BREM");
314  pset.addParameter<bool>("useKDTree", false);
315  vpset.emplace_back(pset);
316  }
317  {
319  pset.addParameter<std::string>("linkerName", "GSFAndHCALLinker");
320  pset.addParameter<std::string>("linkType", "GSF:HCAL");
321  pset.addParameter<bool>("useKDTree", false);
322  vpset.emplace_back(pset);
323  }
324  {
326  pset.addParameter<std::string>("linkerName", "HCALAndBREMLinker");
327  pset.addParameter<std::string>("linkType", "HCAL:BREM");
328  pset.addParameter<bool>("useKDTree", false);
329  vpset.emplace_back(pset);
330  }
331  {
333  pset.addParameter<std::string>("linkerName", "SCAndECALLinker");
334  pset.addParameter<std::string>("linkType", "SC:ECAL");
335  pset.addParameter<bool>("useKDTree", false);
336  pset.addParameter<bool>("SuperClusterMatchByRef", true);
337  vpset.emplace_back(pset);
338  }
340  psd.add<std::string>("linkerName", "");
341  psd.add<std::string>("linkType", "");
342  psd.add<bool>("useKDTree", false);
343  psd.add<std::string>("trajectoryLayerEntrance", "");
344  psd.add<std::string>("trajectoryLayerExit", "");
345  psd.add<int>("nMaxHcalLinksPerTrack", 0);
346  psd.add<double>("minAbsEtaEcal", 0);
347  psd.add<bool>("useConvertedBrems", false);
348  psd.add<bool>("SuperClusterMatchByRef", false);
349  desc.addVPSet("linkDefinitions", psd, vpset);
350  }
351  descriptions.addWithDefaultLabel(desc);
352 }
void addWithDefaultLabel(ParameterSetDescription const &psetDescription)
ParameterDescriptionBase * add(U const &iLabel, T const &value)

◆ produce()

void PFBlockProducer::produce ( edm::Event iEvent,
const edm::EventSetup iSetup 
)
override

Definition at line 374 of file PFBlockProducer.cc.

References groupFilesInBlocks::block, gather_cfg::blocks, iEvent, and str.

374  {
376 
377  auto blocks = pfBlockAlgo_.findBlocks();
378 
379  if (verbose_) {
380  ostringstream str;
381  str << pfBlockAlgo_ << endl;
382  str << "number of blocks : " << blocks.size() << endl;
383  str << endl;
384 
385  for (auto const& block : blocks) {
386  str << block << endl;
387  }
388 
389  LogInfo("PFBlockProducer") << str.str() << endl;
390  }
391 
392  iEvent.emplace(putToken_, blocks);
393 }
const edm::EDPutTokenT< reco::PFBlockCollection > putToken_
int iEvent
Definition: GenABIO.cc:224
PFBlockAlgo pfBlockAlgo_
Particle flow block algorithm.
const bool verbose_
verbose ?
Log< level::Info, false > LogInfo
reco::PFBlockCollection findBlocks()
build blocks
Definition: PFBlockAlgo.cc:139
void buildElements(const edm::Event &)
Definition: PFBlockAlgo.cc:284
#define str(s)

Member Data Documentation

◆ pfBlockAlgo_

PFBlockAlgo PFBlockProducer::pfBlockAlgo_
private

Particle flow block algorithm.

Definition at line 36 of file PFBlockProducer.cc.

◆ putToken_

const edm::EDPutTokenT<reco::PFBlockCollection> PFBlockProducer::putToken_
private

Definition at line 33 of file PFBlockProducer.cc.

◆ verbose_

const bool PFBlockProducer::verbose_
private

verbose ?

Definition at line 32 of file PFBlockProducer.cc.