1416 using namespace edm;
1421 LogInfo(
fName_) <<
"PhotonAnalyzer Analyzing event number: " <<
e.id() <<
" Global Counter " <<
nEvt_ <<
"\n";
1424 bool validTriggerEvent =
true;
1428 if (!triggerEventHandle.
isValid()) {
1430 validTriggerEvent =
false;
1438 if (!photonHandle.
isValid()) {
1448 if (!loosePhotonFlag.
isValid()) {
1449 edm::LogInfo(
fName_) <<
"Error! Can't get the product: PhotonIDLoose_token_" << endl;
1458 if (!tightPhotonFlag.
isValid()) {
1459 edm::LogInfo(
fName_) <<
"Error! Can't get the product: PhotonIDTight_token_" << endl;
1472 int nPho[100][3][3];
1482 int nConv[100][3][3];
1498 if (
label.find(
"Photon") != string::npos) {
1499 for (
uint filterKeyIndex = 0; filterKeyIndex <
triggerEvent.filterKeys(filterIndex).size();
1511 if (
i != (
Keys.size() - 1)) {
1525 for (
unsigned int iPho = 0; iPho < photonHandle->size(); iPho++) {
1560 bool isLoosePhoton(
false), isTightPhoton(
false);
1562 isLoosePhoton =
true;
1565 bool phoIsInBarrel =
false;
1566 bool phoIsInEndcap =
false;
1568 if (fabs(etaPho) < 1.479)
1569 phoIsInBarrel =
true;
1571 phoIsInEndcap =
true;
1581 bool isIsolated =
false;
1583 isIsolated = isLoosePhoton;
1585 isIsolated = isTightPhoton;
1596 bool validEcalRecHits =
true;
1599 if (phoIsInBarrel) {
1602 if (!ecalRecHitHandle.
isValid()) {
1604 validEcalRecHits =
false;
1606 }
else if (phoIsInEndcap) {
1609 if (!ecalRecHitHandle.
isValid()) {
1611 validEcalRecHits =
false;
1614 if (validEcalRecHits)
1615 ecalRecHitCollection = *(ecalRecHitHandle.
product());
1620 if (isLoosePhoton) {
1624 if (isTightPhoton) {
1630 double Et = aPho->
et();
1631 bool passesCuts =
false;
1748 float(vtxH->size()),
1815 bool atLeastOneDeadChannel =
false;
1819 for (
vector<pair<DetId, float> >::const_iterator rhIt = (*bcIt)->hitsAndFractions().begin();
1820 rhIt != (*bcIt)->hitsAndFractions().end();
1824 it != ecalRecHitCollection.
end();
1826 if (rhIt->first == (*it).id()) {
1827 if ((*it).recoFlag() == 9) {
1828 atLeastOneDeadChannel =
true;
1835 if (atLeastOneDeadChannel) {
1852 for (
unsigned int iConv = 0; iConv <
conversions.size(); iConv++) {
1855 if (aConv->nTracks() < 2)
1862 if (!(aConv->conversionVertex().isValid()))
1865 float chi2Prob =
ChiSquaredProbability(aConv->conversionVertex().chi2(), aConv->conversionVertex().ndof());
1867 if (chi2Prob < 0.0005)
1876 if (
cut == 0 && isLoosePhoton) {
1880 if (
cut == 0 && isTightPhoton) {
1893 double convR =
sqrt(aConv->conversionVertex().position().perp2());
1894 double scalar = aConv->conversionVertex().position().x() * aConv->refittedPairMomentum().x() +
1895 aConv->conversionVertex().position().y() * aConv->refittedPairMomentum().y();
1900 aConv->conversionVertex().position().z(),
1906 if (fabs(aPho->
eta()) > 1.5) {
1908 }
else if (fabs(aPho->
eta()) < 1) {
1911 aConv->conversionVertex().position().x(),
1912 aConv->conversionVertex().position().y(),
1917 const std::vector<edm::RefToBase<reco::Track> >
tracks = aConv->tracks();
1919 for (
unsigned int i = 0;
i <
tracks.size();
i++) {
1928 float DPhiTracksAtVtx = -99;
1929 float dPhiTracksAtEcal = -99;
1930 float dEtaTracksAtEcal = -99;
1932 float phiTk1 = aConv->tracksPin()[0].phi();
1933 float phiTk2 = aConv->tracksPin()[1].phi();
1934 DPhiTracksAtVtx = phiTk1 - phiTk2;
1937 if (!aConv->bcMatchingWithTracks().empty() && aConv->bcMatchingWithTracks()[0].
isNonnull() &&
1938 aConv->bcMatchingWithTracks()[1].
isNonnull()) {
1939 float recoPhi1 = aConv->ecalImpactPosition()[0].phi();
1940 float recoPhi2 = aConv->ecalImpactPosition()[1].phi();
1941 float recoEta1 = aConv->ecalImpactPosition()[0].eta();
1942 float recoEta2 = aConv->ecalImpactPosition()[1].eta();
1947 dPhiTracksAtEcal = recoPhi1 - recoPhi2;
1949 dEtaTracksAtEcal = recoEta1 - recoEta2;
1965 for (
unsigned int iPho2 = iPho + 1; iPho2 < photonHandle->size(); iPho2++) {
1973 bool isTightPhoton2(
false), isLoosePhoton2(
false);
1975 isLoosePhoton2 =
true;
1982 bool isIsolated2 =
false;
1984 isIsolated2 = isLoosePhoton2;
1986 isIsolated2 = isTightPhoton2;
1995 float gamgamMass2 = p12.Dot(p12);
1998 if (aPho->
isEB() && aPho2->
isEB()) {
2000 }
else if (aPho->
isEE() && aPho2->
isEE()) {
2007 if (!conversions2.
empty() && conversions2[0]->nTracks() >= 2)
2011 }
else if (!conversions2.
empty() && conversions2[0]->nTracks() >= 2)
bool photonSelection(const reco::Photon *p)
std::vector< std::vector< MonitorElement * > > h_sigmaIetaIetaVsEta_
MonitorElement * h_invMassOneWithTracks_
std::vector< std::vector< std::vector< MonitorElement * > > > h_dEtaTracksAtEcal_
void fill3DHistoVector(std::vector< std::vector< std::vector< MonitorElement *> > > &histoVector, double x, int cut, int type, int part)
bool empty() const
Is the RefVector empty.
std::vector< std::vector< std::vector< MonitorElement * > > > h_phoEt_
edm::EDGetTokenT< reco::VertexCollection > offline_pvToken_
MonitorElement * h_phoEt_preHLT_
std::vector< std::vector< MonitorElement * > > h_phoEta_BadChannels_
std::vector< std::vector< MonitorElement * > > p_maxEXtalOver3x3VsEta_
std::vector< std::vector< MonitorElement * > > p_trackPtSumSolidVsEta_
std::vector< std::vector< MonitorElement * > > h_nTrackIsolSolid_
std::vector< std::vector< MonitorElement * > > p_hOverEVsEta_
The single EDProduct to be saved for each event (AOD case)
std::vector< std::vector< MonitorElement * > > p_nTrackIsolSolidVsEt_
std::vector< std::vector< MonitorElement * > > p_r9VsEta_
edm::EDGetTokenT< edm::ValueMap< bool > > PhotonIDLoose_token_
reco::ConversionRefVector conversions() const
vector of references to Conversion's
std::vector< std::vector< MonitorElement * > > p_sigmaIetaIetaVsEta_
std::vector< std::vector< MonitorElement * > > h_e1x5VsEt_
std::vector< std::vector< std::vector< MonitorElement * > > > h_phoE_
MonitorElement * h_phoEta_Vertex_
std::vector< std::vector< MonitorElement * > > p_e2x5VsEta_
float ecalRecHitSumEtConeDR04() const
std::vector< std::vector< MonitorElement * > > p_e1x5VsEta_
std::vector< std::vector< MonitorElement * > > h_convVtxRvsZ_
std::vector< std::vector< MonitorElement * > > p_r2x5VsEt_
std::vector< std::string > parts_
MonitorElement * h_convEta_Loose_
MonitorElement * h_nRecoVtx_
T const * product() const
std::vector< std::vector< MonitorElement * > > h_nHadIsoBarrel_
std::vector< std::vector< MonitorElement * > > h_phoEta_
std::vector< EcalRecHit >::const_iterator const_iterator
std::vector< std::vector< MonitorElement * > > h_chHadIsoEndcap_
std::vector< std::vector< MonitorElement * > > h_hcalSumEBarrel_
std::vector< std::vector< std::vector< MonitorElement * > > > h_phoConvPhiForEfficiency_
bool isNonnull() const
Checks for non-null.
std::vector< std::vector< MonitorElement * > > p_r1x5VsEt_
float e1x5() const
Shower shape variables.
std::vector< std::vector< MonitorElement * > > h_nTrackIsolHollow_
MonitorElement * h_phoEta_preHLT_
float maxEnergyXtal() const
edm::EDGetTokenT< edm::ValueMap< bool > > PhotonIDTight_token_
std::vector< std::vector< MonitorElement * > > h_convVtxZ_
std::vector< std::vector< MonitorElement * > > h_ecalSumVsEta_
std::vector< std::vector< std::vector< MonitorElement * > > > h_dCotTracks_
std::vector< std::vector< MonitorElement * > > h_chHadIsoBarrel_
std::vector< std::vector< std::vector< MonitorElement * > > > h_hOverE_
MonitorElement * h_convEt_Loose_
std::vector< std::vector< std::vector< MonitorElement * > > > h_phoSigmaEoverE_
std::vector< std::vector< MonitorElement * > > h_trackPtSumSolidVsEta_
Log< level::Error, false > LogError
std::vector< std::vector< std::vector< MonitorElement * > > > h_pOverETracks_
std::vector< std::vector< std::vector< MonitorElement * > > > h_phoConvR9_
std::vector< std::vector< MonitorElement * > > h_r9VsEta_
std::vector< std::vector< MonitorElement * > > h_hcalSumEEndcap_
std::vector< std::vector< MonitorElement * > > h_vertexChi2Prob_
MonitorElement * h_phoEt_postHLT_
std::vector< std::vector< MonitorElement * > > h_convVtxZEndcap_
std::vector< std::vector< MonitorElement * > > h_nTrackIsolHollowVsEta_
MonitorElement * h_convEta_Tight_
std::vector< std::vector< MonitorElement * > > h_e2x5VsEta_
std::vector< std::vector< MonitorElement * > > h_ecalSum_
std::vector< std::vector< MonitorElement * > > p_dCotTracksVsEta_
std::vector< std::vector< std::vector< MonitorElement * > > > p_hcalSumVsEt_
std::vector< std::vector< MonitorElement * > > h_scEta_
P4type getCandidateP4type() const
std::vector< std::vector< MonitorElement * > > h_r1x5VsEt_
XYZTLorentzVectorD XYZTLorentzVector
Lorentz vector with cylindrical internal representation using pseudorapidity.
MonitorElement * h_invMassZeroWithTracks_
float trkSumPtSolidConeDR04() const
std::vector< std::vector< std::vector< MonitorElement * > > > h_phoConvE_
std::vector< std::vector< MonitorElement * > > h_convVtxR_
std::vector< std::vector< MonitorElement * > > h_hcalSumVsEta_
std::vector< std::vector< MonitorElement * > > h_maxEXtalOver3x3VsEta_
std::vector< std::vector< MonitorElement * > > h_phoConvEta_
std::vector< std::vector< std::vector< MonitorElement * > > > h_eOverPTracks_
std::vector< std::vector< MonitorElement * > > h_maxEXtalOver3x3VsEt_
MonitorElement * h_phoEt_Tight_
std::vector< std::vector< MonitorElement * > > h_hcalSum_
MonitorElement * h_invMassPhotonsEBarrel_
std::vector< std::vector< MonitorElement * > > p_hcalSumVsEta_
std::vector< std::vector< MonitorElement * > > h_r1x5VsEta_
reco::SuperClusterRef superCluster() const override
Ref to SuperCluster.
float hcalTowerSumEtConeDR04(int depth=0) const
std::vector< std::vector< std::vector< MonitorElement * > > > h_phoConvEt_
std::vector< std::vector< MonitorElement * > > p_nHitsVsEta_
float sigmaIetaIeta() const
unsigned int prescaleFactor_
std::vector< std::string > types_
std::vector< std::vector< std::vector< MonitorElement * > > > h_h1OverE_
float chargedHadronIso() const
Accessors for Particle Flow Isolation variables.
std::vector< std::vector< MonitorElement * > > p_r1x5VsEta_
std::vector< std::vector< MonitorElement * > > p_hOverEVsEt_
std::vector< std::vector< std::vector< MonitorElement * > > > h_dPhiTracksAtVtx_
edm::EDGetTokenT< edm::SortedCollection< EcalRecHit, edm::StrictWeakOrdering< EcalRecHit > > > barrelRecHit_token_
std::vector< std::vector< MonitorElement * > > h_phoIsoEndcap_
float getCorrectedEnergyError(P4type type) const
edm::EDGetTokenT< edm::SortedCollection< EcalRecHit, edm::StrictWeakOrdering< EcalRecHit > > > endcapRecHit_token_
std::vector< std::vector< MonitorElement * > > p_e2x5VsEt_
std::vector< std::vector< MonitorElement * > > p_maxEXtalOver3x3VsEt_
MonitorElement * h_invMassTwoWithTracks_
std::vector< std::vector< MonitorElement * > > h_nTrackIsolHollowVsEt_
float ChiSquaredProbability(double chiSquared, double nrDOF)
std::vector< std::vector< std::vector< MonitorElement * > > > h_phoSigmaIetaIeta_
std::vector< std::vector< MonitorElement * > > h_e2x5VsEt_
const_iterator begin() const
std::vector< std::vector< MonitorElement * > > h_phoPhi_BadChannels_
MonitorElement * h_invMassPhotonsEEndcapEBarrel_
std::vector< std::vector< MonitorElement * > > p_nTrackIsolSolidVsEta_
float phiNormalization(float &a)
MonitorElement * h_phoEta_Tight_
std::vector< std::vector< MonitorElement * > > h_nTrackIsolSolidVsEt_
std::vector< std::vector< std::vector< MonitorElement * > > > p_phoSigmaEoverEvsNVtx_
MonitorElement * h_phoEt_Loose_
constexpr auto deltaR(const T1 &t1, const T2 &t2) -> decltype(t1.eta())
const_iterator end() const
std::vector< std::vector< std::vector< MonitorElement * > > > p_ecalSumVsEt_
std::vector< std::vector< std::vector< MonitorElement * > > > h_r9_
MonitorElement * h_invMassAllPhotons_
Log< level::Info, false > LogInfo
int nTrkSolidConeDR04() const
std::vector< std::vector< MonitorElement * > > p_nTrackIsolHollowVsEt_
float trkSumPtHollowConeDR04() const
std::vector< std::vector< MonitorElement * > > h_trackPtSumHollowVsEt_
std::vector< std::vector< MonitorElement * > > h_nTrackIsolSolidVsEta_
float hadronicOverEm(int depth=0) const
edm::EDGetTokenT< trigger::TriggerEvent > triggerEvent_token_
std::vector< std::vector< std::vector< MonitorElement * > > > h_scPhi_
bool photonSelectionSlimmed(const reco::Photon *p)
std::vector< std::vector< MonitorElement * > > p_e1x5VsEt_
std::vector< size_type > Keys
std::vector< Photon > PhotonCollection
collectin of Photon objects
bool hasConversionTracks() const
Bool flagging photons with a vector of refereces to conversions with size >0.
MonitorElement * h_invMassPhotonsEEndcap_
std::vector< std::vector< MonitorElement * > > p_nTrackIsolHollowVsEta_
std::vector< std::vector< MonitorElement * > > h_trackPtSumSolidVsEt_
std::vector< std::vector< std::vector< MonitorElement * > > > h_h2OverE_
std::vector< std::vector< MonitorElement * > > p_r2x5VsEta_
std::vector< std::vector< MonitorElement * > > p_r9VsEt_
std::vector< std::vector< MonitorElement * > > h_phoIsoBarrel_
std::vector< std::vector< MonitorElement * > > p_trackPtSumHollowVsEta_
std::vector< std::vector< MonitorElement * > > p_trackPtSumSolidVsEt_
std::vector< std::vector< MonitorElement * > > p_ecalSumVsEta_
double et() const final
transverse energy
std::vector< std::vector< MonitorElement * > > h_tkChi2_
bool useTriggerFiltering_
std::vector< std::vector< MonitorElement * > > h_trackPtSumHollowVsEta_
std::vector< std::vector< MonitorElement * > > h_phoConvEtaForEfficiency_
MonitorElement * h_convEt_Tight_
void fill2DHistoVector(std::vector< std::vector< MonitorElement *> > &histoVector, double x, int cut, int type)
std::vector< std::vector< MonitorElement * > > h_hcalSumVsEt_
std::vector< std::vector< MonitorElement * > > p_trackPtSumHollowVsEt_
MonitorElement * h_phoEta_postHLT_
const LorentzVector & p4(P4type type) const
std::vector< std::vector< MonitorElement * > > h_e1x5VsEta_
MonitorElement * h_phoEta_Loose_
std::vector< std::vector< std::vector< MonitorElement * > > > h_dPhiTracksAtEcal_
std::vector< std::vector< MonitorElement * > > h_trackPtSumSolid_
int nTrkHollowConeDR04() const
std::vector< std::vector< std::vector< MonitorElement * > > > h_nConv_
std::vector< std::vector< MonitorElement * > > h_r2x5VsEt_
edm::EDGetTokenT< std::vector< reco::Photon > > photon_token_
std::vector< std::vector< MonitorElement * > > h_phoEt_BadChannels_
double phi() const final
momentum azimuthal angle
std::vector< std::vector< MonitorElement * > > h_r2x5VsEta_
std::vector< std::vector< MonitorElement * > > h_nHadIsoEndcap_
std::vector< std::vector< std::vector< MonitorElement * > > > h_phoPhi_
std::vector< std::vector< MonitorElement * > > h_convVtxYvsX_
float neutralHadronIso() const
std::vector< std::vector< MonitorElement * > > h_trackPtSumHollow_
std::vector< std::vector< std::vector< MonitorElement * > > > h_nPho_
std::vector< std::vector< MonitorElement * > > h_r9VsEt_
std::vector< std::vector< std::vector< MonitorElement * > > > h_phoConvPhi_
std::vector< std::vector< MonitorElement * > > h_ecalSumVsEt_
std::vector< std::vector< MonitorElement * > > h_ecalSumEEndcap_
std::vector< std::vector< MonitorElement * > > h_ecalSumEBarrel_
double scalar(const CLHEP::HepGenMatrix &m)
Return the matrix as a scalar. Raise an assertion if the matris is not .
double energy() const final
energy
std::vector< std::vector< MonitorElement * > > p_tkChi2VsEta_
double eta() const final
momentum pseudorapidity