427 LogInfo(
"ZToMuMuGammaAnalyzer") <<
"ZToMuMuGammaAnalyzer Analyzing event number: " << e.
id() <<
" Global Counter " <<
nEvt_ <<
"\n";
430 bool validTriggerEvent=
true;
434 if(!triggerEventHandle.
isValid()) {
435 edm::LogInfo(
"PhotonAnalyzer") <<
"Error! Can't get the product: triggerEvent_token_" << endl;
436 validTriggerEvent=
false;
438 if(validTriggerEvent) triggerEvent = *(triggerEventHandle.
product());
445 if ( !photonHandle.
isValid()) {
446 edm::LogInfo(
"ZToMuMuGammaAnalyzer") <<
"Error! Can't get the product: photon_token_" << endl;
454 if (!pfCandidateHandle.
isValid()) {
455 edm::LogError(
"PhotonValidator") <<
"Error! Can't get the product pfCandidates "<< std::endl ;
460 if (
fName_ ==
"zmumugammaGedValidation") {
463 if ( ! phoToParticleBasedIsoMapHandle.
isValid()) {
464 edm::LogInfo(
"PhotonValidator") <<
"Error! Can't get the product: valueMap photons to particle based iso " << std::endl;
467 phoToParticleBasedIsoMap = *(phoToParticleBasedIsoMapHandle.
product());
471 bool validMuons=
true;
476 edm::LogInfo(
"ZToMuMuGammaAnalyzer") <<
"Error! Can't get the product: muon_token_" << endl;
479 if(validMuons) muonCollection = *(muonHandle.
product());
485 edm::LogError(
"TrackerOnlyConversionProducer") <<
"Error! Can't get the product primary Vertex Collection "<<
"\n";
492 for(
uint filterIndex=0;filterIndex<triggerEvent.
sizeFilters();++filterIndex){
494 if(label.find(
"Photon" ) != string::npos ) {
495 for(
uint filterKeyIndex=0;filterKeyIndex<triggerEvent.
filterKeys(filterIndex).size();++filterKeyIndex){
496 Keys.push_back(triggerEvent.
filterKeys(filterIndex)[filterKeyIndex]);
503 sort(Keys.begin(),Keys.end());
504 for (
uint i=0;
i<Keys.size(); ) {
505 if (
i!=(Keys.size()-1)) {
506 if (Keys[
i]==Keys[
i+1]) {
507 Keys.erase(Keys.begin()+
i+1);
526 if ( muonCollection.size() < 2 )
return;
528 for( reco::MuonCollection::const_iterator iMu = muonCollection.begin(); iMu != muonCollection.end(); iMu++) {
531 for( reco::MuonCollection::const_iterator iMu2 = iMu+1; iMu2 != muonCollection.end(); iMu2++) {
533 if ( iMu->charge()*iMu2->charge() > 0)
continue;
538 if ( mumuMass < minMumuInvMass_ || mumuMass >
maxMumuInvMass_ )
continue;
542 if ( photonHandle->empty() )
continue;
546 for(
unsigned int iPho=0; iPho < photonHandle->size(); iPho++) {
549 double dr1 =
deltaR((*iMu).eta(), aPho->eta(), (*iMu).phi(), aPho->phi());
550 double dr2 =
deltaR((*iMu2).eta(), aPho->eta(), (*iMu2).phi(), aPho->phi());
553 nearMuon =*iMu ; farMuon = *iMu2; drNear = dr1;
555 nearMuon = *iMu2; farMuon = *iMu; drNear = dr2;
570 if ( aPho->isEB() || aPho->isEE() ) {
573 if ( aPho->isEB() ) {
577 if ( aPho->isEE() ) {
587 h_phoSigmaEoverE_[0] ->
Fill( aPho->getCorrectedEnergyError(aPho->getCandidateP4type())/aPho->energy() );
590 h_phoSigmaEoverE_[iDet] ->
Fill( aPho->getCorrectedEnergyError(aPho->getCandidateP4type())/aPho->energy() );
591 p_phoSigmaEoverEVsNVtx_[iDet] ->
Fill(
float(vtxH->size()), aPho->getCorrectedEnergyError(aPho->getCandidateP4type())/aPho->energy() );
653 if (
fName_ ==
"zmumugammaGedValidation") {
655 float SumPtIsoValCh = 0.;
656 float SumPtIsoValNh = 0.;
657 float SumPtIsoValPh = 0.;
659 float SumPtIsoValCleanCh = 0.;
660 float SumPtIsoValCleanNh = 0.;
661 float SumPtIsoValCleanPh = 0.;
663 for(
unsigned int lCand=0; lCand < pfCandidateHandle->size(); lCand++) {
665 float dR=
deltaR(aPho->eta(), aPho->phi(),pfCandRef->eta(), pfCandRef->phi());
673 SumPtIsoValCh += pfCandRef->pt();
678 SumPtIsoValNh += pfCandRef->pt();
683 SumPtIsoValPh += pfCandRef->pt();
689 for( std::vector<reco::PFCandidateRef>::const_iterator
i = phoToParticleBasedIsoMap[aPho].
begin();
i != phoToParticleBasedIsoMap[aPho].
end(); ++
i ) {
691 if ( (*
i) == pfCandRef ) {
696 if ( skip )
continue;
698 SumPtIsoValCleanCh += pfCandRef->pt();
703 SumPtIsoValCleanNh += pfCandRef->pt();
708 SumPtIsoValCleanPh += pfCandRef->pt();
MonitorElement * h_dRPhoPFcand_Pho_unCleaned_[3]
MonitorElement * p_hOverEVsEta_[3]
MonitorElement * h_pfMva_[3]
MonitorElement * h_SumPtOverPhoPt_ChHad_unCleaned_[3]
MonitorElement * h_dRPhoPFcand_Pho_Cleaned_[3]
MonitorElement * h2_nTrackIsolSolidVsEt_[3]
ParticleType
particle types
MonitorElement * p_sigmaIetaIetaVsEta_[3]
MonitorElement * p_r1x5VsEta_[3]
const_iterator end() const
float sumPt
sum-pt of tracks
bool muonSelection(const reco::Muon &m, const reco::BeamSpot &bs)
MonitorElement * h_phoSigmaIetaIeta_[3]
The single EDProduct to be saved for each event (AOD case)
trigger::size_type sizeFilters() const
MonitorElement * h2_r2x5VsEta_[3]
MonitorElement * h_newhOverE_[3]
edm::EDGetTokenT< reco::PFCandidateCollection > pfCandidates_
MonitorElement * h2_trackPtSumHollowVsEt_[3]
MonitorElement * h_SumPtOverPhoPt_NeuHad_unCleaned_[3]
edm::EDGetTokenT< std::vector< reco::Photon > > photon_token_
MonitorElement * p_nTrackIsolHollowVsEta_[3]
MonitorElement * h2_r9VsEt_[3]
MonitorElement * h_nCluOutsideMustache_[3]
bool getByToken(EDGetToken token, Handle< PROD > &result) const
MonitorElement * h2_ecalSumVsEt_[3]
MonitorElement * h_nTrackIsolSolid_[3]
MonitorElement * h_SumPtOverPhoPt_Pho_Cleaned_[3]
MonitorElement * h_trackPtSumHollow_[3]
MonitorElement * h2_nTrackIsolSolidVsEta_[3]
MonitorElement * p_ecalSumVsEt_[3]
MonitorElement * h_phoEta_[3]
MonitorElement * h_nPho_[3]
MonitorElement * h_chHadIso_[3]
const Keys & filterKeys(trigger::size_type index) const
MonitorElement * h_phoSigmaEoverE_[3]
MonitorElement * h_dRPhoPFcand_NeuHad_Cleaned_[3]
MonitorElement * h_r1x5_[3]
MonitorElement * p_phoSigmaEoverEVsNVtx_[3]
MonitorElement * h2_sigmaIetaIetaVsEta_[3]
MonitorElement * h_dRPhoPFcand_NeuHad_unCleaned_[3]
double pt() const final
transverse momentum
MonitorElement * h2_hcalSumVsEt_[3]
MonitorElement * h_hcalSum_[3]
MonitorElement * h_phoPhi_[3]
unsigned int prescaleFactor_
MonitorElement * p_trackPtSumHollowVsEt_[3]
MonitorElement * h2_ecalSumVsEta_[3]
edm::EDGetTokenT< trigger::TriggerEvent > triggerEvent_token_
std::vector< Muon > MuonCollection
collection of Muon objects
MonitorElement * h_hOverE_[3]
MonitorElement * h_trackPtSumSolid_[3]
MonitorElement * p_hcalSumVsEt_[3]
MonitorElement * p_e1x5VsEt_[3]
MonitorElement * h2_r2x5VsEt_[3]
MonitorElement * h_h1OverE_[3]
MonitorElement * h_SumPtOverPhoPt_ChHad_Cleaned_[3]
MonitorElement * h2_e1x5VsEta_[3]
MonitorElement * h1_mumuGammaInvMass_[3]
MonitorElement * h2_trackPtSumSolidVsEt_[3]
MonitorElement * h_phoE_[3]
void Fill(HcalDetId &id, double val, std::vector< TH2F > &depth)
MonitorElement * p_r2x5VsEta_[3]
MonitorElement * h_nRecoVtx_
MonitorElement * p_e2x5VsEt_[3]
MonitorElement * p_hcalSumVsEta_[3]
float mumuInvMass(const reco::Muon &m1, const reco::Muon &m2)
float mumuGammaInvMass(const reco::Muon &mu1, const reco::Muon &mu2, const reco::PhotonRef &pho)
MonitorElement * h_phoEt_[3]
MonitorElement * p_ecalSumVsEta_[3]
MonitorElement * p_r9VsEta_[3]
MonitorElement * h_nHadIso_[3]
edm::EDGetTokenT< reco::VertexCollection > offline_pvToken_
double deltaR(double eta1, double eta2, double phi1, double phi2)
MonitorElement * p_trackPtSumSolidVsEta_[3]
MonitorElement * h1_mumuInvMass_[3]
photon histos
MonitorElement * h2_trackPtSumSolidVsEta_[3]
const edm::InputTag filterTag(trigger::size_type index) const
MonitorElement * h2_hcalSumVsEta_[3]
MonitorElement * h_dRPhoPFcand_ChHad_unCleaned_[3]
bool photonSelection(const reco::PhotonRef &p)
MonitorElement * h_scPhi_[3]
MonitorElement * h2_e1x5VsEt_[3]
T const * product() const
MonitorElement * h_scEta_[3]
edm::EDGetTokenT< edm::ValueMap< std::vector< reco::PFCandidateRef > > > photonIsoValmap_token_
std::vector< size_type > Keys
std::vector< Photon > PhotonCollection
collectin of Photon objects
MonitorElement * h_nTrackIsolHollow_[3]
MonitorElement * p_r2x5VsEt_[3]
MonitorElement * h_SumPtOverPhoPt_Pho_unCleaned_[3]
MonitorElement * h_SumPtOverPhoPt_NeuHad_Cleaned_[3]
MonitorElement * h_etOutsideMustache_[3]
MonitorElement * h_e1x5_[3]
MonitorElement * h2_nTrackIsolHollowVsEt_[3]
MonitorElement * h2_nTrackIsolHollowVsEta_[3]
edm::EDGetTokenT< reco::BeamSpot > beamSpot_token_
MonitorElement * h2_e2x5VsEta_[3]
MonitorElement * h2_trackPtSumHollowVsEta_[3]
MonitorElement * h_r9_[3]
MonitorElement * p_r1x5VsEt_[3]
MonitorElement * p_nTrackIsolHollowVsEt_[3]
MonitorElement * p_r9VsEt_[3]
bool basicMuonSelection(const reco::Muon &m)
MonitorElement * p_trackPtSumSolidVsEt_[3]
MonitorElement * p_e2x5VsEta_[3]
MonitorElement * h_e2x5_[3]
MonitorElement * h2_r1x5VsEta_[3]
MonitorElement * p_trackPtSumHollowVsEta_[3]
float maxMumuGammaInvMass_
MonitorElement * h_dRPhoPFcand_ChHad_Cleaned_[3]
MonitorElement * p_hOverEVsEt_[3]
MonitorElement * h2_r1x5VsEt_[3]
MonitorElement * p_nTrackIsolSolidVsEt_[3]
MonitorElement * p_e1x5VsEta_[3]
MonitorElement * p_nTrackIsolSolidVsEta_[3]
MonitorElement * h2_r9VsEta_[3]
const MuonIsolation & isolationR03() const
edm::EDGetTokenT< std::vector< reco::Muon > > muon_token_
MonitorElement * h_ecalSum_[3]
MonitorElement * h_phoIso_[3]
MonitorElement * h_h2OverE_[3]
MonitorElement * h_r2x5_[3]
MonitorElement * h2_e2x5VsEt_[3]