143 edm::LogError(
"") <<
"Error! Can't get ElectronCollection by label. ";
251 std::cout <<
"Error!!! HLT is missing!" << std::endl;
324 if (
pfMET.isValid()) {
362 const int n1 = sc1->size();
363 const int n2 = sc2->size();
367 for (
int i = 0;
i < 5; ++
i) {
378 std::vector<double> ETsc1;
379 std::vector<reco::SuperCluster>::const_iterator sc;
380 for (sc = sc1->begin(); sc != sc1->end(); ++sc) {
382 double scEt = mySc.
energy() / (cosh(mySc.
eta()));
383 ETsc1.push_back(scEt);
385 int *sorted1 =
new int[n1];
386 double *et1 =
new double[n1];
387 for (
int i = 0;
i < n1; ++
i) {
391 TMath::Sort(n1, et1, sorted1,
true);
393 std::vector<double> ETsc2;
394 for (sc = sc2->begin(); sc != sc2->end(); ++sc) {
396 double scEt = mySc.
energy() / (cosh(mySc.
eta()));
397 ETsc2.push_back(scEt);
399 int *sorted2 =
new int[n2];
400 double *et2 =
new double[n2];
401 for (
int i = 0;
i < n2; ++
i) {
405 TMath::Sort(n2, et2, sorted2,
true);
408 for (
int probeSc = 0; probeSc < n1; ++probeSc) {
414 int sc_index = sorted1[probeSc];
415 std::vector<reco::SuperCluster>::const_iterator Rprobe = sc1->begin() + sc_index;
424 for (
int probeSc = 0; probeSc < n2; ++probeSc) {
430 int sc_index = sorted2[probeSc];
431 std::vector<reco::SuperCluster>::const_iterator Rprobe = sc2->begin() + sc_index;
448 reco::TrackCollection::const_iterator tr;
457 for (
int i = 0;
i < 20; ++
i) {
468 std::vector<double> ETtrack;
469 for (tr =
ctf->begin(); tr !=
ctf->end(); ++tr) {
471 double scEt = mySc.
pt();
472 ETtrack.push_back(scEt);
474 int *sortedTr =
new int[
ntracks];
475 double *etTr =
new double[
ntracks];
477 etTr[
i] = ETtrack[
i];
480 TMath::Sort(
ntracks, etTr, sortedTr,
true);
482 for (
int probeSc = 0; probeSc <
ntracks; ++probeSc) {
488 int sc_index = sortedTr[probeSc];
489 std::vector<reco::Track>::const_iterator Rprobe =
ctf->begin() + sc_index;
509 pat::MuonCollection::const_iterator
muon;
510 const int nmuons = pMuons->size();
512 for (
int i = 0;
i < 4; ++
i) {
523 std::vector<double> ETmuons;
524 for (
muon = pmuon->begin();
muon != pmuon->end(); ++
muon) {
526 double scEt = mySc.
track()->pt();
527 ETmuons.push_back(scEt);
529 int *sortedMu =
new int[
nmuons];
530 double *etMu =
new double[
nmuons];
532 etMu[
i] = ETmuons[
i];
535 TMath::Sort(
nmuons, etMu, sortedMu,
true);
537 for (
int probeSc = 0; probeSc <
nmuons; ++probeSc) {
543 int sc_index = sortedMu[probeSc];
544 std::vector<pat::Muon>::const_iterator Rprobe = pmuon->begin() + sc_index;
561 std::cout <<
"Return: no sc in this event" << std::endl;
567 const int MAX_PROBES = 4;
568 for (
int i = 0;
i < MAX_PROBES;
i++) {
626 std::vector<pat::ElectronRef> UniqueElectrons;
634 for (pat::ElectronCollection::const_iterator elec =
electrons->begin(); elec !=
electrons->end(); ++elec) {
637 pat::ElectronCollection::const_iterator BestDuplicate = elec;
639 for (pat::ElectronCollection::const_iterator elec2 =
electrons->begin(); elec2 !=
electrons->end(); ++elec2) {
641 if (elec->superCluster() == elec2->superCluster()) {
642 if (fabs(BestDuplicate->eSuperClusterOverP() - 1.) >= fabs(elec2->eSuperClusterOverP() - 1.)) {
643 BestDuplicate = elec2;
649 if (BestDuplicate == elec)
650 UniqueElectrons.push_back(electronRef);
667 std::vector<double> ETs;
668 std::vector<pat::ElectronRef>::const_iterator elec;
669 for (elec = UniqueElectrons.begin(); elec != UniqueElectrons.end(); ++elec) {
672 double probeEt =
probeEle->caloEnergy() / (cosh(
probeEle->caloPosition().eta()));
673 ETs.push_back(probeEt);
689 if (probeIt >= MAX_PROBES)
692 int elec_index = sorted[probeIt];
693 std::vector<pat::ElectronRef>::const_iterator Rprobe = UniqueElectrons.begin() + elec_index;
697 double probeEt =
probeEle->caloEnergy() / (cosh(
probeEle->caloPosition().eta()));
715 double ProbeTIP =
probeEle->gsfTrack()->d0();
724 probeEle->dr04IsolationVariables().hcalDepth2TowerSumEt;
729 probeEle->dr03IsolationVariables().hcalDepth2TowerSumEt;
735 double pin =
probeEle->trackMomentumAtVtx().R();
736 double pout =
probeEle->trackMomentumOut().R();
737 double sigmaee =
probeEle->scSigmaEtaEta();
738 double sigma_IetaIeta =
probeEle->scSigmaIEtaIEta();
740 if (fabs(
probeEle->caloPosition().eta()) > 1.479) {
741 sigmaee = sigmaee - 0.02 * (fabs(
probeEle->caloPosition().eta()) - 2.3);
893 histofile =
new TFile(filename_histo,
"RECREATE");
896 probe_tree =
new TTree(
"probe_tree",
"Tree to store probe variables");
1023 std::cout <<
"Empty tree: no output..." << std::endl;