444 LogInfo(
"PhotonAnalyzer") <<
"PhotonAnalyzer Analyzing event number: " << e.
id() <<
" Global Counter " <<
nEvt_ <<
"\n";
447 bool validTriggerEvent=
true;
451 if(!triggerEventHandle.isValid()) {
453 validTriggerEvent=
false;
455 if(validTriggerEvent) triggerEvent = *(triggerEventHandle.product());
458 bool validPhotons=
true;
462 if ( !photonHandle.isValid()) {
466 if(validPhotons) photonCollection = *(photonHandle.product());
469 bool validloosePhotonID=
true;
472 e.
getByLabel(
"PhotonIDProd",
"PhotonCutBasedIDLoose", loosePhotonFlag);
473 if ( !loosePhotonFlag.isValid()) {
474 edm::LogInfo(
"PhotonAnalyzer") <<
"Error! Can't get the product "<<
"PhotonCutBasedIDLoose" << endl;
475 validloosePhotonID=
false;
477 if (validloosePhotonID) loosePhotonID = *(loosePhotonFlag.product());
479 bool validtightPhotonID=
true;
482 e.
getByLabel(
"PhotonIDProd",
"PhotonCutBasedIDTight", tightPhotonFlag);
483 if ( !tightPhotonFlag.isValid()) {
484 edm::LogInfo(
"PhotonAnalyzer") <<
"Error! Can't get the product "<<
"PhotonCutBasedIDTight" << endl;
485 validtightPhotonID=
false;
487 if (validtightPhotonID) tightPhotonID = *(tightPhotonFlag.product());
502 int nConv[100][3][3];
518 for(uint filterIndex=0;filterIndex<triggerEvent.sizeFilters();++filterIndex){
520 string label = triggerEvent.filterTag(filterIndex).label();
522 if(label.find(
"Photon" ) != string::npos ) {
524 for(uint filterKeyIndex=0;filterKeyIndex<triggerEvent.filterKeys(filterIndex).size();++filterKeyIndex){
525 Keys.push_back(triggerEvent.filterKeys(filterIndex)[filterKeyIndex]);
535 for ( uint
i=0 ;
i<
Keys.size() ; )
537 if (
i!=(
Keys.size()-1))
547 int photonCounter = 0;
551 for( reco::PhotonCollection::const_iterator iPho = photonCollection.begin(); iPho != photonCollection.end(); iPho++) {
561 double deltaRMin=1000.;
565 for (vector<int>::const_iterator objectKey=
Keys.begin();objectKey!=
Keys.end();objectKey++){
567 deltaR =
reco::deltaR(triggerEvent.getObjects()[(*objectKey)].eta(),triggerEvent.getObjects()[(*objectKey)].phi(),(*iPho).superCluster()->eta(),(*iPho).superCluster()->phi());
568 if(deltaR < deltaRMin) deltaRMin =
deltaR;
572 if(deltaRMin > deltaRMax) {
576 if(deltaRMin <= deltaRMax) {
588 bool isLoosePhoton(
false), isTightPhoton(
false);
590 isLoosePhoton = (loosePhotonID)[photonref];
591 isTightPhoton = (tightPhotonID)[photonref];
597 bool phoIsInBarrel=
false;
598 bool phoIsInEndcap=
false;
599 float etaPho = (*iPho).superCluster()->eta();
600 if ( fabs(etaPho) < 1.479 )
607 if ( phoIsInBarrel ) part = 1;
608 if ( phoIsInEndcap ) part = 2;
611 bool isIsolated=
false;
616 if ( isIsolated ) type=1;
621 bool validEcalRecHits=
true;
624 if ( phoIsInBarrel ) {
627 if (!ecalRecHitHandle.
isValid()) {
629 validEcalRecHits=
false;
632 else if ( phoIsInEndcap ) {
635 if (!ecalRecHitHandle.
isValid()) {
637 validEcalRecHits=
false;
640 if (validEcalRecHits) ecalRecHitCollection = *(ecalRecHitHandle.
product());
659 double Et = (*iPho).et();
660 bool passesCuts =
false;
790 bool atLeastOneDeadChannel=
false;
791 for(
reco::CaloCluster_iterator bcIt = (*iPho).superCluster()->clustersBegin();bcIt != (*iPho).superCluster()->clustersEnd(); ++bcIt) {
792 for(vector< pair<DetId, float> >::const_iterator rhIt = (*bcIt)->hitsAndFractions().begin();rhIt != (*bcIt)->hitsAndFractions().end(); ++rhIt) {
795 if (rhIt->first == (*it).id() ) {
796 if ( (*it).recoFlag() == 9 ) {
797 atLeastOneDeadChannel=
true;
804 if ( atLeastOneDeadChannel ) {
812 if((*iPho).hasConversionTracks()){
822 for (
unsigned int iConv=0; iConv<conversions.
size(); iConv++) {
826 if ( aConv->nTracks() <2 )
continue;
831 if ( !(aConv->conversionVertex().isValid()) )
continue;
833 float chi2Prob =
ChiSquaredProbability( aConv->conversionVertex().chi2(), aConv->conversionVertex().ndof() );
835 if(chi2Prob<0.0005)
continue;
845 if (
cut==0 && isLoosePhoton){
849 if (
cut==0 && isTightPhoton){
864 double convR=
sqrt(aConv->conversionVertex().position().perp2());
865 double scalar = aConv->conversionVertex().position().x()*aConv->refittedPairMomentum().x() + aConv->conversionVertex().position().y()*aConv->refittedPairMomentum().y();
866 if ( scalar < 0 ) convR= -convR;
871 if(fabs(aConv->caloCluster()[0]->eta()) > 1.5){
874 else if(fabs(aConv->caloCluster()[0]->eta()) < 1){
879 const std::vector<edm::RefToBase<reco::Track> >
tracks = aConv->tracks();
882 for (
unsigned int i=0;
i<tracks.size();
i++) {
891 float DPhiTracksAtVtx = -99;
892 float dPhiTracksAtEcal= -99;
893 float dEtaTracksAtEcal= -99;
895 float phiTk1= aConv->tracksPin()[0].phi();
896 float phiTk2= aConv->tracksPin()[1].phi();
897 DPhiTracksAtVtx = phiTk1-phiTk2;
900 if (aConv->bcMatchingWithTracks()[0].
isNonnull() && aConv->bcMatchingWithTracks()[1].
isNonnull() ) {
901 float recoPhi1 = aConv->ecalImpactPosition()[0].phi();
902 float recoPhi2 = aConv->ecalImpactPosition()[1].phi();
903 float recoEta1 = aConv->ecalImpactPosition()[0].eta();
904 float recoEta2 = aConv->ecalImpactPosition()[1].eta();
909 dPhiTracksAtEcal = recoPhi1 -recoPhi2;
911 dEtaTracksAtEcal = recoEta1 -recoEta2;
937 for (reco::PhotonCollection::const_iterator iPho2=iPho+1; iPho2!=photonCollection.end(); iPho2++){
942 bool isTightPhoton2(
false), isLoosePhoton2(
false);
945 isTightPhoton2 = (tightPhotonID)[photonref2];
946 isLoosePhoton2 = (loosePhotonID)[photonref2];
949 bool isIsolated2=
false;
959 float gamgamMass2 = p12.Dot(p12);
966 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_
std::vector< std::vector< MonitorElement * > > p_sigmaIetaIetaVsEta_
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_
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_
edm::InputTag triggerEvent_
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::string barrelRecHitProducer_
std::string photonCollection_
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::string endcapRecHitProducer_
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_
std::vector< std::vector< MonitorElement * > > h_e2x5VsEt_
std::vector< std::vector< MonitorElement * > > h_phoPhi_BadChannels_
std::vector< std::vector< MonitorElement * > > p_nTrackIsolSolidVsEta_
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
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_
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::string barrelRecHitCollection_
std::vector< std::vector< MonitorElement * > > h_tkChi2_
bool useTriggerFiltering_
std::string photonProducer_
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_
std::string endcapRecHitCollection_
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_