CMS 3D CMS Logo

List of all members | Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes
PFRecHitProducer Class Referencefinal
Inheritance diagram for PFRecHitProducer:
edm::stream::EDProducer<>

Public Member Functions

 PFRecHitProducer (const edm::ParameterSet &iConfig)
 
 ~PFRecHitProducer () 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 Member Functions

void beginRun (edm::Run const &, const edm::EventSetup &) override
 
void produce (edm::Event &, const edm::EventSetup &) override
 

Private Attributes

std::vector< std::unique_ptr< PFRecHitCreatorBase > > creators_
 
bool init_
 
std::unique_ptr< PFRecHitNavigatorBasenavigator_
 

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

Definition at line 16 of file PFRecHitProducer.cc.

Constructor & Destructor Documentation

◆ PFRecHitProducer()

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

Definition at line 41 of file PFRecHitProducer.cc.

References gpuPixelDoublets::cc, beamerCreator::create(), creators_, get, edm::ParameterSet::getParameter(), Skims_PA_cff::name, navigator_, and AlCaHLTBitMon_QueryRunRegistry::string.

41  {
42  produces<reco::PFRecHitCollection>();
43  produces<reco::PFRecHitCollection>("Cleaned");
44 
45  edm::ConsumesCollector cc = consumesCollector();
46 
47  std::vector<edm::ParameterSet> creators = iConfig.getParameter<std::vector<edm::ParameterSet>>("producers");
48  for (auto& creator : creators) {
49  std::string name = creator.getParameter<std::string>("name");
50  creators_.emplace_back(PFRecHitFactory::get()->create(name, creator, cc));
51  }
52 
53  edm::ParameterSet navSet = iConfig.getParameter<edm::ParameterSet>("navigator");
54  navigator_ = PFRecHitNavigationFactory::get()->create(navSet.getParameter<std::string>("name"), navSet, cc);
55 }
std::vector< std::unique_ptr< PFRecHitCreatorBase > > creators_
T getParameter(std::string const &) const
Definition: ParameterSet.h:307
def create(alignables, pedeDump, additionalData, outputFile, config)
uint32_t cc[maxCellsPerHit]
Definition: gpuFishbone.h:49
#define get
std::unique_ptr< PFRecHitNavigatorBase > navigator_

◆ ~PFRecHitProducer()

PFRecHitProducer::~PFRecHitProducer ( )
overridedefault

Member Function Documentation

◆ beginRun()

void PFRecHitProducer::beginRun ( edm::Run const &  iRun,
const edm::EventSetup iSetup 
)
overrideprivate

Definition at line 63 of file PFRecHitProducer.cc.

References creators_, and navigator_.

63  {
64  for (const auto& creator : creators_) {
65  creator->init(iSetup);
66  }
67  navigator_->init(iSetup);
68 }
std::vector< std::unique_ptr< PFRecHitCreatorBase > > creators_
std::unique_ptr< PFRecHitNavigatorBase > navigator_

◆ fillDescriptions()

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

Definition at line 102 of file PFRecHitProducer.cc.

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

102  {
104  {
106  pset.add<std::string>("name", "");
107  pset.add<std::vector<int>>("hcalEnums", {});
108  pset.add<edm::ParameterSetDescription>("barrel", {});
109  pset.add<edm::ParameterSetDescription>("endcap", {});
110  {
112  pset2.add<std::string>("name", "");
113  pset2.add<std::string>("topologySource", "");
114  pset.add<edm::ParameterSetDescription>("hgcee", pset2);
115  pset.add<edm::ParameterSetDescription>("hgcheb", pset2);
116  pset.add<edm::ParameterSetDescription>("hgchef", pset2);
117  }
118  desc.add<edm::ParameterSetDescription>("navigator", pset);
119  }
120  {
122  psd.add<std::string>("name", "");
123  psd.add<edm::InputTag>("src", {});
124  {
126  psd2.add<std::string>("name", "");
127  psd2.add<std::vector<int>>("maxSeverities", {});
128  psd2.add<std::vector<double>>("cleaningThresholds", {});
129  psd2.add<std::vector<std::string>>("flags", {});
130  psd2.add<bool>("usePFThresholdsFromDB", false);
131  {
133  psd3.add<std::vector<int>>("depth", {});
134  psd3.add<std::vector<double>>("threshold", {});
135  psd3.add<int>("detectorEnum", 0);
136  psd2.addVPSet("cuts", psd3, {});
137  }
138  psd2.add<double>("thresholdSNR", 0);
139  psd2.add<bool>("applySelectionsToAllCrystals", false);
140  psd2.add<double>("cleaningThreshold", 0);
141  psd2.add<bool>("timingCleaning", false);
142  psd2.add<bool>("topologicalCleaning", false);
143  psd2.add<bool>("skipTTRecoveredHits", false);
144  psd2.add<double>("threshold", 0);
145  psd2.add<double>("threshold_ring0", 0);
146  psd2.add<double>("threshold_ring12", 0);
147  psd.addVPSet("qualityTests", psd2, {});
148  }
149  psd.add<double>("EMDepthCorrection", 0);
150  psd.add<double>("HADDepthCorrection", 0);
151  psd.add<double>("thresh_HF", 0);
152  psd.add<double>("ShortFibre_Cut", 0);
153  psd.add<double>("LongFibre_Fraction", 0);
154  psd.add<double>("LongFibre_Cut", 0);
155  psd.add<double>("ShortFibre_Fraction", 0);
156  psd.add<double>("HFCalib29", 0);
157  psd.add<edm::InputTag>("srFlags", {});
158  psd.add<std::string>("geometryInstance", "");
159  desc.addVPSet("producers", psd, {});
160  }
161  descriptions.addWithDefaultLabel(desc);
162 }
void addWithDefaultLabel(ParameterSetDescription const &psetDescription)
ParameterDescriptionBase * addVPSet(U const &iLabel, ParameterSetDescription const &validator, std::vector< ParameterSet > const &defaults)
ParameterDescriptionBase * add(U const &iLabel, T const &value)

◆ produce()

void PFRecHitProducer::produce ( edm::Event iEvent,
const edm::EventSetup iSetup 
)
overrideprivate

Definition at line 71 of file PFRecHitProducer.cc.

References creators_, iEvent, eostools::move(), navigator_, MillePedeFileConverter_cfg::out, jetUpdater_cfi::sort, and hgcalUtils::sortByDetId().

71  {
72  using namespace edm;
73  auto out = std::make_unique<reco::PFRecHitCollection>();
74  auto cleaned = std::make_unique<reco::PFRecHitCollection>();
75 
76  out->reserve(localRA1.upper());
77  cleaned->reserve(localRA2.upper());
78 
79  for (const auto& creator : creators_) {
80  creator->importRecHits(out, cleaned, iEvent, iSetup);
81  }
82 
83  if (out->capacity() > 2 * out->size())
84  out->shrink_to_fit();
85  if (cleaned->capacity() > 2 * cleaned->size())
86  cleaned->shrink_to_fit();
87  localRA1.update(out->size());
88  localRA2.update(cleaned->size());
89  std::sort(out->begin(), out->end(), sortByDetId);
90 
91  //create a refprod here
93 
94  for (auto& pfrechit : *out) {
95  navigator_->associateNeighbours(pfrechit, out, refProd);
96  }
97 
98  iEvent.put(std::move(out), "");
99  iEvent.put(std::move(cleaned), "Cleaned");
100 }
std::vector< std::unique_ptr< PFRecHitCreatorBase > > creators_
std::vector< PFRecHit > PFRecHitCollection
collection of PFRecHit objects
Definition: PFRecHitFwd.h:9
static bool sortByDetId(const std::pair< int, float > &pair1, const std::pair< int, float > &pair2)
int iEvent
Definition: GenABIO.cc:224
HLT enums.
def move(src, dest)
Definition: eostools.py:511
std::unique_ptr< PFRecHitNavigatorBase > navigator_

Member Data Documentation

◆ creators_

std::vector<std::unique_ptr<PFRecHitCreatorBase> > PFRecHitProducer::creators_
private

Definition at line 26 of file PFRecHitProducer.cc.

Referenced by beginRun(), PFRecHitProducer(), and produce().

◆ init_

bool PFRecHitProducer::init_
private

Definition at line 28 of file PFRecHitProducer.cc.

◆ navigator_

std::unique_ptr<PFRecHitNavigatorBase> PFRecHitProducer::navigator_
private

Definition at line 27 of file PFRecHitProducer.cc.

Referenced by beginRun(), PFRecHitProducer(), and produce().