get ecal photon specific corrected energy plus values from regressions and store them in the Photon
279 std::vector<double> preselCutValues;
284 std::vector<int> flags_, severitiesexcl_;
286 for(
unsigned int lSC=0; lSC < photonCoreHandle->size(); lSC++) {
293 int subdet = scRef->seed()->hitsAndFractions()[0].first.subdetId();
299 hits = ecalBarrelHits;
305 hits = ecalEndcapHits;
309 edm::LogWarning(
"")<<
"PhotonProducer: do not know if it is a barrel or endcap SuperCluster";
311 if(hits ==
nullptr)
continue;
314 if (scRef->energy()/cosh(scRef->eta()) <= preselCutValues[0] )
continue;
320 double HoE1=towerIso1.getTowerESum(&(*scRef))/scRef->energy();
321 double HoE2=towerIso2.getTowerESum(&(*scRef))/scRef->energy();
324 towerIsoBehindClus.setTowerCollection(hcalTowersHandle.
product());
325 std::vector<CaloTowerDetId> TowersBehindClus = towerIsoBehindClus.towersOf(*scRef);
326 float hcalDepth1OverEcalBc = towerIsoBehindClus.getDepth1HcalESum(TowersBehindClus)/scRef->energy();
327 float hcalDepth2OverEcalBc = towerIsoBehindClus.getDepth2HcalESum(TowersBehindClus)/scRef->energy();
339 float e1x5 = EcalClusterTools::e1x5( *(scRef->seed()), &(*hits), &(*topology));
340 float e2x5 = EcalClusterTools::e2x5Max( *(scRef->seed()), &(*hits), &(*topology));
341 float e3x3 = EcalClusterTools::e3x3( *(scRef->seed()), &(*hits), &(*topology));
342 float e5x5 = EcalClusterTools::e5x5( *(scRef->seed()), &(*hits), &(*topology));
343 std::vector<float> cov = EcalClusterTools::covariances( *(scRef->seed()), &(*hits), &(*topology),
geometry);
344 std::vector<float> locCov = EcalClusterTools::localCovariances( *(scRef->seed()), &(*hits), &(*topology));
347 float sigmaIetaIeta =
sqrt(locCov[0]);
348 float r9 =e3x3/(scRef->rawEnergy());
360 float full5x5_sigmaEtaEta =
sqrt(full5x5_cov[0]);
366 caloPosition = unconvPos;
368 caloPosition = scRef->position();
372 double photonEnergy=1.;
390 newCandidate.setFiducialVolumeFlags( fiducialFlags );
391 newCandidate.setIsolationVariables(isolVarR04, isolVarR03 );
396 showerShape.
e1x5= e1x5;
397 showerShape.
e2x5= e2x5;
398 showerShape.
e3x3= e3x3;
399 showerShape.
e5x5= e5x5;
408 newCandidate.setShowerShapeVariables ( showerShape );
412 full5x5_showerShape.
e1x5= full5x5_e1x5;
413 full5x5_showerShape.
e2x5= full5x5_e2x5;
414 full5x5_showerShape.
e3x3= full5x5_e3x3;
415 full5x5_showerShape.
e5x5= full5x5_e5x5;
417 full5x5_showerShape.
sigmaEtaEta = full5x5_sigmaEtaEta;
419 newCandidate.full5x5_setShowerShapeVariables ( full5x5_showerShape );
446 newCandidate.setMIPVariables(mipVar);
453 if ( newCandidate.pt() <
highEt_) {
454 if ( newCandidate.hadronicOverEm() >= preselCutValues[1] ) isLooseEM=
false;
455 if ( newCandidate.ecalRecHitSumEtConeDR04() > preselCutValues[2]+ preselCutValues[3]*newCandidate.pt() ) isLooseEM=
false;
456 if ( newCandidate.hcalTowerSumEtConeDR04() > preselCutValues[4]+ preselCutValues[5]*newCandidate.pt() ) isLooseEM=
false;
457 if ( newCandidate.nTrkSolidConeDR04() >
int(preselCutValues[6]) ) isLooseEM=
false;
458 if ( newCandidate.nTrkHollowConeDR04() >
int(preselCutValues[7]) ) isLooseEM=
false;
459 if ( newCandidate.trkSumPtSolidConeDR04() > preselCutValues[8] ) isLooseEM=
false;
460 if ( newCandidate.trkSumPtHollowConeDR04() > preselCutValues[9] ) isLooseEM=
false;
461 if ( newCandidate.sigmaIetaIeta() > preselCutValues[10] ) isLooseEM=
false;
const CaloSubdetectorGeometry * getSubdetectorGeometry(const DetId &id) const
access the subdetector geometry for the given subdetector directly
std::vector< double > preselCutValuesEndcap_
std::vector< CaloTowerDetId > hcalTowersBehindClusters
ROOT::Math::LorentzVector< ROOT::Math::PxPyPzE4D< double > > XYZTLorentzVectorD
Lorentz vector with cylindrical internal representation using pseudorapidity.
float hcalDepth2OverEcalBc
PositionCalc posCalculator_
std::vector< int > flagsexclEB_
std::vector< int > flagsexclEE_
std::string candidateP4type_
std::vector< int > severitiesexclEE_
PhotonIsolationCalculator * thePhotonIsolationCalculator_
std::vector< int > severitiesexclEB_
edm::ESHandle< CaloGeometry > theCaloGeom_
PhotonEnergyCorrector * thePhotonEnergyCorrector_
void calculate(edm::Event &evt, reco::Photon &, int subdet, const reco::VertexCollection &vtxcol, const edm::EventSetup &iSetup)
float hcalDepth1OverEcalBc
T const * product() const
XYZVectorD XYZVector
spatial vector with cartesian internal representation
XYZPointD XYZPoint
point in space with cartesian internal representation
std::vector< double > preselCutValuesBarrel_
ESHandle< TrackerGeometry > geometry
math::XYZPoint Calculate_Location(const HitsAndFractions &iDetIds, const edm::SortedCollection< HitType > *iRecHits, const CaloSubdetectorGeometry *iSubGeom, const CaloSubdetectorGeometry *iESGeom=0)
PhotonMIPHaloTagger * thePhotonMIPHaloTagger_
T const * product() const