28 return (*it).energy();
48 : EgammaCandidateCollection_(
50 EgammaGsfTrackCollection_(
62 egammaPtCut(iConfig.getParameter<double>(
"egammaPtCut")),
63 egammaEtaCut(iConfig.getParameter<double>(
"egammaEtaCut")),
76 <<
"size of \"absEtaBinUpperEdges\" (" <<
absEtaBinUpperEdges.size() <<
") and \"egammaSigmaIEtaIEtaCut\" (" 82 throw cms::Exception(
"IncorrectValue") <<
"absEtaBinUpperEdges entries should be greater than or equal to zero.";
85 throw cms::Exception(
"ImproperBinning") <<
"absEtaBinUpperEdges entries should be in increasing order.";
92 <<
") should have a value larger than \"egammaEtaCut\" (" <<
egammaEtaCut <<
").";
96 produces<Run3ScoutingElectronCollection>();
97 produces<Run3ScoutingPhotonCollection>();
107 auto outElectrons = std::make_unique<Run3ScoutingElectronCollection>();
108 auto outPhotons = std::make_unique<Run3ScoutingPhotonCollection>();
215 for (
auto& candidate : *EgammaCandidateCollection) {
236 uint32_t
seedId = (*SCseed).seed();
240 int detSize = mDetIds.size();
241 std::vector<uint32_t> mDetIdIds;
242 std::vector<float> mEnergies;
243 std::vector<float> mTimes;
244 mDetIdIds.reserve(detSize);
245 mEnergies.reserve(detSize);
246 mTimes.reserve(detSize);
248 for (
int i = 0;
i < detSize;
i++) {
251 mDetIdIds.push_back(mDetIds[
i]);
260 auto const HoE = candidate.superCluster()->energy() != 0.
261 ? ((*HoverEMap)[candidateRef] / candidate.superCluster()->energy())
267 auto const sinin = candidate.superCluster()->energy() != 0. ? (*SigmaIEtaIEtaMap)[candidateRef] : 999.;
276 unsigned int const maxTrkSize = EgammaGsfTrackCollection->size();
277 std::vector<float> trkd0;
278 std::vector<float> trkdz;
279 std::vector<float> trkpt;
280 std::vector<float> trketa;
281 std::vector<float> trkphi;
282 std::vector<float> trkpMode;
283 std::vector<float> trketaMode;
284 std::vector<float> trkphiMode;
285 std::vector<float> trkqoverpModeError;
286 std::vector<float> trkchi2overndf;
287 std::vector<int> trkcharge;
288 trkd0.reserve(maxTrkSize);
289 trkdz.reserve(maxTrkSize);
290 trkpt.reserve(maxTrkSize);
291 trketa.reserve(maxTrkSize);
292 trkphi.reserve(maxTrkSize);
293 trkpMode.reserve(maxTrkSize);
294 trketaMode.reserve(maxTrkSize);
295 trkphiMode.reserve(maxTrkSize);
296 trkqoverpModeError.reserve(maxTrkSize);
297 trkchi2overndf.reserve(maxTrkSize);
298 trkcharge.reserve(maxTrkSize);
300 for (
auto&
track : *EgammaGsfTrackCollection) {
305 if (scRefFromTrk == scRef) {
306 trkd0.push_back(
track.d0());
307 trkdz.push_back(
track.dz());
308 trkpt.push_back(
track.pt());
309 trketa.push_back(
track.eta());
310 trkphi.push_back(
track.phi());
311 trkpMode.push_back(
track.pMode());
312 trketaMode.push_back(
track.etaMode());
313 trkphiMode.push_back(
track.phiMode());
314 trkqoverpModeError.push_back(
track.qoverpModeError());
315 auto const trackndof =
track.ndof();
316 trkchi2overndf.push_back(((trackndof == 0) ? -1 : (
track.chi2() / trackndof)));
317 trkcharge.push_back(
track.charge());
320 if (trkcharge.empty()) {
321 outPhotons->emplace_back(candidate.pt(),
326 scRef->preshowerEnergy(),
327 scRef->correctedEnergyUncertainty(),
328 (*SigmaIEtaIEtaMap)[candidateRef],
330 (*EcalPFClusterIsoMap)[candidateRef],
331 (*HcalPFClusterIsoMap)[candidateRef],
333 (*R9Map)[candidateRef],
337 scRef->clustersSize(),
344 outElectrons->emplace_back(candidate.pt(),
349 scRef->preshowerEnergy(),
350 scRef->correctedEnergyUncertainty(),
361 (*DetaMap)[candidateRef],
362 (*DphiMap)[candidateRef],
363 (*SigmaIEtaIEtaMap)[candidateRef],
365 (*OneOEMinusOneOPMap)[candidateRef],
366 (*MissingHitsMap)[candidateRef],
369 (*EcalPFClusterIsoMap)[candidateRef],
370 (*HcalPFClusterIsoMap)[candidateRef],
371 (*EleGsfTrackIsoMap)[candidateRef],
372 (*R9Map)[candidateRef],
376 scRef->clustersSize(),
405 desc.add<
double>(
"egammaPtCut", 4.0);
406 desc.add<
double>(
"egammaEtaCut", 2.5);
407 desc.add<
double>(
"egammaHoverECut", 1.0);
408 desc.add<std::vector<double>>(
"egammaSigmaIEtaIEtaCut", {99999.0, 99999.0});
409 desc.add<std::vector<double>>(
"absEtaBinUpperEdges", {1.479, 5.0});
410 desc.add<
bool>(
"saveRecHitTiming",
false);
411 desc.add<
int>(
"mantissaPrecision", 10)->setComment(
"default float16, change to 23 for float32");
412 desc.add<
int>(
"rechitMatrixSize", 10);
413 desc.add<
bool>(
"rechitZeroSuppression",
true);
416 descriptions.
add(
"hltScoutingEgammaProducer",
desc);
helper::MatcherGetRef< C >::ref_type getRef(const Handle< C > &c, size_t k)
const int mantissaPrecision
const edm::EDGetTokenT< RecoEcalCandMap > SigmaIEtaIEtaMap_
const edm::EDGetTokenT< EcalRecHitCollection > ecalRechitEE_
edm::ESGetToken< CaloTopology, CaloTopologyRecord > topologyToken_
const edm::EDGetTokenT< RecoEcalCandMap > R9Map_
const std::vector< double > egammaSigmaIEtaIEtaCut
T const * product() const
std::vector< EcalRecHit >::const_iterator const_iterator
const edm::EDGetTokenT< reco::GsfTrackCollection > EgammaGsfTrackCollection_
const edm::EDGetTokenT< RecoEcalCandMap > EleGsfTrackIsoMap_
const edm::EDGetTokenT< RecoEcalCandMap > HoverEMap_
const edm::EDGetTokenT< reco::RecoEcalCandidateCollection > EgammaCandidateCollection_
const std::vector< double > absEtaBinUpperEdges
const edm::EDGetTokenT< RecoEcalCandMap > DetaMap_
const double egammaHoverECut
The Signals That Services Can Subscribe To This is based on ActivityRegistry and is current per Services can connect to the signals distributed by the ActivityRegistry in order to monitor the activity of the application Each possible callback has some defined which we here list in angle e< void, edm::EventID const &, edm::Timestamp const & > We also list in braces which AR_WATCH_USING_METHOD_ is used for those or
std::vector< GsfTrack > GsfTrackCollection
collection of GsfTracks
const int rechitMatrixSize
Abs< T >::type abs(const T &t)
const double egammaEtaCut
#define DEFINE_FWK_MODULE(type)
bool isNull() const
Checks for null.
float recHitT(const DetId id, const EcalRecHitCollection &recHits)
const edm::EDGetTokenT< RecoEcalCandMap > OneOEMinusOneOPMap_
const edm::EDGetTokenT< RecoEcalCandMap > MissingHitsMap_
const edm::EDGetTokenT< RecoEcalCandMap > DphiMap_
const bool saveRecHitTiming
void add(std::string const &label, ParameterSetDescription const &psetDescription)
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
std::vector< RecoEcalCandidate > RecoEcalCandidateCollection
collectin of RecoEcalCandidate objects
void produce(edm::StreamID sid, edm::Event &iEvent, edm::EventSetup const &setup) const final
static float reduceMantissaToNbitsRounding(const float &f)
const bool rechitZeroSuppression
const edm::EDGetTokenT< EcalRecHitCollection > ecalRechitEB_
float recHitE(const DetId id, const EcalRecHitCollection &recHits)
~HLTScoutingEgammaProducer() override
const edm::EDGetTokenT< RecoEcalCandMap > HcalPFClusterIsoMap_
const edm::EDGetTokenT< RecoEcalCandMap > EcalPFClusterIsoMap_
HLTScoutingEgammaProducer(const edm::ParameterSet &)