613 LogInfo(
fName_) <<
"PhotonAnalyzer Analyzing event number: " << e.
id() <<
" Global Counter " <<
nEvt_ <<
"\n";
616 bool validTriggerEvent=
true;
620 if(!triggerEventHandle.
isValid()) {
622 validTriggerEvent=
false;
630 if ( !photonHandle.
isValid()) {
641 if ( !loosePhotonFlag.
isValid()) {
651 if ( !tightPhotonFlag.
isValid()) {
676 int nConv[100][3][3];
689 for(uint filterIndex=0;filterIndex<triggerEvent.sizeFilters();++filterIndex){
690 string label = triggerEvent.filterTag(filterIndex).label();
691 if(label.find(
"Photon" ) != string::npos ) {
692 for(uint filterKeyIndex=0;filterKeyIndex<triggerEvent.filterKeys(filterIndex).size();++filterKeyIndex){
693 Keys.push_back(triggerEvent.filterKeys(filterIndex)[filterKeyIndex]);
700 sort(Keys.begin(),Keys.end());
701 for ( uint
i=0 ;
i<Keys.size() ; )
703 if (
i!=(Keys.size()-1))
705 if (Keys[
i]==Keys[
i+1]) Keys.erase(Keys.begin()+
i+1) ;
716 for(
unsigned int iPho=0; iPho < photonHandle->size(); iPho++) {
729 for (vector<int>::const_iterator objectKey=Keys.begin();objectKey!=Keys.end();objectKey++){
732 if(deltaR < deltaRMin) deltaRMin =
deltaR;
736 if(deltaRMin > deltaRMax) {
740 if(deltaRMin <= deltaRMax) {
746 bool isLoosePhoton(
false), isTightPhoton(
false);
750 bool phoIsInBarrel=
false;
751 bool phoIsInEndcap=
false;
753 if ( fabs(etaPho) < 1.479 )
760 if ( phoIsInBarrel ) part = 1;
761 if ( phoIsInEndcap ) part = 2;
764 bool isIsolated=
false;
769 if ( isIsolated ) type=1;
773 bool validEcalRecHits=
true;
776 if ( phoIsInBarrel ) {
779 if (!ecalRecHitHandle.
isValid()) {
781 validEcalRecHits=
false;
784 else if ( phoIsInEndcap ) {
787 if (!ecalRecHitHandle.
isValid()) {
789 validEcalRecHits=
false;
792 if (validEcalRecHits) ecalRecHitCollection = *(ecalRecHitHandle.
product());
807 double Et = aPho->
et();
808 bool passesCuts =
false;
951 bool atLeastOneDeadChannel=
false;
953 for(vector< pair<DetId, float> >::const_iterator rhIt = (*bcIt)->hitsAndFractions().begin();rhIt != (*bcIt)->hitsAndFractions().end(); ++rhIt) {
956 if (rhIt->first == (*it).id() ) {
957 if ( (*it).recoFlag() == 9 ) {
958 atLeastOneDeadChannel=
true;
965 if ( atLeastOneDeadChannel ) {
982 for (
unsigned int iConv=0; iConv<conversions.
size(); iConv++) {
986 if ( aConv->nTracks() <2 )
continue;
991 if ( !(aConv->conversionVertex().isValid()) )
continue;
993 float chi2Prob =
ChiSquaredProbability( aConv->conversionVertex().chi2(), aConv->conversionVertex().ndof() );
995 if(chi2Prob<0.0005)
continue;
1003 if (
cut==0 && isLoosePhoton){
1007 if (
cut==0 && isTightPhoton){
1020 double convR=
sqrt(aConv->conversionVertex().position().perp2());
1021 double scalar = aConv->conversionVertex().position().x()*aConv->refittedPairMomentum().x() + aConv->conversionVertex().position().y()*aConv->refittedPairMomentum().y();
1022 if ( scalar < 0 ) convR= -convR;
1028 if( fabs(aPho->
eta()) > 1.5){
1031 else if(fabs(aPho->
eta()) < 1){
1037 const std::vector<edm::RefToBase<reco::Track> >
tracks = aConv->tracks();
1040 for (
unsigned int i=0;
i<tracks.size();
i++) {
1049 float DPhiTracksAtVtx = -99;
1050 float dPhiTracksAtEcal= -99;
1051 float dEtaTracksAtEcal= -99;
1053 float phiTk1= aConv->tracksPin()[0].phi();
1054 float phiTk2= aConv->tracksPin()[1].phi();
1055 DPhiTracksAtVtx = phiTk1-phiTk2;
1058 if (aConv->bcMatchingWithTracks().size() > 0 && aConv->bcMatchingWithTracks()[0].
isNonnull() && aConv->bcMatchingWithTracks()[1].
isNonnull() ) {
1059 float recoPhi1 = aConv->ecalImpactPosition()[0].phi();
1060 float recoPhi2 = aConv->ecalImpactPosition()[1].phi();
1061 float recoEta1 = aConv->ecalImpactPosition()[0].eta();
1062 float recoEta2 = aConv->ecalImpactPosition()[1].eta();
1067 dPhiTracksAtEcal = recoPhi1 -recoPhi2;
1069 dEtaTracksAtEcal = recoEta1 -recoEta2;
1085 for(
unsigned int iPho2=iPho+1; iPho2 < photonHandle->size(); iPho2++) {
1093 bool isTightPhoton2(
false), isLoosePhoton2(
false);
1101 bool isIsolated2=
false;
1111 float gamgamMass2 = p12.Dot(p12);
1118 if(conversions.
size()!=0 && 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_
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.
reco::SuperClusterRef superCluster() const
Ref to SuperCluster.
edm::EDGetTokenT< edm::ValueMap< bool > > PhotonIDLoose_token_
float neutralHadronIso() const
std::vector< std::vector< MonitorElement * > > p_sigmaIetaIetaVsEta_
virtual double eta() const final
momentum pseudorapidity
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)
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_
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_
virtual double phi() const final
momentum azimuthal angle
std::vector< std::vector< MonitorElement * > > h_r1x5VsEt_
XYZTLorentzVectorD XYZTLorentzVector
Lorentz vector with cylindrical internal representation using pseudorapidity.
MonitorElement * h_invMassZeroWithTracks_
virtual double et() const final
transverse energy
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_
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_
virtual 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_
auto deltaR(const T1 &t1, const T2 &t2) -> decltype(t1.eta())
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_
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_
const_iterator end() const
double deltaR(double eta1, double eta2, double phi1, double phi2)
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_
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_
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