613 LogInfo(
fName_) <<
"PhotonAnalyzer Analyzing event number: " << e.
id() <<
" Global Counter " <<
nEvt_ <<
"\n";
616 bool validTriggerEvent=
true;
620 if(!triggerEventHandle.isValid()) {
622 validTriggerEvent=
false;
624 if(validTriggerEvent) triggerEvent = *(triggerEventHandle.product());
631 if ( !photonHandle.isValid()) {
638 bool validloosePhotonID=
true;
642 if ( !loosePhotonFlag.isValid()) {
644 validloosePhotonID=
false;
646 if (validloosePhotonID) loosePhotonID = *(loosePhotonFlag.product());
648 bool validtightPhotonID=
true;
652 if ( !tightPhotonFlag.isValid()) {
654 validtightPhotonID=
false;
656 if (validtightPhotonID) tightPhotonID = *(tightPhotonFlag.product());
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]);
701 for ( uint
i=0 ;
i<
Keys.size() ; )
703 if (
i!=(
Keys.size()-1))
716 for(
unsigned int iPho=0; iPho < photonHandle->size(); iPho++) {
726 double deltaRMin=1000.;
729 for (vector<int>::const_iterator objectKey=
Keys.begin();objectKey!=
Keys.end();objectKey++){
731 deltaR =
reco::deltaR(triggerEvent.getObjects()[(*objectKey)].eta(),triggerEvent.getObjects()[(*objectKey)].phi(),aPho->superCluster()->eta(),aPho->superCluster()->phi());
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;
752 float etaPho = aPho->superCluster()->eta();
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;
952 for(
reco::CaloCluster_iterator bcIt = aPho->superCluster()->clustersBegin();bcIt != aPho->superCluster()->clustersEnd(); ++bcIt) {
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 ) {
972 if(aPho->hasConversionTracks()){
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){
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_
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_
edm::EDGetTokenT< edm::ValueMap< bool > > PhotonIDLoose_token_
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_
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_
std::vector< std::vector< MonitorElement * > > p_r1x5VsEt_
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_
double deltaR(const T1 &t1, const T2 &t2)
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_
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_
bool photonSelection(const reco::PhotonRef &p)
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_
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_
std::vector< std::vector< MonitorElement * > > p_hOverEVsEt_
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_
std::vector< std::vector< MonitorElement * > > h_phoPhi_BadChannels_
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_
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_
MonitorElement * h_invMassAllPhotons_
std::vector< std::vector< MonitorElement * > > p_nTrackIsolHollowVsEt_
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_
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_
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_