|
|
Go to the documentation of this file.
134 const std::vector<std::string> flagnamesEB =
135 config.getParameter<std::vector<std::string> >(
"RecHitFlagToBeExcludedEB");
137 const std::vector<std::string> flagnamesEE =
138 config.getParameter<std::vector<std::string> >(
"RecHitFlagToBeExcludedEE");
140 flagsexclEB_ = StringToEnumValue<EcalRecHit::Flags>(flagnamesEB);
142 flagsexclEE_ = StringToEnumValue<EcalRecHit::Flags>(flagnamesEE);
144 const std::vector<std::string> severitynamesEB =
145 config.getParameter<std::vector<std::string> >(
"RecHitSeverityToBeExcludedEB");
147 severitiesexclEB_ = StringToEnumValue<EcalSeverityLevel::SeverityLevel>(severitynamesEB);
149 const std::vector<std::string> severitynamesEE =
150 config.getParameter<std::vector<std::string> >(
"RecHitSeverityToBeExcludedEE");
152 severitiesexclEE_ = StringToEnumValue<EcalSeverityLevel::SeverityLevel>(severitynamesEE);
209 auto outputPhotonCollection_p = std::make_unique<reco::PhotonCollection>();
212 bool validPhotonCoreHandle =
true;
215 if (!photonCoreHandle.
isValid()) {
216 edm::LogError(
"PhotonProducer") <<
"Error! Can't get the photonCoreProducer";
217 validPhotonCoreHandle =
false;
221 bool validEcalRecHits =
true;
225 if (!barrelHitHandle.
isValid()) {
226 edm::LogError(
"PhotonProducer") <<
"Error! Can't get the barrelEcalHits";
227 validEcalRecHits =
false;
229 if (validEcalRecHits)
235 if (!endcapHitHandle.
isValid()) {
236 edm::LogError(
"PhotonProducer") <<
"Error! Can't get the endcapEcalHits";
237 validEcalRecHits =
false;
239 if (validEcalRecHits)
258 bool validVertex =
true;
262 edm::LogWarning(
"PhotonProducer") <<
"Error! Can't get the product primary Vertex Collection "
272 if (validPhotonCoreHandle)
286 edm::LogInfo(
"PhotonProducer") <<
" Put in the event " << iSC <<
" Photon Candidates \n";
310 std::vector<double> preselCutValues;
315 std::vector<int> flags_, severitiesexcl_;
317 for (
unsigned int lSC = 0; lSC < photonCoreHandle->size(); lSC++) {
322 int subdet = scRef->seed()->hitsAndFractions()[0].first.subdetId();
328 hits = ecalBarrelHits;
334 hits = ecalEndcapHits;
338 edm::LogWarning(
"") <<
"PhotonProducer: do not know if it is a barrel or endcap SuperCluster";
344 if (scRef->energy() / cosh(scRef->eta()) <= preselCutValues[0])
350 double HoE1 = towerIso1.
getTowerESum(&(*scRef)) / scRef->energy();
351 double HoE2 = towerIso2.
getTowerESum(&(*scRef)) / scRef->energy();
368 float e2x5 = EcalClusterTools::e2x5Max(*(scRef->seed()), &(*
hits), &(*topology));
369 float e3x3 = EcalClusterTools::e3x3(*(scRef->seed()), &(*
hits), &(*topology));
370 float e5x5 = EcalClusterTools::e5x5(*(scRef->seed()), &(*
hits), &(*topology));
371 const auto& cov = EcalClusterTools::covariances(*(scRef->seed()), &(*
hits), &(*topology),
geometry);
372 const auto& locCov = EcalClusterTools::localCovariances(*(scRef->seed()), &(*
hits), &(*topology));
375 float sigmaIetaIeta =
sqrt(locCov[0]);
376 float r9 = e3x3 / (scRef->rawEnergy());
388 float full5x5_sigmaEtaEta =
sqrt(full5x5_cov[0]);
394 caloPosition = unconvPos;
396 caloPosition = scRef->position();
416 newCandidate.setFiducialVolumeFlags(fiducialFlags);
417 newCandidate.setIsolationVariables(isolVarR04, isolVarR03);
423 showerShape.
e3x3 = e3x3;
424 showerShape.
e5x5 = e5x5;
433 newCandidate.setShowerShapeVariables(showerShape);
437 full5x5_showerShape.
e1x5 = full5x5_e1x5;
438 full5x5_showerShape.
e2x5 = full5x5_e2x5;
439 full5x5_showerShape.
e3x3 = full5x5_e3x3;
440 full5x5_showerShape.
e5x5 = full5x5_e5x5;
442 full5x5_showerShape.
sigmaEtaEta = full5x5_sigmaEtaEta;
444 newCandidate.full5x5_setShowerShapeVariables(full5x5_showerShape);
462 newCandidate.setMIPVariables(mipVar);
466 bool isLooseEM =
true;
467 if (newCandidate.pt() <
highEt_) {
468 if (newCandidate.hadronicOverEm() >= preselCutValues[1])
470 if (newCandidate.ecalRecHitSumEtConeDR04() > preselCutValues[2] + preselCutValues[3] * newCandidate.pt())
472 if (newCandidate.hcalTowerSumEtConeDR04() > preselCutValues[4] + preselCutValues[5] * newCandidate.pt())
474 if (newCandidate.nTrkSolidConeDR04() >
int(preselCutValues[6]))
476 if (newCandidate.nTrkHollowConeDR04() >
int(preselCutValues[7]))
478 if (newCandidate.trkSumPtSolidConeDR04() > preselCutValues[8])
480 if (newCandidate.trkSumPtHollowConeDR04() > preselCutValues[9])
482 if (newCandidate.sigmaIetaIeta() > preselCutValues[10])
T const * product() const
float hcalDepth2OverEcalBc
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)
edm::EDGetTokenT< CaloTowerCollection > hcalTowers_
std::vector< int > flagsexclEE_
T const * product() const
edm::EDGetTokenT< reco::PhotonCoreCollection > photonCoreProducer_
void fillPhotonCollection(edm::Event &evt, edm::EventSetup const &es, const edm::Handle< reco::PhotonCoreCollection > &photonCoreHandle, const CaloTopology *topology, const EcalRecHitCollection *ecalBarrelHits, const EcalRecHitCollection *ecalEndcapHits, CaloTowerCollection const &hcalTowers, reco::VertexCollection &pvVertices, reco::PhotonCollection &outputCollection, int &iSC, const EcalSeverityLevelAlgo *sevLv)
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
double depth2HcalESum(std::vector< CaloTowerDetId > const &towers, CaloTowerCollection const &)
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< EcalRecHitCollection > endcapEcalHits_
double getTowerESum(const reco::Candidate *cand, const std::vector< CaloTowerDetId > *detIdToExclude=nullptr) const
#define DEFINE_FWK_MODULE(type)
math::XYZPoint Calculate_Location(const HitsAndFractions &iDetIds, const edm::SortedCollection< HitType > *iRecHits, const CaloSubdetectorGeometry *iSubGeom, const CaloSubdetectorGeometry *iESGeom=nullptr)
PhotonProducer(const edm::ParameterSet &ps)
bool getByToken(EDGetToken token, Handle< PROD > &result) const
float hcalDepth1OverEcalBc
std::string candidateP4type_
std::vector< CaloTowerDetId > towersOf(reco::SuperCluster const &sc, CaloTowerConstituentsMap const &towerMap, HoeMode mode=HoeMode::SingleTower)
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
isolationSumsCalculatorSet
std::vector< int > severitiesexclEE_
PhotonIsolationCalculator photonIsolationCalculator_
void init(const edm::EventSetup &theEventSetup)
edm::EDGetTokenT< reco::VertexCollection > vertexProducer_
std::vector< CaloTowerDetId > hcalTowersBehindClusters
void calculate(edm::Event &evt, reco::Photon &, int subdet, const reco::VertexCollection &vtxcol, const edm::EventSetup &iSetup)
double depth1HcalESum(std::vector< CaloTowerDetId > const &towers, CaloTowerCollection const &)
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_
bool get(ProductID const &oid, Handle< PROD > &result) const