56 using boost::shared_ptr;
71 eventAuxiliary_( new edm::EventAuxiliary ),
89 =
new TH1F(
"h_deltaETvisible_MCEHT",
"Jet Et difference CaloTowers-MC"
92 =
new TH1F(
"h_deltaETvisible_MCPF" ,
"Jet Et difference ParticleFlow-MC"
107 unsigned int nev =
ev_->
size();
108 for (
unsigned int entry = 0; entry < nev; ++entry ) {
114 cout<<
"Number of events: "<< nev
138 cout<<
"calling PFRootEventManager::readOptions"<<endl;
155 catch(
const string& err ) {
166 string calibfilename;
168 if (!calibfilename.empty()) {
169 calibFile_ =
new std::ofstream(calibfilename.c_str());
170 std::cout <<
"Calib file name " << calibfilename <<
" " << calibfilename.c_str() << std::endl;
179 bool doOutTree =
false;
182 if(!outfilename.empty() ) {
183 outFile_ = TFile::Open(outfilename.c_str(),
"recreate");
203 options_->
GetOpt(
"pfjet_benchmark",
"outjetfile", outjetfilename);
209 options_->
GetOpt(
"pfjet_benchmark",
"plotAgainstReco", plotAgainstReco);
242 options_->
GetOpt(
"pfmet_benchmark",
"outmetfile", outmetfilename);
251 bool pfmetBenchmarkDebug;
252 options_->
GetOpt(
"pfmet_benchmark",
"debug", pfmetBenchmarkDebug);
264 std::vector<unsigned int> vIgnoreParticlesIDs;
265 options_->
GetOpt(
"pfmet_benchmark",
"trueMetIgnoreParticlesIDs", vIgnoreParticlesIDs);
268 metManager_->SetIgnoreParticlesIDs(&vIgnoreParticlesIDs);
270 std::vector<unsigned int> trueMetSpecificIdCut;
271 std::vector<double> trueMetSpecificEtaCut;
272 options_->
GetOpt(
"pfmet_benchmark",
"trueMetSpecificIdCut", trueMetSpecificIdCut);
273 options_->
GetOpt(
"pfmet_benchmark",
"trueMetSpecificEtaCut", trueMetSpecificEtaCut);
274 if (trueMetSpecificIdCut.size()!=trueMetSpecificEtaCut.size())
std::cout <<
"Warning: PFRootEventManager: trueMetSpecificIdCut.size()!=trueMetSpecificEtaCut.size()" << std::endl;
275 else metManager_->SetSpecificIdCut(&trueMetSpecificIdCut,&trueMetSpecificEtaCut);
282 cout<<
"+++ Setting PFCandidate benchmark"<<endl;
284 dir = dir->mkdir(
"PFTask");
285 dir = dir->mkdir(
"particleFlowManager");
292 bool matchCharge =
true;
293 options_->
GetOpt(
"pfCandidate_benchmark",
"matchCharge", matchCharge);
298 static_cast<Benchmark::Mode>(mode));
302 cout<<
"+++ Done "<<endl;
309 cout<<
"+++ Setting PFDQM Monitoring " <<endl;
313 dqmFile_ = TFile::Open(dqmfilename.c_str(),
"recreate");
316 TDirectory* dir1 = dir->mkdir(
"PFJetValidation");
317 TDirectory*
dir2 = dir->mkdir(
"PFMETValidation");
324 bool matchCharge =
true;
325 options_->
GetOpt(
"pfCandidate_benchmark",
"matchCharge", matchCharge);
330 ptMin, 10e5, -4.5, 4.5, -10.0, 10.0,
false);
334 ptMin, 10e5, -4.5, 4.5, -10.0, 10.0,
false);
342 TH2F* hBNeighbour0 = 0;
343 TH2F* hENeighbour0 = 0;
345 if(!outputFile0.empty() ) {
346 file0 = TFile::Open(outputFile0.c_str(),
"recreate");
347 hBNeighbour0 =
new TH2F(
"BNeighbour0",
"f_{Neighbours} vs 1/E_{Seed} (ECAL Barrel)",500, 0., 0.5, 1000,0.,1.);
348 hENeighbour0 =
new TH2F(
"ENeighbour0",
"f_{Neighbours} vs 1/E_{Seed} (ECAL Endcap)",500, 0., 0.2, 1000,0.,1.);
353 TH2F* hBNeighbour1 = 0;
354 TH2F* hENeighbour1 = 0;
356 if(!outputFile1.empty() ) {
357 file1 = TFile::Open(outputFile1.c_str(),
"recreate");
358 hBNeighbour1 =
new TH2F(
"BNeighbour1",
"f_{Neighbours} vs 1/E_{Seed} (HCAL Barrel)",500, 0., 0.05, 400,0.,1.);
359 hENeighbour1 =
new TH2F(
"ENeighbour1",
"f_{Neighbours} vs 1/E_{Seed} (HCAL Endcap)",500, 0., 0.05, 400,0.,1.);
364 TH2F* hBNeighbour2 = 0;
365 TH2F* hENeighbour2 = 0;
367 if(!outputFile2.empty() ) {
368 file2 = TFile::Open(outputFile2.c_str(),
"recreate");
369 hBNeighbour2 =
new TH2F(
"BNeighbour2",
"f_{Neighbours} vs 1/E_{Seed} (HFEM Barrel)",500, 0., 0.02, 400,0.,1.);
370 hENeighbour2 =
new TH2F(
"ENeighbour2",
"f_{Neighbours} vs 1/E_{Seed} (HFEM Endcap)",500, 0., 0.02, 400,0.,1.);
375 TH2F* hBNeighbour3 = 0;
376 TH2F* hENeighbour3 = 0;
378 if(!outputFile3.empty() ) {
379 file3 = TFile::Open(outputFile3.c_str(),
"recreate");
380 hBNeighbour3 =
new TH2F(
"BNeighbour3",
"f_{Neighbours} vs 1/E_{Seed} (HFHAD Barrel)",500, 0., 0.02, 400,0.,1.);
381 hENeighbour3 =
new TH2F(
"ENeighbour3",
"f_{Neighbours} vs 1/E_{Seed} (HFHAD Endcap)",500, 0., 0.02, 400,0.,1.);
386 TH2F* hBNeighbour4 = 0;
387 TH2F* hENeighbour4 = 0;
389 if(!outputFile4.empty() ) {
390 file4 = TFile::Open(outputFile4.c_str(),
"recreate");
391 hBNeighbour4 =
new TH2F(
"BNeighbour4",
"f_{Neighbours} vs 1/E_{Seed} (Preshower Barrel)",200, 0., 1000., 400,0.,1.);
392 hENeighbour4 =
new TH2F(
"ENeighbour4",
"f_{Neighbours} vs 1/E_{Seed} (Preshower Endcap)",200, 0., 1000., 400,0.,1.);
412 cerr<<
"PFRootEventManager::ReadOptions, bad filter/taus option."<<endl
413 <<
"please use : "<<endl
414 <<
"\tfilter taus n_charged n_neutral"<<endl;
422 double threshold_R0=0.4;
425 double threshold_R1=1.0;
429 double threshHO_Seed_Ring0=1.0;
430 options_->
GetOpt(
"clustering",
"threshHO_Seed_Ring0", threshHO_Seed_Ring0);
432 double threshHO_Ring0=0.5;
435 double threshHO_Seed_Outer=3.1;
436 options_->
GetOpt(
"clustering",
"threshHO_Seed_Outer", threshHO_Seed_Outer);
438 double threshHO_Outer=1.0;
445 bool clusteringDebug =
false;
452 double threshEcalBarrel = 0.1;
453 options_->
GetOpt(
"clustering",
"thresh_Ecal_Barrel", threshEcalBarrel);
455 double threshPtEcalBarrel = 0.0;
456 options_->
GetOpt(
"clustering",
"thresh_Pt_Ecal_Barrel", threshPtEcalBarrel);
458 double threshSeedEcalBarrel = 0.3;
460 threshSeedEcalBarrel);
462 double threshPtSeedEcalBarrel = 0.0;
464 threshPtSeedEcalBarrel);
466 double threshCleanEcalBarrel = 1E5;
468 threshCleanEcalBarrel);
470 std::vector<double> minS4S1CleanEcalBarrel;
472 minS4S1CleanEcalBarrel);
474 double threshDoubleSpikeEcalBarrel = 10.;
476 threshDoubleSpikeEcalBarrel);
478 double minS6S2DoubleSpikeEcalBarrel = 0.04;
480 minS6S2DoubleSpikeEcalBarrel);
482 double threshEcalEndcap = 0.2;
483 options_->
GetOpt(
"clustering",
"thresh_Ecal_Endcap", threshEcalEndcap);
485 double threshPtEcalEndcap = 0.0;
486 options_->
GetOpt(
"clustering",
"thresh_Pt_Ecal_Endcap", threshPtEcalEndcap);
488 double threshSeedEcalEndcap = 0.8;
490 threshSeedEcalEndcap);
492 double threshPtSeedEcalEndcap = 0.0;
494 threshPtSeedEcalEndcap);
496 double threshCleanEcalEndcap = 1E5;
498 threshCleanEcalEndcap);
500 std::vector<double> minS4S1CleanEcalEndcap;
502 minS4S1CleanEcalEndcap);
504 double threshDoubleSpikeEcalEndcap = 1E9;
506 threshDoubleSpikeEcalEndcap);
508 double minS6S2DoubleSpikeEcalEndcap = -1.;
510 minS6S2DoubleSpikeEcalEndcap);
512 double showerSigmaEcal = 3;
516 int nNeighboursEcal = 4;
517 options_->
GetOpt(
"clustering",
"neighbours_Ecal", nNeighboursEcal);
519 int posCalcNCrystalEcal = -1;
521 posCalcNCrystalEcal);
524 = threshEcalBarrel<threshEcalEndcap ? threshEcalBarrel:threshEcalEndcap;
528 bool useCornerCellsEcal =
false;
600 double threshHcalBarrel = 0.8;
601 options_->
GetOpt(
"clustering",
"thresh_Hcal_Barrel", threshHcalBarrel);
603 double threshPtHcalBarrel = 0.0;
604 options_->
GetOpt(
"clustering",
"thresh_Pt_Hcal_Barrel", threshPtHcalBarrel);
606 double threshSeedHcalBarrel = 1.4;
608 threshSeedHcalBarrel);
610 double threshPtSeedHcalBarrel = 0.0;
612 threshPtSeedHcalBarrel);
614 double threshCleanHcalBarrel = 1E5;
616 threshCleanHcalBarrel);
618 std::vector<double> minS4S1CleanHcalBarrel;
620 minS4S1CleanHcalBarrel);
622 double threshHcalEndcap = 0.8;
623 options_->
GetOpt(
"clustering",
"thresh_Hcal_Endcap", threshHcalEndcap);
625 double threshPtHcalEndcap = 0.0;
626 options_->
GetOpt(
"clustering",
"thresh_Pt_Hcal_Endcap", threshPtHcalEndcap);
628 double threshSeedHcalEndcap = 1.4;
630 threshSeedHcalEndcap);
632 double threshPtSeedHcalEndcap = 0.0;
634 threshPtSeedHcalEndcap);
636 double threshCleanHcalEndcap = 1E5;
638 threshCleanHcalEndcap);
640 std::vector<double> minS4S1CleanHcalEndcap;
642 minS4S1CleanHcalEndcap);
644 double showerSigmaHcal = 15;
648 int nNeighboursHcal = 4;
649 options_->
GetOpt(
"clustering",
"neighbours_Hcal", nNeighboursHcal);
651 int posCalcNCrystalHcal = 5;
653 posCalcNCrystalHcal);
655 bool useCornerCellsHcal =
false;
659 bool cleanRBXandHPDs =
false;
664 = threshHcalBarrel<threshHcalEndcap ? threshHcalBarrel:threshHcalEndcap;
703 double threshHOBarrel = 0.5;
704 options_->
GetOpt(
"clustering",
"thresh_HO_Barrel", threshHOBarrel);
706 double threshPtHOBarrel = 0.0;
707 options_->
GetOpt(
"clustering",
"thresh_Pt_HO_Barrel", threshPtHOBarrel);
709 double threshSeedHOBarrel = 1.0;
713 double threshPtSeedHOBarrel = 0.0;
715 threshPtSeedHOBarrel);
717 double threshCleanHOBarrel = 1E5;
719 threshCleanHOBarrel);
721 std::vector<double> minS4S1CleanHOBarrel;
723 minS4S1CleanHOBarrel);
725 double threshDoubleSpikeHOBarrel = 1E9;
727 threshDoubleSpikeHOBarrel);
729 double minS6S2DoubleSpikeHOBarrel = -1;
731 minS6S2DoubleSpikeHOBarrel);
733 double threshHOEndcap = 1.0;
734 options_->
GetOpt(
"clustering",
"thresh_HO_Endcap", threshHOEndcap);
736 double threshPtHOEndcap = 0.0;
737 options_->
GetOpt(
"clustering",
"thresh_Pt_HO_Endcap", threshPtHOEndcap);
739 double threshSeedHOEndcap = 3.1;
743 double threshPtSeedHOEndcap = 0.0;
745 threshPtSeedHOEndcap);
747 double threshCleanHOEndcap = 1E5;
749 threshCleanHOEndcap);
751 std::vector<double> minS4S1CleanHOEndcap;
753 minS4S1CleanHOEndcap);
755 double threshDoubleSpikeHOEndcap = 1E9;
757 threshDoubleSpikeHOEndcap);
759 double minS6S2DoubleSpikeHOEndcap = -1;
761 minS6S2DoubleSpikeHOEndcap);
763 double showerSigmaHO = 15;
767 int nNeighboursHO = 4;
770 int posCalcNCrystalHO = 5;
774 bool useCornerCellsHO =
false;
778 bool cleanRBXandHPDsHO =
false;
783 = threshHOBarrel<threshHOEndcap ? threshHOBarrel:threshHOEndcap;
829 double threshHFEM = 0.;
832 double threshPtHFEM = 0.;
835 double threshSeedHFEM = 0.001;
839 double threshPtSeedHFEM = 0.0;
843 double threshCleanHFEM = 1E5;
847 std::vector<double> minS4S1CleanHFEM;
851 double showerSigmaHFEM = 0.1;
855 int nNeighboursHFEM = 4;
856 options_->
GetOpt(
"clustering",
"neighbours_HFEM", nNeighboursHFEM);
858 int posCalcNCrystalHFEM = -1;
860 posCalcNCrystalHFEM);
862 bool useCornerCellsHFEM =
false;
866 double posCalcP1HFEM = threshHFEM;
894 double threshHFHAD = 0.;
897 double threshPtHFHAD = 0.;
900 double threshSeedHFHAD = 0.001;
904 double threshPtSeedHFHAD = 0.0;
908 double threshCleanHFHAD = 1E5;
912 std::vector<double> minS4S1CleanHFHAD;
916 double showerSigmaHFHAD = 0.1;
920 int nNeighboursHFHAD = 4;
921 options_->
GetOpt(
"clustering",
"neighbours_HFHAD", nNeighboursHFHAD);
923 int posCalcNCrystalHFHAD = -1;
925 posCalcNCrystalHFHAD);
927 bool useCornerCellsHFHAD =
false;
929 useCornerCellsHFHAD);
931 double posCalcP1HFHAD = threshHFHAD;
959 double threshPS = 0.0001;
962 double threshPtPS = 0.0;
965 double threshSeedPS = 0.001;
969 double threshPtSeedPS = 0.0;
970 options_->
GetOpt(
"clustering",
"thresh_Pt_Seed_PS", threshPtSeedPS);
972 double threshCleanPS = 1E5;
975 std::vector<double> minS4S1CleanPS;
976 options_->
GetOpt(
"clustering",
"minS4S1_Clean_PS", minS4S1CleanPS);
979 double threshPSBarrel = threshPS;
980 double threshSeedPSBarrel = threshSeedPS;
982 double threshPtPSBarrel = threshPtPS;
983 double threshPtSeedPSBarrel = threshPtSeedPS;
985 double threshCleanPSBarrel = threshCleanPS;
986 std::vector<double> minS4S1CleanPSBarrel = minS4S1CleanPS;
988 double threshPSEndcap = threshPS;
989 double threshSeedPSEndcap = threshSeedPS;
991 double threshPtPSEndcap = threshPtPS;
992 double threshPtSeedPSEndcap = threshPtSeedPS;
994 double threshCleanPSEndcap = threshCleanPS;
995 std::vector<double> minS4S1CleanPSEndcap = minS4S1CleanPS;
997 double showerSigmaPS = 0.1;
1001 int nNeighboursPS = 4;
1004 int posCalcNCrystalPS = -1;
1008 bool useCornerCellsPS =
false;
1012 double posCalcP1PS = threshPS;
1062 std::vector<double> DPtovPtCut;
1063 std::vector<unsigned> NHitCut;
1064 bool useIterTracking;
1065 int nuclearInteractionsPurity;
1068 options_->
GetOpt(
"particle_flow",
"useIterTracking", useIterTracking);
1069 options_->
GetOpt(
"particle_flow",
"nuclearInteractionsPurity", nuclearInteractionsPurity);
1072 std::vector<double> PhotonSelectionCuts;
1074 options_->
GetOpt(
"particle_flow",
"photonSelection", PhotonSelectionCuts);
1081 nuclearInteractionsPurity,
1083 PhotonSelectionCuts,
1089 cerr<<
"exception setting PFBlockAlgo parameters: "
1090 <<err.what()<<
". terminating."<<endl;
1096 bool blockAlgoDebug =
false;
1100 bool AlgoDebug =
false;
1105 boost::shared_ptr<PFEnergyCalibration>
1109 bool usePFSCEleCalib;
1110 std::vector<double> calibPFSCEle_Fbrem_barrel;
1111 std::vector<double> calibPFSCEle_Fbrem_endcap;
1112 std::vector<double> calibPFSCEle_barrel;
1113 std::vector<double> calibPFSCEle_endcap;
1114 options_->
GetOpt(
"particle_flow",
"usePFSCEleCalib",usePFSCEleCalib);
1115 options_->
GetOpt(
"particle_flow",
"calibPFSCEle_Fbrem_barrel",calibPFSCEle_Fbrem_barrel);
1116 options_->
GetOpt(
"particle_flow",
"calibPFSCEle_Fbrem_endcap",calibPFSCEle_Fbrem_endcap);
1117 options_->
GetOpt(
"particle_flow",
"calibPFSCEle_barrel",calibPFSCEle_barrel);
1118 options_->
GetOpt(
"particle_flow",
"calibPFSCEle_endcap",calibPFSCEle_endcap);
1119 boost::shared_ptr<PFSCEnergyCalibration>
1120 thePFSCEnergyCalibration (
new PFSCEnergyCalibration(calibPFSCEle_Fbrem_barrel,calibPFSCEle_Fbrem_endcap,
1121 calibPFSCEle_barrel,calibPFSCEle_endcap ));
1123 bool useEGammaSupercluster;
1124 double sumEtEcalIsoForEgammaSC_barrel;
1125 double sumEtEcalIsoForEgammaSC_endcap;
1126 double coneEcalIsoForEgammaSC;
1127 double sumPtTrackIsoForEgammaSC_barrel;
1128 double sumPtTrackIsoForEgammaSC_endcap;
1129 unsigned int nTrackIsoForEgammaSC;
1130 double coneTrackIsoForEgammaSC;
1131 options_->
GetOpt(
"particle_flow",
"useEGammaSupercluster",useEGammaSupercluster);
1132 options_->
GetOpt(
"particle_flow",
"sumEtEcalIsoForEgammaSC_barrel",sumEtEcalIsoForEgammaSC_barrel);
1133 options_->
GetOpt(
"particle_flow",
"sumEtEcalIsoForEgammaSC_endcap",sumEtEcalIsoForEgammaSC_endcap);
1134 options_->
GetOpt(
"particle_flow",
"coneEcalIsoForEgammaSC",coneEcalIsoForEgammaSC);
1135 options_->
GetOpt(
"particle_flow",
"sumPtTrackIsoForEgammaSC_barrel",sumPtTrackIsoForEgammaSC_barrel);
1136 options_->
GetOpt(
"particle_flow",
"sumPtTrackIsoForEgammaSC_endcap",sumPtTrackIsoForEgammaSC_endcap);
1137 options_->
GetOpt(
"particle_flow",
"nTrackIsoForEgammaSC",nTrackIsoForEgammaSC);
1138 options_->
GetOpt(
"particle_flow",
"coneTrackIsoForEgammaSC",coneTrackIsoForEgammaSC);
1142 bool calibHF_use =
false;
1143 std::vector<double> calibHF_eta_step;
1144 std::vector<double> calibHF_a_EMonly;
1145 std::vector<double> calibHF_b_HADonly;
1146 std::vector<double> calibHF_a_EMHAD;
1147 std::vector<double> calibHF_b_EMHAD;
1149 options_->
GetOpt(
"particle_flow",
"calib_calibHF_use",calibHF_use);
1150 options_->
GetOpt(
"particle_flow",
"calib_calibHF_eta_step",calibHF_eta_step);
1151 options_->
GetOpt(
"particle_flow",
"calib_calibHF_a_EMonly",calibHF_a_EMonly);
1152 options_->
GetOpt(
"particle_flow",
"calib_calibHF_b_HADonly",calibHF_b_HADonly);
1153 options_->
GetOpt(
"particle_flow",
"calib_calibHF_a_EMHAD",calibHF_a_EMHAD);
1154 options_->
GetOpt(
"particle_flow",
"calib_calibHF_b_EMHAD",calibHF_b_EMHAD);
1156 boost::shared_ptr<PFEnergyCalibrationHF> thepfEnergyCalibrationHF
1157 (
new PFEnergyCalibrationHF(calibHF_use,calibHF_eta_step,calibHF_a_EMonly,calibHF_b_HADonly,calibHF_a_EMHAD,calibHF_b_EMHAD) ) ;
1163 double nSigmaECAL = 99999;
1165 double nSigmaHCAL = 99999;
1173 cerr<<
"exception setting PFAlgo parameters: "
1174 <<err.what()<<
". terminating."<<endl;
1179 std::vector<double> muonHCAL;
1180 std::vector<double> muonECAL;
1181 std::vector<double> muonHO;
1186 assert ( muonHCAL.size() == 2 && muonECAL.size() == 2 && muonHO.size() == 2);
1188 double nSigmaTRACK = 3.0;
1191 double ptError = 1.0;
1194 std::vector<double> factors45;
1196 assert ( factors45.size() == 2 );
1203 iConfig.addParameter<
double>(
"maxDPtOPt",maxDPtOPt);
1206 options_->
GetOpt(
"particle_flow",
"minTrackerHits", minTrackerHits);
1211 iConfig.addParameter<
int>(
"minPixelHits",minPixelHits);
1217 double ptErrorScale;
1219 iConfig.addParameter<
double>(
"ptErrorScale",ptErrorScale);
1221 double eventFractionForCleaning;
1222 options_->
GetOpt(
"particle_flow",
"eventFractionForCleaning", eventFractionForCleaning);
1223 iConfig.addParameter<
double>(
"eventFractionForCleaning",eventFractionForCleaning);
1227 iConfig.addParameter<
double>(
"dzPV",dzpv);
1229 bool postMuonCleaning;
1230 options_->
GetOpt(
"particle_flow",
"postMuonCleaning", postMuonCleaning);
1231 iConfig.addParameter<
bool>(
"postMuonCleaning",postMuonCleaning);
1233 double minPtForPostCleaning;
1234 options_->
GetOpt(
"particle_flow",
"minPtForPostCleaning", minPtForPostCleaning);
1235 iConfig.addParameter<
double>(
"minPtForPostCleaning",minPtForPostCleaning);
1237 double eventFactorForCosmics;
1238 options_->
GetOpt(
"particle_flow",
"eventFactorForCosmics", eventFactorForCosmics);
1239 iConfig.addParameter<
double>(
"eventFactorForCosmics",eventFactorForCosmics);
1241 double minSignificanceForCleaning;
1242 options_->
GetOpt(
"particle_flow",
"metSignificanceForCleaning", minSignificanceForCleaning);
1243 iConfig.addParameter<
double>(
"metSignificanceForCleaning",minSignificanceForCleaning);
1245 double minSignificanceForRejection;
1246 options_->
GetOpt(
"particle_flow",
"metSignificanceForRejection", minSignificanceForRejection);
1247 iConfig.addParameter<
double>(
"metSignificanceForRejection",minSignificanceForRejection);
1249 double metFactorForCleaning;
1250 options_->
GetOpt(
"particle_flow",
"metFactorForCleaning", metFactorForCleaning);
1251 iConfig.addParameter<
double>(
"metFactorForCleaning",metFactorForCleaning);
1253 double eventFractionForRejection;
1254 options_->
GetOpt(
"particle_flow",
"eventFractionForRejection", eventFractionForRejection);
1255 iConfig.addParameter<
double>(
"eventFractionForRejection",eventFractionForRejection);
1257 double metFactorForRejection;
1258 options_->
GetOpt(
"particle_flow",
"metFactorForRejection", metFactorForRejection);
1259 iConfig.addParameter<
double>(
"metFactorForRejection",metFactorForRejection);
1261 double metFactorForHighEta;
1262 options_->
GetOpt(
"particle_flow",
"metFactorForHighEta", metFactorForHighEta);
1263 iConfig.addParameter<
double>(
"metFactorForHighEta",metFactorForHighEta);
1265 double ptFactorForHighEta;
1266 options_->
GetOpt(
"particle_flow",
"ptFactorForHighEta", ptFactorForHighEta);
1267 iConfig.addParameter<
double>(
"ptFactorForHighEta",ptFactorForHighEta);
1270 double metFactorForFakes;
1271 options_->
GetOpt(
"particle_flow",
"metFactorForFakes", metFactorForFakes);
1272 iConfig.addParameter<
double>(
"metFactorForFakes",metFactorForFakes);
1274 double minMomentumForPunchThrough;
1275 options_->
GetOpt(
"particle_flow",
"minMomentumForPunchThrough", minMomentumForPunchThrough);
1276 iConfig.addParameter<
double>(
"minMomentumForPunchThrough",minMomentumForPunchThrough);
1278 double minEnergyForPunchThrough;
1279 options_->
GetOpt(
"particle_flow",
"minEnergyForPunchThrough", minEnergyForPunchThrough);
1280 iConfig.addParameter<
double>(
"minEnergyForPunchThrough",minEnergyForPunchThrough);
1283 double punchThroughFactor;
1284 options_->
GetOpt(
"particle_flow",
"punchThroughFactor", punchThroughFactor);
1285 iConfig.addParameter<
double>(
"punchThroughFactor",punchThroughFactor);
1287 double punchThroughMETFactor;
1288 options_->
GetOpt(
"particle_flow",
"punchThroughMETFactor", punchThroughMETFactor);
1289 iConfig.addParameter<
double>(
"punchThroughMETFactor",punchThroughMETFactor);
1292 double cosmicRejectionDistance;
1293 options_->
GetOpt(
"particle_flow",
"cosmicRejectionDistance", cosmicRejectionDistance);
1294 iConfig.addParameter<
double>(
"cosmicRejectionDistance",cosmicRejectionDistance);
1300 cerr<<
"exception setting PFAlgo Muon and Fake parameters: "
1301 <<err.what()<<
". terminating."<<endl;
1306 bool postHFCleaning =
true;
1307 options_->
GetOpt(
"particle_flow",
"postHFCleaning", postHFCleaning);
1308 double minHFCleaningPt = 5.;
1309 options_->
GetOpt(
"particle_flow",
"minHFCleaningPt", minHFCleaningPt);
1310 double minSignificance = 2.5;
1311 options_->
GetOpt(
"particle_flow",
"minSignificance", minSignificance);
1312 double maxSignificance = 2.5;
1313 options_->
GetOpt(
"particle_flow",
"maxSignificance", maxSignificance);
1314 double minSignificanceReduction = 1.4;
1315 options_->
GetOpt(
"particle_flow",
"minSignificanceReduction", minSignificanceReduction);
1316 double maxDeltaPhiPt = 7.0;
1317 options_->
GetOpt(
"particle_flow",
"maxDeltaPhiPt", maxDeltaPhiPt);
1318 double minDeltaMet = 0.4;
1327 minSignificanceReduction,
1332 cerr<<
"exception setting post HF cleaning parameters: "
1333 <<err.what()<<
". terminating."<<endl;
1353 double mvaEleCut = -1.;
1356 bool applyCrackCorrections=
true;
1357 options_->
GetOpt(
"particle_flow",
"electron_crackCorrection",applyCrackCorrections);
1359 string mvaWeightFileEleID =
"";
1361 mvaWeightFileEleID);
1362 mvaWeightFileEleID =
expand(mvaWeightFileEleID);
1365 options_->
GetOpt(
"particle_flow",
"egammaElectrons",egammaElectronstagname);
1376 thePFSCEnergyCalibration,
1378 sumEtEcalIsoForEgammaSC_barrel,
1379 sumEtEcalIsoForEgammaSC_endcap,
1380 coneEcalIsoForEgammaSC,
1381 sumPtTrackIsoForEgammaSC_barrel,
1382 sumPtTrackIsoForEgammaSC_endcap,
1383 nTrackIsoForEgammaSC,
1384 coneTrackIsoForEgammaSC,
1385 applyCrackCorrections,
1388 useEGammaSupercluster);
1391 cerr<<
"exception setting PFAlgo Electron parameters: "
1392 <<err.what()<<
". terminating."<<endl;
1398 bool usePFPhotons =
true;
1400 string mvaWeightFileConvID =
"";
1401 string mvaWeightFileRegLCEB=
"";
1402 string mvaWeightFileRegLCEE=
"";
1403 string mvaWeightFileRegGCEB=
"";
1404 string mvaWeightFileRegGCEEhr9=
"";
1405 string mvaWeightFileRegGCEElr9=
"";
1406 string mvaWeightFileRegRes=
"";
1408 double mvaConvCut=-1.;
1409 double sumPtTrackIsoForPhoton=2.0;
1410 double sumPtTrackIsoSlopeForPhoton=0.001;
1414 options_->
GetOpt(
"particle_flow",
"convID_mvaWeightFile", mvaWeightFileConvID);
1415 options_->
GetOpt(
"particle_flow",
"mvaWeightFileRegLCEB", mvaWeightFileRegLCEB);
1416 options_->
GetOpt(
"particle_flow",
"mvaWeightFileRegLCEE", mvaWeightFileRegLCEE);
1417 options_->
GetOpt(
"particle_flow",
"mvaWeightFileRegGCEB", mvaWeightFileRegGCEB);
1418 options_->
GetOpt(
"particle_flow",
"mvaWeightFileRegGCEEHr9", mvaWeightFileRegGCEEhr9);
1419 options_->
GetOpt(
"particle_flow",
"mvaWeightFileRegGCEELr9", mvaWeightFileRegGCEElr9);
1420 options_->
GetOpt(
"particle_flow",
"mvaWeightFileRegRes", mvaWeightFileRegRes);
1422 options_->
GetOpt(
"particle_flow",
"sumPtTrackIsoForPhoton",sumPtTrackIsoForPhoton);
1423 options_->
GetOpt(
"particle_flow",
"sumPtTrackIsoSlopeForPhoton",sumPtTrackIsoSlopeForPhoton);
1426 if( usePFPhotons ) {
1428 TFile *infile_PFLCEB =
new TFile(mvaWeightFileRegLCEB.c_str(),
"READ");
1429 TFile *infile_PFLCEE =
new TFile(mvaWeightFileRegLCEE.c_str(),
"READ");
1430 TFile *infile_PFGCEB =
new TFile(mvaWeightFileRegGCEB.c_str(),
"READ");
1431 TFile *infile_PFGCEEhR9 =
new TFile(mvaWeightFileRegGCEEhr9.c_str(),
"READ");
1432 TFile *infile_PFGCEElR9 =
new TFile(mvaWeightFileRegGCEElr9.c_str(),
"READ");
1433 TFile *infile_PFRes =
new TFile(mvaWeightFileRegRes.c_str(),
"READ");
1444 mvaWeightFileConvID,
1449 sumPtTrackIsoForPhoton,
1450 sumPtTrackIsoSlopeForPhoton
1453 gbrGCEEhr9,gbrGCEElr9,
1459 cerr<<
"exception setting PFAlgo Photon parameters: "
1460 <<err.what()<<
". terminating."<<endl;
1468 bool rejectTracks_Bad =
true;
1469 bool rejectTracks_Step45 =
true;
1470 bool usePFConversions =
false;
1471 bool usePFNuclearInteractions =
false;
1472 bool usePFV0s =
false;
1475 double dptRel_DispVtx = 10;
1478 options_->
GetOpt(
"particle_flow",
"usePFConversions", usePFConversions);
1480 options_->
GetOpt(
"particle_flow",
"usePFNuclearInteractions", usePFNuclearInteractions);
1481 options_->
GetOpt(
"particle_flow",
"dptRel_DispVtx", dptRel_DispVtx);
1485 rejectTracks_Step45,
1486 usePFNuclearInteractions,
1493 cerr<<
"exception setting PFAlgo displaced vertex parameters: "
1494 <<err.what()<<
". terminating."<<endl;
1499 bool bCorrect =
false;
1500 bool bCalibPrimary =
false;
1501 double dptRel_PrimaryTrack = 0;
1502 double dptRel_MergedTrack = 0;
1503 double ptErrorSecondary = 0;
1504 vector<double> nuclCalibFactors;
1507 options_->
GetOpt(
"particle_flow",
"bCalibPrimary", bCalibPrimary);
1508 options_->
GetOpt(
"particle_flow",
"dptRel_PrimaryTrack", dptRel_PrimaryTrack);
1509 options_->
GetOpt(
"particle_flow",
"dptRel_MergedTrack", dptRel_MergedTrack);
1510 options_->
GetOpt(
"particle_flow",
"ptErrorSecondary", ptErrorSecondary);
1511 options_->
GetOpt(
"particle_flow",
"nuclCalibFactors", nuclCalibFactors);
1517 cerr<<
"exception setting PFAlgo cand connector parameters: "
1518 <<err.what()<<
". terminating."<<endl;
1544 double mEtInputCut = 0.5;
1547 double mEInputCut = 0.;
1550 double seedThreshold = 1.0;
1553 double coneRadius = 0.5;
1556 double coneAreaFraction= 1.0;
1562 int maxIterations=100;
1565 double overlapThreshold = 0.75;
1571 double rparam = 1.0;
1589 cout <<
"----------------------------------" << endl;
1598 double coneAngle = 0.5;
1601 double seedEt = 0.4;
1604 double coneMerge = 100.0;
1612 cout <<
"Tau Benchmark Options : ";
1613 cout <<
"Angle=" << coneAngle <<
" seedEt=" << seedEt
1614 <<
" Merge=" << coneMerge << endl;
1678 cout<<
"Opening input root files"<<endl;
1687 catch(
string& err) {
1695 cout <<
"The rootfile(s) " << endl;
1698 cout <<
" is (are) not valid file(s) to open" << endl;
1701 cout <<
"The rootfile(s) : " << endl;
1704 cout<<
" are opened with " <<
ev_->
size() <<
" events." <<endl;
1709 options_->
GetOpt(
"root",
"rechits_ECAL_inputTag", rechitsECALtagname);
1713 options_->
GetOpt(
"root",
"rechits_HCAL_inputTag", rechitsHCALtagname);
1717 options_->
GetOpt(
"root",
"rechits_HO_inputTag", rechitsHOtagname);
1721 options_->
GetOpt(
"root",
"rechits_HFEM_inputTag", rechitsHFEMtagname);
1725 options_->
GetOpt(
"root",
"rechits_HFHAD_inputTag", rechitsHFHADtagname);
1728 std::vector<string> rechitsCLEANEDtagnames;
1729 options_->
GetOpt(
"root",
"rechits_CLEANED_inputTags", rechitsCLEANEDtagnames);
1730 for (
unsigned tags = 0;
tags<rechitsCLEANEDtagnames.size(); ++
tags )
1738 options_->
GetOpt(
"root",
"rechits_PS_inputTag", rechitsPStagname);
1746 options_->
GetOpt(
"root",
"displacedRecTracks_inputTag", displacedRecTrackstagname);
1750 options_->
GetOpt(
"root",
"primaryVertices_inputTag", primaryVerticestagname);
1758 options_->
GetOpt(
"root",
"gsfrecTracks_inputTag", gsfrecTrackstagname);
1765 options_->
GetOpt(
"root",
"convBremGsfrecTracks_inputTag", convBremGsfrecTrackstagname);
1783 options_->
GetOpt(
"root",
"conversion_inputTag", conversiontagname);
1806 options_->
GetOpt(
"root",
"PFDisplacedVertex_inputTag", pfNuclearTrackerVertextagname);
1811 options_->
GetOpt(
"root",
"trueParticles_inputTag", trueParticlestagname);
1819 options_->
GetOpt(
"root",
"caloTowers_inputTag", caloTowerstagname);
1828 options_->
GetOpt(
"root",
"genParticlesforMET_inputTag", genParticlesforMETtagname);
1832 options_->
GetOpt(
"root",
"genParticlesforJets_inputTag", genParticlesforJetstagname);
1837 options_->
GetOpt(
"root",
"particleFlowCand_inputTag", pfCandidatetagname);
1845 options_->
GetOpt(
"root",
"corrCaloJets_inputTag", corrcaloJetstagname);
1896 cout <<
" Writing DQM root file " << endl;
1919 LumisMap::const_iterator iL = iR->second.find( lumi );
1920 if( iL != iR->second.end() ) {
1921 EventToEntry::const_iterator iE = iL->second.find( event );
1922 if( iE != iL->second.end() ) {
1926 cout<<
"event "<<
event<<
" not found in run "<<run<<
", lumi "<<lumi<<endl;
1930 cout<<
"lumi "<<lumi<<
" not found in run "<<run<<endl;
1934 cout<<
"run "<<run<<
" not found"<<endl;
1943 cout<<
"event "<<
event<<
" is not present, sorry."<<endl;
1957 bool exists =
ev_->
to(entry);
1959 std::cout <<
"Entry " << entry <<
" does not exist " << std::endl;
1969 (entry < 100 && entry%10 == 0) ||
1970 (entry < 1000 && entry%100 == 0) ||
1972 cout<<
"process entry "<< entry
1973 <<
", run "<<iEvent.
id().
run()
1975 <<
", event:"<<iEvent.
id().
event()
1995 cout<<
"number of muons : "<<
muons_.size()<<endl;
1998 cout<<
"number of v0 : "<<
v0_.size()<<endl;
2014 cout<<
"clustering is OFF - clusters come from the input file"<<endl;
2070 cout <<
" =====================PFJetBenchmark =================" << endl;
2071 cout<<
"Resol Pt max "<<resPt
2072 <<
" resChargedHadEnergy Max " << resChargedHadEnergy
2073 <<
" resNeutralHadEnergy Max " << resNeutralHadEnergy
2074 <<
" resNeutralEmEnergy Max "<< resNeutralEmEnergy << endl;
2083 if ( resPt < -1. ) {
2084 cout <<
" =====================PFJetBenchmark =================" << endl;
2085 cout<<
"process entry "<< entry << endl;
2086 cout<<
"Resol Pt max "<<resPt
2087 <<
" resChargedHadEnergy Max " << resChargedHadEnergy
2088 <<
" resNeutralHadEnergy Max " << resNeutralHadEnergy
2089 <<
" resNeutralEmEnergy Max "<< resNeutralEmEnergy
2090 <<
" Jet pt " <<
genJets_[0].pt() << endl;
2142 float deltaMin, deltaMax;
2151 double deltaEt = 0.;
2198 if( pfc.
pt() >
ptMin )
return true;
2207 cout <<
"start reading from simulation"<<endl;
2217 if ( foundstdTracks ) {
2221 cerr<<
"PFRootEventManager::ProcessEntry : stdTracks Collection not found : "
2226 if ( foundMCTruth ) {
2248 cerr<<
"PFRootEventManager::ProcessEntry : rechitsECAL Collection not found : "
2257 cerr<<
"PFRootEventManager::ProcessEntry : rechitsHCAL Collection not found : "
2267 cerr<<
"PFRootEventManager::ProcessEntry : rechitsHO Collection not found : "
2277 cerr<<
"PFRootEventManager::ProcessEntry : rechitsHFEM Collection not found : "
2286 cerr<<
"PFRootEventManager::ProcessEntry : rechitsHFHAD Collection not found : "
2293 if ( foundCLEANED ) {
2297 cerr<<
"PFRootEventManager::ProcessEntry : rechitsCLEANED Collection not found : "
2308 cerr<<
"PFRootEventManager::ProcessEntry : rechitsPS Collection not found : "
2317 cerr<<
"PFRootEventManager::ProcessEntry : caloTowers Collection not found : "
2326 cerr<<
"PFRootEventManager::ProcessEntry : primaryVertices Collection not found : "
2336 cerr<<
"PFRootEventManager::ProcessEntry : pfNuclearTrackerVertex Collection not found : "
2341 if ( foundrecTracks ) {
2345 cerr<<
"PFRootEventManager::ProcessEntry : recTracks Collection not found : "
2350 if ( founddisplacedRecTracks ) {
2354 cerr<<
"PFRootEventManager::ProcessEntry : displacedRecTracks Collection not found : "
2360 if ( foundgsfrecTracks ) {
2364 cerr<<
"PFRootEventManager::ProcessEntry : gsfrecTracks Collection not found : "
2369 if ( foundconvBremGsfrecTracks ) {
2373 cerr<<
"PFRootEventManager::ProcessEntry : convBremGsfrecTracks Collection not found : "
2389 cerr<<
"PFRootEventManager::ProcessEntry : muons Collection not found : "
2394 if ( foundconversion ) {
2398 cerr<<
"PFRootEventManager::ProcessEntry : conversion Collection not found : "
2409 cerr<<
"PFRootEventManager::ProcessEntry : v0 Collection not found : "
2410 <<entry <<
" " <<
v0Tag_<<endl;
2415 if ( foundPhotons) {
2418 cerr <<
"PFRootEventManager::ProcessEntry : photon collection not found : "
2425 if ( foundElectrons) {
2430 cerr <<
"PFRootEventManager::ProcessEntry : electron collection not found : "
2436 if ( foundgenJets ) {
2445 if ( foundgenParticlesforJets ) {
2454 if ( foundgenParticlesforMET ) {
2463 if ( foundcaloJets ) {
2467 cerr<<
"PFRootEventManager::ProcessEntry : caloJets Collection not found : "
2472 if ( foundcorrcaloJets ) {
2481 if ( foundpfJets ) {
2485 cerr<<
"PFRootEventManager::ProcessEntry : PFJets Collection not found : "
2490 if ( foundpfCands ) {
2494 cerr<<
"PFRootEventManager::ProcessEntry : PFCandidate Collection not found : "
2499 if ( foundpfMets ) {
2503 cerr<<
"PFRootEventManager::ProcessEntry : PFMets Collection not found : "
2508 if ( foundtcMets ) {
2512 cerr<<
"TCRootEventManager::ProcessEntry : TCMets Collection not found : "
2517 if ( foundcaloMets ) {
2521 cerr<<
"CALORootEventManager::ProcessEntry : CALOMets Collection not found : "
2527 bool goodevent =
true;
2532 cout <<
"PFRootEventManager : event discarded Nparticles="
2537 cout <<
"PFRootEventManager : leptonic tau discarded " << endl;
2543 cout <<
"PFRootEventManager : tau discarded: "
2544 <<
"number of charged and neutral particles different from "
2620 const std::vector<int>& ptcdaughters = ptc.
daughterIds();
2622 for (
unsigned int dapt=0; dapt < ptcdaughters.size(); ++dapt) {
2628 int pdgdaugther = daughter.
pdgCode();
2629 int abspdgdaughter =
std::abs(pdgdaugther);
2632 if (abspdgdaughter == 11 ||
2633 abspdgdaughter == 13) {
2654 const std::vector<int>& daughters = ptc.
daughterIds();
2658 if(!daughters.empty() )
continue;
2661 double pdgCode = ptc.
pdgCode();
2665 else if( pdgCode==22 )
2713 int kqa,kq1,kq2,kq3,kqj,irt,kqx,kqn;
2717 int ichg[109]={-1,2,-1,2,-1,2,-1,2,0,0,-3,0,-3,0,-3,0,
2718 -3,0,0,0,0,0,0,3,0,0,0,0,0,0,3,0,3,6,0,0,3,6,0,0,-1,2,-1,2,-1,2,0,0,0,0,
2719 -3,0,-3,0,-3,0,0,0,0,0,-1,2,-1,2,-1,2,0,0,0,0,
2720 -3,0,-3,0,-3,0,3,3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
2726 kqn=kqa/1000000000%10;
2736 if(kqa==0 || kqa >= 10000000) {
2738 if(kqn==1) {hepchg=0;}
2741 else if(kqa<=100) {hepchg = ichg[kqa-1];}
2743 else if(kqa==100 || kqa==101) {hepchg = -3;}
2745 else if(kqa==102 || kqa==104) {hepchg = -6;}
2747 else if(kqj == 0) {hepchg = 0;}
2749 else if(kqx>0 && irt<100)
2751 hepchg = ichg[irt-1];
2752 if(kqa==1000017 || kqa==1000018) {hepchg = 0;}
2753 if(kqa==1000034 || kqa==1000052) {hepchg = 0;}
2754 if(kqa==1000053 || kqa==1000054) {hepchg = 0;}
2755 if(kqa==5100061 || kqa==5100062) {hepchg = 6;}
2761 hepchg = ichg[kq2-1]-ichg[kq1-1];
2763 if((kq2==3) || (kq2==5)) {hepchg = ichg[kq1-1]-ichg[kq2-1];}
2767 hepchg = ichg[kq3-1] + ichg[kq2-1];
2772 hepchg = ichg[kq3-1]+ichg[kq2-1]+ichg[kq1-1];
2776 if(Id<0 && hepchg!=0) {hepchg = -1*hepchg;}
2807 bool findNeighbours) {
2810 map<unsigned, unsigned> detId2index;
2812 for(
unsigned i=0;
i<rechits.size();
i++) {
2813 rechits[
i].calculatePositionREP();
2816 detId2index.insert( make_pair(rechits[
i].detId(),
i) );
2819 if(findNeighbours) {
2820 for(
unsigned i=0;
i<rechits.size();
i++) {
2829 const map<unsigned, unsigned>& detId2index ) {
2836 for(
unsigned i=0;
i<neighbours4DetId.size();
i++) {
2837 unsigned detId = neighbours4DetId[
i];
2839 const map<unsigned, unsigned>::const_iterator& it = detId2index.find(detId);
2841 if(it != detId2index.end() ) {
2847 for(
unsigned i=0;
i<neighbours8DetId.size();
i++) {
2848 unsigned detId = neighbours8DetId[
i];
2850 const map<unsigned, unsigned>::const_iterator& it = detId2index.find(detId);
2852 if(it != detId2index.end() ) {
2865 cout <<
"start clustering"<<endl;
2927 for(
unsigned i=0;
i<clusters.size();
i++) {
2929 cluster.
eta = clusters[
i].position().Eta();
2930 cluster.
phi = clusters[
i].position().Phi();
2931 cluster.
e = clusters[
i].energy();
2932 cluster.
layer = clusters[
i].layer();
2938 switch( clusters[
i].layer() ) {
2963 cluster.
eta, cluster.
phi,
2989 for (
unsigned i=0;
i < trueParticles.size();
i++) {
2999 if(ntrajpoints == 3) {
3027 for (
unsigned i=0;
i < pfCandidates.size();
i++) {
3032 outptc.
eta = candidate.
eta();
3033 outptc.
phi = candidate.
phi();
3034 outptc.
e = candidate.
energy();
3048 for (
unsigned i=0;
i < cts.
size();
i++) {
3068 for (
unsigned i=0;
i < blocks.size();
i++) {
3083 cout <<
"start particle flow"<<endl;
3088 cout<<
"PFRootEventManager::particleFlow start"<<endl;
3150 vector<bool> trackMask;
3152 vector<bool> gsftrackMask;
3154 vector<bool> ecalMask;
3156 vector<bool> hcalMask;
3159 vector<bool> scmask;
3161 vector<bool> hoMask;
3164 vector<bool> hfemMask;
3166 vector<bool> hfhadMask;
3168 vector<bool> psMask;
3170 vector<bool> photonMask;
3175 muonh, nuclearh, displacedtrackh, convh, v0,
3176 ecalh, hcalh, hoh, hfemh, hfhadh, psh,
3177 photonh, ebsch, eesch, pfclusassoch, trackMask,gsftrackMask,
3178 ecalMask, hcalMask, hoMask, hfemMask, hfhadMask, psMask,photonMask,scmask );
3181 trackMask, ecalMask, hcalMask, hoMask, psMask);
3213 if(
debug_)
cout<<
"PFRootEventManager::particleFlow stop"<<endl;
3225 if ( differentSize ) {
3226 cout <<
"+++WARNING+++ PFCandidate size changed for entry "
3227 << entry <<
" !" << endl
3228 <<
" - original size : " <<
pfCandCMSSW_.size() << endl
3232 double deltaE = (*pfCandidates_)[
i].energy()-
pfCandCMSSW_[
i].energy();
3235 if ( fabs(deltaE) > 1E-4 ||
3236 fabs(deltaEta) > 1E-9 ||
3237 fabs(deltaPhi) > 1E-9 ) {
3238 cout <<
"+++WARNING+++ PFCandidate " <<
i
3239 <<
" changed for entry " << entry <<
" ! " << endl
3241 <<
" - Current : " << (*pfCandidates_)[
i] << endl
3242 <<
" DeltaE = : " << deltaE << endl
3243 <<
" DeltaEta = : " << deltaEta << endl
3244 <<
" DeltaPhi = : " << deltaPhi << endl << endl;
3255 cout<<
"start reconstruct GenJets --- "<<endl;
3256 cout<<
" input gen particles for jet: all neutrinos removed ; muons present" << endl;
3276 cout <<
" #" <<
i <<
" PDG code:" << genPart.
pdgId()
3277 <<
" status " << genPart.
status()
3278 <<
", p/pt/eta/phi: " << genPart.
p() <<
'/' << genPart.
pt()
3279 <<
'/' << genPart.
eta() <<
'/' << genPart.
phi() << endl;
3285 vector<ProtoJet> protoJets;
3291 typedef vector <ProtoJet>::const_iterator IPJ;
3292 for (IPJ ipj = protoJets.begin(); ipj != protoJets.end (); ipj++) {
3308 ProtoJet::Constituents::const_iterator constituent = constituents.
begin();
3309 for (; constituent != constituents.end(); ++constituent) {
3312 uint
index = constituent->index();
3316 newJet.setJetArea(protojet.
jetArea());
3317 newJet.setPileup(protojet.
pileup());
3318 newJet.setNPasses(protojet.
nPasses());
3320 if (
jetsDebug_ )
cout<<
" gen jet "<<ijet<<
" "<<newJet.print()<<endl;
3331 cout<<
"start reconstruct CaloJets --- "<<endl;
3344 for(
unsigned ipj=0; ipj<
caloJets_.size(); ipj++) {
3346 cout<<
" calo jet "<<ipj<<
" "<<protojet.
pt() <<endl;
3357 cout<<
"start reconstruct PF Jets --- "<<endl;
3367 vector<ProtoJet> protoJets;
3373 typedef vector <ProtoJet>::const_iterator IPJ;
3374 for (IPJ ipj = protoJets.begin(); ipj != protoJets.end (); ipj++) {
3390 ProtoJet::Constituents::const_iterator constituent = constituents.
begin();
3391 for (; constituent != constituents.end(); ++constituent) {
3394 uint
index = constituent->index();
3398 newJet.setJetArea(protojet.
jetArea());
3399 newJet.setPileup(protojet.
pileup());
3400 newJet.setNPasses(protojet.
nPasses());
3402 if (
jetsDebug_ )
cout<<
" PF jet "<<ijet<<
" "<<newJet.print()<<endl;
3470 TLorentzVector partTOTMC;
3471 bool tauFound =
false;
3472 bool tooManyTaus =
false;
3479 if(
i ) tooManyTaus =
true;
3484 if(!tauFound || tooManyTaus ) {
3490 const std::vector<int>& ptcdaughters =
trueParticles_[0].daughterIds();
3496 for (
unsigned int dapt=0; dapt < ptcdaughters.size(); ++dapt) {
3500 TLorentzVector partMC;
3501 partMC.SetPxPyPzE(tpatvtx.
momentum().Px(),
3506 partTOTMC += partMC;
3510 cout << pdgcode << endl;
3511 cout << tpatvtx << endl;
3512 cout << partMC.Px() <<
" " << partMC.Py() <<
" "
3513 << partMC.Pz() <<
" " << partMC.E()
3515 <<
sqrt(partMC.Px()*partMC.Px()+partMC.Py()*partMC.Py())
3523 for ( HepMC::GenEvent::particle_const_iterator
3524 piter = myGenEvent->particles_begin();
3525 piter != myGenEvent->particles_end();
3529 if (
std::abs((*piter)->pdg_id())==15){
3532 for ( HepMC::GenVertex::particles_out_const_iterator bp =
3533 (*piter)->end_vertex()->particles_out_const_begin();
3534 bp != (*piter)->end_vertex()->particles_out_const_end(); ++bp ) {
3535 uint nuId=
std::abs((*bp)->pdg_id());
3536 bool isNeutrino=(nuId==12)||(nuId==14)||(nuId==16);
3540 TLorentzVector partMC;
3541 partMC.SetPxPyPzE((*bp)->momentum().x(),
3542 (*bp)->momentum().y(),
3543 (*bp)->momentum().z(),
3544 (*bp)->momentum().e());
3545 partTOTMC += partMC;
3550 if (itau>1) tooManyTaus=
true;
3552 if(!tauFound || tooManyTaus ) {
3553 cerr<<
"PFRootEventManager::tauBenchmark : not a single tau event"<<endl;
3561 jetmc.
eta = partTOTMC.Eta();
3562 jetmc.
phi = partTOTMC.Phi();
3563 jetmc.
et = partTOTMC.Et();
3564 jetmc.
e = partTOTMC.E();
3600 cout <<
" ET Vector=" << partTOTMC.Et()
3601 <<
" " << partTOTMC.Eta()
3602 <<
" " << partTOTMC.Phi() << endl;
cout << endl;
3610 vector<TLorentzVector> allcalotowers;
3613 double threshCaloTowers = 1E-10;
3621 TLorentzVector caloT;
3626 caloT.SetPxPyPzE(pxyz.X(),pxyz.Y(),pxyz.Z(),
caloTowers_[
i].energy());
3627 allcalotowers.push_back(caloT);
3632 cout <<
" RETRIEVED " << allcalotowers.size()
3633 <<
" CALOTOWER 4-VECTORS " << endl;
3637 const vector< PFJetAlgorithm::Jet >& caloTjets
3641 double JetEHTETmax = 0.0;
3642 for (
unsigned i = 0;
i < caloTjets.size();
i++) {
3643 TLorentzVector jetmom = caloTjets[
i].GetMomentum();
3644 double jetcalo_pt =
sqrt(jetmom.Px()*jetmom.Px()+jetmom.Py()*jetmom.Py());
3645 double jetcalo_et = jetmom.Et();
3648 jet.
eta = jetmom.Eta();
3649 jet.
phi = jetmom.Phi();
3650 jet.
et = jetmom.Et();
3653 const vector<int>& indexes = caloTjets[
i].GetIndexes();
3654 for(
unsigned ii=0;
ii<indexes.size();
ii++){
3664 cout <<
" ECAL+HCAL jet : " << caloTjets[
i] << endl;
3665 cout << jetmom.Px() <<
" " << jetmom.Py() <<
" "
3666 << jetmom.Pz() <<
" " << jetmom.E()
3667 <<
" PT=" << jetcalo_pt << endl;
3670 if (jetcalo_et >= JetEHTETmax)
3671 JetEHTETmax = jetcalo_et;
3676 vector<TLorentzVector> allrecparticles;
3688 for(
unsigned i=0;
i<candidates.size();
i++) {
3697 cout <<
i <<
" " << candidate << endl;
3699 cout <<
" type= " << type <<
" " << candidate.
charge()
3705 TLorentzVector partRec(PFpart.Px(),
3711 allrecparticles.push_back( partRec );
3717 cout <<
" THERE ARE " << allrecparticles.size()
3718 <<
" RECONSTRUCTED 4-VECTORS" << endl;
3721 const vector< PFJetAlgorithm::Jet >& PFjets
3725 cout << PFjets.size() <<
" PF Jets found" << endl;
3726 double JetPFETmax = 0.0;
3727 for (
unsigned i = 0;
i < PFjets.size();
i++) {
3728 TLorentzVector jetmom = PFjets[
i].GetMomentum();
3729 double jetpf_pt =
sqrt(jetmom.Px()*jetmom.Px()+jetmom.Py()*jetmom.Py());
3730 double jetpf_et = jetmom.Et();
3733 jet.
eta = jetmom.Eta();
3734 jet.
phi = jetmom.Phi();
3735 jet.
et = jetmom.Et();
3741 cout <<
" Rec jet : "<< PFjets[
i] <<endl;
3742 cout << jetmom.Px() <<
" " << jetmom.Py() <<
" "
3743 << jetmom.Pz() <<
" " << jetmom.E()
3744 <<
" PT=" << jetpf_pt <<
" eta="<< jetmom.Eta()
3745 <<
" Phi=" << jetmom.Phi() << endl;
3746 cout <<
"------------------------------------------------" << endl;
3749 if (jetpf_et >= JetPFETmax)
3750 JetPFETmax = jetpf_et;
3755 double deltaEtEHT = JetEHTETmax - partTOTMC.Et();
3758 double deltaEt = JetPFETmax - partTOTMC.Et();
3762 cout <<
"tau benchmark E_T(PF) - E_T(true) = " << deltaEt << endl;
3765 return deltaEt/partTOTMC.Et();
3820 string newString = oldString;
3822 string dollar =
"$";
3826 int dollarPos = newString.find(dollar,0);
3827 if( dollarPos == -1 )
return oldString;
3829 int lengh = newString.find(slash,0) - newString.find(dollar,0) + 1;
3830 string env_variable =
3831 newString.substr( ( newString.find(dollar,0) + 1 ), lengh -2);
3833 int begin = env_variable.find_first_of(
"{");
3834 int end = env_variable.find_last_of(
"}");
3839 env_variable = env_variable.substr( begin+1, end-1 );
3844 char*
directory = getenv( env_variable.c_str() );
3847 cerr<<
"please define environment variable $"<<env_variable<<endl;
3854 newString.replace( 0, lengh , sdir);
3857 cout <<
"expand " <<oldString<<
" to "<< newString << endl;
3872 if(!myGenEvent)
return;
3874 for ( HepMC::GenEvent::particle_const_iterator
3875 piter = myGenEvent->particles_begin();
3876 piter != myGenEvent->particles_end();
3879 if ( nGen != 1 || nSim != 1 )
return;
3882 if (
genJets_.size() != 1 )
return;
3884 double true_eta =
genJets_[0].eta();
3885 double true_phi =
genJets_[0].phi();
3889 double rec_ECALEnergy = 0.;
3890 double rec_HCALEnergy = 0.;
3891 double deltaRMin = 999.;
3892 unsigned int theJet = 0;
3893 for (
unsigned int ijet=0; ijet<
pfJets_.size(); ++ijet ) {
3894 double rec_ECAL =
pfJets_[ijet].neutralEmEnergy();
3895 double rec_HCAL =
pfJets_[ijet].neutralHadronEnergy();
3896 double rec_eta =
pfJets_[0].eta();
3897 double rec_phi =
pfJets_[0].phi();
3899 + (rec_phi-true_phi)*(rec_phi-true_phi) );
3900 if ( deltaR < deltaRMin ) {
3902 rec_ECALEnergy = rec_ECAL;
3903 rec_HCALEnergy = rec_HCAL;
3906 if ( deltaRMin > 0.1 )
return;
3908 std::vector < PFCandidatePtr > constituents =
pfJets_[theJet].getPFConstituents ();
3909 double pat_ECALEnergy = 0.;
3910 double pat_HCALEnergy = 0.;
3911 for (
unsigned ic = 0; ic < constituents.size (); ++ic) {
3912 if ( constituents[ic]->particleId() < 4 )
continue;
3913 if ( constituents[ic]->particleId() == 4 )
3914 pat_ECALEnergy += constituents[ic]->rawEcalEnergy();
3915 else if ( constituents[ic]->particleId() == 5 )
3916 pat_HCALEnergy += constituents[ic]->rawHcalEnergy();
3919 out << true_eta <<
" " << true_phi <<
" " << true_E
3920 <<
" " << rec_ECALEnergy <<
" " << rec_HCALEnergy
3921 <<
" " << pat_ECALEnergy <<
" " << pat_HCALEnergy
3922 <<
" " << deltaRMin << std::endl;
3932 std::vector< std::list <simMatch> > candSimMatchTrack;
3933 std::vector< std::list <simMatch> > candSimMatchEcal;
3943 out<<
"ECAL RecHits ==============================================="<<endl;
3945 out<<
"HCAL RecHits ==============================================="<<endl;
3948 out<<
"HO RecHits ================================================="<<endl;
3951 out<<
"HFEM RecHits ==============================================="<<endl;
3953 out<<
"HFHAD RecHits =============================================="<<endl;
3955 out<<
"PS RecHits ================================================="<<endl;
3960 out<<
"ECAL Clusters ============================================="<<endl;
3962 out<<
"HCAL Clusters ============================================="<<endl;
3965 out<<
"HO Clusters ==============================================="<<endl;
3968 out<<
"HFEM Clusters ============================================="<<endl;
3970 out<<
"HFHAD Clusters ============================================"<<endl;
3972 out<<
"PS Clusters ============================================="<<endl;
3975 bool printTracks =
true;
3980 out<<
"Particle Flow Blocks ======================================"<<endl;
3982 out<<
i<<
" "<<(*pfBlocks_)[
i]<<endl;
3987 out<<
"Particle Flow Candidates =================================="<<endl;
3998 out<<
"MEX, MEY, MET ============================================" <<endl
3999 << mex <<
" " << mey <<
" " <<
sqrt(mex*mex+mey*mey);
4006 cout<<
"MCTruthMatching Results"<<endl;
4009 out <<icand<<
" " <<(*pfCandidates_)[icand]<<endl;
4010 out <<
"is matching:" << endl;
4013 ITM it_t = candSimMatchTrack[icand].begin();
4014 ITM itend_t = candSimMatchTrack[icand].end();
4015 for(;it_t!=itend_t;++it_t){
4016 unsigned simid = it_t->second;
4019 out <<
"\t\tthrough Track matching pTrectrack="
4020 << it_t->first <<
" GeV" << endl;
4023 ITM it_e = candSimMatchEcal[icand].begin();
4024 ITM itend_e = candSimMatchEcal[icand].end();
4025 for(;it_e!=itend_e;++it_e){
4026 unsigned simid = it_e->second;
4029 out <<
"\t\tsimparticle contributing to a total of "
4031 <<
" GeV of its ECAL cluster"
4034 cout<<
"________________"<<endl;
4039 out<<
"Jets ====================================================="<<endl;
4040 out<<
"Particle Flow: "<<endl;
4046 out<<
"Generated: "<<endl;
4053 out<<
"Calo: "<<endl;
4060 out<<
"Sim Particles ==========================================="<<endl;
4078 cout<<
"MCTruthMatching Results"<<endl;
4080 cout <<
"==== Particle Simulated " <<
i << endl;
4085 cout <<
"Look at the desintegration products" << endl;
4092 cout <<
"matching pfCandidate (trough tracking): " << endl;
4096 ITM it = candSimMatchTrack[icand].begin();
4097 ITM itend = candSimMatchTrack[icand].end();
4098 for(;it!=itend;++it)
4099 if(
i == it->second ){
4100 out<<icand<<
" "<<(*pfCandidates_)[icand]<<endl;
4107 vector<unsigned> rechitSimIDs
4109 vector<double> rechitSimFrac
4112 if( !rechitSimIDs.size() )
continue;
4114 cout <<
"matching pfCandidate (through ECAL): " << endl;
4117 double totalEcalE = 0.0;
4119 for (
unsigned isimrh=0; isimrh < rechitSimIDs.size();
4123 cout <<
"For info, this particle deposits E=" << totalEcalE
4124 <<
"(GeV) in the ECAL" << endl;
4129 ITM it = candSimMatchEcal[icand].begin();
4130 ITM itend = candSimMatchEcal[icand].end();
4131 for(;it!=itend;++it)
4132 if(
i == it->second )
4133 out<<icand<<
" "<<it->first<<
"GeV "<<(*pfCandidates_)[icand]<<endl;
4150 int maxNLines)
const {
4154 if(!myGenEvent)
return;
4156 out<<
"GenParticles ==========================================="<<endl;
4158 std::cout <<
"Id Gen Name eta phi pT E Vtx1 "
4160 <<
"Moth Vtx2 eta phi R Z Da1 Da2 Ecal?"
4164 for ( HepMC::GenEvent::particle_const_iterator
4165 piter = myGenEvent->particles_begin();
4166 piter != myGenEvent->particles_end();
4169 if( nLines == maxNLines)
break;
4174 int partId = p->pdg_id();
4287 p->momentum().e() );
4293 if ( !p->production_vertex() && p->pdg_id() == 2212 )
continue;
4298 if(p->production_vertex() ) {
4299 vertex1.SetCoordinates( p->production_vertex()->position().x()/10.,
4300 p->production_vertex()->position().y()/10.,
4301 p->production_vertex()->position().z()/10. );
4302 vertexId1 = p->production_vertex()->barcode();
4305 out.setf(std::ios::fixed, std::ios::floatfield);
4306 out.setf(std::ios::right, std::ios::adjustfield);
4308 out << std::setw(4) << p->barcode() <<
" "
4311 for(
unsigned int k=0;
k<11-name.length() &&
k<12;
k++) out <<
" ";
4313 double eta = momentum1.eta();
4314 if ( eta > +10. ) eta = +10.;
4315 if ( eta < -10. ) eta = -10.;
4317 out << std::setw(6) << std::setprecision(2) << eta <<
" "
4318 << std::setw(6) << std::setprecision(2) << momentum1.phi() <<
" "
4319 << std::setw(7) << std::setprecision(2) << momentum1.pt() <<
" "
4320 << std::setw(7) << std::setprecision(2) << momentum1.e() <<
" "
4321 << std::setw(4) << vertexId1 <<
" "
4322 << std::setw(6) << std::setprecision(1) << vertex1.x() <<
" "
4323 << std::setw(6) << std::setprecision(1) << vertex1.y() <<
" "
4324 << std::setw(6) << std::setprecision(1) << vertex1.z() <<
" ";
4327 if( p->production_vertex() ) {
4328 if ( p->production_vertex()->particles_in_size() ) {
4330 *(p->production_vertex()->particles_in_const_begin());
4332 out << std::setw(4) << mother->barcode() <<
" ";
4338 if ( p->end_vertex() ) {
4340 p->end_vertex()->position().y()/10.,
4341 p->end_vertex()->position().z()/10.,
4342 p->end_vertex()->position().t()/10.);
4343 int vertexId2 = p->end_vertex()->barcode();
4345 std::vector<const HepMC::GenParticle*> children;
4346 HepMC::GenVertex::particles_out_const_iterator firstDaughterIt =
4347 p->end_vertex()->particles_out_const_begin();
4348 HepMC::GenVertex::particles_out_const_iterator lastDaughterIt =
4349 p->end_vertex()->particles_out_const_end();
4350 for ( ; firstDaughterIt != lastDaughterIt ; ++firstDaughterIt ) {
4351 children.push_back(*firstDaughterIt);
4354 out << std::setw(4) << vertexId2 <<
" "
4355 << std::setw(6) << std::setprecision(2) << vertex2.eta() <<
" "
4356 << std::setw(6) << std::setprecision(2) << vertex2.phi() <<
" "
4357 << std::setw(5) << std::setprecision(1) << vertex2.pt() <<
" "
4358 << std::setw(6) << std::setprecision(1) << vertex2.z() <<
" ";
4360 for (
unsigned id=0;
id<children.size(); ++id )
4361 out << std::setw(4) << children[id]->barcode() <<
" ";
4369 for(
unsigned i=0;
i<rechits.size();
i++) {
4370 string seedstatus =
" ";
4372 seedstatus =
"SEED";
4380 const char* seedstatus,
4381 ostream&
out)
const {
4390 TCutG* cutg = (TCutG*) gROOT->FindObject(
"CUTG");
4391 if( !cutg || cutg->IsInside( eta, phi ) )
4392 out<<index<<
"\t"<<seedstatus<<
" "<<rh<<endl;
4396 ostream&
out )
const {
4397 for(
unsigned i=0;
i<clusters.size();
i++) {
4404 ostream&
out )
const {
4414 TCutG* cutg = (TCutG*) gROOT->FindObject(
"CUTG");
4415 if( !cutg || cutg->IsInside( eta, phi ) )
4421 TCutG* cutg = (TCutG*) gROOT->FindObject(
"CUTG");
4422 if(!cutg)
return true;
4424 const vector< reco::PFTrajectoryPoint >& points = track.
trajectoryPoints();
4426 for(
unsigned i=0;
i<points.size();
i++) {
4427 if( ! points[
i].isValid() )
continue;
4430 if( cutg->IsInside( pos.Eta(), pos.Phi() ) )
return true;
4443 TCutG* cutg = (TCutG*) gROOT->FindObject(
"CUTG");
4445 mask.resize( rechits.size(),
true);
4450 mask.reserve( rechits.size() );
4451 for(
unsigned i=0;
i<rechits.size();
i++) {
4453 double eta = rechits[
i].position().Eta();
4454 double phi = rechits[
i].position().Phi();
4456 if( cutg->IsInside( eta, phi ) )
4457 mask.push_back(
true );
4459 mask.push_back(
false );
4468 TCutG* cutg = (TCutG*) gROOT->FindObject(
"CUTG");
4472 mask.reserve( clusters.size() );
4473 for(
unsigned i=0;
i<clusters.size();
i++) {
4475 double eta = clusters[
i].position().Eta();
4476 double phi = clusters[
i].position().Phi();
4478 if( cutg->IsInside( eta, phi ) )
4479 mask.push_back(
true );
4481 mask.push_back(
false );
4490 TCutG* cutg = (TCutG*) gROOT->FindObject(
"CUTG");
4494 mask.reserve( tracks.size() );
4495 for(
unsigned i=0;
i<tracks.size();
i++) {
4497 mask.push_back(
true );
4499 mask.push_back(
false );
4508 TCutG* cutg = (TCutG*) gROOT->FindObject(
"CUTG");
4512 mask.reserve( photons.size() );
4513 for(
unsigned i=0;
i<photons.size();
i++) {
4514 double eta = photons[
i].caloPosition().Eta();
4515 double phi = photons[
i].caloPosition().Phi();
4516 if( cutg->IsInside( eta, phi ) )
4517 mask.push_back(
true );
4519 mask.push_back(
false );
4529 TCutG* cutg = (TCutG*) gROOT->FindObject(
"CUTG");
4533 mask.reserve( tracks.size() );
4534 for(
unsigned i=0;
i<tracks.size();
i++) {
4536 mask.push_back(
true );
4538 mask.push_back(
false );
4546 double& peta,
double& pphi,
double& pe)
4551 string err =
"PFRootEventManager::closestParticle : ";
4552 err +=
"vector of PFSimParticles is empty";
4553 throw std::length_error( err.c_str() );
4556 double mindist2 = 99999999;
4557 unsigned iClosest=0;
4577 double deta = peta -
eta;
4578 double dphi = pphi -
phi;
4580 double dist2 = deta*deta + dphi*dphi;
4582 if(dist2<mindist2) {
4615 case 1: { name =
"d";latexString=
"d";
break; }
4616 case 2: { name =
"u";latexString=
"u";
break; }
4617 case 3: { name =
"s";latexString=
"s" ;
break; }
4618 case 4: { name =
"c";latexString=
"c" ;
break; }
4619 case 5: { name =
"b";latexString=
"b" ;
break; }
4620 case 6: { name =
"t";latexString=
"t" ;
break; }
4621 case -1: { name =
"~d";latexString=
"#bar{d}" ;
break; }
4622 case -2: { name =
"~u";latexString=
"#bar{u}" ;
break; }
4623 case -3: { name =
"~s";latexString=
"#bar{s}" ;
break; }
4624 case -4: { name =
"~c";latexString=
"#bar{c}" ;
break; }
4625 case -5: { name =
"~b";latexString=
"#bar{b}" ;
break; }
4626 case -6: { name =
"~t";latexString=
"#bar{t}" ;
break; }
4627 case 11: { name =
"e-";latexString=
name ;
break; }
4628 case -11: { name =
"e+";latexString=
name ;
break; }
4629 case 12: { name =
"nu_e";latexString=
"#nu_{e}" ;
break; }
4630 case -12: { name =
"~nu_e";latexString=
"#bar{#nu}_{e}" ;
break; }
4631 case 13: { name =
"mu-";latexString=
"#mu-" ;
break; }
4632 case -13: { name =
"mu+";latexString=
"#mu+" ;
break; }
4633 case 14: { name =
"nu_mu";latexString=
"#nu_{mu}" ;
break; }
4634 case -14: { name =
"~nu_mu";latexString=
"#bar{#nu}_{#mu}";
break; }
4635 case 15: { name =
"tau-";latexString=
"#tau^{-}" ;
break; }
4636 case -15: { name =
"tau+";latexString=
"#tau^{+}" ;
break; }
4637 case 16: { name =
"nu_tau";latexString=
"#nu_{#tau}" ;
break; }
4638 case -16: { name =
"~nu_tau";latexString=
"#bar{#nu}_{#tau}";
break; }
4639 case 21: { name =
"gluon";latexString=
name;
break; }
4640 case 22: { name =
"gamma";latexString=
"#gamma";
break; }
4641 case 23: { name =
"Z0";latexString=
"Z^{0}" ;
break; }
4642 case 24: { name =
"W+";latexString=
"W^{+}" ;
break; }
4643 case 25: { name =
"H0";latexString=
name ;
break; }
4644 case -24: { name =
"W-";latexString=
"W^{-}" ;
break; }
4645 case 111: { name =
"pi0";latexString=
"#pi^{0}" ;
break; }
4646 case 113: { name =
"rho0";latexString=
"#rho^{0}" ;
break; }
4647 case 223: { name =
"omega";latexString=
"#omega" ;
break; }
4648 case 333: { name =
"phi";latexString=
"#phi";
break; }
4649 case 443: { name =
"J/psi";latexString=
"J/#psi" ;
break; }
4650 case 553: { name =
"Upsilon";latexString=
"#Upsilon" ;
break; }
4651 case 130: { name =
"K0L";latexString=
name ;
break; }
4652 case 211: { name =
"pi+";latexString=
"#pi^{+}" ;
break; }
4653 case -211: { name =
"pi-";latexString=
"#pi^{-}" ;
break; }
4654 case 213: { name =
"rho+";latexString=
"#rho^{+}" ;
break; }
4655 case -213: { name =
"rho-";latexString=
"#rho^{-}" ;
break; }
4656 case 221: { name =
"eta";latexString=
"#eta" ;
break; }
4657 case 331: { name =
"eta'";latexString=
"#eta'" ;
break; }
4658 case 441: { name =
"etac";latexString=
"#eta_{c}" ;
break; }
4659 case 551: { name =
"etab";latexString=
"#eta_{b}";
break; }
4660 case 310: { name =
"K0S";latexString=
name ;
break; }
4661 case 311: { name =
"K0";latexString=
"K^{0}" ;
break; }
4662 case -311: { name =
"Kbar0";latexString=
"#bar{#Kappa}^{0}" ;
break; }
4663 case 321: { name =
"K+";latexString=
"K^{+}";
break; }
4664 case -321: { name =
"K-";latexString=
"K^{-}";
break; }
4665 case 411: { name =
"D+";latexString=
"D^{+}" ;
break; }
4666 case -411: { name =
"D-";latexString=
"D^{-}";
break; }
4667 case 421: { name =
"D0";latexString=
"D^{0}" ;
break; }
4668 case -421: { name =
"D0-bar";latexString=
"#overline{D^{0}}" ;
break; }
4669 case 423: { name =
"D*0";latexString=
"D^{*0}" ;
break; }
4670 case -423: { name =
"D*0-bar";latexString=
"#overline{D^{*0}}" ;
break; }
4671 case 431: { name =
"Ds_+";latexString=
"Ds_{+}" ;
break; }
4672 case -431: { name =
"Ds_-";latexString=
"Ds_{-}" ;
break; }
4673 case 511: { name =
"B0";latexString=
name;
break; }
4674 case 521: { name =
"B+";latexString=
"B^{+}" ;
break; }
4675 case -521: { name =
"B-";latexString=
"B^{-}" ;
break; }
4676 case 531: { name =
"Bs_0";latexString=
"Bs_{0}" ;
break; }
4677 case -531: { name =
"anti-Bs_0";latexString=
"#overline{Bs_{0}}" ;
break; }
4678 case 541: { name =
"Bc_+";latexString=
"Bc_{+}" ;
break; }
4679 case -541: { name =
"Bc_+";latexString=
"Bc_{+}" ;
break; }
4680 case 313: { name =
"K*0";latexString=
"K^{*0}" ;
break; }
4681 case -313: { name =
"K*bar0";latexString=
"#bar{K}^{*0}" ;
break; }
4682 case 323: { name =
"K*+";latexString=
"#K^{*+}";
break; }
4683 case -323: { name =
"K*-";latexString=
"#K^{*-}" ;
break; }
4684 case 413: { name =
"D*+";latexString=
"D^{*+}";
break; }
4685 case -413: { name =
"D*-";latexString=
"D^{*-}" ;
break; }
4687 case 433: { name =
"Ds*+";latexString=
"D_{s}^{*+}" ;
break; }
4688 case -433: { name =
"Ds*-";latexString=
"B_{S}{*-}" ;
break; }
4690 case 513: { name =
"B*0";latexString=
"B^{*0}" ;
break; }
4691 case -513: { name =
"anti-B*0";latexString=
"#overline{B^{*0}}" ;
break; }
4692 case 523: { name =
"B*+";latexString=
"B^{*+}" ;
break; }
4693 case -523: { name =
"B*-";latexString=
"B^{*-}" ;
break; }
4695 case 533: { name =
"B*_s0";latexString=
"B^{*}_{s0}" ;
break; }
4696 case -533 : {name=
"anti-B_s0"; latexString=
"#overline{B_{s}^{0}}";
break; }
4698 case 543: { name =
"B*_c+";latexString=
"B^{*}_{c+}";
break; }
4699 case -543: { name =
"B*_c-";latexString=
"B^{*}_{c-}";
break; }
4700 case 1114: { name =
"Delta-";latexString=
"#Delta^{-}" ;
break; }
4701 case -1114: { name =
"Deltabar+";latexString=
"#bar{#Delta}^{+}" ;
break; }
4702 case -2112: { name =
"nbar0";latexString=
"{bar}n^{0}" ;
break; }
4703 case 2112: { name =
"n"; latexString=
name ;
break;}
4704 case 2114: { name =
"Delta0"; latexString=
"#Delta^{0}" ;
break; }
4705 case -2114: { name =
"Deltabar0"; latexString=
"#bar{#Delta}^{0}" ;
break; }
4706 case 3122: { name =
"Lambda0";latexString=
"#Lambda^{0}";
break; }
4707 case -3122: { name =
"Lambdabar0";latexString=
"#bar{#Lambda}^{0}" ;
break; }
4708 case 3112: { name =
"Sigma-"; latexString=
"#Sigma" ;
break; }
4709 case -3112: { name =
"Sigmabar+"; latexString=
"#bar{#Sigma}^{+}" ;
break; }
4710 case 3114: { name =
"Sigma*-"; latexString=
"#Sigma^{*}" ;
break; }
4711 case -3114: { name =
"Sigmabar*+"; latexString=
"#bar{#Sigma}^{*+}" ;
break; }
4714 case 3212: { name =
"Sigma0";latexString=
"#Sigma^{0}" ;
break; }
4715 case -3212: { name =
"Sigmabar0";latexString=
"#bar{#Sigma}^{0}" ;
break; }
4716 case 3214: { name =
"Sigma*0"; latexString=
"#Sigma^{*0}" ;
break; }
4717 case -3214: { name =
"Sigma*bar0";latexString=
"#bar{#Sigma}^{*0}" ;
break; }
4718 case 3222: { name =
"Sigma+"; latexString=
"#Sigma^{+}" ;
break; }
4719 case -3222: { name =
"Sigmabar-"; latexString=
"#bar{#Sigma}^{-}";
break; }
4720 case 3224: { name =
"Sigma*+"; latexString=
"#Sigma^{*+}" ;
break; }
4721 case -3224: { name =
"Sigmabar*-"; latexString=
"#bar{#Sigma}^{*-}";
break; }
4723 case 2212: { name =
"p";latexString=
name ;
break; }
4724 case -2212: { name =
"~p";latexString=
"#bar{p}" ;
break; }
4725 case -2214: { name =
"Delta-";latexString=
"#Delta^{-}" ;
break; }
4726 case 2214: { name =
"Delta+";latexString=
"#Delta^{+}" ;
break; }
4727 case -2224: { name =
"Deltabar--"; latexString=
"#bar{#Delta}^{--}" ;
break; }
4728 case 2224: { name =
"Delta++"; latexString=
"#Delta^{++}";
break; }
4730 case 3312: { name =
"Xi-"; latexString=
"#Xi^{-}";
break; }
4731 case -3312: { name =
"Xi+"; latexString=
"#Xi^{+}";
break; }
4732 case 3314: { name =
"Xi*-"; latexString=
"#Xi^{*-}";
break; }
4733 case -3314: { name =
"Xi*+"; latexString=
"#Xi^{*+}";
break; }
4735 case 3322: { name =
"Xi0"; latexString=
"#Xi^{0}";
break; }
4736 case -3322: { name =
"anti-Xi0"; latexString=
"#overline{Xi^{0}}";
break; }
4737 case 3324: { name =
"Xi*0"; latexString=
"#Xi^{*0}";
break; }
4738 case -3324: { name =
"anti-Xi*0"; latexString=
"#overline{Xi^{*0}}";
break; }
4740 case 3334: { name =
"Omega-"; latexString=
"#Omega^{-}";
break; }
4741 case -3334: { name =
"anti-Omega+"; latexString=
"#Omega^{+}";
break; }
4743 case 4122: { name =
"Lambda_c+"; latexString=
"#Lambda_{c}^{+}";
break; }
4744 case -4122: { name =
"Lambda_c-"; latexString=
"#Lambda_{c}^{-}";
break; }
4745 case 4222: { name =
"Sigma_c++"; latexString=
"#Sigma_{c}^{++}";
break; }
4746 case -4222: { name =
"Sigma_c--"; latexString=
"#Sigma_{c}^{--}";
break; }
4749 case 92 : {name=
"String"; latexString=
"String";
break; }
4751 case 2101 : {name=
"ud_0"; latexString=
"ud_{0}";
break; }
4752 case -2101 : {name=
"anti-ud_0"; latexString=
"#overline{ud}_{0}";
break; }
4753 case 2103 : {name=
"ud_1"; latexString=
"ud_{1}";
break; }
4754 case -2103 : {name=
"anti-ud_1"; latexString=
"#overline{ud}_{1}";
break; }
4755 case 2203 : {name=
"uu_1"; latexString=
"uu_{1}";
break; }
4756 case -2203 : {name=
"anti-uu_1"; latexString=
"#overline{uu}_{1}";
break; }
4757 case 3303 : {name=
"ss_1"; latexString=
"#overline{ss}_{1}";
break; }
4758 case 3101 : {name=
"sd_0"; latexString=
"sd_{0}";
break; }
4759 case -3101 : {name=
"anti-sd_0"; latexString=
"#overline{sd}_{0}";
break; }
4760 case 3103 : {name=
"sd_1"; latexString=
"sd_{1}";
break; }
4761 case -3103 : {name=
"anti-sd_1"; latexString=
"#overline{sd}_{1}";
break; }
4763 case 20213 : {name=
"a_1+"; latexString=
"a_{1}^{+}";
break; }
4764 case -20213 : {name=
"a_1-"; latexString=
"a_{1}^{-}";
break; }
4769 cout <<
"Unknown code : " << partId << endl;
4782 std::vector< std::list <simMatch> >& candSimMatchTrack,
4783 std::vector< std::list <simMatch> >& candSimMatchEcal)
const
4788 out <<
"Running Monte Carlo Truth Matching Tool" << endl;
4792 candSimMatchTrack.resize(candidates.size());
4793 candSimMatchEcal.resize(candidates.size());
4795 for(
unsigned i=0;
i<candidates.size();
i++) {
4800 out <<
i<<
" " <<(*pfCandidates_)[
i]<<endl;
4801 out <<
"is matching:" << endl;
4807 for(
unsigned iel=0; iel<eleInBlocks.size(); ++iel) {
4808 PFBlockRef blockRef = eleInBlocks[iel].first;
4809 unsigned indexInBlock = eleInBlocks[iel].second;
4818 = elements_h[ indexInBlock ].type();
4825 = elements_h[ indexInBlock ].trackRefPF();
4826 assert( !trackref.
isNull() );
4829 unsigned rtrkID = track.trackId();
4835 if(trackIDM != 99999
4836 && trackIDM == rtrkID){
4839 out <<
"\tSimParticle " << isim
4840 <<
" through Track matching pTrectrack="
4841 << trkREF->pt() <<
" GeV" << endl;
4844 std::pair<double, unsigned> simtrackmatch
4845 = make_pair(trkREF->pt(),trackIDM);
4846 candSimMatchTrack[
i].push_back(simtrackmatch);
4856 = elements_h[ indexInBlock ].clusterRef();
4857 assert( !clusterref.
isNull() );
4860 const std::vector< reco::PFRecHitFraction >&
4861 fracs = cluster.recHitFractions();
4865 vector<unsigned> simpID;
4868 for(
unsigned int rhit = 0; rhit < fracs.size(); ++rhit){
4871 if(rh.
isNull())
continue;
4882 vector<unsigned> rechitSimIDs
4884 vector<double> rechitSimFrac
4887 if( !rechitSimIDs.size() )
continue;
4889 for (
unsigned isimrh=0; isimrh < rechitSimIDs.size(); isimrh++) {
4890 if( rechitSimIDs[isimrh] == rechit_cluster.
detId() ){
4892 bool takenalready =
false;
4893 for(
unsigned iss = 0; iss < simpID.size(); ++iss)
4894 if(simpID[iss] == isim) takenalready =
true;
4895 if(!takenalready) simpID.push_back(isim);
4898 ((rechit_cluster.
energy()*rechitSimFrac[isimrh])/100.0)
4899 *fracs[rhit].fraction();
4911 for(
unsigned is=0; is < simpID.size(); ++is)
4913 double frac_of_cluster
4914 = (simpEC[simpID[is]]/cluster.energy())*100.0;
4917 std::pair<double, unsigned> simecalmatch
4918 = make_pair(simpEC[simpID[is]],simpID[is]);
4919 candSimMatchEcal[
i].push_back(simecalmatch);
4922 out <<
"\tSimParticle " << simpID[is]
4923 <<
" through ECAL matching Epfcluster="
4925 <<
" GeV with N=" << simpCN[simpID[is]]
4926 <<
" rechits in common "
4928 out <<
"\t\tsimparticle contributing to a total of "
4929 << simpEC[simpID[is]]
4930 <<
" GeV of this cluster ("
4931 << frac_of_cluster <<
"%) "
4940 cout <<
"==============================================================="
4947 cout <<
"=================================================================="
4949 cout <<
"SimParticles" << endl;
4953 cout <<
"==== Particle Simulated " <<
i << endl;
4958 cout <<
"Look at the desintegration products" << endl;
4965 cout <<
"matching pfCandidate (trough tracking): " << endl;
4966 for(
unsigned icand=0; icand<candidates.size(); icand++ )
4968 ITM it = candSimMatchTrack[icand].begin();
4969 ITM itend = candSimMatchTrack[icand].end();
4970 for(;it!=itend;++it)
4971 if(
i == it->second ){
4972 out<<icand<<
" "<<(*pfCandidates_)[icand]<<endl;
4980 vector<unsigned> rechitSimIDs
4982 vector<double> rechitSimFrac
4985 if( !rechitSimIDs.size() )
continue;
4987 cout <<
"matching pfCandidate (through ECAL): " << endl;
4990 double totalEcalE = 0.0;
4992 for (
unsigned isimrh=0; isimrh < rechitSimIDs.size();
4996 cout <<
"For info, this particle deposits E=" << totalEcalE
4997 <<
"(GeV) in the ECAL" << endl;
4999 for(
unsigned icand=0; icand<candidates.size(); icand++ )
5001 ITM it = candSimMatchEcal[icand].begin();
5002 ITM itend = candSimMatchEcal[icand].end();
5003 for(;it!=itend;++it)
5004 if(
i == it->second )
5005 out<<icand<<
" "<<it->first<<
"GeV "<<(*pfCandidates_)[icand]<<endl;
5017 if ( tagname.size() == 1 )
5020 else if ( tagname.size() == 2 )
5023 else if ( tagname.size() == 3 )
5024 return tagname[2] ==
'*' ?
5028 cout <<
"Invalid tag name with " << tagname.size() <<
" strings "<< endl;
void setmEInputCut(double amEInputCut)
Minimum E for jet constituents.
edm::InputTag displacedRecTracksTag_
CaloTowerCollection caloTowers_
std::auto_ptr< reco::PFBlockCollection > pfBlocks_
reconstructed pfblocks
bool useAtHLT_
Use HLT tracking.
const std::vector< int > & daughterIds() const
void setThreshCleanBarrel(double thresh)
set barrel clean threshold
edm::InputTag MCTruthTag_
std::auto_ptr< reco::PFCandidateCollection > transferCandidates()
void fillClusterMask(std::vector< bool > &mask, const reco::PFClusterCollection &clusters) const
cluster mask set to true for rechits inside TCutG
edm::Handle< reco::CaloMETCollection > caloMetsHandle_
CMSSW Calo MET.
virtual double energy() const GCC11_FINAL
energy
EventNumber_t event() const
void fillTrackMask(std::vector< bool > &mask, const reco::PFRecTrackCollection &tracks) const
track mask set to true for rechits inside TCutG
const math::XYZPoint & position() const
cluster centroid position
void reconstructGenJets()
reconstruct gen jets
void add4Neighbour(unsigned index)
reconstructed track used as an input to particle flow
std::string getGenParticleName(int partId, std::string &latexStringName) const
get name of genParticle
void setOverlapThreshold(double aOverlapThreshold)
????
edm::Handle< reco::GenParticleRefVector > genParticlesforJetsHandle_
input collection of gen particles
void reset()
reset before next event
void setThreshDoubleSpikeEndcap(double thresh)
set endcap thresholds for double spike cleaning
void reconstructPFJets()
reconstruct pf jets
void setParameters(Benchmark::Mode mode, float ptmin, float ptmax, float etamin, float etamax, float phimin, float phimax, bool metSpHistos)
set the parameters locally
PFClusterAlgo clusterAlgoHFEM_
clustering algorithm for HF, electro-magnetic layer
void setDirectory(TDirectory *dir)
set directory (to use in ROOT)
PFMETMonitor pfMETMonitor_
unsigned filterNParticles_
void SetConeMerge(double coneMerge)
void printCluster(const reco::PFCluster &cluster, std::ostream &out=std::cout) const
bool tauBenchmarkDebug_
tau benchmark debug
double printSimParticlesPtMin_
bool printPFJets_
print PFJets yes/no
ParticleType
particle types
edm::Handle< reco::PFRecHitCollection > rechitsHFEMHandle_
rechits HF EM
PFClusterAlgo clusterAlgoHO_
clustering algorithm for HO
boost::shared_ptr< PFEnergyCalibration > calibration_
edm::Handle< reco::PFJetCollection > pfJetsHandle_
CMSSW PF Jets.
void setShowerSigma(double sigma)
set shower sigma for
void add8Neighbour(unsigned index)
JetReco::InputCollection Constituents
bool printPFBlocks_
print PFBlocks yes/no
PFJetBenchmark PFJetBenchmark_
PFJet Benchmark.
General option file parser.
void setPFMuonAndFakeParameters(const edm::ParameterSet &pset)
Ptr< typename C::value_type > refToPtr(Ref< C, typename C::value_type, refhelper::FindUsingAdvance< C, typename C::value_type > > const &ref)
reco::PFMETCollection pfMetsCMSSW_
bool useConvBremPFRecTracks_
Use Conv Brem KF Tracks.
edm::InputTag caloJetsTag_
void fillOutEventWithPFCandidates(const reco::PFCandidateCollection &pfCandidates)
fills OutEvent with candidates
void setPosCalcP1(double p1)
set p1 for position calculation
virtual double p() const GCC11_FINAL
magnitude of momentum vector
virtual const LorentzVector & p4() const GCC11_FINAL
four-momentum Lorentz vector
Particle flow cluster, see clustering algorithm in PFClusterAlgo.
void doClustering(const reco::PFRecHitCollection &rechits)
perform clustering
bool debug_
debug printouts for this PFRootEventManager on/off
edm::Handle< reco::PFCandidateCollection > pfCandidateHandle_
CMSSW PF candidates.
void setDirectory(TDirectory *dir)
set directory (to use in ROOT)
boost::shared_ptr< PFEnergyCalibrationHF > thepfEnergyCalibrationHF_
static void setDepthCorParameters(int mode, double a, double b, double ap, double bp)
void setPosCalcNCrystal(int n)
set number of crystals for position calculation (-1 all,5, or 9)
reco::GenParticleRefVector genParticlesforJets_
void setThreshSeedBarrel(double thresh)
set barrel seed threshold
unsigned detId() const
rechit detId
edm::InputTag convBremGsfrecTracksTag_
void makeIterativeConeJets(const JetReco::InputCollection &fInput, JetReco::OutputCollection *fOutput)
Produce jet collection using CMS Iterative Cone Algorithm.
void setCandConnectorParameters(const edm::ParameterSet &iCfgCandConnector)
int chargeValue(const int &pdgId) const
virtual int pdgId() const GCC11_FINAL
PDG identifier.
edm::Handle< reco::PFRecHitCollection > rechitsHCALHandle_
rechits HCAL
void push_back(Ptr< T > const &iPtr)
edm::Handle< reco::PFMETCollection > pfMetsHandle_
CMSSW PF MET.
void reconstructParticles(const reco::PFBlockHandle &blockHandle)
const math::XYZPoint & position() const
cartesian position (x, y, z)
void setS6S2DoubleSpikeEndcap(double cut)
fwlite::ChainEvent * ev_
NEW: input event.
std::vector< InputItem > InputCollection
IO * options_
options file parser
reco::PFJetCollection pfJetsCMSSW_
std::auto_ptr< reco::PFClusterCollection > clustersECAL_
void PreprocessRecHits(reco::PFRecHitCollection &rechits, bool findNeighbours)
preprocess a rechit vector from a given rechit branch
std::auto_ptr< reco::PFCandidateElectronExtraCollection > transferElectronExtra()
bool usePFV0s_
Use of V0 in PFAlgo.
bool isSeed(unsigned rhi) const
double printClustersEMin_
void fill(const T &jetCollection, const C &matchedJetCollection, float &minVal, float &maxVal)
fill histograms with all particle
reco::MuonCollection muons_
void setmEtInputCut(double amEtInputCut)
Minimum ET for jet constituents.
void setSeedThreshold(double aSeedThreshold)
Set seed to start jet reconstruction.
edm::InputTag stdTracksTag_
const Constituents & getTowerList()
void setMaxIterations(int amaxIteration)
????
std::vector< std::string > inFileNames_
input file names
PFRootEventManager()
default constructor
reco::PFRecTrackCollection displacedRecTracks_
General CMS geometry parameters used during Particle Flow reconstruction or drawing. All methods and members are static.
reco::GenJetCollection genJets_
gen Jets
edm::InputTag egammaElectronsTag_
reco::PFRecHitCollection rechitsHFHAD_
edm::InputTag primaryVerticesTag_
unsigned rectrackId() const
std::vector< PFSimParticle > PFSimParticleCollection
collection of PFSimParticle objects
const edm::OwnVector< reco::PFBlockElement > & elements() const
edm::InputTag rechitsHFEMTag_
void addJetMC(const Jet &jets)
edm::InputTag rechitsECALTag_
std::vector< PFRecHit > PFRecHitCollection
collection of PFRecHit objects
reco::CandidatePtrVector caloTowersPtrs_
bool usePFNuclearInteractions_
Use of PFDisplacedVertex in PFAlgo.
Transient Jet class used by the reconstruction algorithms.
bool isHadronicTau() const
study the sim event to check if the tau decay is hadronic
void checkCleaning(const reco::PFRecHitCollection &cleanedHF)
Check HF Cleaning.
std::auto_ptr< reco::PFClusterCollection > clustersHCAL_
reco::PhotonCollection photons_
bool usePFElectrons_
Use PFElectrons.
Base class for particle flow input reconstructed tracks and simulated particles.
const std::vector< PFJetAlgorithm::Jet > & FindJets(const std::vector< TLorentzVector > *vecs)
std::vector< ProtoJet > caloJets_
calo Jets
void setDisplacedVerticesParameters(bool rejectTracks_Bad, bool rejectTracks_Step45, bool usePFNuclearInteractions, bool usePFConversions, bool usePFDecays, double dptRel_DispVtx)
void fillOutEventWithCaloTowers(const CaloTowerCollection &cts)
fills outEvent with calo towers
void setThreshBarrel(double thresh)
setters -------------------------------------------------——
PFClusterAlgo clusterAlgoECAL_
reco::PFRecTrackCollection recTracks_
edm::Handle< reco::GsfPFRecTrackCollection > gsfrecTracksHandle_
reconstructed GSF tracks
void write()
write to the TFile, in plain ROOT mode. No need to call this function in DQM mode ...
LuminosityBlockNumber_t luminosityBlock() const
void setConeRadius(double aConeRadius)
Set radius of the cone.
void setUseCornerCells(bool usecornercells)
activate use of cells with a common corner to build topo-clusters
bool highPtJet(double ptMin) const
returns true if there is at least one jet with pT>pTmin
void setPFEleParameters(double mvaEleCut, std::string mvaWeightFileEleID, bool usePFElectrons, const boost::shared_ptr< PFSCEnergyCalibration > &thePFSCEnergyCalibration, const boost::shared_ptr< PFEnergyCalibration > &thePFEnergyCalibration, double sumEtEcalIsoForEgammaSC_barrel, double sumEtEcalIsoForEgammaSC_endcap, double coneEcalIsoForEgammaSC, double sumPtTrackIsoForEgammaSC_barrel, double sumPtTrackIsoForEgammaSC_endcap, unsigned int nTrackIsoForEgammaSC, double coneTrackIsoForEgammaSC, bool applyCrackCorrections=false, bool usePFSCEleCalib=true, bool useEGElectrons=false, bool useEGammaSupercluster=true)
void setPFVertexParameters(bool useVertex, const reco::VertexCollection *primaryVertices)
void setEGElectronCollection(const reco::GsfElectronCollection &egelectrons)
virtual double py() const GCC11_FINAL
y coordinate of momentum vector
reco::PFRecHitCollection rechitsPS_
Jets made from PFObjects.
void applyCuts(const reco::CandidatePtrVector &Candidates, JetReco::InputCollection *input)
void particleFlow()
performs particle flow
std::vector< ElementInBlock > ElementsInBlocks
edm::Handle< reco::PhotonCollection > photonHandle_
photons
void setNumber(int number)
double printGenParticlesPtMin_
void setPFPhotonParameters(bool usePFPhoton, std::string mvaWeightFileConvID, double mvaConvCut, bool useReg, std::string X0_Map, const boost::shared_ptr< PFEnergyCalibration > &thePFEnergyCalibration, double sumPtTrackIsoForPhoton, double sumPtTrackIsoSlopeForPhoton)
double tauBenchmark(const reco::PFCandidateCollection &candidates)
COLIN need to get rid of this mess.
edm::Handle< std::vector< reco::CaloJet > > caloJetsHandle_
CMSSW calo Jets.
static std::string const input
bool GetOpt(const char *tag, const char *key, std::vector< T > &values) const
reads a vector of T
bool doPFMETBenchmark_
PFMET benchmark on/off.
reco::PFRecHitCollection rechitsHCAL_
std::vector< PFCandidatePtr > pfCandidates(const PFJet &jet, int particleId, bool sort=true)
void reconstructFWLiteJets(const reco::CandidatePtrVector &Candidates, std::vector< ProtoJet > &output)
used by the reconstruct*Jets functions
edm::InputTag gsfrecTracksTag_
edm::Handle< reco::PFRecHitCollection > rechitsECALHandle_
rechits ECAL
void setThreshPtSeedBarrel(double thresh)
edm::Handle< reco::PFRecHitCollection > rechitsHFHADHandle_
rechits HF HAD
std::vector< edm::Handle< reco::PFRecHitCollection > > rechitsCLEANEDHandles_
reco::PFSimParticleCollection trueParticles_
XYZTLorentzVectorD XYZTLorentzVector
Lorentz vector with cylindrical internal representation using pseudorapidity.
edm::Handle< reco::PFSimParticleCollection > trueParticlesHandle_
true particles
void addCandidate(const Particle &ptc)
bool readFromSimulation(int entry)
read data from simulation tree
void setThreshSeedEndcap(double thresh)
set endcap seed threshold
edm::InputTag stringToTag(const std::vector< std::string > &tagname)
returns an InputTag from a vector of strings
void print(std::ostream &out=std::cout, int maxNLines=-1) const
print information
virtual float phi() const GCC11_FINAL
momentum azimuthal angle
void readOptions(const char *file, bool refresh=true, bool reconnect=false)
edm::Handle< reco::TrackCollection > stdTracksHandle_
standard reconstructed tracks
std::vector< int > filterTaus_
edm::InputTag rechitsPSTag_
void setup(std::string Filename, bool debug, bool plotAgainstReco=0, bool onlyTwoJets=1, double deltaRMax=0.1, std::string benchmarkLabel_="ParticleFlow", double recPt=-1, double maxEta=-1, DQMStore *dbe_store=NULL)
bool isNull() const
Checks for null.
bool isNeutrino(const Candidate &part)
edm::Handle< reco::GenJetCollection > genJetsHandle_
CMSSW gen Jets.
void fillPhotonMask(std::vector< bool > &mask, const reco::PhotonCollection &photons) const
photon mask set to true for photons inside TCutG
bool jetsDebug_
debug printouts for jet algo on/off
bool printClusters_
print clusters yes/no
reco::VertexCollection primaryVertices_
void setDebug(bool debug)
edm::InputTag genParticlesforMETTag_
Particle flow rechit (rechit + geometry and topology information). See clustering algorithm in PFClus...
reco::CandidatePtrVector pfCandidatesPtrs_
TTree * outTree_
output tree
void fillOutEventWithClusters(const reco::PFClusterCollection &clusters)
fills OutEvent with clusters
void setParameters(double nSigmaECAL, double nSigmaHCAL, const boost::shared_ptr< PFEnergyCalibration > &calibration, const boost::shared_ptr< PFEnergyCalibrationHF > &thepfEnergyCalibrationHF)
std::auto_ptr< reco::PFClusterCollection > clustersPS_
std::vector< GsfPFRecTrack > GsfPFRecTrackCollection
collection of GsfPFRecTrack objects
virtual int status() const GCC11_FINAL
status word
void printRecHits(const reco::PFRecHitCollection &rechits, const PFClusterAlgo &clusterAlgo, std::ostream &out=std::cout) const
print rechits
edm::InputTag rechitsHOTag_
reco::GenJetCollection genJetsCMSSW_
void makeMidpointJets(const JetReco::InputCollection &fInput, JetReco::OutputCollection *fOutput)
Produce jet collection using CMS Midpoint Jet Algorithm.
TFile * outFile_
output file
void setup()
book histograms
void mcTruthMatching(std::ostream &out, const reco::PFCandidateCollection &candidates, std::vector< std::list< simMatch > > &candSimMatchTrack, std::vector< std::list< simMatch > > &candSimMatchEcal) const
void setDebug(bool debug)
sets debug printout flag
PFJetMonitor pfJetMonitor_
std::ofstream * calibFile_
void setParameters(float dRMax, bool matchCharge, Benchmark::Mode mode, float ptmin, float ptmax, float etamin, float etamax, float phimin, float phimax, bool fracHistoFlag=true)
set the parameters locally
void setNNeighbours(int n)
set number of neighbours for
TH1F * h_deltaETvisible_MCPF_
output histo dET ( PF - MC)
edm::InputTag pfNuclearTrackerVertexTag_
void setParameters(float dRMax=0.3, bool matchCharge=true, Benchmark::Mode mode=Benchmark::DEFAULT)
set the benchmark parameters
edm::InputTag corrcaloJetsTag_
bool doParticleFlow_
particle flow on/off
void setPFPhotonRegWeights(const GBRForest *LCorrForestEB, const GBRForest *LCorrForestEE, const GBRForest *GCorrForestBarrel, const GBRForest *GCorrForestEndcapHr9, const GBRForest *GCorrForestEndcapLr9, const GBRForest *PFEcalResolution)
virtual double px() const GCC11_FINAL
x coordinate of momentum vector
Abs< T >::type abs(const T &t)
edm::InputTag genParticlesforJetsTag_
edm::InputTag caloTowersTag_
PFClusterAlgo clusterAlgoHCAL_
clustering algorithm for HCAL
float jetArea() const
Jet area as calculated by algorithm.
Jets made from MC generator particles.
PFCandidateManager pfCandidateManager_
edm::InputTag recTracksTag_
std::auto_ptr< reco::PFCandidateElectronExtraCollection > pfCandidateElectronExtras_
PFCandidateElectronExtra.
void addCluster(const Cluster &ptc)
bool printPFCandidates_
print PFCandidates yes/no
void printClusters(const reco::PFClusterCollection &clusters, std::ostream &out=std::cout) const
print clusters
std::list< std::pair< double, unsigned > >::iterator ITM
void setS4S1CleanBarrel(const std::vector< double > &coeffs)
reco::PFCandidateCollection pfCandCMSSW_
const reco::PFTrajectoryPoint & extrapolatedPoint(unsigned layerid) const
reco::GsfPFRecTrackCollection gsfrecTracks_
bool useKDTreeTrackEcalLinker_
ECAL-track link optimization.
edm::InputTag genJetsTag_
void SetConeAngle(double coneAngle)
void setThreshPtSeedEndcap(double thresh)
double resNeutralEmEnergyMax() const
double resNeutralHadEnergyMax() const
void SetSeedEt(double et)
bool usePFConversions_
Use of conversions in PFAlgo.
std::auto_ptr< reco::PFClusterCollection > clustersHO_
bool findRecHitNeighbours_
find rechit neighbours ?
reco::CandidatePtrVector genParticlesforJetsPtrs_
std::vector< double > recHitContribFrac() const
How EventSelector::AcceptEvent() decides whether to accept an event for output otherwise it is excluding the probing of A single or multiple positive and the trigger will pass if any such matching triggers are PASS or EXCEPTION[A criterion thatmatches no triggers at all is detected and causes a throw.] A single negative with an expectation of appropriate bit checking in the decision and the trigger will pass if any such matching triggers are FAIL or EXCEPTION A wildcarded negative criterion that matches more than one trigger in the trigger but the state exists so we define the behavior If all triggers are the negative crieriion will lead to accepting the event(this again matches the behavior of"!*"before the partial wildcard feature was incorporated).The per-event"cost"of each negative criterion with multiple relevant triggers is about the same as!*was in the past
void setPostHFCleaningParameters(bool postHFCleaning, double minHFCleaningPt, double minSignificance, double maxSignificance, double minSignificanceReduction, double maxDeltaPhiPt, double minDeltaMet)
std::vector< PFBlock > PFBlockCollection
collection of PFBlock objects
TH1F * h_deltaETvisible_MCEHT_
output histo dET ( EHT - MC)
void setThreshPtEndcap(double thresh)
bool to(Long64_t iIndex)
Go to the event at index iIndex.
virtual bool processEntry(int entry)
process one entry (pass the TTree entry)
reco::PFRecHitCollection rechitsHFEM_
void setDebug(bool aDebug)
PFAlgo pfAlgo_
particle flow algorithm
true particle for particle flow
reco::SuperClusterCollection eesc_
double energy() const
cluster energy
void clustering()
read data from testbeam tree
edm::Handle< reco::PFRecHitCollection > rechitsHOHandle_
rechits HO
std::vector< reco::PFRecHitCollection > rechitsCLEANEDV_
rechits HF CLEANED
void setThreshEndcap(double thresh)
set endcap threshold
void process(const reco::PFJetCollection &, const reco::GenJetCollection &)
void addJetPF(const Jet &jets)
edm::InputTag rechitsHFHADTag_
std::string expand(const std::string &oldString) const
virtual float eta() const GCC11_FINAL
momentum pseudorapidity
void setThreshDoubleSpikeBarrel(double thresh)
set endcap thresholds for double spike cleaning
void printRecHit(const reco::PFRecHit &rh, unsigned index, const char *seed=" ", std::ostream &out=std::cout) const
void makeFastJets(const JetReco::InputCollection &fInput, JetReco::OutputCollection *fOutput)
Produce jet collection using CMS Fast Jet Algorithm.
double deltaR(double eta1, double eta2, double phi1, double phi2)
const std::vector< reco::PFTrajectoryPoint > & trajectoryPoints() const
void setConeAreaFraction(double aConeAreaFraction)
Set fraction of (alowed) overlapping.
bool makeSpecific(const JetReco::InputCollection &fConstituents, const CaloSubdetectorGeometry &fTowerGeometry, reco::CaloJet::Specific *fJetSpecific)
Make CaloJet specifics. Assumes ProtoJet is made from CaloTowerCandidates.
double printPFCandidatesPtMin_
void fillOutEventWithSimParticles(const reco::PFSimParticleCollection &ptcs)
fills OutEvent with sim particles
virtual bool processEvent(int run, int lumi, int event)
process one event (pass the CMS event number)
std::auto_ptr< reco::PFCandidateCollection > pfCandidates_
reconstructed pfCandidates
bool countChargedAndPhotons() const
const math::XYZPoint & position() const
is seed ?
bool printMCTruthMatching_
reco::PFRecHitCollection rechitsHO_
void setDirectory(TDirectory *dir)
set directory (to use in ROOT)
void fillOne(const reco::MET &met, const reco::MET &matchedMet, float &minVal, float &maxVal)
edm::Handle< reco::PFConversionCollection > conversionHandle_
conversions
void connect(const char *infilename="")
open the root file and connect to the tree
std::vector< reco::PFCandidate > PFCandidateCollection
collection of PFCandidates
const std::vector< unsigned > & neighboursIds8() const
reco::GsfPFRecTrackCollection convBremGsfrecTracks_
void setInput(const T< reco::PFRecTrackCollection > &trackh, const T< reco::GsfPFRecTrackCollection > &gsftrackh, const T< reco::GsfPFRecTrackCollection > &convbremgsftrackh, const T< reco::MuonCollection > &muonh, const T< reco::PFDisplacedTrackerVertexCollection > &nuclearh, const T< reco::PFRecTrackCollection > &nucleartrackh, const T< reco::PFConversionCollection > &conv, const T< reco::PFV0Collection > &v0, const T< reco::PFClusterCollection > &ecalh, const T< reco::PFClusterCollection > &hcalh, const T< reco::PFClusterCollection > &hoh, const T< reco::PFClusterCollection > &hfemh, const T< reco::PFClusterCollection > &hfhadh, const T< reco::PFClusterCollection > &psh, const T< reco::PhotonCollection > &egphh, const T< reco::SuperClusterCollection > &sceb, const T< reco::SuperClusterCollection > &scee, const T< edm::ValueMap< reco::CaloClusterPtr > > &pfclusterassoc, const Mask &trackMask=dummyMask_, const Mask &gsftrackMask=dummyMask_, const Mask &ecalMask=dummyMask_, const Mask &hcalMask=dummyMask_, const Mask &hoMask=dummyMask_, const Mask &hfemMask=dummyMask_, const Mask &hfhadMask=dummyMask_, const Mask &psMask=dummyMask_, const Mask &phMask=dummyMask_, const Mask &scMask=dummyMask_)
set input collections of tracks and clusters
edm::Handle< reco::GsfElectronCollection > egammaElectronHandle_
void printGenParticles(std::ostream &out=std::cout, int maxNLines=-1) const
print the HepMC truth
const math::XYZTLorentzVector & momentum() const
4-momenta quadrivector
reco::GenParticleCollection genParticlesCMSSW_
edm::Handle< reco::GenParticleCollection > genParticlesforMETHandle_
CMSSW GenParticles.
bool doTauBenchmark_
tau benchmark on/off
const HepMC::GenEvent * GetEvent() const
reco::PFJetCollection pfJets_
PF Jets.
edm::InputTag caloMetsTag_
std::auto_ptr< reco::PFClusterCollection > clustersHFEM_
double resChargedHadEnergyMax() const
bool eventAccepted() const
returns true if the event is accepted(have a look at the function implementation) ...
virtual const_iterator begin() const
first daughter const_iterator
edm::InputTag rechitsHCALTag_
void printMCCalib(std::ofstream &out) const
print calibration information
reco::PFRecHitCollection rechitsCLEANED_
unsigned int nCharged(const GenJet &jet)
XYZVectorD XYZVector
spatial vector with cartesian internal representation
virtual int charge() const GCC11_FINAL
electric charge
std::auto_ptr< reco::PFClusterCollection > clustersHFHAD_
XYZPointD XYZPoint
point in space with cartesian internal representation
edm::Handle< CaloTowerCollection > caloTowersHandle_
input collection of calotowers
const LorentzVector & p4() const
unsigned int nTrajectoryMeasurements() const
PFBlockAlgo pfBlockAlgo_
algorithm for building the particle flow blocks
void setRange(float ptMin, float ptMax, float etaMin, float etaMax, float phiMin, float phiMax)
reco::TrackCollection stdTracks_
std::auto_ptr< reco::PFBlockCollection > transferBlocks()
bool highPtPFCandidate(double ptMin, reco::PFCandidate::ParticleType type=reco::PFCandidate::X) const
returns true if there is a PFCandidate of a given type over a given pT
reco::CaloMETCollection caloMetsCMSSW_
void addParticle(const Particle &ptc)
PFClusterAlgo clusterAlgoPS_
clustering algorithm for PS
void setRecHitNeigbours(reco::PFRecHit &rh, const std::map< unsigned, unsigned > &detId2index)
std::vector< Photon > PhotonCollection
collectin of Photon objects
void findBlocks()
build blocks
float pileup() const
pileup energy contribution as calculated by algorithm
edm::Handle< edm::HepMCProduct > MCTruthHandle_
MC truth.
reco::PFDisplacedTrackerVertexCollection pfNuclearTrackerVertex_
T const * product() const
edm::HepMCProduct MCTruth_
void addBlock(const Block &b)
bool doPFCandidateBenchmark_
virtual void readSpecificOptions(const char *file)
virtual ~PFRootEventManager()
destructor
bool doPFJetBenchmark_
PFJet benchmark on/off.
const reco::PFSimParticle & closestParticle(reco::PFTrajectoryPoint::LayerType layer, double eta, double phi, double &peta, double &pphi, double &pe) const
find the closest PFSimParticle to a point (eta,phi) in a given detector
edm::Handle< reco::METCollection > tcMetsHandle_
CMSSW TCMET.
std::auto_ptr< METManager > metManager_
edm::Handle< reco::PFDisplacedTrackerVertexCollection > pfNuclearTrackerVertexHandle_
PFDisplacedVertex.
void setThreshPtBarrel(double thresh)
std::auto_ptr< std::vector< reco::PFCluster > > & clusters()
void clear()
Clear the PtrVector.
edm::Handle< reco::VertexCollection > primaryVerticesHandle_
reconstructed primary vertices
void initializeEventInformation()
Particle reconstructed by the particle flow algorithm.
bool getByLabel(InputTag const &, Handle< T > &) const
bool useHO_
Use of HO in links with tracks/HCAL and in particle flow reconstruction.
double energy() const
rechit energy
edm::InputTag conversionTag_
void setCleanRBXandHPDs(bool cleanRBXandHPDs)
Activate cleaning of HCAL RBX's and HPD's.
bool printSimParticles_
print true particles yes/no
void setS6S2DoubleSpikeBarrel(double cut)
void reconstructCaloJets()
reconstruct calo jets
edm::Handle< reco::PFRecTrackCollection > displacedRecTracksHandle_
edm::Handle< reco::PFRecHitCollection > rechitsPSHandle_
rechits PS
edm::Handle< std::vector< reco::CaloJet > > corrcaloJetsHandle_
CMSSW corrected calo Jets.
edm::Handle< reco::GsfPFRecTrackCollection > convBremGsfrecTracksHandle_
reconstructed secondary GSF tracks
edm::Handle< reco::PFV0Collection > v0Handle_
V0.
void enableDebugging(bool debug)
set hits on which clustering will be performed
static TVector3 VectorEPRtoXYZ(const TVector3 &posepr)
converts a vector (in eta,phi,R) to a vector in (x,y,z)
void setS4S1CleanEndcap(const std::vector< double > &coeffs)
void fill(const reco::PFCandidateCollection &candCollection, const C &matchedCandCollection)
fill histograms with all particle
size_type size() const
Size of the RefVector.
bool useConvBremGsfTracks_
Use Secondary Gsf Tracks.
std::vector< PFCluster > PFClusterCollection
collection of PFCluster objects
static void enable()
enable automatic library loading
std::vector< reco::CaloJet > corrcaloJetsCMSSW_
math::XYZPoint Point
point in the space
edm::InputTag pfCandidateTag_
void pfCandCompare(int)
compare particle flow
reco::PFRecHitCollection rechitsECAL_
unsigned int nTrajectoryPoints() const
double MET1cut
PFMET Benchmark.
A PFTrack holds several trajectory points, which basically contain the position and momentum of a tra...
void setRParam(double aRparam)
reco::SuperClusterCollection ebsc_
superclusters
int nPasses() const
number of passes taken by algorithm
reco::PFConversionCollection conversion_
PFClusterAlgo clusterAlgoHFHAD_
clustering algorithm for HF, hadronic layer
const std::vector< unsigned > & neighboursIds4() const
void addJetEHT(const Jet &jets)
void setUseOptimization(bool useKDTreeTrackEcalLinker)
virtual ParticleType particleId() const
void setMaxPairSize(int aMaxPairSize)
????
void setThreshCleanEndcap(double thresh)
set endcap clean threshold
void setup()
book histograms
std::vector< reco::PFCandidateElectronExtra > PFCandidateElectronExtraCollection
collection of PFCandidateElectronExtras
std::vector< reco::CaloJet > caloJetsCMSSW_
virtual float pt() const GCC11_FINAL
transverse momentum
void setHistos(TFile *file, TH2F *hB, TH2F *hE)
set endcap clean threshold
const ElementsInBlocks & elementsInBlocks() const
bool JECinCaloMet_
propagate the Jet Energy Corrections to the caloMET on/off
bool fastsim_
Fastsim or fullsim.
reco::METCollection tcMetsCMSSW_
void setPtMin(double aPtMin)
bool useEGElectrons_
Use EGElectrons.
LayerType
Define the different layers where the track can be propagated.
bool useEGPhotons_
Use EGPhotons.
void addCaloTower(const CaloTower &ct)
void fillRecHitMask(std::vector< bool > &mask, const reco::PFRecHitCollection &rechits) const
rechit mask set to true for rechits inside TCutG
void setParameters(std::vector< double > &DPtovPtCut, std::vector< unsigned > &NHitCut, bool useConvBremPFRecTracks, bool useIterTracking, int nuclearInteractionsPurity, bool useEGPhotons, std::vector< double > &photonSelectionCuts, bool useSuperClusters, bool superClusterMatchByRef)
bool trackInsideGCut(const reco::PFTrack &track) const
is PFTrack inside cut G ? yes if at least one trajectory point is inside.
bool doCompare_
comparison with pf CMSSW
std::vector< PFRecTrack > PFRecTrackCollection
collection of PFRecTrack objects
bool printGenParticles_
print MC truth yes/no
tuple size
Write out results.
edm::Handle< reco::MuonCollection > muonsHandle_
muons
void PreprocessRecTracks(reco::PFRecTrackCollection &rectracks)
preprocess a rectrack vector from a given rectrack branch
void setup()
book histograms
reco::GsfElectronCollection egammaElectrons_
std::vector< unsigned > recHitContrib() const
void fillOutEventWithBlocks(const reco::PFBlockCollection &blocks)
fills outEvent with blocks
std::vector< edm::InputTag > rechitsCLEANEDTags_
edm::InputTag trueParticlesTag_
FWLiteJetProducer jetMaker_
wrapper to official jet algorithms
bool printRecHits_
print rechits yes/no
int jetAlgoType_
jet algo type
void setElectronExtraRef(const edm::OrphanHandle< reco::PFCandidateElectronExtraCollection > &extrah)
edm::Handle< reco::PFRecTrackCollection > recTracksHandle_
reconstructed tracks
int eventToEntry(int run, int lumi, int event) const