35 const boost::shared_ptr<PFEnergyCalibration>& thePFEnergyCalibration,
36 double sumPtTrackIsoForPhoton,
37 double sumPtTrackIsoSlopeForPhoton
43 thePFEnergyCalibration_(thePFEnergyCalibration),
44 sumPtTrackIsoForPhoton_(sumPtTrackIsoForPhoton),
45 sumPtTrackIsoSlopeForPhoton_(sumPtTrackIsoSlopeForPhoton),
46 nlost(0.0), nlayers(0.0),
47 chi2(0.0), STIP(0.0), del_phi(0.0),HoverPt(0.0), EoverPt(0.0), track_pt(0.0),
49 CrysPhi_(0.0), CrysEta_(0.0), VtxZ_(0.0), ClusPhi_(0.0), ClusEta_(0.0),
50 ClusR9_(0.0), Clus5x5ratio_(0.0), PFCrysEtaCrack_(0.0), logPFClusE_(0.0), e3x3_(0.0),
51 CrysIPhi_(0), CrysIEta_(0),
52 CrysX_(0.0), CrysY_(0.0),
54 eSeed_(0.0), e1x3_(0.0),e3x1_(0.0), e1x5_(0.0), e2x5Top_(0.0), e2x5Bottom_(0.0), e2x5Left_(0.0), e2x5Right_(0.0),
55 etop_(0.0), ebottom_(0.0), eleft_(0.0), eright_(0.0),
57 PFPhoEta_(0.0), PFPhoPhi_(0.0), PFPhoR9_(0.0), PFPhoR9Corr_(0.0), SCPhiWidth_(0.0), SCEtaWidth_(0.0),
58 PFPhoEt_(0.0), RConv_(0.0), PFPhoEtCorr_(0.0), PFPhoE_(0.0), PFPhoECorr_(0.0), MustE_(0.0), E3x3_(0.0),
59 dEta_(0.0), dPhi_(0.0), LowClusE_(0.0), RMSAll_(0.0), RMSMust_(0.0), nPFClus_(0.0),
60 TotPS1_(0.0), TotPS2_(0.0),
62 x0inner_(0.0), x0middle_(0.0), x0outer_(0.0),
63 excluded_(0.0), Mustache_EtRatio_(0.0), Mustache_Et_out_(0.0)
79 TFile *XO_File =
new TFile(X0_Map.c_str(),
"READ");
80 X0_sum=(TH2D*)XO_File->Get(
"TrackerSum");
81 X0_inner = (TH2D*)XO_File->Get(
"Inner");
82 X0_middle = (TH2D*)XO_File->Get(
"Middle");
83 X0_outer = (TH2D*)XO_File->Get(
"Outer");
88 std::vector<bool>& active,
90 std::vector<reco::PFCandidatePhotonExtra>& pfPhotonExtraCandidates,
91 std::vector<reco::PFCandidate>
92 &tempElectronCandidates
111 std::vector<bool>::const_iterator actIter = active.begin();
113 bool isActive =
true;
116 if(elements.
size() != active.size()) {
124 std::vector<unsigned int> elemsToLock;
125 elemsToLock.resize(0);
127 for( ; ele != elements.
end(); ++ele, ++actIter ) {
133 float photonEnergy_ = 0.;
137 float RawEcalEne = 0.;
140 float ps1TotEne = 0.;
141 float ps2TotEne = 0.;
143 bool hasConvTrack=
false;
144 bool hasSingleleg=
false;
145 std::vector<unsigned int> AddClusters(0);
147 std::multimap<unsigned int, unsigned int>ClusterAddPS1;
148 std::multimap<unsigned int, unsigned int>ClusterAddPS2;
149 std::vector<reco::TrackRef>singleLegRef;
150 std::vector<float>MVA_values(0);
151 std::vector<float>MVALCorr;
152 std::vector<CaloCluster>PFClusters;
154 isActive = *(actIter);
167 elemsToLock.push_back(ele-elements.
begin());
169 std::multimap<double, unsigned int> ecalAssoPFClusters;
170 blockRef->associatedElements( ele-elements.
begin(),
179 if( ! ecalAssoPFClusters.size() ) {
187 for(std::multimap<double, unsigned int>::iterator itecal = ecalAssoPFClusters.begin();
188 itecal != ecalAssoPFClusters.end(); ++itecal) {
199 vector<double> ps1Ene(0);
200 vector<double> ps2Ene(0);
215 if( !( active[itecal->second] ) ) {
227 bool isClosest=
false;
228 std::multimap<double, unsigned int> Trackscheck;
229 blockRef->associatedElements( itecal->second,
234 for(std::multimap<double, unsigned int>::iterator track = Trackscheck.begin();
235 track != Trackscheck.end(); ++track) {
238 if( ! (active[track->second]) )
continue;
241 std::multimap<double, unsigned int> closecheck;
242 blockRef->associatedElements(track->second,
245 reco::PFBlockElement::ECAL,
247 if(closecheck.begin()->second ==itecal->second)isClosest=
true;
248 if(!hasSingleleg)mva_reject++;
251 if(mva_reject>0 && isClosest)useIt=
false;
253 if( !useIt )
continue;
258 elemsToLock.push_back(itecal->second);
261 std::multimap<double, unsigned int> PS1Elems;
262 std::multimap<double, unsigned int> PS2Elems;
264 blockRef->associatedElements( itecal->second,
270 blockRef->associatedElements( itecal->second,
277 for(std::multimap<double, unsigned int>::iterator iteps = PS1Elems.begin();
278 iteps != PS1Elems.end(); ++iteps) {
281 if( !(active[iteps->second]) )
continue;
284 std::multimap<double, unsigned int> ECALPS1check;
285 blockRef->associatedElements( iteps->second,
288 reco::PFBlockElement::ECAL,
290 if(itecal->second==ECALPS1check.begin()->second)
293 ps1Ene.
push_back( ps1ClusterRef->energy() );
294 ps1=ps1+ps1ClusterRef->energy();
296 elemsToLock.push_back(iteps->second);
299 for(std::multimap<double, unsigned int>::iterator iteps = PS2Elems.begin();
300 iteps != PS2Elems.end(); ++iteps) {
303 if( !(active[iteps->second]) )
continue;
306 std::multimap<double, unsigned int> ECALPS2check;
307 blockRef->associatedElements( iteps->second,
310 reco::PFBlockElement::ECAL,
312 if(itecal->second==ECALPS2check.begin()->second)
315 ps2Ene.
push_back( ps2ClusterRef->energy() );
316 ps2=ps2ClusterRef->energy()+ps2;
318 elemsToLock.push_back(iteps->second);
323 std::multimap<double, unsigned int> hcalElems;
324 blockRef->associatedElements( itecal->second,linkData,
329 for(std::multimap<double, unsigned int>::iterator ithcal = hcalElems.begin();
330 ithcal != hcalElems.end(); ++ithcal) {
332 if ( ! (active[ithcal->second] ) )
continue;
338 bool useHcal =
false;
339 if ( !useHcal )
continue;
347 std::multimap<double, unsigned int>
convTracks;
348 blockRef->associatedElements( itecal->second,
353 for(std::multimap<double, unsigned int>::iterator track = convTracks.begin();
354 track != convTracks.end(); ++track) {
357 if( ! (active[track->second]) )
continue;
376 for(
unsigned int i=0;
i<IsoTracks.size();
i++)
377 {
if(IsoTracks[
i]==track->second)included=
true;}
378 if(!included)IsoTracks.push_back(track->second);
383 elemsToLock.push_back(track->second);
387 for(
unsigned int ic=0; ic<singleLegRef.size(); ic++)
388 if(singleLegRef[ic]==t_ref)matched=
true;
395 std::multimap<double, unsigned int> moreClusters;
396 blockRef->associatedElements( track->second,
399 reco::PFBlockElement::ECAL,
402 float p_in=
sqrt(elements[track->second].trackRef()->innerMomentum().x() * elements[track->second].trackRef()->innerMomentum().x() +
403 elements[track->second].trackRef()->innerMomentum().y()*elements[track->second].trackRef()->innerMomentum().y()+
404 elements[track->second].trackRef()->innerMomentum().z()*elements[track->second].trackRef()->innerMomentum().z());
406 for(std::multimap<double, unsigned int>::iterator clust = moreClusters.begin();
407 clust != moreClusters.end(); ++clust)
409 if(!active[clust->second])
continue;
411 linked_E=linked_E+elements[clust->second].clusterRef()->energy();
413 if(linked_E/p_in>1.5)
break;
416 for(std::multimap<double, unsigned int>::iterator cluscheck = ecalAssoPFClusters.begin();
417 cluscheck != ecalAssoPFClusters.end(); ++cluscheck)
419 if(cluscheck->second==clust->second)included=
true;
421 if(!included)AddClusters.
push_back(clust->second);
429 elemsToLock.push_back(track->second);
435 std::multimap<double, unsigned int> moreClusters;
436 blockRef->associatedElements( track->second,
439 reco::PFBlockElement::ECAL,
442 float p_in=
sqrt(elements[track->second].trackRef()->innerMomentum().x() * elements[track->second].trackRef()->innerMomentum().x() +
443 elements[track->second].trackRef()->innerMomentum().y()*elements[track->second].trackRef()->innerMomentum().y()+
444 elements[track->second].trackRef()->innerMomentum().z()*elements[track->second].trackRef()->innerMomentum().z());
446 for(std::multimap<double, unsigned int>::iterator clust = moreClusters.begin();
447 clust != moreClusters.end(); ++clust)
449 if(!active[clust->second])
continue;
450 linked_E=linked_E+elements[clust->second].clusterRef()->energy();
451 if(linked_E/p_in>1.5)
break;
453 for(std::multimap<double, unsigned int>::iterator cluscheck = ecalAssoPFClusters.begin();
454 cluscheck != ecalAssoPFClusters.end(); ++cluscheck)
456 if(cluscheck->second==clust->second)included=
true;
458 if(!included)AddClusters.
push_back(clust->second);
464 std::multimap<double, unsigned int> moreTracks;
465 blockRef->associatedElements( track->second,
471 for(std::multimap<double, unsigned int>::iterator track2 = moreTracks.begin();
472 track2 != moreTracks.end(); ++track2) {
475 if( ! (active[track2->second]) )
continue;
477 if(track->second==track2->second)
continue;
481 elemsToLock.push_back(track2->second);
484 std::multimap<double, unsigned int> convEcal;
485 blockRef->associatedElements( track2->second,
488 reco::PFBlockElement::ECAL,
490 float p_in=
sqrt(elements[track->second].trackRef()->innerMomentum().x()*elements[track->second].trackRef()->innerMomentum().x()+
491 elements[track->second].trackRef()->innerMomentum().y()*elements[track->second].trackRef()->innerMomentum().y()+
492 elements[track->second].trackRef()->innerMomentum().z()*elements[track->second].trackRef()->innerMomentum().z());
496 for(std::multimap<double, unsigned int>::iterator itConvEcal = convEcal.begin();
497 itConvEcal != convEcal.end(); ++itConvEcal) {
499 if( ! (active[itConvEcal->second]) )
continue;
501 for(std::multimap<double, unsigned int>::iterator cluscheck = ecalAssoPFClusters.begin();
502 cluscheck != ecalAssoPFClusters.end(); ++cluscheck)
504 if(cluscheck->second==itConvEcal->second)included=
true;
506 linked_E=linked_E+elements[itConvEcal->second].clusterRef()->energy();
507 if(linked_E/p_in>1.5)
break;
508 if(!included){AddClusters.
push_back(itConvEcal->second);
515 std::multimap<double, unsigned int> hcalElems_conv;
516 blockRef->associatedElements( itecal->second,linkData,
521 for(std::multimap<double, unsigned int>::iterator ithcal2 = hcalElems_conv.begin();
522 ithcal2 != hcalElems_conv.end(); ++ithcal2) {
524 if ( ! (active[ithcal2->second] ) )
continue;
531 if ( !useHcal )
continue;
547 float addedCalibEne=0;
549 std::vector<double>AddedPS1(0);
550 std::vector<double>AddedPS2(0);
553 for(
unsigned int i=0;
i<AddClusters.size();
i++)
555 std::multimap<double, unsigned int> PS1Elems_conv;
556 std::multimap<double, unsigned int> PS2Elems_conv;
557 blockRef->associatedElements(AddClusters[
i],
562 blockRef->associatedElements( AddClusters[i],
568 for(std::multimap<double, unsigned int>::iterator iteps = PS1Elems_conv.begin();
569 iteps != PS1Elems_conv.end(); ++iteps)
571 if(!active[iteps->second])
continue;
572 std::multimap<double, unsigned int> PS1Elems_check;
573 blockRef->associatedElements(iteps->second,
576 reco::PFBlockElement::ECAL,
578 if(PS1Elems_check.begin()->second==AddClusters[
i])
582 AddedPS1.
push_back(ps1ClusterRef->energy());
583 addedps1=addedps1+ps1ClusterRef->energy();
584 elemsToLock.push_back(iteps->second);
588 for(std::multimap<double, unsigned int>::iterator iteps = PS2Elems_conv.begin();
589 iteps != PS2Elems_conv.end(); ++iteps) {
590 if(!active[iteps->second])
continue;
591 std::multimap<double, unsigned int> PS2Elems_check;
592 blockRef->associatedElements(iteps->second,
595 reco::PFBlockElement::ECAL,
598 if(PS2Elems_check.begin()->second==AddClusters[
i])
601 AddedPS2.
push_back(ps2ClusterRef->energy());
602 addedps2=addedps2+ps2ClusterRef->energy();
603 elemsToLock.push_back(iteps->second);
607 addedRawEne = AddclusterRef->energy()+addedRawEne;
611 elemsToLock.push_back(AddClusters[i]);
615 PFClusters.push_back(*clusterRef);
618 EE=LocCorr*clusterRef->energy()+addedCalibEne;
622 MVALCorr.push_back(LocCorr*clusterRef->energy());
628 RawEcalEne += clusterRef->energy()+addedRawEne;
629 photonX_ += EE * clusterRef->position().X();
630 photonY_ += EE * clusterRef->position().Y();
631 photonZ_ += EE * clusterRef->position().Z();
632 ps1TotEne += ps1+addedps1;
633 ps2TotEne += ps2+addedps2;
637 float Elec_rawEcal=0;
643 std::vector<double>AddedPS1(0);
644 std::vector<double>AddedPS2(0);
647 tempElectronCandidates,
655 for(std::vector<unsigned int>::const_iterator it =
665 unsigned int index=*it;
667 elements[
index].clusterRef();
669 Elec_rawEcal=Elec_rawEcal+
670 elements[
index].clusterRef()->energy();
671 std::multimap<double, unsigned int> PS1Elems;
672 std::multimap<double, unsigned int> PS2Elems;
674 blockRef->associatedElements(index,
678 blockRef->associatedElements( index,
685 for(std::multimap<double, unsigned int>::iterator iteps =
687 iteps != PS1Elems.end(); ++iteps)
689 std::multimap<double, unsigned int> Clustcheck; blockRef->associatedElements( iteps->second, linkData,
691 reco::PFBlockElement::ECAL,
693 if(Clustcheck.begin()->second==
index)
695 AddedPS1.push_back(elements[iteps->second].clusterRef()->energy());
696 Elec_totPs1=Elec_totPs1+elements[iteps->second].clusterRef()->energy();
700 for(std::multimap<double, unsigned int>::iterator iteps =
702 iteps != PS2Elems.end(); ++iteps)
704 std::multimap<double, unsigned int> Clustcheck; blockRef->associatedElements( iteps->second, linkData,
706 reco::PFBlockElement::ECAL,
708 if(Clustcheck.begin()->second==
index)
710 AddedPS2.push_back(elements[iteps->second].clusterRef()->energy());
711 Elec_totPs2=Elec_totPs2+elements[iteps->second].clusterRef()->energy();
717 energyEm(*clusterRef,AddedPS1,AddedPS2,
false);
718 PFClusters.push_back(*clusterRef);
721 EE=LocCorr*clusterRef->energy();
722 MVALCorr.push_back(LocCorr*clusterRef->energy());
727 MVALCorr.push_back(LocCorr*clusterRef->energy());
731 ElectronX += EE * clusterRef->position().X();
732 ElectronY += EE * clusterRef->position().Y();
733 ElectronZ += EE * clusterRef->position().Z();
747 photonEnergy_ += Elec_energy;
748 RawEcalEne += Elec_rawEcal;
749 photonX_ += ElectronX;
750 photonY_ += ElectronY;
751 photonZ_ += ElectronZ;
752 ps1TotEne += Elec_totPs1;
753 ps2TotEne += Elec_totPs2;
756 if( ! (photonEnergy_ > 0.) )
continue;
757 float sum_track_pt=0;
759 for(
unsigned int i=0;
i<IsoTracks.size();
i++)sum_track_pt=sum_track_pt+elements[IsoTracks[
i]].trackRef()->pt();
770 photonEnergy_* photonDirection.Y(),
771 photonEnergy_* photonDirection.Z(),
776 elemsToLock.resize(0);
807 for ( std::vector<reco::PFCandidate>::const_iterator ec=tempElectronCandidates.begin(); ec != tempElectronCandidates.end(); ++ec ){
808 for(
int i=0;
i<matches;
i++)
819 for(std::vector<unsigned int>::const_iterator it =
825 for(std::vector<unsigned int>::const_iterator it = elemsToLock.begin();
826 it != elemsToLock.end(); ++it)
833 if(elements[*it].convRef().isNonnull())
837 for(
unsigned int ic = 0; ic < ConversionsRef_.
size(); ic++)
839 if(ConversionsRef_[ic]==elements[*it].convRef())matched=
true;
841 if(!matched)ConversionsRef_.
push_back(elements[*it].convRef());
851 for(
unsigned int l=0;
l<MVALCorr.size(); ++
l)
864 GCorr * photonEnergy_ );
865 photonCand.
setP4(photonCorrMomentum);
872 myExtra.setMustache_Et(MustacheEt);
873 myExtra.setExcludedClust(excluded);
874 if(fabs(photonCand.
eta()<1.4446))
877 myExtra.setMVAGlobalCorrE(GCorr * PFPhoECorr_);
878 else myExtra.setMVAGlobalCorrE(GCorr * photonEnergy_);
880 myExtra.SetPFPhotonRes(Res);
884 for(
unsigned int ic = 0; ic < MVA_values.size(); ic++)
886 myExtra.addSingleLegConvMva(MVA_values[ic]);
887 myExtra.addSingleLegConvTrackRef(singleLegRef[ic]);
890 for(
unsigned int ic = 0; ic < ConversionsRef_.
size(); ic++)
892 myExtra.addConversionRef(ConversionsRef_[ic]);
895 pfPhotonExtraCandidates.push_back(myExtra);
896 pfCandidates->push_back(photonCand);
898 elemsToLock.resize(0);
920 std::vector<unsigned int>insideMust;
921 std::vector<unsigned int>outsideMust;
922 std::multimap<float, unsigned int>OrderedClust;
928 for(
unsigned int i=0;
i<insideMust.size(); ++
i){
930 OrderedClust.insert(make_pair(PFClusters[index].
energy(),index));
932 std::multimap<float, unsigned int>::iterator it;
933 it=OrderedClust.begin();
934 unsigned int lowEindex=(*it).second;
935 std::multimap<float, unsigned int>::reverse_iterator rit;
936 rit=OrderedClust.rbegin();
937 unsigned int highEindex=(*rit).second;
938 if(insideMust.size()>1){
939 dEta_=fabs(PFClusters[highEindex].
eta()-PFClusters[lowEindex].
eta());
940 dPhi_=asin(PFClusters[highEindex].
phi()-PFClusters[lowEindex].
phi());
949 std::vector<reco::CaloCluster>PFMustClusters;
950 if(insideMust.size()>2){
951 for(
unsigned int i=0;
i<insideMust.size(); ++
i){
952 unsigned int index=insideMust[
i];
953 if(index==lowEindex)
continue;
954 PFMustClusters.push_back(PFClusters[index]);
958 for(
unsigned int i=0;
i<insideMust.size(); ++
i){
959 unsigned int index=insideMust[
i];
960 PFMustClusters.push_back(PFClusters[index]);
967 for(
unsigned i=0;
i<eleInBlocks.size();
i++)
970 unsigned indexInBlock = eleInBlocks[
i].second;
1024 std::vector<unsigned int>insideMust;
1025 std::vector<unsigned int>outsideMust;
1026 std::multimap<float, unsigned int>OrderedClust;
1032 for(
unsigned int i=0;
i<insideMust.size(); ++
i){
1034 OrderedClust.insert(make_pair(PFClusters[index].
energy(),index));
1036 std::multimap<float, unsigned int>::iterator it;
1037 it=OrderedClust.begin();
1038 unsigned int lowEindex=(*it).second;
1039 std::multimap<float, unsigned int>::reverse_iterator rit;
1040 rit=OrderedClust.rbegin();
1041 unsigned int highEindex=(*rit).second;
1042 if(insideMust.size()>1){
1043 dEta_=fabs(PFClusters[highEindex].
eta()-PFClusters[lowEindex].
eta());
1044 dPhi_=asin(PFClusters[highEindex].
phi()-PFClusters[lowEindex].
phi());
1053 std::vector<reco::CaloCluster>PFMustClusters;
1054 if(insideMust.size()>2){
1055 for(
unsigned int i=0;
i<insideMust.size(); ++
i){
1056 unsigned int index=insideMust[
i];
1057 if(index==lowEindex)
continue;
1058 PFMustClusters.push_back(PFClusters[index]);
1062 for(
unsigned int i=0;
i<insideMust.size(); ++
i){
1063 unsigned int index=insideMust[
i];
1064 PFMustClusters.push_back(PFClusters[index]);
1071 for(
unsigned i=0;
i<eleInBlocks.size();
i++)
1074 unsigned indexInBlock = eleInBlocks[
i].second;
1159 double PFClustPhiRMS=0;
1163 for(
unsigned int c=0;
c<PFClusters.size(); ++
c){
1164 delPhi2=(acos(
cos(PFPhoPhi-PFClusters[
c].
phi()))* acos(
cos(PFPhoPhi-PFClusters[
c].
phi())) )+delPhi2;
1165 delPhiSum=delPhiSum+ acos(
cos(PFPhoPhi-PFClusters[
c].
phi()))*PFClusters[
c].energy();
1166 ClusSum=ClusSum+PFClusters[
c].energy();
1168 double meandPhi=delPhiSum/ClusSum;
1169 PFClustPhiRMS=
sqrt(fabs(delPhi2/ClusSum - (meandPhi*meandPhi)));
1171 return PFClustPhiRMS;
1177 std::pair<double, double>ClusCoor=ClusterVar.
GetCrysCoor();
1178 std::pair<int, int>ClusIndex=ClusterVar.
GetCrysIndex();
1226 if(rightstrip>leftstrip)
e2x5Max_=rightstrip+centerstrip;
1227 else e2x5Max_=leftstrip+centerstrip;
1232 ClusPhi_=clusterRef->position().phi();
1233 ClusEta_=fabs(clusterRef->position().eta());
1234 EB=fabs(clusterRef->position().eta())/clusterRef->position().eta();
1264 LC_Var[22]=CrysIphiMod2;
1265 LC_Var[23]=CrysIetaMod5;
1266 LC_Var[24]=CrysIphiMod20;
1305 bool convtkfound=
false;
1311 chi2=elements[track_index].trackRef()->chi2()/elements[track_index].trackRef()->ndof();
1312 nlost=elements[track_index].trackRef()->trackerExpectedHitsInner().numberOfLostHits();
1313 nlayers=elements[track_index].trackRef()->hitPattern().trackerLayersWithMeasurement();
1314 track_pt=elements[track_index].trackRef()->pt();
1315 STIP=elements[track_index].trackRefPF()->STIP();
1319 std::multimap<double, unsigned int> ecalAssoTrack;
1324 std::multimap<double, unsigned int> hcalAssoTrack;
1329 if(ecalAssoTrack.size() > 0) {
1330 for(std::multimap<double, unsigned int>::iterator itecal = ecalAssoTrack.begin();
1331 itecal != ecalAssoTrack.end(); ++itecal) {
1332 linked_e=linked_e+elements[itecal->second].clusterRef()->energy();
1335 if(hcalAssoTrack.size() > 0) {
1336 for(std::multimap<double, unsigned int>::iterator ithcal = hcalAssoTrack.begin();
1337 ithcal != hcalAssoTrack.end(); ++ithcal) {
1338 linked_h=linked_h+elements[ithcal->second].clusterRef()->energy();
1341 EoverPt=linked_e/elements[track_index].trackRef()->pt();
1342 HoverPt=linked_h/elements[track_index].trackRef()->pt();
1343 GlobalVector rvtx(elements[track_index].trackRef()->innerPosition().
X()-primaryvtx.
x(),
1344 elements[track_index].trackRef()->innerPosition().Y()-primaryvtx.
y(),
1345 elements[track_index].trackRef()->innerPosition().Z()-primaryvtx.
z());
1346 double vtx_phi=rvtx.
phi();
1348 del_phi=fabs(
deltaPhi(vtx_phi, elements[track_index].trackRef()->innerMomentum().
Phi()));
1358 std::vector<reco::PFCandidate>&
1359 tempElectronCandidates,
1365 for ( std::vector<reco::PFCandidate>::const_iterator ec=tempElectronCandidates.begin(); ec != tempElectronCandidates.end(); ++ec )
1368 int mh=ec->gsfTrackRef()->trackerExpectedHitsInner().numberOfLostHits();
1377 if(seedRef.
isAvailable() && seedRef->isEcalDriven())
1384 if(PhotscRef==ElecscRef)
1391 for(
unsigned i=0;
i<eleInBlocks.size();
i++)
1394 unsigned indexInBlock = eleInBlocks[
i].second;
double GetResponse(const float *vector) const
void setPs2Energy(float e2)
set corrected PS2 energy
Abstract base class for a PFBlock element (track, cluster...)
PhotonRef photonRef() const
void setPs1Energy(float e1)
set corrected PS1 energy
const GBRForest * ReaderLCEE_
void setFlag(Flags theFlag, bool value)
set a given flag
void set_mva_nothing_gamma(float mva)
set mva for gamma detection
double y() const
y coordinate
std::map< unsigned int, Link > LinkData
Geom::Phi< T > phi() const
verbosityLevel verbosityLevel_
virtual void setP4(const LorentzVector &p4)
set 4-momentum
const edm::OwnVector< reco::PFBlockElement > & elements() const
const GBRForest * ReaderRes_
const LinkData & linkData() const
std::vector< unsigned int > AddFromElectron_
const GBRForest * ReaderGCEEhR9_
float EvaluateGCorrMVA(reco::PFCandidate, std::vector< reco::CaloCluster >PFClusters)
double E5x5Element(int i, int j)
reco::Vertex primaryVertex_
std::pair< double, double > GetCrysCoor()
virtual double eta() const
momentum pseudorapidity
std::vector< ElementInBlock > ElementsInBlocks
const ElementsInBlocks & elementsInBlocks() const
std::vector< PFCandidatePtr > pfCandidates(const PFJet &jet, int particleId, bool sort=true)
void RunPFPhoton(const reco::PFBlockRef &blockRef, std::vector< bool > &active, std::auto_ptr< reco::PFCandidateCollection > &pfPhotonCandidates, std::vector< reco::PFCandidatePhotonExtra > &pfPhotonExtraCandidates, std::vector< reco::PFCandidate > &tempElectronCandidates)
void addLCorrClusEnergy(float LCorrE)
XYZTLorentzVectorD XYZTLorentzVector
Lorentz vector with cylindrical internal representation using pseudorapidity.
bool isNonnull() const
Checks for non-null.
virtual double energy() const
energy
void MustacheClust(std::vector< CaloCluster >clusters, std::vector< unsigned int > &insideMust, std::vector< unsigned int > &outsideMust)
std::pair< double, double > GetCrysIndex()
TMVA::Reader * tmvaReader_
void addElementInBlock(const reco::PFBlockRef &blockref, unsigned elementIndex)
add an element to the current PFCandidate
virtual reco::TrackRef trackRef() const
Cos< T >::type cos(const T &t)
double z() const
y coordinate
SuperClusterRef superClusterRef() const
float EvaluateLCorrMVA(reco::PFClusterRef clusterRef)
const GBRForest * ReaderLCEB_
block
Formating index page's pieces.
void addDaughter(const Candidate &, const std::string &s="")
add a clone of the passed candidate as daughter
double sumPtTrackIsoSlopeForPhoton_
PFPhotonAlgo(std::string mvaweightfile, double mvaConvCut, bool useReg, std::string X0_Map, const reco::Vertex &primary, const boost::shared_ptr< PFEnergyCalibration > &thePFEnergyCalibration, double sumPtTrackIsoForPhoton, double sumPtTrackIsoSlopeForPhoton)
void setEcalEnergy(float eeRaw, float eeCorr)
set corrected Ecal energy
double ClustersPhiRMS(std::vector< reco::CaloCluster >PFClusters, float PFPhoPhi)
boost::shared_ptr< PFEnergyCalibration > thePFEnergyCalibration_
const GBRForest * ReaderGCEB_
void EarlyConversion(std::vector< reco::PFCandidate > &tempElectronCandidates, const reco::PFBlockElementSuperCluster *sc)
double x() const
x coordinate
virtual bool trackType(TrackType trType) const
XYZVectorD XYZVector
spatial vector with cartesian internal representation
void associatedElements(unsigned i, const LinkData &linkData, std::multimap< double, unsigned > &sortedAssociates, reco::PFBlockElement::Type type=PFBlockElement::NONE, LinkTest test=LINKTEST_RECHIT) const
XYZPointD XYZPoint
point in space with cartesian internal representation
virtual void setVertex(math::XYZPoint p)
float EvaluateResMVA(reco::PFCandidate, std::vector< reco::CaloCluster >PFClusters)
bool EvaluateSingleLegMVA(const reco::PFBlockRef &blockref, const reco::Vertex &primaryvtx, unsigned int track_index)
Particle reconstructed by the particle flow algorithm.
void push_back(value_type const &ref)
Add a Ref<C, T> to the RefVector.
size_type size() const
Size of the RefVector.
void setSuperClusterRef(const reco::SuperClusterRef &scRef)
const GBRForest * ReaderGCEElR9_
void FillMustacheVar(std::vector< CaloCluster >clusters)
double sumPtTrackIsoForPhoton_
std::vector< int > match_ind
virtual double phi() const
momentum azimuthal angle
void setHcalEnergy(float ehRaw, float ehCorr)
set corrected Hcal energy
reco::SuperClusterRef superClusterRef() const
return a reference to the corresponding SuperCluster if any