443 LogInfo(
"PhotonAnalyzer") <<
"PhotonAnalyzer Analyzing event number: " << e.
id() <<
" Global Counter " <<
nEvt_ <<
"\n";
446 bool validTriggerEvent=
true;
450 if(!triggerEventHandle.isValid()) {
451 edm::LogInfo(
"PhotonAnalyzer") <<
"Error! Can't get the product: triggerEvent_" << endl;
452 validTriggerEvent=
false;
454 if(validTriggerEvent) triggerEvent = *(triggerEventHandle.product());
457 bool validPhotons=
true;
461 if ( !photonHandle.isValid()) {
462 edm::LogInfo(
"PhotonAnalyzer") <<
"Error! Can't get the product: photon_token_" << endl;
465 if(validPhotons) photonCollection = *(photonHandle.product());
468 bool validloosePhotonID=
true;
472 if ( !loosePhotonFlag.isValid()) {
473 edm::LogInfo(
"PhotonAnalyzer") <<
"Error! Can't get the product: PhotonIDLoose_token_" << endl;
474 validloosePhotonID=
false;
476 if (validloosePhotonID) loosePhotonID = *(loosePhotonFlag.product());
478 bool validtightPhotonID=
true;
482 if ( !tightPhotonFlag.isValid()) {
483 edm::LogInfo(
"PhotonAnalyzer") <<
"Error! Can't get the product: PhotonIDTight_token_" << endl;
484 validtightPhotonID=
false;
486 if (validtightPhotonID) tightPhotonID = *(tightPhotonFlag.product());
501 int nConv[100][3][3];
517 for(uint filterIndex=0;filterIndex<triggerEvent.sizeFilters();++filterIndex){
519 string label = triggerEvent.filterTag(filterIndex).label();
521 if(label.find(
"Photon" ) != string::npos ) {
523 for(uint filterKeyIndex=0;filterKeyIndex<triggerEvent.filterKeys(filterIndex).size();++filterKeyIndex){
524 Keys.push_back(triggerEvent.filterKeys(filterIndex)[filterKeyIndex]);
534 for ( uint
i=0 ;
i<
Keys.size() ; )
536 if (
i!=(
Keys.size()-1))
546 int photonCounter = 0;
550 for( reco::PhotonCollection::const_iterator iPho = photonCollection.begin(); iPho != photonCollection.end(); iPho++) {
560 double deltaRMin=1000.;
564 for (vector<int>::const_iterator objectKey=
Keys.begin();objectKey!=
Keys.end();objectKey++){
566 deltaR =
reco::deltaR(triggerEvent.getObjects()[(*objectKey)].eta(),triggerEvent.getObjects()[(*objectKey)].phi(),(*iPho).superCluster()->eta(),(*iPho).superCluster()->phi());
567 if(deltaR < deltaRMin) deltaRMin =
deltaR;
571 if(deltaRMin > deltaRMax) {
575 if(deltaRMin <= deltaRMax) {
587 bool isLoosePhoton(
false), isTightPhoton(
false);
589 isLoosePhoton = (loosePhotonID)[photonref];
590 isTightPhoton = (tightPhotonID)[photonref];
596 bool phoIsInBarrel=
false;
597 bool phoIsInEndcap=
false;
598 float etaPho = (*iPho).superCluster()->eta();
599 if ( fabs(etaPho) < 1.479 )
606 if ( phoIsInBarrel ) part = 1;
607 if ( phoIsInEndcap ) part = 2;
610 bool isIsolated=
false;
615 if ( isIsolated ) type=1;
620 bool validEcalRecHits=
true;
623 if ( phoIsInBarrel ) {
626 if (!ecalRecHitHandle.
isValid()) {
627 edm::LogError(
"PhotonAnalyzer") <<
"Error! Can't get the product: barrelRecHit_token_";
628 validEcalRecHits=
false;
631 else if ( phoIsInEndcap ) {
634 if (!ecalRecHitHandle.
isValid()) {
635 edm::LogError(
"PhotonAnalyzer") <<
"Error! Can't get the product: endcapRecHit_token";
636 validEcalRecHits=
false;
639 if (validEcalRecHits) ecalRecHitCollection = *(ecalRecHitHandle.
product());
658 double Et = (*iPho).et();
659 bool passesCuts =
false;
789 bool atLeastOneDeadChannel=
false;
790 for(
reco::CaloCluster_iterator bcIt = (*iPho).superCluster()->clustersBegin();bcIt != (*iPho).superCluster()->clustersEnd(); ++bcIt) {
791 for(vector< pair<DetId, float> >::const_iterator rhIt = (*bcIt)->hitsAndFractions().begin();rhIt != (*bcIt)->hitsAndFractions().end(); ++rhIt) {
794 if (rhIt->first == (*it).id() ) {
795 if ( (*it).recoFlag() == 9 ) {
796 atLeastOneDeadChannel=
true;
803 if ( atLeastOneDeadChannel ) {
811 if((*iPho).hasConversionTracks()){
821 for (
unsigned int iConv=0; iConv<conversions.
size(); iConv++) {
825 if ( aConv->nTracks() <2 )
continue;
830 if ( !(aConv->conversionVertex().isValid()) )
continue;
832 float chi2Prob =
ChiSquaredProbability( aConv->conversionVertex().chi2(), aConv->conversionVertex().ndof() );
834 if(chi2Prob<0.0005)
continue;
844 if (
cut==0 && isLoosePhoton){
848 if (
cut==0 && isTightPhoton){
863 double convR=
sqrt(aConv->conversionVertex().position().perp2());
864 double scalar = aConv->conversionVertex().position().x()*aConv->refittedPairMomentum().x() + aConv->conversionVertex().position().y()*aConv->refittedPairMomentum().y();
865 if ( scalar < 0 ) convR= -convR;
870 if(fabs(aConv->caloCluster()[0]->eta()) > 1.5){
873 else if(fabs(aConv->caloCluster()[0]->eta()) < 1){
878 const std::vector<edm::RefToBase<reco::Track> >
tracks = aConv->tracks();
881 for (
unsigned int i=0;
i<tracks.size();
i++) {
890 float DPhiTracksAtVtx = -99;
891 float dPhiTracksAtEcal= -99;
892 float dEtaTracksAtEcal= -99;
894 float phiTk1= aConv->tracksPin()[0].phi();
895 float phiTk2= aConv->tracksPin()[1].phi();
896 DPhiTracksAtVtx = phiTk1-phiTk2;
899 if (aConv->bcMatchingWithTracks()[0].
isNonnull() && aConv->bcMatchingWithTracks()[1].
isNonnull() ) {
900 float recoPhi1 = aConv->ecalImpactPosition()[0].phi();
901 float recoPhi2 = aConv->ecalImpactPosition()[1].phi();
902 float recoEta1 = aConv->ecalImpactPosition()[0].eta();
903 float recoEta2 = aConv->ecalImpactPosition()[1].eta();
908 dPhiTracksAtEcal = recoPhi1 -recoPhi2;
910 dEtaTracksAtEcal = recoEta1 -recoEta2;
936 for (reco::PhotonCollection::const_iterator iPho2=iPho+1; iPho2!=photonCollection.end(); iPho2++){
941 bool isTightPhoton2(
false), isLoosePhoton2(
false);
944 isTightPhoton2 = (tightPhotonID)[photonref2];
945 isLoosePhoton2 = (loosePhotonID)[photonref2];
948 bool isIsolated2=
false;
958 float gamgamMass2 = p12.Dot(p12);
965 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_
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::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_
std::vector< std::vector< MonitorElement * > > h_phoEta_
std::vector< EcalRecHit >::const_iterator const_iterator
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_
std::vector< std::vector< std::vector< MonitorElement * > > > h_dCotTracks_
std::vector< std::vector< std::vector< MonitorElement * > > > h_hOverE_
MonitorElement * h_convEt_Loose_
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_
bool isNonnull() const
Checks for non-null.
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_
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 * > > 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_
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_
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_
std::vector< std::vector< MonitorElement * > > p_e1x5VsEt_
std::vector< size_type > Keys
MonitorElement * h_invMassPhotonsEEndcap_
std::vector< std::vector< MonitorElement * > > p_nTrackIsolHollowVsEta_
std::vector< Photon > PhotonCollection
collectin of Photon objects
std::vector< std::vector< MonitorElement * > > h_trackPtSumSolidVsEt_
T const * product() const
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 * > > 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< 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_