147 edm::LogError(
"")<<
"Error! Can't get ElectronCollection by label. ";
255 std::cout <<
"Error!!! HLT is missing!" << std::endl;
356 const int n1 = sc1->size();
357 const int n2 = sc2->size();
361 for (
int i=0;
i<5; ++
i) {
372 std::vector<double> ETsc1;
373 std::vector<reco::SuperCluster>::const_iterator sc;
374 for (sc = sc1->begin(); sc != sc1->end(); ++sc) {
376 double scEt = mySc.
energy()/(cosh(mySc.
eta()));
377 ETsc1.push_back(scEt);
380 int *sorted1 =
new int[n1];
381 double *et1 =
new double[n1];
382 for (
int i=0;
i<n1; ++
i) {
386 TMath::Sort(n1, et1, sorted1,
true);
388 std::vector<double> ETsc2;
389 for (sc = sc2->begin(); sc != sc2->end(); ++sc) {
391 double scEt = mySc.
energy()/(cosh(mySc.
eta()));
392 ETsc2.push_back(scEt);
395 int *sorted2 =
new int[n2];
396 double *et2 =
new double[n2];
397 for (
int i=0;
i<n2; ++
i) {
401 TMath::Sort(n2, et2, sorted2,
true);
404 for(
int probeSc = 0; probeSc < n1; ++probeSc)
408 if (probeSc >= 5)
break;
410 int sc_index = sorted1[probeSc];
411 std::vector<reco::SuperCluster>::const_iterator
412 Rprobe = sc1->begin() + sc_index;
421 for(
int probeSc = 0; probeSc < n2; ++probeSc)
425 if (probeSc >= 5)
break;
427 int sc_index = sorted2[probeSc];
428 std::vector<reco::SuperCluster>::const_iterator
429 Rprobe = sc2->begin() + sc_index;
437 delete [] sorted1;
delete [] sorted2;
438 delete [] et1;
delete [] et2;
444 reco::TrackCollection::const_iterator tr;
445 const int ntracks = ctf->size();
453 for (
int i=0;
i<20; ++
i) {
461 std::vector<double> ETtrack;
462 for (tr = ctf->begin(); tr != ctf->end(); ++tr) {
464 double scEt = mySc.
pt();
465 ETtrack.push_back(scEt);
467 int *sortedTr =
new int[ntracks];
468 double *etTr =
new double[ntracks];
469 for (
int i=0;
i<ntracks; ++
i) {
470 etTr[
i] = ETtrack[
i];
473 TMath::Sort(ntracks, etTr, sortedTr,
true);
475 for(
int probeSc = 0; probeSc < ntracks; ++probeSc)
479 if (probeSc >= 20)
break;
481 int sc_index = sortedTr[probeSc];
482 std::vector<reco::Track>::const_iterator
483 Rprobe = ctf->begin() + sc_index;
496 delete [] sortedTr;
delete [] etTr;
500 evt.
getByLabel(
"selectedLayer1Muons", pMuons);
502 pat::MuonCollection::const_iterator
muon;
503 const int nmuons = pMuons->size();
505 for (
int i=0;
i<4; ++
i) {
513 std::vector<double> ETmuons;
514 for (muon = pmuon->begin(); muon != pmuon->end(); ++
muon) {
516 double scEt = mySc.
track()->pt();
517 ETmuons.push_back(scEt);
519 int *sortedMu =
new int[nmuons];
520 double *etMu =
new double[nmuons];
521 for (
int i=0;
i<nmuons; ++
i) {
522 etMu[
i] = ETmuons[
i];
525 TMath::Sort(nmuons, etMu, sortedMu,
true);
527 for(
int probeSc = 0; probeSc < nmuons; ++probeSc)
531 if (probeSc >= 4)
break;
533 int sc_index = sortedMu[probeSc];
534 std::vector<pat::Muon>::const_iterator
535 Rprobe = pmuon->begin() + sc_index;
548 delete [] sortedMu;
delete [] etMu;
550 if (n1+n2+ntracks == 0) {
551 std::cout <<
"Return: no sc in this event" << std::endl;
557 const int MAX_PROBES = 4;
558 for(
int i =0;
i < MAX_PROBES;
i++){
617 std::vector<pat::ElectronRef> UniqueElectrons;
625 for(pat::ElectronCollection::const_iterator
626 elec = electrons->begin(); elec != electrons->end();++elec) {
629 pat::ElectronCollection::const_iterator BestDuplicate = elec;
631 for(pat::ElectronCollection::const_iterator
632 elec2 = electrons->begin();
633 elec2 != electrons->end(); ++elec2)
637 if( elec->superCluster() == elec2->superCluster())
639 if(fabs(BestDuplicate->eSuperClusterOverP()-1.)
640 >= fabs(elec2->eSuperClusterOverP()-1.))
642 BestDuplicate = elec2;
648 if(BestDuplicate == elec) UniqueElectrons.push_back(electronRef);
665 std::vector<double> ETs;
666 std::vector<pat::ElectronRef>::const_iterator elec;
667 for (elec = UniqueElectrons.begin(); elec != UniqueElectrons.end(); ++elec) {
670 double probeEt = probeEle->caloEnergy()/(cosh(probeEle->caloPosition().eta()));
671 ETs.push_back(probeEt);
682 TMath::Sort(elec_1_duplicate_removal, et, sorted,
true);
689 if (probeIt >= MAX_PROBES)
break;
691 int elec_index = sorted[probeIt];
692 std::vector<pat::ElectronRef>::const_iterator
693 Rprobe = UniqueElectrons.begin() + elec_index;
697 double probeEt = probeEle->caloEnergy()/(cosh(probeEle->caloPosition().eta()));
702 if(fabs(probeEle->caloPosition().eta()) <
BarrelMaxEta ||
716 probeEle->classification();
717 double ProbeTIP = probeEle->gsfTrack()->d0();
726 probeEle->dr04IsolationVariables().hcalDepth1TowerSumEt +
727 probeEle->dr04IsolationVariables().hcalDepth2TowerSumEt;
729 probe_iso_user[probeIt] = probeEle->dr04IsolationVariables().tkSumPt;
732 probeEle->dr03IsolationVariables().hcalDepth1TowerSumEt +
733 probeEle->dr03IsolationVariables().hcalDepth2TowerSumEt;
735 double hOverE = probeEle->hadronicOverEm();
736 double deltaPhiIn = probeEle->deltaPhiSuperClusterTrackAtVtx();
737 double deltaEtaIn = probeEle->deltaEtaSuperClusterTrackAtVtx();
738 double eOverP = probeEle->eSuperClusterOverP();
739 double pin = probeEle->trackMomentumAtVtx().R();
740 double pout = probeEle->trackMomentumOut().R();
741 double sigmaee = probeEle->scSigmaEtaEta();
742 double sigma_IetaIeta = probeEle->scSigmaIEtaIEta();
744 if( fabs (probeEle->caloPosition().eta()) > 1.479 ) {
745 sigmaee = sigmaee - 0.02*(fabs(probeEle->caloPosition().eta()) -2.3);
749 double e5x5, e2x5, e1x5;
750 e5x5 = probeEle->scE5x5();
751 e1x5 = probeEle->scE1x5();
752 e2x5 = probeEle->scE2x5Max();
900 histofile =
new TFile(filename_histo,
"RECREATE");
903 probe_tree =
new TTree(
"probe_tree",
"Tree to store probe variables");
910 "probe_ele_vertex_x[4]/D");
912 "probe_ele_vertex_y[4]/D");
914 "probe_ele_vertex_z[4]/D");
1020 "ctf_track_tip_bs[20]/D");
1038 std::cout <<
"Empty tree: no output..." << std::endl;
T getUntrackedParameter(std::string const &, T const &) const
double probe_ele_phi_for_tree[4]
edm::InputTag HLTCollectionE31_
double probe_ecal_iso_user[4]
double sc_multi5x5_eta[5]
double probe_sc_eta_for_tree[4]
edm::InputTag pfMetCollectionTag_
int elec_1_duplicate_removal
#define DEFINE_FWK_MODULE(type)
int probe_sc_pass_fiducial_cut[4]
edm::InputTag HLTTriggerResultsE31_
std::vector< Track > TrackCollection
collection of Tracks
double probe_ele_eta_for_tree[4]
double probe_hcal_isolation_value[4]
double probe_ele_sihih[4]
edm::InputTag tcMetCollectionTag_
double phi() const
azimuthal angle of momentum vector
int probe_charge_for_tree[4]
edm::InputTag t1MetCollectionTag_
double probe_ele_Xvertex_for_tree[4]
edm::InputTag corHybridsc_
double eta() const
pseudorapidity of cluster centroid
edm::InputTag mcMetCollectionTag_
int probe_classification_index_for_tree[4]
double probe_ele_et_for_tree[4]
GenPurposeSkimmerData(const edm::ParameterSet &)
double sc_multi5x5_phi[5]
double eta() const
pseudorapidity of momentum vector
std::vector< Electron > ElectronCollection
double probe_ele_Zvertex_for_tree[4]
std::vector< SuperCluster > SuperClusterCollection
collection of SuperCluser objectr
double pt() const
track transverse momentum
edm::InputTag multi5x5sc_
edm::InputTag ctfTracksTag_
double energy() const
cluster energy
double probe_isolation_value[4]
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
double vz() const
z coordinate of the reference point on track
double ctf_track_tip_bs[20]
XYZPointD XYZPoint
point in space with cartesian internal representation
T const * product() const
std::vector< Muon > MuonCollection
double probe_ele_Yvertex_for_tree[4]
double probe_sc_phi_for_tree[4]
double vy() const
y coordinate of the reference point on track
double probe_ecal_isolation_value[4]
double probe_sc_et_for_tree[4]
edm::InputTag HLTTriggerResultsE29_
const Point & position() const
position
double phi() const
azimuthal angle of cluster centroid
virtual void analyze(const edm::Event &, const edm::EventSetup &)
edm::InputTag ElectronCollection_
double dxy() const
dxy parameter. (This is the transverse impact parameter w.r.t. to (0,0,0) ONLY if refPoint is close t...
double probe_hcal_iso_user[4]
Analysis-level muon class.
reco::TrackRef track() const
reference to Track reconstructed in the tracker only (reimplemented from reco::Muon) ...
edm::InputTag HLTCollectionE29_
double vx() const
x coordinate of the reference point on track
edm::InputTag MetCollectionTag_