145 barrelecalCollection_{consumes(
config.getParameter<
edm::InputTag>(
"barrelEcalRecHitCollection"))},
146 endcapecalCollection_{consumes(
config.getParameter<
edm::InputTag>(
"endcapEcalRecHitCollection"))},
147 measurementTrkEvtToken_{consumes(
edm::InputTag(
"MeasurementTrackerEvent"))},
149 navToken_(esConsumes<edm::Transition::BeginRun>(
edm::ESInputTag(
"",
"SimpleNavigationSchool"))),
153 theTrajectoryBuilder_(createBaseCkfTrajectoryBuilder(
155 outInSeedFinder_{
config, consumesCollector()},
156 outInTrackFinder_{
config, theTrajectoryBuilder_.get(), consumesCollector()},
157 inOutSeedFinder_{
config, consumesCollector()},
158 inOutTrackFinder_{
config, theTrajectoryBuilder_.get(), consumesCollector()} {
159 OutInTrackCandidateCollection_ =
config.getParameter<
std::string>(
"outInTrackCandidateCollection");
160 InOutTrackCandidateCollection_ =
config.getParameter<
std::string>(
"inOutTrackCandidateCollection");
162 OutInTrackSCAssociationCollection_ =
config.getParameter<
std::string>(
"outInTrackCandidateSCAssociationCollection");
163 InOutTrackSCAssociationCollection_ =
config.getParameter<
std::string>(
"inOutTrackCandidateSCAssociationCollection");
168 isoConeR_ =
config.getParameter<
double>(
"isoConeR");
169 isoInnerConeR_ =
config.getParameter<
double>(
"isoInnerConeR");
170 isoEtaSlice_ =
config.getParameter<
double>(
"isoEtaSlice");
171 isoEtMin_ =
config.getParameter<
double>(
"isoEtMin");
172 isoEMin_ =
config.getParameter<
double>(
"isoEMin");
173 vetoClusteredHits_ =
config.getParameter<
bool>(
"vetoClusteredHits");
174 useNumXtals_ =
config.getParameter<
bool>(
"useNumXstals");
175 ecalIsoCut_offset_ =
config.getParameter<
double>(
"ecalIsoCut_offset");
176 ecalIsoCut_slope_ =
config.getParameter<
double>(
"ecalIsoCut_slope");
179 auto const& flagnamesEB =
config.getParameter<std::vector<std::string>>(
"RecHitFlagToBeExcludedEB");
180 auto const& flagnamesEE =
config.getParameter<std::vector<std::string>>(
"RecHitFlagToBeExcludedEE");
182 flagsexclEB_ = StringToEnumValue<EcalRecHit::Flags>(flagnamesEB);
183 flagsexclEE_ = StringToEnumValue<EcalRecHit::Flags>(flagnamesEE);
185 auto const& severitynamesEB =
config.getParameter<std::vector<std::string>>(
"RecHitSeverityToBeExcludedEB");
186 auto const& severitynamesEE =
config.getParameter<std::vector<std::string>>(
"RecHitSeverityToBeExcludedEE");
188 severitiesexclEB_ = StringToEnumValue<EcalSeverityLevel::SeverityLevel>(severitynamesEB);
189 severitiesexclEE_ = StringToEnumValue<EcalSeverityLevel::SeverityLevel>(severitynamesEE);
192 produces<TrackCandidateCollection>(OutInTrackCandidateCollection_);
193 produces<TrackCandidateCollection>(InOutTrackCandidateCollection_);
195 produces<reco::TrackCandidateCaloClusterPtrAssociation>(OutInTrackSCAssociationCollection_);
196 produces<reco::TrackCandidateCaloClusterPtrAssociation>(InOutTrackSCAssociationCollection_);
200 if (cfgCone.hOverEConeSize > 0) {
201 cfgCone.onlyBehindCluster =
false;
202 cfgCone.checkHcalStatus =
false;
207 cfgCone.maxSeverityHB =
config.getParameter<
int>(
"maxHcalRecHitSeverity");
209 cfgCone.maxSeverityHE = cfgCone.maxSeverityHB;
212 hcalHelper_ = std::make_unique<ElectronHcalHelper>(cfgCone, consumesCollector());
243 auto outInTrackCandidate_p = std::make_unique<TrackCandidateCollection>();
245 auto inOutTrackCandidate_p = std::make_unique<TrackCandidateCollection>();
247 auto outInAssoc_p = std::make_unique<reco::TrackCandidateCaloClusterPtrAssociation>();
248 auto inOutAssoc_p = std::make_unique<reco::TrackCandidateCaloClusterPtrAssociation>();
251 bool validBarrelBCHandle =
true;
253 if (!bcBarrelHandle.isValid()) {
254 edm::LogError(
"ConversionTrackCandidateProducer") <<
"Error! Can't get the Barrel Basic Clusters!";
255 validBarrelBCHandle =
false;
259 bool validEndcapBCHandle =
true;
261 if (!bcEndcapHandle.isValid()) {
262 edm::LogError(
"CoonversionTrackCandidateProducer") <<
"Error! Can't get the Endcap Basic Clusters";
263 validEndcapBCHandle =
false;
267 bool validBarrelSCHandle =
true;
269 if (!scBarrelHandle.isValid()) {
270 edm::LogError(
"CoonversionTrackCandidateProducer") <<
"Error! Can't get the barrel superclusters!";
271 validBarrelSCHandle =
false;
275 bool validEndcapSCHandle =
true;
277 if (!scEndcapHandle.isValid()) {
278 edm::LogError(
"CoonversionTrackCandidateProducer") <<
"Error! Can't get the endcap superclusters!";
279 validEndcapSCHandle =
false;
296 if (validBarrelBCHandle && validBarrelSCHandle)
303 *outInTrackCandidate_p,
304 *inOutTrackCandidate_p,
308 if (validEndcapBCHandle && validEndcapSCHandle) {
316 *outInTrackCandidate_p,
317 *inOutTrackCandidate_p,
331 auto const refprodInOutTrackC = theEvent.
put(
std::move(inOutTrackCandidate_p), InOutTrackCandidateCollection_);
342 theEvent.
put(
std::move(outInAssoc_p), OutInTrackSCAssociationCollection_);
345 theEvent.
put(
std::move(inOutAssoc_p), InOutTrackSCAssociationCollection_);
364 for (
auto const& aClus : scHandle->ptrs()) {
366 if (aClus->energy() / cosh(aClus->eta()) <= minSCEt_)
368 if (aClus->eta() > 1.479 && aClus->eta() < 1.556)
373 double scEt = sc->
energy() / cosh(sc->
eta());
375 if (HoE >= maxHOverE_)
380 isoConeR_, isoInnerConeR_, isoEtaSlice_, isoEtMin_, isoEMin_,
theCaloGeom_, ecalRecHits, sevLevel,
DetId::Ecal);
393 if (ecalIsolation > ecalIsoCut_offset_ + ecalIsoCut_slope_ * scEt)
414 for (
auto it = theOutInTracks.begin(); it != theOutInTracks.end(); ++it) {
415 vecRecOI.push_back(aClus);
419 for (
auto it = theInOutTracks.begin(); it != theInOutTracks.end(); ++it) {
420 vecRecIO.push_back(aClus);
430 desc.
add<
edm::InputTag>(
"bcBarrelCollection", {
"particleFlowSuperClusterECAL",
"particleFlowBasicClusterECALBarrel"});
431 desc.
add<
edm::InputTag>(
"bcEndcapCollection", {
"particleFlowSuperClusterECAL",
"particleFlowBasicClusterECALEndcap"});
433 {
"particleFlowSuperClusterECAL",
"particleFlowSuperClusterECALBarrel"});
435 {
"particleFlowSuperClusterECAL",
"particleFlowSuperClusterECALEndcapWithPreshower"});
437 desc.
add<
std::string>(
"outInTrackCandidateSCAssociationCollection",
"outInTrackCandidateSCAssociationCollection");
438 desc.
add<
std::string>(
"inOutTrackCandidateSCAssociationCollection",
"inOutTrackCandidateSCAssociationCollection");
439 desc.
add<
std::string>(
"outInTrackCandidateCollection",
"outInTracksFromConversions");
440 desc.
add<
std::string>(
"inOutTrackCandidateCollection",
"inOutTracksFromConversions");
442 desc.
add<
edm::InputTag>(
"barrelEcalRecHitCollection", {
"ecalRecHit",
"EcalRecHitsEB"});
443 desc.
add<
edm::InputTag>(
"endcapEcalRecHitCollection", {
"ecalRecHit",
"EcalRecHitsEE"});
445 desc.
add<
std::string>(
"OutInRedundantSeedCleaner",
"CachingSeedCleanerBySharedInput");
446 desc.
add<
std::string>(
"InOutRedundantSeedCleaner",
"CachingSeedCleanerBySharedInput");
447 desc.
add<
bool>(
"useHitsSplitting",
false);
448 desc.
add<
int>(
"maxNumOfSeedsOutIn", 50);
449 desc.
add<
int>(
"maxNumOfSeedsInOut", 50);
450 desc.
add<
double>(
"bcEtCut", 1.5);
451 desc.
add<
double>(
"bcECut", 1.5);
452 desc.
add<
bool>(
"useEtCut",
true);
455 desc.
add<std::vector<double>>(
"recHitEThresholdHB", {0., 0., 0., 0.});
456 desc.
add<std::vector<double>>(
"recHitEThresholdHE", {0., 0., 0., 0., 0., 0., 0.});
457 desc.
add<
int>(
"maxHcalRecHitSeverity", 999999);
459 desc.
add<
double>(
"minSCEt", 20.0);
460 desc.
add<
double>(
"hOverEConeSize", 0.15);
461 desc.
add<
double>(
"maxHOverE", 0.15);
462 desc.
add<
double>(
"isoInnerConeR", 3.5);
463 desc.
add<
double>(
"isoConeR", 0.4);
464 desc.
add<
double>(
"isoEtaSlice", 2.5);
465 desc.
add<
double>(
"isoEtMin", 0.0);
466 desc.
add<
double>(
"isoEMin", 0.08);
467 desc.
add<
bool>(
"vetoClusteredHits",
false);
468 desc.
add<
bool>(
"useNumXstals",
true);
469 desc.
add<
double>(
"ecalIsoCut_offset", 999999999);
470 desc.
add<
double>(
"ecalIsoCut_slope", 0.0);
472 desc.
add<std::vector<std::string>>(
"RecHitFlagToBeExcludedEB", {});
473 desc.
add<std::vector<std::string>>(
"RecHitSeverityToBeExcludedEB", {});
474 desc.
add<std::vector<std::string>>(
"RecHitFlagToBeExcludedEE", {});
475 desc.
add<std::vector<std::string>>(
"RecHitSeverityToBeExcludedEE", {});
477 desc.
add<
double>(
"fractionShared", 0.5);
478 desc.
add<
std::string>(
"TrajectoryBuilder",
"TrajectoryBuilderForConversions");
486 psd0.
add<
std::string>(
"propagatorAlongTISE",
"alongMomElePropagator");
487 psd0.
add<
int>(
"numberMeasurementsForFit", 4);
488 psd0.
add<
std::string>(
"propagatorOppositeTISE",
"oppositeToMomElePropagator");
491 desc.
add<
bool>(
"allowSharedFirstHit",
true);
492 desc.
add<
double>(
"ValidHitBonus", 5.0);
493 desc.
add<
double>(
"MissingHitPenalty", 20.0);
495 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)
double hcalESum(const reco::SuperCluster &, int depth) const
edm::EDGetTokenT< edm::View< reco::CaloCluster > > scIslandEndcapProducer_
InOutConversionTrackFinder inOutTrackFinder_
double getEtSum(const reco::Candidate *emObject) const
#define DEFINE_FWK_MODULE(type)
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_
double eta() const
pseudorapidity of cluster centroid
void doFlagChecks(const std::vector< int > &v)
std::vector< int > flagsexclEE_
std::string InOutTrackCandidateCollection_
void setNavigationSchool(const NavigationSchool *navigation)
bool getData(T &iHolder) const
std::string OutInTrackSCAssociationCollection_
void makeSeeds(const edm::Handle< edm::View< reco::CaloCluster > > &allBc) override
Handle< PROD > getHandle(EDGetTokenT< PROD > token) const
void setUseNumCrystals(bool b=true)
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
std::vector< int > severitiesexclEE_
void makeSeeds(const edm::Handle< edm::View< reco::CaloCluster > > &allBc) override
bool get(ProductID const &oid, Handle< PROD > &result) const
double energy() const
cluster energy
ParameterDescriptionBase * add(U const &iLabel, T const &value)
ConversionTrackCandidateProducer(const edm::ParameterSet &ps)
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)
void doSeverityChecks(const EcalRecHitCollection *const recHits, const std::vector< int > &v)
std::unique_ptr< ElectronHcalHelper > hcalHelper_
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)
T getParameter(std::string const &) const
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.
tuple config
parse the configuration file
edm::EDGetTokenT< edm::View< reco::CaloCluster > > bcBarrelCollection_
void setVetoClustered(bool b=true)
edm::EDGetTokenT< edm::View< reco::CaloCluster > > bcEndcapCollection_
edm::EDGetTokenT< HBHERecHitCollection > hbheRecHits_
OutInConversionTrackFinder outInTrackFinder_
OutInConversionSeedFinder outInSeedFinder_
void produce(edm::Event &evt, const edm::EventSetup &es) override
void beginRun(edm::Run const &, edm::EventSetup const &es) final
ESHandle< T > getHandle(const ESGetToken< T, R > &iToken) 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