614 LogInfo(
fName_) <<
"PhotonAnalyzer Analyzing event number: " << e.
id() <<
" Global Counter " <<
nEvt_ <<
"\n";
617 bool validTriggerEvent=
true;
621 if(!triggerEventHandle.
isValid()) {
623 validTriggerEvent=
false;
631 if ( !photonHandle.
isValid()) {
642 if ( !loosePhotonFlag.
isValid()) {
652 if ( !tightPhotonFlag.
isValid()) {
677 int nConv[100][3][3];
690 for(
uint filterIndex=0;filterIndex<triggerEvent.sizeFilters();++filterIndex){
691 string label = triggerEvent.filterTag(filterIndex).label();
692 if(label.find(
"Photon" ) != string::npos ) {
693 for(
uint filterKeyIndex=0;filterKeyIndex<triggerEvent.filterKeys(filterIndex).size();++filterKeyIndex){
694 Keys.push_back(triggerEvent.filterKeys(filterIndex)[filterKeyIndex]);
701 sort(Keys.begin(),Keys.end());
702 for (
uint i=0 ;
i<Keys.size() ; )
704 if (
i!=(Keys.size()-1))
706 if (Keys[
i]==Keys[
i+1]) Keys.erase(Keys.begin()+
i+1) ;
717 for(
unsigned int iPho=0; iPho < photonHandle->size(); iPho++) {
730 for (vector<int>::const_iterator objectKey=Keys.begin();objectKey!=Keys.end();objectKey++){
733 if(deltaR < deltaRMin) deltaRMin =
deltaR;
737 if(deltaRMin > deltaRMax) {
741 if(deltaRMin <= deltaRMax) {
747 bool isLoosePhoton(
false), isTightPhoton(
false);
751 bool phoIsInBarrel=
false;
752 bool phoIsInEndcap=
false;
754 if ( fabs(etaPho) < 1.479 )
761 if ( phoIsInBarrel ) part = 1;
762 if ( phoIsInEndcap ) part = 2;
765 bool isIsolated=
false;
771 if ( isIsolated ) type=1;
775 bool validEcalRecHits=
true;
778 if ( phoIsInBarrel ) {
781 if (!ecalRecHitHandle.
isValid()) {
783 validEcalRecHits=
false;
786 else if ( phoIsInEndcap ) {
789 if (!ecalRecHitHandle.
isValid()) {
791 validEcalRecHits=
false;
794 if (validEcalRecHits) ecalRecHitCollection = *(ecalRecHitHandle.
product());
809 double Et = aPho->
et();
810 bool passesCuts =
false;
953 bool atLeastOneDeadChannel=
false;
955 for(vector< pair<DetId, float> >::const_iterator rhIt = (*bcIt)->hitsAndFractions().begin();rhIt != (*bcIt)->hitsAndFractions().end(); ++rhIt) {
958 if (rhIt->first == (*it).id() ) {
959 if ( (*it).recoFlag() == 9 ) {
960 atLeastOneDeadChannel=
true;
967 if ( atLeastOneDeadChannel ) {
984 for (
unsigned int iConv=0; iConv<conversions.
size(); iConv++) {
988 if ( aConv->nTracks() <2 )
continue;
993 if ( !(aConv->conversionVertex().isValid()) )
continue;
995 float chi2Prob =
ChiSquaredProbability( aConv->conversionVertex().chi2(), aConv->conversionVertex().ndof() );
997 if(chi2Prob<0.0005)
continue;
1005 if (
cut==0 && isLoosePhoton){
1009 if (
cut==0 && isTightPhoton){
1022 double convR=
sqrt(aConv->conversionVertex().position().perp2());
1023 double scalar = aConv->conversionVertex().position().x()*aConv->refittedPairMomentum().x() + aConv->conversionVertex().position().y()*aConv->refittedPairMomentum().y();
1024 if ( scalar < 0 ) convR= -convR;
1030 if( fabs(aPho->
eta()) > 1.5){
1033 else if(fabs(aPho->
eta()) < 1){
1039 const std::vector<edm::RefToBase<reco::Track> >
tracks = aConv->tracks();
1042 for (
unsigned int i=0;
i<tracks.size();
i++) {
1051 float DPhiTracksAtVtx = -99;
1052 float dPhiTracksAtEcal= -99;
1053 float dEtaTracksAtEcal= -99;
1055 float phiTk1= aConv->tracksPin()[0].phi();
1056 float phiTk2= aConv->tracksPin()[1].phi();
1057 DPhiTracksAtVtx = phiTk1-phiTk2;
1060 if (!aConv->bcMatchingWithTracks().empty() && aConv->bcMatchingWithTracks()[0].
isNonnull() && aConv->bcMatchingWithTracks()[1].
isNonnull() ) {
1061 float recoPhi1 = aConv->ecalImpactPosition()[0].phi();
1062 float recoPhi2 = aConv->ecalImpactPosition()[1].phi();
1063 float recoEta1 = aConv->ecalImpactPosition()[0].eta();
1064 float recoEta2 = aConv->ecalImpactPosition()[1].eta();
1069 dPhiTracksAtEcal = recoPhi1 -recoPhi2;
1071 dEtaTracksAtEcal = recoEta1 -recoEta2;
1087 for(
unsigned int iPho2=iPho+1; iPho2 < photonHandle->size(); iPho2++) {
1095 bool isTightPhoton2(
false), isLoosePhoton2(
false);
1103 bool isIsolated2=
false;
1114 float gamgamMass2 = p12.Dot(p12);
1122 if(!conversions.
empty() && conversions[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_
std::vector< std::vector< std::vector< MonitorElement * > > > h_phoEt_
float hcalTowerSumEtConeDR04() const
Hcal isolation sum.
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_
bool isNonnull() const
Checks for non-null.
std::vector< std::vector< MonitorElement * > > p_trackPtSumSolidVsEta_
double eta() const final
momentum pseudorapidity
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::SortedCollection< EcalRecHit, edm::StrictWeakOrdering< EcalRecHit > > > barrelRecHit_token_
float chargedHadronIso() const
Accessors for Particle Flow Isolation variables.
edm::EDGetTokenT< edm::ValueMap< bool > > PhotonIDLoose_token_
float neutralHadronIso() const
std::vector< std::vector< MonitorElement * > > p_sigmaIetaIetaVsEta_
bool getByToken(EDGetToken token, Handle< PROD > &result) const
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_
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_
float trkSumPtSolidConeDR04() const
std::vector< std::vector< MonitorElement * > > h_nHadIsoBarrel_
std::vector< std::vector< MonitorElement * > > h_phoEta_
std::vector< EcalRecHit >::const_iterator const_iterator
float e1x5() const
Shower shape variables.
std::vector< std::vector< MonitorElement * > > h_chHadIsoEndcap_
std::vector< std::vector< MonitorElement * > > h_hcalSumEBarrel_
std::vector< std::vector< std::vector< MonitorElement * > > > h_phoConvPhiForEfficiency_
std::vector< std::vector< MonitorElement * > > p_r1x5VsEt_
float ecalRecHitSumEtConeDR04() const
std::vector< std::vector< MonitorElement * > > h_nTrackIsolHollow_
MonitorElement * h_phoEta_preHLT_
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_
std::vector< std::vector< std::vector< MonitorElement * > > > h_pOverETracks_
void fill3DHistoVector(std::vector< std::vector< std::vector< MonitorElement * > > > &histoVector, double x, int cut, int type, int part)
reco::SuperClusterRef superCluster() const override
Ref to SuperCluster.
std::vector< std::vector< std::vector< MonitorElement * > > > h_phoConvR9_
bool empty() const
Is the RefVector empty.
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_
float hadronicDepth2OverEm() const
the hadronic release in depth2 over electromagnetic fraction
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_
std::vector< std::vector< MonitorElement * > > h_r1x5VsEt_
XYZTLorentzVectorD XYZTLorentzVector
Lorentz vector with cylindrical internal representation using pseudorapidity.
MonitorElement * h_invMassZeroWithTracks_
std::vector< std::vector< std::vector< MonitorElement * > > > h_phoConvE_
void fill2DHistoVector(std::vector< std::vector< MonitorElement * > > &histoVector, double x, int cut, int type)
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_
std::vector< std::vector< std::vector< MonitorElement * > > > h_phoConvEt_
std::vector< std::vector< MonitorElement * > > p_nHitsVsEta_
double et() const final
transverse energy
reco::ConversionRefVector conversions() const
vector of references to Conversion's
unsigned int prescaleFactor_
void Fill(HcalDetId &id, double val, std::vector< TH2F > &depth)
std::vector< std::string > types_
std::vector< std::vector< std::vector< MonitorElement * > > > h_h1OverE_
std::vector< std::vector< MonitorElement * > > p_r1x5VsEta_
float sigmaIetaIeta() const
std::vector< std::vector< MonitorElement * > > p_hOverEVsEt_
double energy() const final
energy
std::vector< std::vector< std::vector< MonitorElement * > > > h_dPhiTracksAtVtx_
std::vector< std::vector< MonitorElement * > > h_phoIsoEndcap_
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_
edm::EDGetTokenT< edm::SortedCollection< EcalRecHit, edm::StrictWeakOrdering< EcalRecHit > > > endcapRecHit_token_
std::vector< std::vector< MonitorElement * > > h_e2x5VsEt_
int nTrkHollowConeDR04() const
std::vector< std::vector< MonitorElement * > > h_phoPhi_BadChannels_
MonitorElement * h_invMassPhotonsEEndcapEBarrel_
std::vector< std::vector< MonitorElement * > > p_nTrackIsolSolidVsEta_
float hadronicOverEm() const
the total hadronic over electromagnetic fraction
float phiNormalization(float &a)
MonitorElement * h_phoEta_Tight_
std::vector< std::vector< MonitorElement * > > h_nTrackIsolSolidVsEt_
float getCorrectedEnergyError(P4type type) const
std::vector< std::vector< std::vector< MonitorElement * > > > p_phoSigmaEoverEvsNVtx_
P4type getCandidateP4type() const
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_
float hadronicDepth1OverEm() const
the hadronic release in depth1 over electromagnetic fraction
MonitorElement * h_invMassAllPhotons_
std::vector< std::vector< MonitorElement * > > p_nTrackIsolHollowVsEt_
bool hasConversionTracks() const
Bool flagging photons with a vector of refereces to conversions with size >0.
std::vector< std::vector< MonitorElement * > > h_trackPtSumHollowVsEt_
std::vector< std::vector< MonitorElement * > > h_nTrackIsolSolidVsEta_
edm::EDGetTokenT< trigger::TriggerEvent > triggerEvent_token_
std::vector< std::vector< std::vector< MonitorElement * > > > h_scPhi_
bool photonSelectionSlimmed(const reco::Photon *p)
T const * product() const
std::vector< std::vector< MonitorElement * > > p_e1x5VsEt_
std::vector< size_type > Keys
std::vector< Photon > PhotonCollection
collectin of Photon objects
MonitorElement * h_invMassPhotonsEEndcap_
int nTrkSolidConeDR04() const
std::vector< std::vector< MonitorElement * > > p_nTrackIsolHollowVsEta_
const LorentzVector & p4(P4type type) const
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_
float trkSumPtHollowConeDR04() const
std::vector< std::vector< MonitorElement * > > p_trackPtSumSolidVsEt_
std::vector< std::vector< MonitorElement * > > p_ecalSumVsEta_
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_
std::vector< std::vector< MonitorElement * > > h_hcalSumVsEt_
std::vector< std::vector< MonitorElement * > > p_trackPtSumHollowVsEt_
MonitorElement * h_phoEta_postHLT_
size_type size() const
Size of the RefVector.
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_
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_
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_
const_iterator begin() const
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 .
std::vector< std::vector< MonitorElement * > > p_tkChi2VsEta_
float maxEnergyXtal() const