145 scHybridBarrelProducer_{consumes(
config.getParameter<
edm::InputTag>(
"scHybridBarrelProducer"))},
146 scIslandEndcapProducer_{consumes(
config.getParameter<
edm::InputTag>(
"scIslandEndcapProducer"))},
149 barrelecalCollection_{consumes(
config.getParameter<
edm::InputTag>(
"barrelEcalRecHitCollection"))},
150 endcapecalCollection_{consumes(
config.getParameter<
edm::InputTag>(
"endcapEcalRecHitCollection"))},
151 measurementTrkEvtToken_{consumes(
edm::InputTag(
"MeasurementTrackerEvent"))},
153 navToken_(esConsumes<edm::Transition::BeginRun>(
edm::ESInputTag(
"",
"SimpleNavigationSchool"))),
157 theTrajectoryBuilder_(createBaseCkfTrajectoryBuilder(
159 outInSeedFinder_{
config, consumesCollector()},
160 outInTrackFinder_{
config, theTrajectoryBuilder_.get(), consumesCollector()},
161 inOutSeedFinder_{
config, consumesCollector()},
162 inOutTrackFinder_{
config, theTrajectoryBuilder_.get(), consumesCollector()} {
163 OutInTrackCandidateCollection_ =
config.getParameter<
std::string>(
"outInTrackCandidateCollection");
164 InOutTrackCandidateCollection_ =
config.getParameter<
std::string>(
"inOutTrackCandidateCollection");
166 OutInTrackSCAssociationCollection_ =
config.getParameter<
std::string>(
"outInTrackCandidateSCAssociationCollection");
167 InOutTrackSCAssociationCollection_ =
config.getParameter<
std::string>(
"inOutTrackCandidateSCAssociationCollection");
169 cutsFromDB =
config.getParameter<
bool>(
"usePFThresholdsFromDB");
171 hcalCutsToken_ = esConsumes<HcalPFCuts, HcalPFCutsRcd, edm::Transition::BeginRun>(
edm::ESInputTag(
"",
"withTopo"));
173 hOverEConeSize_ =
config.getParameter<
double>(
"hOverEConeSize");
174 maxHOverE_ =
config.getParameter<
double>(
"maxHOverE");
175 minSCEt_ =
config.getParameter<
double>(
"minSCEt");
176 isoConeR_ =
config.getParameter<
double>(
"isoConeR");
177 isoInnerConeR_ =
config.getParameter<
double>(
"isoInnerConeR");
178 isoEtaSlice_ =
config.getParameter<
double>(
"isoEtaSlice");
179 isoEtMin_ =
config.getParameter<
double>(
"isoEtMin");
180 isoEMin_ =
config.getParameter<
double>(
"isoEMin");
181 vetoClusteredHits_ =
config.getParameter<
bool>(
"vetoClusteredHits");
182 useNumXtals_ =
config.getParameter<
bool>(
"useNumXstals");
183 ecalIsoCut_offset_ =
config.getParameter<
double>(
"ecalIsoCut_offset");
184 ecalIsoCut_slope_ =
config.getParameter<
double>(
"ecalIsoCut_slope");
187 auto const& flagnamesEB =
config.getParameter<std::vector<std::string>>(
"RecHitFlagToBeExcludedEB");
188 auto const& flagnamesEE =
config.getParameter<std::vector<std::string>>(
"RecHitFlagToBeExcludedEE");
190 flagsexclEB_ = StringToEnumValue<EcalRecHit::Flags>(flagnamesEB);
191 flagsexclEE_ = StringToEnumValue<EcalRecHit::Flags>(flagnamesEE);
193 auto const& severitynamesEB =
config.getParameter<std::vector<std::string>>(
"RecHitSeverityToBeExcludedEB");
194 auto const& severitynamesEE =
config.getParameter<std::vector<std::string>>(
"RecHitSeverityToBeExcludedEE");
196 severitiesexclEB_ = StringToEnumValue<EcalSeverityLevel::SeverityLevel>(severitynamesEB);
197 severitiesexclEE_ = StringToEnumValue<EcalSeverityLevel::SeverityLevel>(severitynamesEE);
200 produces<TrackCandidateCollection>(OutInTrackCandidateCollection_);
201 produces<TrackCandidateCollection>(InOutTrackCandidateCollection_);
203 produces<reco::TrackCandidateCaloClusterPtrAssociation>(OutInTrackSCAssociationCollection_);
204 produces<reco::TrackCandidateCaloClusterPtrAssociation>(InOutTrackSCAssociationCollection_);
208 if (cfgCone.hOverEConeSize > 0) {
209 cfgCone.onlyBehindCluster =
false;
210 cfgCone.checkHcalStatus =
false;
212 cfgCone.hbheRecHits = hbheRecHits_;
215 cfgCone.maxSeverityHB =
config.getParameter<
int>(
"maxHcalRecHitSeverity");
217 cfgCone.maxSeverityHE = cfgCone.maxSeverityHB;
220 hcalHelper_ = std::make_unique<ElectronHcalHelper>(cfgCone, consumesCollector());
255 auto outInTrackCandidate_p = std::make_unique<TrackCandidateCollection>();
257 auto inOutTrackCandidate_p = std::make_unique<TrackCandidateCollection>();
259 auto outInAssoc_p = std::make_unique<reco::TrackCandidateCaloClusterPtrAssociation>();
260 auto inOutAssoc_p = std::make_unique<reco::TrackCandidateCaloClusterPtrAssociation>();
263 bool validBarrelBCHandle =
true;
265 if (!bcBarrelHandle.isValid()) {
266 edm::LogError(
"ConversionTrackCandidateProducer") <<
"Error! Can't get the Barrel Basic Clusters!";
267 validBarrelBCHandle =
false;
271 bool validEndcapBCHandle =
true;
273 if (!bcEndcapHandle.isValid()) {
274 edm::LogError(
"CoonversionTrackCandidateProducer") <<
"Error! Can't get the Endcap Basic Clusters";
275 validEndcapBCHandle =
false;
279 bool validBarrelSCHandle =
true;
281 if (!scBarrelHandle.isValid()) {
282 edm::LogError(
"CoonversionTrackCandidateProducer") <<
"Error! Can't get the barrel superclusters!";
283 validBarrelSCHandle =
false;
287 bool validEndcapSCHandle =
true;
289 if (!scEndcapHandle.isValid()) {
290 edm::LogError(
"CoonversionTrackCandidateProducer") <<
"Error! Can't get the endcap superclusters!";
291 validEndcapSCHandle =
false;
308 if (validBarrelBCHandle && validBarrelSCHandle)
315 *outInTrackCandidate_p,
316 *inOutTrackCandidate_p,
320 if (validEndcapBCHandle && validEndcapSCHandle) {
328 *outInTrackCandidate_p,
329 *inOutTrackCandidate_p,
376 for (
auto const& aClus : scHandle->ptrs()) {
378 if (aClus->energy() / cosh(aClus->eta()) <=
minSCEt_)
380 if (aClus->eta() > 1.479 && aClus->eta() < 1.556)
385 double scEt = sc->
energy() / cosh(sc->
eta());
426 for (
auto it = theOutInTracks.begin(); it != theOutInTracks.end(); ++it) {
427 vecRecOI.push_back(aClus);
431 for (
auto it = theInOutTracks.begin(); it != theInOutTracks.end(); ++it) {
432 vecRecIO.push_back(aClus);
442 desc.add<
edm::InputTag>(
"bcBarrelCollection", {
"particleFlowSuperClusterECAL",
"particleFlowBasicClusterECALBarrel"});
443 desc.add<
edm::InputTag>(
"bcEndcapCollection", {
"particleFlowSuperClusterECAL",
"particleFlowBasicClusterECALEndcap"});
445 {
"particleFlowSuperClusterECAL",
"particleFlowSuperClusterECALBarrel"});
447 {
"particleFlowSuperClusterECAL",
"particleFlowSuperClusterECALEndcapWithPreshower"});
449 desc.add<
std::string>(
"outInTrackCandidateSCAssociationCollection",
"outInTrackCandidateSCAssociationCollection");
450 desc.add<
std::string>(
"inOutTrackCandidateSCAssociationCollection",
"inOutTrackCandidateSCAssociationCollection");
451 desc.add<
std::string>(
"outInTrackCandidateCollection",
"outInTracksFromConversions");
452 desc.add<
std::string>(
"inOutTrackCandidateCollection",
"inOutTracksFromConversions");
454 desc.add<
edm::InputTag>(
"barrelEcalRecHitCollection", {
"ecalRecHit",
"EcalRecHitsEB"});
455 desc.add<
edm::InputTag>(
"endcapEcalRecHitCollection", {
"ecalRecHit",
"EcalRecHitsEE"});
457 desc.add<
std::string>(
"OutInRedundantSeedCleaner",
"CachingSeedCleanerBySharedInput");
458 desc.add<
std::string>(
"InOutRedundantSeedCleaner",
"CachingSeedCleanerBySharedInput");
459 desc.add<
bool>(
"useHitsSplitting",
false);
460 desc.add<
int>(
"maxNumOfSeedsOutIn", 50);
461 desc.add<
int>(
"maxNumOfSeedsInOut", 50);
462 desc.add<
double>(
"bcEtCut", 1.5);
463 desc.add<
double>(
"bcECut", 1.5);
464 desc.add<
bool>(
"useEtCut",
true);
467 desc.add<std::vector<double>>(
"recHitEThresholdHB", {0., 0., 0., 0.});
468 desc.add<std::vector<double>>(
"recHitEThresholdHE", {0., 0., 0., 0., 0., 0., 0.});
469 desc.add<
bool>(
"usePFThresholdsFromDB",
false);
470 desc.add<
int>(
"maxHcalRecHitSeverity", 999999);
472 desc.add<
double>(
"minSCEt", 20.0);
473 desc.add<
double>(
"hOverEConeSize", 0.15);
474 desc.add<
double>(
"maxHOverE", 0.15);
475 desc.add<
double>(
"isoInnerConeR", 3.5);
476 desc.add<
double>(
"isoConeR", 0.4);
477 desc.add<
double>(
"isoEtaSlice", 2.5);
478 desc.add<
double>(
"isoEtMin", 0.0);
479 desc.add<
double>(
"isoEMin", 0.08);
480 desc.add<
bool>(
"vetoClusteredHits",
false);
481 desc.add<
bool>(
"useNumXstals",
true);
482 desc.add<
double>(
"ecalIsoCut_offset", 999999999);
483 desc.add<
double>(
"ecalIsoCut_slope", 0.0);
485 desc.add<std::vector<std::string>>(
"RecHitFlagToBeExcludedEB", {});
486 desc.add<std::vector<std::string>>(
"RecHitSeverityToBeExcludedEB", {});
487 desc.add<std::vector<std::string>>(
"RecHitFlagToBeExcludedEE", {});
488 desc.add<std::vector<std::string>>(
"RecHitSeverityToBeExcludedEE", {});
490 desc.add<
double>(
"fractionShared", 0.5);
491 desc.add<
std::string>(
"TrajectoryBuilder",
"TrajectoryBuilderForConversions");
499 psd0.
add<
std::string>(
"propagatorAlongTISE",
"alongMomElePropagator");
500 psd0.
add<
int>(
"numberMeasurementsForFit", 4);
501 psd0.
add<
std::string>(
"propagatorOppositeTISE",
"oppositeToMomElePropagator");
504 desc.add<
bool>(
"allowSharedFirstHit",
true);
505 desc.add<
double>(
"ValidHitBonus", 5.0);
506 desc.add<
double>(
"MissingHitPenalty", 20.0);
508 descriptions.
add(
"conversionTrackCandidatesDefault",
desc);
std::vector< Trajectory > tracks(const TrajectorySeedCollection &seeds, TrackCandidateCollection &candidates) const override
const math::XYZPoint & position() const
cluster centroid position
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
void setTracks(std::vector< Trajectory > const &in)
T const & getData(const ESGetToken< T, R > &iToken) const noexcept(false)
bool get(ProductID const &oid, Handle< PROD > &result) const
edm::ESGetToken< HcalPFCuts, HcalPFCutsRcd > hcalCutsToken_
edm::EDGetTokenT< edm::View< reco::CaloCluster > > scIslandEndcapProducer_
InOutConversionTrackFinder inOutTrackFinder_
const edm::ESGetToken< NavigationSchool, NavigationSchoolRecord > navToken_
std::vector< TrackCandidate > TrackCandidateCollection
std::vector< edm::Ref< reco::SuperClusterCollection > > vecOfSCRefForOutIn
std::string OutInTrackCandidateCollection_
void insert(const H &h, I begin, I end)
std::vector< int > severitiesexclEB_
Global3DPoint GlobalPoint
edm::EDGetTokenT< EcalRecHitCollection > endcapecalCollection_
std::vector< edm::Ptr< reco::CaloCluster > > caloPtrVecInOut_
Log< level::Error, false > LogError
std::string InOutTrackSCAssociationCollection_
double ecalIsoCut_offset_
edm::EDGetTokenT< MeasurementTrackerEvent > measurementTrkEvtToken_
std::unique_ptr< BaseCkfTrajectoryBuilder > theTrajectoryBuilder_
std::vector< int > flagsexclEE_
std::string InOutTrackCandidateCollection_
void setNavigationSchool(const NavigationSchool *navigation)
std::string OutInTrackSCAssociationCollection_
void makeSeeds(const edm::Handle< edm::View< reco::CaloCluster > > &allBc) override
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
std::vector< int > severitiesexclEE_
void makeSeeds(const edm::Handle< edm::View< reco::CaloCluster > > &allBc) override
#define DEFINE_FWK_MODULE(type)
HcalPFCuts const * hcalCuts
ParameterDescriptionBase * add(U const &iLabel, T const &value)
ConversionTrackCandidateProducer(const edm::ParameterSet &ps)
ESHandle< T > getHandle(const ESGetToken< T, R > &iToken) const
void buildCollections(bool detector, const edm::Handle< edm::View< reco::CaloCluster >> &scHandle, const edm::Handle< edm::View< reco::CaloCluster >> &bcHandle, const EcalRecHitCollection &ecalRecHits, const EcalSeverityLevelAlgo *sevLev, ElectronHcalHelper const &hcalHelper, TrackCandidateCollection &outInTracks, TrackCandidateCollection &inOutTracks, std::vector< edm::Ptr< reco::CaloCluster >> &vecRecOI, std::vector< edm::Ptr< reco::CaloCluster >> &vecRecIO)
std::unique_ptr< ElectronHcalHelper > hcalHelper_
double energy() const
cluster energy
virtual void setCandidate(float e, GlobalPoint pos)
std::vector< edm::Ref< reco::SuperClusterCollection > > vecOfSCRefForInOut
edm::ESHandle< CaloGeometry > theCaloGeom_
std::vector< edm::Ptr< reco::CaloCluster > > caloPtrVecOutIn_
edm::EDGetTokenT< edm::View< reco::CaloCluster > > scHybridBarrelProducer_
const edm::ESGetToken< CaloGeometry, CaloGeometryRecord > theCaloGeomToken_
TrajectorySeedCollection & seeds()
void setEvent(const edm::Event &e)
void add(std::string const &label, ParameterSetDescription const &psetDescription)
std::vector< int > flagsexclEB_
void setEventSetup(const edm::EventSetup &es)
Initialize EventSetup objects at each event.
void setEventSetup(const edm::EventSetup &es)
Initialize EventSetup objects at each event.
Handle< PROD > getHandle(EDGetTokenT< PROD > token) const
edm::EDGetTokenT< edm::View< reco::CaloCluster > > bcBarrelCollection_
edm::EDGetTokenT< edm::View< reco::CaloCluster > > bcEndcapCollection_
edm::EDGetTokenT< HBHERecHitCollection > hbheRecHits_
dictionary config
Read in AllInOne config in JSON format.
OutInConversionTrackFinder outInTrackFinder_
OutInConversionSeedFinder outInSeedFinder_
double eta() const
pseudorapidity of cluster centroid
void produce(edm::Event &evt, const edm::EventSetup &es) override
void beginRun(edm::Run const &, edm::EventSetup const &es) final
double hcalESum(const reco::SuperCluster &, int depth, const HcalPFCuts *hcalCuts) const
std::array< double, 4 > arrayHB
std::vector< Trajectory > tracks(const TrajectorySeedCollection &seeds, TrackCandidateCollection &candidate) const override
edm::EDGetTokenT< EcalRecHitCollection > barrelecalCollection_
InOutConversionSeedFinder inOutSeedFinder_
void setEventSetup(const edm::EventSetup &es)
Initialize EventSetup objects at each event.
const edm::ESGetToken< EcalSeverityLevelAlgo, EcalSeverityLevelAlgoRcd > sevlvToken_
std::array< double, 7 > arrayHE