146 edm::LogError(
"")<<
"Error! Can't get ElectronCollection by label. ";
254 std::cout <<
"Error!!! HLT is missing!" << std::endl;
355 const int n1 = sc1->size();
356 const int n2 = sc2->size();
360 for (
int i=0;
i<5; ++
i) {
371 std::vector<double> ETsc1;
372 std::vector<reco::SuperCluster>::const_iterator sc;
373 for (sc = sc1->begin(); sc != sc1->end(); ++sc) {
375 double scEt = mySc.
energy()/(cosh(mySc.
eta()));
376 ETsc1.push_back(scEt);
379 int *sorted1 =
new int[n1];
380 double *et1 =
new double[n1];
381 for (
int i=0;
i<n1; ++
i) {
385 TMath::Sort(n1, et1, sorted1,
true);
387 std::vector<double> ETsc2;
388 for (sc = sc2->begin(); sc != sc2->end(); ++sc) {
390 double scEt = mySc.
energy()/(cosh(mySc.
eta()));
391 ETsc2.push_back(scEt);
394 int *sorted2 =
new int[n2];
395 double *et2 =
new double[n2];
396 for (
int i=0;
i<n2; ++
i) {
400 TMath::Sort(n2, et2, sorted2,
true);
403 for(
int probeSc = 0; probeSc < n1; ++probeSc)
407 if (probeSc >= 5)
break;
409 int sc_index = sorted1[probeSc];
410 std::vector<reco::SuperCluster>::const_iterator
411 Rprobe = sc1->begin() + sc_index;
420 for(
int probeSc = 0; probeSc < n2; ++probeSc)
424 if (probeSc >= 5)
break;
426 int sc_index = sorted2[probeSc];
427 std::vector<reco::SuperCluster>::const_iterator
428 Rprobe = sc2->begin() + sc_index;
436 delete [] sorted1;
delete [] sorted2;
437 delete [] et1;
delete [] et2;
443 reco::TrackCollection::const_iterator tr;
444 const int ntracks = ctf->size();
452 for (
int i=0;
i<20; ++
i) {
460 std::vector<double> ETtrack;
461 for (tr = ctf->begin(); tr != ctf->end(); ++tr) {
463 double scEt = mySc.
pt();
464 ETtrack.push_back(scEt);
466 int *sortedTr =
new int[ntracks];
467 double *etTr =
new double[ntracks];
468 for (
int i=0;
i<ntracks; ++
i) {
469 etTr[
i] = ETtrack[
i];
472 TMath::Sort(ntracks, etTr, sortedTr,
true);
474 for(
int probeSc = 0; probeSc < ntracks; ++probeSc)
478 if (probeSc >= 20)
break;
480 int sc_index = sortedTr[probeSc];
481 std::vector<reco::Track>::const_iterator
482 Rprobe = ctf->begin() + sc_index;
495 delete [] sortedTr;
delete [] etTr;
499 evt.
getByLabel(
"selectedLayer1Muons", pMuons);
501 pat::MuonCollection::const_iterator
muon;
502 const int nmuons = pMuons->size();
504 for (
int i=0;
i<4; ++
i) {
512 std::vector<double> ETmuons;
513 for (muon = pmuon->begin(); muon != pmuon->end(); ++
muon) {
515 double scEt = mySc.
track()->pt();
516 ETmuons.push_back(scEt);
518 int *sortedMu =
new int[nmuons];
519 double *etMu =
new double[nmuons];
520 for (
int i=0;
i<nmuons; ++
i) {
521 etMu[
i] = ETmuons[
i];
524 TMath::Sort(nmuons, etMu, sortedMu,
true);
526 for(
int probeSc = 0; probeSc < nmuons; ++probeSc)
530 if (probeSc >= 4)
break;
532 int sc_index = sortedMu[probeSc];
533 std::vector<pat::Muon>::const_iterator
534 Rprobe = pmuon->begin() + sc_index;
547 delete [] sortedMu;
delete [] etMu;
549 if (n1+n2+ntracks == 0) {
550 std::cout <<
"Return: no sc in this event" << std::endl;
556 const int MAX_PROBES = 4;
557 for(
int i =0;
i < MAX_PROBES;
i++){
616 std::vector<pat::ElectronRef> UniqueElectrons;
624 for(pat::ElectronCollection::const_iterator
625 elec = electrons->begin(); elec != electrons->end();++elec) {
628 pat::ElectronCollection::const_iterator BestDuplicate = elec;
630 for(pat::ElectronCollection::const_iterator
631 elec2 = electrons->begin();
632 elec2 != electrons->end(); ++elec2)
636 if( elec->superCluster() == elec2->superCluster())
638 if(fabs(BestDuplicate->eSuperClusterOverP()-1.)
639 >= fabs(elec2->eSuperClusterOverP()-1.))
641 BestDuplicate = elec2;
647 if(BestDuplicate == elec) UniqueElectrons.push_back(electronRef);
664 std::vector<double> ETs;
665 std::vector<pat::ElectronRef>::const_iterator elec;
666 for (elec = UniqueElectrons.begin(); elec != UniqueElectrons.end(); ++elec) {
669 double probeEt = probeEle->caloEnergy()/(cosh(probeEle->caloPosition().eta()));
670 ETs.push_back(probeEt);
681 TMath::Sort(elec_1_duplicate_removal, et, sorted,
true);
688 if (probeIt >= MAX_PROBES)
break;
690 int elec_index = sorted[probeIt];
691 std::vector<pat::ElectronRef>::const_iterator
692 Rprobe = UniqueElectrons.begin() + elec_index;
696 double probeEt = probeEle->caloEnergy()/(cosh(probeEle->caloPosition().eta()));
701 if(fabs(probeEle->caloPosition().eta()) <
BarrelMaxEta ||
715 probeEle->classification();
716 double ProbeTIP = probeEle->gsfTrack()->d0();
725 probeEle->dr04IsolationVariables().hcalDepth1TowerSumEt +
726 probeEle->dr04IsolationVariables().hcalDepth2TowerSumEt;
728 probe_iso_user[probeIt] = probeEle->dr04IsolationVariables().tkSumPt;
731 probeEle->dr03IsolationVariables().hcalDepth1TowerSumEt +
732 probeEle->dr03IsolationVariables().hcalDepth2TowerSumEt;
734 double hOverE = probeEle->hadronicOverEm();
735 double deltaPhiIn = probeEle->deltaPhiSuperClusterTrackAtVtx();
736 double deltaEtaIn = probeEle->deltaEtaSuperClusterTrackAtVtx();
737 double eOverP = probeEle->eSuperClusterOverP();
738 double pin = probeEle->trackMomentumAtVtx().R();
739 double pout = probeEle->trackMomentumOut().R();
740 double sigmaee = probeEle->scSigmaEtaEta();
741 double sigma_IetaIeta = probeEle->scSigmaIEtaIEta();
743 if( fabs (probeEle->caloPosition().eta()) > 1.479 ) {
744 sigmaee = sigmaee - 0.02*(fabs(probeEle->caloPosition().eta()) -2.3);
748 double e5x5, e2x5, e1x5;
749 e5x5 = probeEle->scE5x5();
750 e1x5 = probeEle->scE1x5();
751 e2x5 = probeEle->scE2x5Max();
899 histofile =
new TFile(filename_histo,
"RECREATE");
902 probe_tree =
new TTree(
"probe_tree",
"Tree to store probe variables");
909 "probe_ele_vertex_x[4]/D");
911 "probe_ele_vertex_y[4]/D");
913 "probe_ele_vertex_z[4]/D");
1019 "ctf_track_tip_bs[20]/D");
1037 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_