148 scHybridBarrelProducer_{consumes(
config.getParameter<
edm::InputTag>(
"scHybridBarrelProducer"))},
149 scIslandEndcapProducer_{consumes(
config.getParameter<
edm::InputTag>(
"scIslandEndcapProducer"))},
152 barrelecalCollection_{consumes(
config.getParameter<
edm::InputTag>(
"barrelEcalRecHitCollection"))},
153 endcapecalCollection_{consumes(
config.getParameter<
edm::InputTag>(
"endcapEcalRecHitCollection"))},
154 measurementTrkEvtToken_{consumes(
edm::InputTag(
"MeasurementTrackerEvent"))},
156 navToken_(esConsumes<edm::Transition::BeginRun>(
edm::ESInputTag(
"",
"SimpleNavigationSchool"))),
160 theTrajectoryBuilder_(createBaseCkfTrajectoryBuilder(
162 outInSeedFinder_{
config, consumesCollector()},
163 outInTrackFinder_{
config, theTrajectoryBuilder_.get(), consumesCollector()},
164 inOutSeedFinder_{
config, consumesCollector()},
165 inOutTrackFinder_{
config, theTrajectoryBuilder_.get(), consumesCollector()} {
166 OutInTrackCandidateCollection_ =
config.getParameter<
std::string>(
"outInTrackCandidateCollection");
167 InOutTrackCandidateCollection_ =
config.getParameter<
std::string>(
"inOutTrackCandidateCollection");
169 OutInTrackSCAssociationCollection_ =
config.getParameter<
std::string>(
"outInTrackCandidateSCAssociationCollection");
170 InOutTrackSCAssociationCollection_ =
config.getParameter<
std::string>(
"inOutTrackCandidateSCAssociationCollection");
172 cutsFromDB =
config.getParameter<
bool>(
"usePFThresholdsFromDB");
174 hcalCutsToken_ = esConsumes<HcalPFCuts, HcalPFCutsRcd, edm::Transition::BeginRun>(
edm::ESInputTag(
"",
"withTopo"));
176 hOverEConeSize_ =
config.getParameter<
double>(
"hOverEConeSize");
177 maxHOverE_ =
config.getParameter<
double>(
"maxHOverE");
178 minSCEt_ =
config.getParameter<
double>(
"minSCEt");
179 isoConeR_ =
config.getParameter<
double>(
"isoConeR");
180 isoInnerConeR_ =
config.getParameter<
double>(
"isoInnerConeR");
181 isoEtaSlice_ =
config.getParameter<
double>(
"isoEtaSlice");
182 isoEtMin_ =
config.getParameter<
double>(
"isoEtMin");
183 isoEMin_ =
config.getParameter<
double>(
"isoEMin");
184 vetoClusteredHits_ =
config.getParameter<
bool>(
"vetoClusteredHits");
185 useNumXtals_ =
config.getParameter<
bool>(
"useNumXstals");
186 ecalIsoCut_offset_ =
config.getParameter<
double>(
"ecalIsoCut_offset");
187 ecalIsoCut_slope_ =
config.getParameter<
double>(
"ecalIsoCut_slope");
190 auto const& flagnamesEB =
config.getParameter<std::vector<std::string>>(
"RecHitFlagToBeExcludedEB");
191 auto const& flagnamesEE =
config.getParameter<std::vector<std::string>>(
"RecHitFlagToBeExcludedEE");
193 flagsexclEB_ = StringToEnumValue<EcalRecHit::Flags>(flagnamesEB);
194 flagsexclEE_ = StringToEnumValue<EcalRecHit::Flags>(flagnamesEE);
196 auto const& severitynamesEB =
config.getParameter<std::vector<std::string>>(
"RecHitSeverityToBeExcludedEB");
197 auto const& severitynamesEE =
config.getParameter<std::vector<std::string>>(
"RecHitSeverityToBeExcludedEE");
199 severitiesexclEB_ = StringToEnumValue<EcalSeverityLevel::SeverityLevel>(severitynamesEB);
200 severitiesexclEE_ = StringToEnumValue<EcalSeverityLevel::SeverityLevel>(severitynamesEE);
203 produces<TrackCandidateCollection>(OutInTrackCandidateCollection_);
204 produces<TrackCandidateCollection>(InOutTrackCandidateCollection_);
206 produces<reco::TrackCandidateCaloClusterPtrAssociation>(OutInTrackSCAssociationCollection_);
207 produces<reco::TrackCandidateCaloClusterPtrAssociation>(InOutTrackSCAssociationCollection_);
211 if (cfgCone.hOverEConeSize > 0) {
212 cfgCone.onlyBehindCluster =
false;
213 cfgCone.checkHcalStatus =
false;
215 cfgCone.hbheRecHits = hbheRecHits_;
218 cfgCone.maxSeverityHB =
config.getParameter<
int>(
"maxHcalRecHitSeverity");
220 cfgCone.maxSeverityHE = cfgCone.maxSeverityHB;
223 hcalHelper_ = std::make_unique<ElectronHcalHelper>(cfgCone, consumesCollector());
258 auto outInTrackCandidate_p = std::make_unique<TrackCandidateCollection>();
260 auto inOutTrackCandidate_p = std::make_unique<TrackCandidateCollection>();
262 auto outInAssoc_p = std::make_unique<reco::TrackCandidateCaloClusterPtrAssociation>();
263 auto inOutAssoc_p = std::make_unique<reco::TrackCandidateCaloClusterPtrAssociation>();
266 bool validBarrelBCHandle =
true;
268 if (!bcBarrelHandle.isValid()) {
269 edm::LogError(
"ConversionTrackCandidateProducer") <<
"Error! Can't get the Barrel Basic Clusters!";
270 validBarrelBCHandle =
false;
274 bool validEndcapBCHandle =
true;
276 if (!bcEndcapHandle.isValid()) {
277 edm::LogError(
"CoonversionTrackCandidateProducer") <<
"Error! Can't get the Endcap Basic Clusters";
278 validEndcapBCHandle =
false;
282 bool validBarrelSCHandle =
true;
284 if (!scBarrelHandle.isValid()) {
285 edm::LogError(
"CoonversionTrackCandidateProducer") <<
"Error! Can't get the barrel superclusters!";
286 validBarrelSCHandle =
false;
290 bool validEndcapSCHandle =
true;
292 if (!scEndcapHandle.isValid()) {
293 edm::LogError(
"CoonversionTrackCandidateProducer") <<
"Error! Can't get the endcap superclusters!";
294 validEndcapSCHandle =
false;
313 if (validBarrelBCHandle && validBarrelSCHandle)
320 *outInTrackCandidate_p,
321 *inOutTrackCandidate_p,
325 if (validEndcapBCHandle && validEndcapSCHandle) {
333 *outInTrackCandidate_p,
334 *inOutTrackCandidate_p,
381 for (
auto const& aClus : scHandle->ptrs()) {
383 if (aClus->energy() / cosh(aClus->eta()) <=
minSCEt_)
385 if (aClus->eta() > 1.479 && aClus->eta() < 1.556)
390 double scEt = sc->
energy() / cosh(sc->
eta());
431 for (
auto it = theOutInTracks.begin();
it != theOutInTracks.end(); ++
it) {
432 vecRecOI.push_back(aClus);
436 for (
auto it = theInOutTracks.begin();
it != theInOutTracks.end(); ++
it) {
437 vecRecIO.push_back(aClus);
447 desc.add<
edm::InputTag>(
"bcBarrelCollection", {
"particleFlowSuperClusterECAL",
"particleFlowBasicClusterECALBarrel"});
448 desc.add<
edm::InputTag>(
"bcEndcapCollection", {
"particleFlowSuperClusterECAL",
"particleFlowBasicClusterECALEndcap"});
450 {
"particleFlowSuperClusterECAL",
"particleFlowSuperClusterECALBarrel"});
452 {
"particleFlowSuperClusterECAL",
"particleFlowSuperClusterECALEndcapWithPreshower"});
454 desc.add<
std::string>(
"outInTrackCandidateSCAssociationCollection",
"outInTrackCandidateSCAssociationCollection");
455 desc.add<
std::string>(
"inOutTrackCandidateSCAssociationCollection",
"inOutTrackCandidateSCAssociationCollection");
456 desc.add<
std::string>(
"outInTrackCandidateCollection",
"outInTracksFromConversions");
457 desc.add<
std::string>(
"inOutTrackCandidateCollection",
"inOutTracksFromConversions");
459 desc.add<
edm::InputTag>(
"barrelEcalRecHitCollection", {
"ecalRecHit",
"EcalRecHitsEB"});
460 desc.add<
edm::InputTag>(
"endcapEcalRecHitCollection", {
"ecalRecHit",
"EcalRecHitsEE"});
462 desc.add<
std::string>(
"OutInRedundantSeedCleaner",
"CachingSeedCleanerBySharedInput");
463 desc.add<
std::string>(
"InOutRedundantSeedCleaner",
"CachingSeedCleanerBySharedInput");
464 desc.add<
bool>(
"useHitsSplitting",
false);
465 desc.add<
int>(
"maxNumOfSeedsOutIn", 50);
466 desc.add<
int>(
"maxNumOfSeedsInOut", 50);
467 desc.add<
double>(
"bcEtCut", 1.5);
468 desc.add<
double>(
"bcECut", 1.5);
469 desc.add<
bool>(
"useEtCut",
true);
472 desc.add<std::vector<double>>(
"recHitEThresholdHB", {0., 0., 0., 0.});
473 desc.add<std::vector<double>>(
"recHitEThresholdHE", {0., 0., 0., 0., 0., 0., 0.});
474 desc.add<
bool>(
"usePFThresholdsFromDB",
false);
475 desc.add<
int>(
"maxHcalRecHitSeverity", 999999);
477 desc.add<
double>(
"minSCEt", 20.0);
478 desc.add<
double>(
"hOverEConeSize", 0.15);
479 desc.add<
double>(
"maxHOverE", 0.15);
480 desc.add<
double>(
"isoInnerConeR", 3.5);
481 desc.add<
double>(
"isoConeR", 0.4);
482 desc.add<
double>(
"isoEtaSlice", 2.5);
483 desc.add<
double>(
"isoEtMin", 0.0);
484 desc.add<
double>(
"isoEMin", 0.08);
485 desc.add<
bool>(
"vetoClusteredHits",
false);
486 desc.add<
bool>(
"useNumXstals",
true);
487 desc.add<
double>(
"ecalIsoCut_offset", 999999999);
488 desc.add<
double>(
"ecalIsoCut_slope", 0.0);
490 desc.add<std::vector<std::string>>(
"RecHitFlagToBeExcludedEB", {});
491 desc.add<std::vector<std::string>>(
"RecHitSeverityToBeExcludedEB", {});
492 desc.add<std::vector<std::string>>(
"RecHitFlagToBeExcludedEE", {});
493 desc.add<std::vector<std::string>>(
"RecHitSeverityToBeExcludedEE", {});
495 desc.add<
double>(
"fractionShared", 0.5);
496 desc.add<
std::string>(
"TrajectoryBuilder",
"TrajectoryBuilderForConversions");
504 psd0.
add<
std::string>(
"propagatorAlongTISE",
"alongMomElePropagator");
505 psd0.
add<
int>(
"numberMeasurementsForFit", 4);
506 psd0.
add<
std::string>(
"propagatorOppositeTISE",
"oppositeToMomElePropagator");
509 desc.add<
bool>(
"allowSharedFirstHit",
true);
510 desc.add<
double>(
"ValidHitBonus", 5.0);
511 desc.add<
double>(
"MissingHitPenalty", 20.0);
513 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_
const edm::ESGetToken< EcalPFRecHitThresholds, EcalPFRecHitThresholdsRcd > ecalPFRechitThresholdsToken_
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_
const EcalPFRecHitThresholds * thresholds
std::array< double, 7 > arrayHE