|
|
Go to the documentation of this file.
136 const std::vector<std::string> flagnamesEB =
137 config.getParameter<std::vector<std::string>>(
"RecHitFlagToBeExcludedEB");
139 const std::vector<std::string> flagnamesEE =
140 config.getParameter<std::vector<std::string>>(
"RecHitFlagToBeExcludedEE");
142 flagsexclEB_ = StringToEnumValue<EcalRecHit::Flags>(flagnamesEB);
144 flagsexclEE_ = StringToEnumValue<EcalRecHit::Flags>(flagnamesEE);
146 const std::vector<std::string> severitynamesEB =
147 config.getParameter<std::vector<std::string>>(
"RecHitSeverityToBeExcludedEB");
149 severitiesexclEB_ = StringToEnumValue<EcalSeverityLevel::SeverityLevel>(severitynamesEB);
151 const std::vector<std::string> severitynamesEE =
152 config.getParameter<std::vector<std::string>>(
"RecHitSeverityToBeExcludedEE");
154 severitiesexclEE_ = StringToEnumValue<EcalSeverityLevel::SeverityLevel>(severitynamesEE);
181 hcalHelperCone_ = std::make_unique<ElectronHcalHelper>(cfgCone, consumesCollector());
182 hcalHelperBc_ = std::make_unique<ElectronHcalHelper>(cfgBc, consumesCollector());
241 auto outputPhotonCollection_p = std::make_unique<reco::PhotonCollection>();
244 bool validPhotonCoreHandle =
true;
247 if (!photonCoreHandle.
isValid()) {
248 edm::LogError(
"PhotonProducer") <<
"Error! Can't get the photonCoreProducer";
249 validPhotonCoreHandle =
false;
253 bool validEcalRecHits =
true;
257 if (!barrelHitHandle.
isValid()) {
258 edm::LogError(
"PhotonProducer") <<
"Error! Can't get the barrelEcalHits";
259 validEcalRecHits =
false;
261 if (validEcalRecHits)
267 if (!endcapHitHandle.
isValid()) {
268 edm::LogError(
"PhotonProducer") <<
"Error! Can't get the endcapEcalHits";
269 validEcalRecHits =
false;
271 if (validEcalRecHits)
291 bool validVertex =
true;
295 edm::LogWarning(
"PhotonProducer") <<
"Error! Can't get the product primary Vertex Collection "
305 if (validPhotonCoreHandle)
320 edm::LogInfo(
"PhotonProducer") <<
" Put in the event " << iSC <<
" Photon Candidates \n";
325 for (
auto& pho : *outputPhotonCollection_p)
326 pho.hcalToRun2EffDepth();
352 std::vector<double> preselCutValues;
357 std::vector<int> flags_, severitiesexcl_;
359 for (
unsigned int lSC = 0; lSC < photonCoreHandle->size(); lSC++) {
364 int subdet = scRef->seed()->hitsAndFractions()[0].first.subdetId();
370 hits = ecalBarrelHits;
376 hits = ecalEndcapHits;
380 edm::LogWarning(
"") <<
"PhotonProducer: do not know if it is a barrel or endcap SuperCluster";
386 if (scRef->energy() / cosh(scRef->eta()) <= preselCutValues[0])
397 float e2x5 = EcalClusterTools::e2x5Max(*(scRef->seed()), &(*
hits), &(*topology));
398 float e3x3 = EcalClusterTools::e3x3(*(scRef->seed()), &(*
hits), &(*topology));
399 float e5x5 = EcalClusterTools::e5x5(*(scRef->seed()), &(*
hits), &(*topology));
400 const auto& cov = EcalClusterTools::covariances(*(scRef->seed()), &(*
hits), &(*topology),
geometry);
401 const auto& locCov = EcalClusterTools::localCovariances(*(scRef->seed()), &(*
hits), &(*topology));
404 float sigmaIetaIeta =
sqrt(locCov[0]);
405 float r9 = e3x3 / (scRef->rawEnergy());
417 float full5x5_sigmaEtaEta =
sqrt(full5x5_cov[0]);
423 caloPosition = unconvPos;
425 caloPosition = scRef->position();
445 newCandidate.setFiducialVolumeFlags(fiducialFlags);
446 newCandidate.setIsolationVariables(isolVarR04, isolVarR03);
452 showerShape.
e3x3 = e3x3;
453 showerShape.
e5x5 = e5x5;
463 newCandidate.setShowerShapeVariables(showerShape);
467 full5x5_showerShape.
e1x5 = full5x5_e1x5;
468 full5x5_showerShape.
e2x5 = full5x5_e2x5;
469 full5x5_showerShape.
e3x3 = full5x5_e3x3;
470 full5x5_showerShape.
e5x5 = full5x5_e5x5;
472 full5x5_showerShape.
sigmaEtaEta = full5x5_sigmaEtaEta;
480 newCandidate.full5x5_setShowerShapeVariables(full5x5_showerShape);
498 newCandidate.setMIPVariables(mipVar);
502 bool isLooseEM =
true;
503 if (newCandidate.pt() <
highEt_) {
504 if (newCandidate.hadronicOverEm() >= preselCutValues[1])
506 if (newCandidate.ecalRecHitSumEtConeDR04() > preselCutValues[2] + preselCutValues[3] * newCandidate.pt())
508 if (newCandidate.hcalTowerSumEtConeDR04() > preselCutValues[4] + preselCutValues[5] * newCandidate.pt())
510 if (newCandidate.nTrkSolidConeDR04() >
int(preselCutValues[6]))
512 if (newCandidate.nTrkHollowConeDR04() >
int(preselCutValues[7]))
514 if (newCandidate.trkSumPtSolidConeDR04() > preselCutValues[8])
516 if (newCandidate.trkSumPtHollowConeDR04() > preselCutValues[9])
518 if (newCandidate.sigmaIetaIeta() > preselCutValues[10])
edm::EDGetTokenT< HBHERecHitCollection > hbheRecHits
auto hcalTowersBehindClusters(const reco::SuperCluster &sc) const
T const * product() const
void setup(const edm::ParameterSet &conf, edm::ConsumesCollector &&iC)
void setup(const edm::ParameterSet &conf, std::vector< int > const &flagsEB_, std::vector< int > const &flagsEE_, std::vector< int > const &severitiesEB_, std::vector< int > const &severitiesEE_, edm::ConsumesCollector &&iC)
std::vector< int > flagsexclEE_
T const * product() const
edm::EDGetTokenT< reco::PhotonCoreCollection > photonCoreProducer_
std::array< double, 4 > arrayHB
ROOT::Math::LorentzVector< ROOT::Math::PxPyPzE4D< double > > XYZTLorentzVectorD
Lorentz vector with cylindrical internal representation using pseudorapidity.
std::vector< Vertex > VertexCollection
collection of Vertex objects
const CaloSubdetectorGeometry * getSubdetectorGeometry(const DetId &id) const
access the subdetector geometry for the given subdetector directly
Log< level::Info, false > LogInfo
std::vector< double > preselCutValuesBarrel_
Log< level::Warning, false > LogWarning
void MIPcalculate(const reco::Photon *, const edm::Event &, const edm::EventSetup &es, reco::Photon::MIPVariables &mipId)
PhotonEnergyCorrector photonEnergyCorrector_
edm::EDGetTokenT< HBHERecHitCollection > hbheRecHits_
edm::EDGetTokenT< EcalRecHitCollection > endcapEcalHits_
#define DEFINE_FWK_MODULE(type)
std::unique_ptr< ElectronHcalHelper > hcalHelperCone_
math::XYZPoint Calculate_Location(const HitsAndFractions &iDetIds, const edm::SortedCollection< HitType > *iRecHits, const CaloSubdetectorGeometry *iSubGeom, const CaloSubdetectorGeometry *iESGeom=nullptr)
std::unique_ptr< ElectronHcalHelper > hcalHelperBc_
std::array< float, 7 > hcalOverEcal
PhotonProducer(const edm::ParameterSet &ps)
bool getByToken(EDGetToken token, Handle< PROD > &result) const
std::string candidateP4type_
double hcalESum(const reco::SuperCluster &, int depth) const
XYZPointD XYZPoint
point in space with cartesian internal representation
void produce(edm::Event &evt, const edm::EventSetup &es) override
std::string PhotonCollection_
XYZVectorD XYZVector
spatial vector with cartesian internal representation
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
std::vector< double > preselCutValuesEndcap_
Log< level::Error, false > LogError
void fillPhotonCollection(edm::Event &evt, edm::EventSetup const &es, const edm::Handle< reco::PhotonCoreCollection > &photonCoreHandle, const CaloTopology *topology, const EcalRecHitCollection *ecalBarrelHits, const EcalRecHitCollection *ecalEndcapHits, ElectronHcalHelper const &hcalHelperCone, ElectronHcalHelper const &hcalHelperBc, reco::VertexCollection &pvVertices, reco::PhotonCollection &outputCollection, int &iSC, const EcalSeverityLevelAlgo *sevLv)
isolationSumsCalculatorSet
std::vector< int > severitiesexclEE_
PhotonIsolationCalculator photonIsolationCalculator_
void init(const edm::EventSetup &theEventSetup)
edm::EDGetTokenT< reco::VertexCollection > vertexProducer_
std::vector< CaloTowerDetId > hcalTowersBehindClusters
std::array< float, 7 > hcalOverEcalBc
EgammaHcalIsolation::arrayHB eThresHB
void calculate(edm::Event &evt, reco::Photon &, int subdet, const reco::VertexCollection &vtxcol, const edm::EventSetup &iSetup)
PositionCalc posCalculator_
void calculate(const reco::Photon *, const edm::Event &, const edm::EventSetup &es, reco::Photon::FiducialFlags &phofid, reco::Photon::IsolationVariables &phoisolR03, reco::Photon::IsolationVariables &phoisolR04) const
std::vector< Photon > PhotonCollection
collectin of Photon objects
std::vector< int > severitiesexclEB_
edm::EDGetTokenT< EcalRecHitCollection > barrelEcalHits_
PhotonMIPHaloTagger photonMIPHaloTagger_
std::vector< int > flagsexclEB_
EgammaHcalIsolation::arrayHE eThresHE
std::array< double, 7 > arrayHE