56 using boost::shared_ptr;
71 eventAuxiliary_( new edm::EventAuxiliary ),
87 =
new TH1F(
"h_deltaETvisible_MCEHT",
"Jet Et difference CaloTowers-MC"
90 =
new TH1F(
"h_deltaETvisible_MCPF" ,
"Jet Et difference ParticleFlow-MC"
105 unsigned int nev =
ev_->
size();
112 cout<<
"Number of events: "<< nev
136 cout<<
"calling PFRootEventManager::readOptions"<<endl;
153 catch(
const string& err ) {
164 string calibfilename;
166 if (!calibfilename.empty()) {
167 calibFile_ =
new std::ofstream(calibfilename.c_str());
168 std::cout <<
"Calib file name " << calibfilename <<
" " << calibfilename.c_str() << std::endl;
177 bool doOutTree =
false;
180 if(!outfilename.empty() ) {
181 outFile_ = TFile::Open(outfilename.c_str(),
"recreate");
201 options_->
GetOpt(
"pfjet_benchmark",
"outjetfile", outjetfilename);
207 options_->
GetOpt(
"pfjet_benchmark",
"plotAgainstReco", plotAgainstReco);
239 std::string outmetfilename;
240 options_->
GetOpt(
"pfmet_benchmark",
"outmetfile", outmetfilename);
249 bool pfmetBenchmarkDebug;
250 options_->
GetOpt(
"pfmet_benchmark",
"debug", pfmetBenchmarkDebug);
262 std::vector<unsigned int> vIgnoreParticlesIDs;
263 options_->
GetOpt(
"pfmet_benchmark",
"trueMetIgnoreParticlesIDs", vIgnoreParticlesIDs);
266 metManager_->SetIgnoreParticlesIDs(&vIgnoreParticlesIDs);
268 std::vector<unsigned int> trueMetSpecificIdCut;
269 std::vector<double> trueMetSpecificEtaCut;
270 options_->
GetOpt(
"pfmet_benchmark",
"trueMetSpecificIdCut", trueMetSpecificIdCut);
271 options_->
GetOpt(
"pfmet_benchmark",
"trueMetSpecificEtaCut", trueMetSpecificEtaCut);
272 if (trueMetSpecificIdCut.size()!=trueMetSpecificEtaCut.size())
std::cout <<
"Warning: PFRootEventManager: trueMetSpecificIdCut.size()!=trueMetSpecificEtaCut.size()" << std::endl;
273 else metManager_->SetSpecificIdCut(&trueMetSpecificIdCut,&trueMetSpecificEtaCut);
280 cout<<
"+++ Setting PFCandidate benchmark"<<endl;
282 dir = dir->mkdir(
"PFTask");
283 dir = dir->mkdir(
"particleFlowManager");
290 bool matchCharge =
true;
291 options_->
GetOpt(
"pfCandidate_benchmark",
"matchCharge", matchCharge);
296 static_cast<Benchmark::Mode>(mode));
300 cout<<
"+++ Done "<<endl;
303 std::string outputFile0;
305 TH2F* hBNeighbour0 = 0;
306 TH2F* hENeighbour0 = 0;
308 if(!outputFile0.empty() ) {
309 file0 = TFile::Open(outputFile0.c_str(),
"recreate");
310 hBNeighbour0 =
new TH2F(
"BNeighbour0",
"f_{Neighbours} vs 1/E_{Seed} (ECAL Barrel)",500, 0., 0.5, 1000,0.,1.);
311 hENeighbour0 =
new TH2F(
"ENeighbour0",
"f_{Neighbours} vs 1/E_{Seed} (ECAL Endcap)",500, 0., 0.2, 1000,0.,1.);
314 std::string outputFile1;
316 TH2F* hBNeighbour1 = 0;
317 TH2F* hENeighbour1 = 0;
319 if(!outputFile1.empty() ) {
320 file1 = TFile::Open(outputFile1.c_str(),
"recreate");
321 hBNeighbour1 =
new TH2F(
"BNeighbour1",
"f_{Neighbours} vs 1/E_{Seed} (HCAL Barrel)",500, 0., 0.05, 400,0.,1.);
322 hENeighbour1 =
new TH2F(
"ENeighbour1",
"f_{Neighbours} vs 1/E_{Seed} (HCAL Endcap)",500, 0., 0.05, 400,0.,1.);
325 std::string outputFile2;
327 TH2F* hBNeighbour2 = 0;
328 TH2F* hENeighbour2 = 0;
330 if(!outputFile2.empty() ) {
331 file2 = TFile::Open(outputFile2.c_str(),
"recreate");
332 hBNeighbour2 =
new TH2F(
"BNeighbour2",
"f_{Neighbours} vs 1/E_{Seed} (HFEM Barrel)",500, 0., 0.02, 400,0.,1.);
333 hENeighbour2 =
new TH2F(
"ENeighbour2",
"f_{Neighbours} vs 1/E_{Seed} (HFEM Endcap)",500, 0., 0.02, 400,0.,1.);
336 std::string outputFile3;
338 TH2F* hBNeighbour3 = 0;
339 TH2F* hENeighbour3 = 0;
341 if(!outputFile3.empty() ) {
342 file3 = TFile::Open(outputFile3.c_str(),
"recreate");
343 hBNeighbour3 =
new TH2F(
"BNeighbour3",
"f_{Neighbours} vs 1/E_{Seed} (HFHAD Barrel)",500, 0., 0.02, 400,0.,1.);
344 hENeighbour3 =
new TH2F(
"ENeighbour3",
"f_{Neighbours} vs 1/E_{Seed} (HFHAD Endcap)",500, 0., 0.02, 400,0.,1.);
347 std::string outputFile4;
349 TH2F* hBNeighbour4 = 0;
350 TH2F* hENeighbour4 = 0;
352 if(!outputFile4.empty() ) {
353 file4 = TFile::Open(outputFile4.c_str(),
"recreate");
354 hBNeighbour4 =
new TH2F(
"BNeighbour4",
"f_{Neighbours} vs 1/E_{Seed} (Preshower Barrel)",200, 0., 1000., 400,0.,1.);
355 hENeighbour4 =
new TH2F(
"ENeighbour4",
"f_{Neighbours} vs 1/E_{Seed} (Preshower Endcap)",200, 0., 1000., 400,0.,1.);
375 cerr<<
"PFRootEventManager::ReadOptions, bad filter/taus option."<<endl
376 <<
"please use : "<<endl
377 <<
"\tfilter taus n_charged n_neutral"<<endl;
387 bool clusteringDebug =
false;
394 double threshEcalBarrel = 0.1;
395 options_->
GetOpt(
"clustering",
"thresh_Ecal_Barrel", threshEcalBarrel);
397 double threshPtEcalBarrel = 0.0;
398 options_->
GetOpt(
"clustering",
"thresh_Pt_Ecal_Barrel", threshPtEcalBarrel);
400 double threshSeedEcalBarrel = 0.3;
402 threshSeedEcalBarrel);
404 double threshPtSeedEcalBarrel = 0.0;
406 threshPtSeedEcalBarrel);
408 double threshCleanEcalBarrel = 1E5;
410 threshCleanEcalBarrel);
412 std::vector<double> minS4S1CleanEcalBarrel;
414 minS4S1CleanEcalBarrel);
416 double threshDoubleSpikeEcalBarrel = 10.;
418 threshDoubleSpikeEcalBarrel);
420 double minS6S2DoubleSpikeEcalBarrel = 0.04;
422 minS6S2DoubleSpikeEcalBarrel);
424 double threshEcalEndcap = 0.2;
425 options_->
GetOpt(
"clustering",
"thresh_Ecal_Endcap", threshEcalEndcap);
427 double threshPtEcalEndcap = 0.0;
428 options_->
GetOpt(
"clustering",
"thresh_Pt_Ecal_Endcap", threshPtEcalEndcap);
430 double threshSeedEcalEndcap = 0.8;
432 threshSeedEcalEndcap);
434 double threshPtSeedEcalEndcap = 0.0;
436 threshPtSeedEcalEndcap);
438 double threshCleanEcalEndcap = 1E5;
440 threshCleanEcalEndcap);
442 std::vector<double> minS4S1CleanEcalEndcap;
444 minS4S1CleanEcalEndcap);
446 double threshDoubleSpikeEcalEndcap = 1E9;
448 threshDoubleSpikeEcalEndcap);
450 double minS6S2DoubleSpikeEcalEndcap = -1.;
452 minS6S2DoubleSpikeEcalEndcap);
454 double showerSigmaEcal = 3;
458 int nNeighboursEcal = 4;
459 options_->
GetOpt(
"clustering",
"neighbours_Ecal", nNeighboursEcal);
461 int posCalcNCrystalEcal = -1;
463 posCalcNCrystalEcal);
466 = threshEcalBarrel<threshEcalEndcap ? threshEcalBarrel:threshEcalEndcap;
470 bool useCornerCellsEcal =
false;
542 double threshHcalBarrel = 0.8;
543 options_->
GetOpt(
"clustering",
"thresh_Hcal_Barrel", threshHcalBarrel);
545 double threshPtHcalBarrel = 0.0;
546 options_->
GetOpt(
"clustering",
"thresh_Pt_Hcal_Barrel", threshPtHcalBarrel);
548 double threshSeedHcalBarrel = 1.4;
550 threshSeedHcalBarrel);
552 double threshPtSeedHcalBarrel = 0.0;
554 threshPtSeedHcalBarrel);
556 double threshCleanHcalBarrel = 1E5;
558 threshCleanHcalBarrel);
560 std::vector<double> minS4S1CleanHcalBarrel;
562 minS4S1CleanHcalBarrel);
564 double threshHcalEndcap = 0.8;
565 options_->
GetOpt(
"clustering",
"thresh_Hcal_Endcap", threshHcalEndcap);
567 double threshPtHcalEndcap = 0.0;
568 options_->
GetOpt(
"clustering",
"thresh_Pt_Hcal_Endcap", threshPtHcalEndcap);
570 double threshSeedHcalEndcap = 1.4;
572 threshSeedHcalEndcap);
574 double threshPtSeedHcalEndcap = 0.0;
576 threshPtSeedHcalEndcap);
578 double threshCleanHcalEndcap = 1E5;
580 threshCleanHcalEndcap);
582 std::vector<double> minS4S1CleanHcalEndcap;
584 minS4S1CleanHcalEndcap);
586 double showerSigmaHcal = 15;
590 int nNeighboursHcal = 4;
591 options_->
GetOpt(
"clustering",
"neighbours_Hcal", nNeighboursHcal);
593 int posCalcNCrystalHcal = 5;
595 posCalcNCrystalHcal);
597 bool useCornerCellsHcal =
false;
606 = threshHcalBarrel<threshHcalEndcap ? threshHcalBarrel:threshHcalEndcap;
646 double threshHFEM = 0.;
649 double threshPtHFEM = 0.;
652 double threshSeedHFEM = 0.001;
656 double threshPtSeedHFEM = 0.0;
660 double threshCleanHFEM = 1E5;
664 std::vector<double> minS4S1CleanHFEM;
668 double showerSigmaHFEM = 0.1;
672 int nNeighboursHFEM = 4;
673 options_->
GetOpt(
"clustering",
"neighbours_HFEM", nNeighboursHFEM);
675 int posCalcNCrystalHFEM = -1;
677 posCalcNCrystalHFEM);
679 bool useCornerCellsHFEM =
false;
683 double posCalcP1HFEM = threshHFEM;
711 double threshHFHAD = 0.;
714 double threshPtHFHAD = 0.;
717 double threshSeedHFHAD = 0.001;
721 double threshPtSeedHFHAD = 0.0;
725 double threshCleanHFHAD = 1E5;
729 std::vector<double> minS4S1CleanHFHAD;
733 double showerSigmaHFHAD = 0.1;
737 int nNeighboursHFHAD = 4;
738 options_->
GetOpt(
"clustering",
"neighbours_HFHAD", nNeighboursHFHAD);
740 int posCalcNCrystalHFHAD = -1;
742 posCalcNCrystalHFHAD);
744 bool useCornerCellsHFHAD =
false;
746 useCornerCellsHFHAD);
748 double posCalcP1HFHAD = threshHFHAD;
776 double threshPS = 0.0001;
779 double threshPtPS = 0.0;
782 double threshSeedPS = 0.001;
786 double threshPtSeedPS = 0.0;
787 options_->
GetOpt(
"clustering",
"thresh_Pt_Seed_PS", threshPtSeedPS);
789 double threshCleanPS = 1E5;
792 std::vector<double> minS4S1CleanPS;
793 options_->
GetOpt(
"clustering",
"minS4S1_Clean_PS", minS4S1CleanPS);
796 double threshPSBarrel = threshPS;
797 double threshSeedPSBarrel = threshSeedPS;
799 double threshPtPSBarrel = threshPtPS;
800 double threshPtSeedPSBarrel = threshPtSeedPS;
802 double threshCleanPSBarrel = threshCleanPS;
803 std::vector<double> minS4S1CleanPSBarrel = minS4S1CleanPS;
805 double threshPSEndcap = threshPS;
806 double threshSeedPSEndcap = threshSeedPS;
808 double threshPtPSEndcap = threshPtPS;
809 double threshPtSeedPSEndcap = threshPtSeedPS;
811 double threshCleanPSEndcap = threshCleanPS;
812 std::vector<double> minS4S1CleanPSEndcap = minS4S1CleanPS;
814 double showerSigmaPS = 0.1;
818 int nNeighboursPS = 4;
821 int posCalcNCrystalPS = -1;
825 bool useCornerCellsPS =
false;
829 double posCalcP1PS = threshPS;
874 std::vector<double> DPtovPtCut;
875 std::vector<unsigned> NHitCut;
880 options_->
GetOpt(
"particle_flow",
"useIterTracking", useIterTracking);
881 options_->
GetOpt(
"particle_flow",
"nuclearInteractionsPurity", nuclearInteractionsPurity);
889 nuclearInteractionsPurity);
892 cerr<<
"exception setting PFBlockAlgo parameters: "
893 <<err.what()<<
". terminating."<<endl;
899 bool blockAlgoDebug =
false;
903 bool AlgoDebug =
false;
910 double e_slope = 1.0;
915 double eh_eslope = 1.05;
916 options_->
GetOpt(
"particle_flow",
"calib_ECAL_HCAL_eslope", eh_eslope);
917 double eh_hslope = 1.06;
918 options_->
GetOpt(
"particle_flow",
"calib_ECAL_HCAL_hslope", eh_hslope);
919 double eh_offset = 6.11;
920 options_->
GetOpt(
"particle_flow",
"calib_ECAL_HCAL_offset", eh_offset);
922 double h_slope = 2.17;
924 double h_offset = 1.73;
926 double h_damping = 2.49;
927 options_->
GetOpt(
"particle_flow",
"calib_HCAL_damping", h_damping);
930 unsigned newCalib = 0;
932 std::cout <<
"New calib = " << newCalib << std::endl;
934 boost::shared_ptr<pftools::PFClusterCalibration>
938 boost::shared_ptr<PFEnergyCalibration>
953 options_->
GetOpt(
"particle_flow",
"usePFSCEleCalib",usePFSCEleCalib);
954 options_->
GetOpt(
"particle_flow",
"calibPFSCEle_barrel",calibPFSCEle_barrel);
955 options_->
GetOpt(
"particle_flow",
"calibPFSCEle_endcap",calibPFSCEle_endcap);
956 boost::shared_ptr<PFSCEnergyCalibration>
968 options_->
GetOpt(
"particle_flow",
"useEGammaSupercluster",useEGammaSupercluster);
969 options_->
GetOpt(
"particle_flow",
"sumEtEcalIsoForEgammaSC_barrel",sumEtEcalIsoForEgammaSC_barrel);
970 options_->
GetOpt(
"particle_flow",
"sumEtEcalIsoForEgammaSC_endcap",sumEtEcalIsoForEgammaSC_endcap);
971 options_->
GetOpt(
"particle_flow",
"coneEcalIsoForEgammaSC",coneEcalIsoForEgammaSC);
972 options_->
GetOpt(
"particle_flow",
"sumPtTrackIsoForEgammaSC_barrel",sumPtTrackIsoForEgammaSC_barrel);
973 options_->
GetOpt(
"particle_flow",
"sumPtTrackIsoForEgammaSC_endcap",sumPtTrackIsoForEgammaSC_endcap);
974 options_->
GetOpt(
"particle_flow",
"nTrackIsoForEgammaSC",nTrackIsoForEgammaSC);
975 options_->
GetOpt(
"particle_flow",
"coneTrackIsoForEgammaSC",coneTrackIsoForEgammaSC);
976 options_->
GetOpt(
"particle_flow",
"useEGammaElectrons",useEGammaElectrons);
986 options_->
GetOpt(
"particle_flow",
"calib_calibHF_use",calibHF_use);
987 options_->
GetOpt(
"particle_flow",
"calib_calibHF_eta_step",calibHF_eta_step);
988 options_->
GetOpt(
"particle_flow",
"calib_calibHF_a_EMonly",calibHF_a_EMonly);
989 options_->
GetOpt(
"particle_flow",
"calib_calibHF_b_HADonly",calibHF_b_HADonly);
990 options_->
GetOpt(
"particle_flow",
"calib_calibHF_a_EMHAD",calibHF_a_EMHAD);
991 options_->
GetOpt(
"particle_flow",
"calib_calibHF_b_EMHAD",calibHF_b_EMHAD);
993 boost::shared_ptr<PFEnergyCalibrationHF> thepfEnergyCalibrationHF
994 (
new PFEnergyCalibrationHF(calibHF_use,calibHF_eta_step,calibHF_a_EMonly,calibHF_b_HADonly,calibHF_a_EMHAD,calibHF_b_EMHAD) ) ;
1000 double nSigmaECAL = 99999;
1002 double nSigmaHCAL = 99999;
1008 double g0, g1, e0, e1;
1013 clusterCalibration->setCorrections(e0, e1, g0, g1);
1015 int allowNegative(0);
1016 options_->
GetOpt(
"correction",
"allowNegativeEnergy", allowNegative);
1017 clusterCalibration->setAllowNegativeEnergy(allowNegative);
1019 int doCorrection(1);
1021 clusterCalibration->setDoCorrection(doCorrection);
1023 int doEtaCorrection(1);
1024 options_->
GetOpt(
"correction",
"doEtaCorrection", doEtaCorrection);
1025 clusterCalibration->setDoEtaCorrection(doEtaCorrection);
1029 clusterCalibration->setBarrelBoundary(barrelEta);
1035 clusterCalibration->setEcalHcalEnergyCuts(ecalEcut,hcalEcut);
1037 std::vector<std::string>*
names = clusterCalibration->getKnownSectorNames();
1038 for(std::vector<std::string>::iterator
i = names->begin();
i != names->end(); ++
i) {
1039 std::string sector = *
i;
1040 std::vector<double> params;
1042 clusterCalibration->setEvolutionParameters(sector, params);
1045 std::vector<double> etaCorrectionParams;
1046 options_->
GetOpt(
"evolution",
"etaCorrection", etaCorrectionParams);
1047 clusterCalibration->setEtaCorrectionParameters(etaCorrectionParams);
1055 cerr<<
"exception setting PFAlgo parameters: "
1056 <<err.what()<<
". terminating."<<endl;
1061 std::vector<double> muonHCAL;
1062 std::vector<double> muonECAL;
1065 assert ( muonHCAL.size() == 2 && muonECAL.size() == 2 );
1067 double nSigmaTRACK = 3.0;
1070 double ptError = 1.0;
1073 std::vector<double> factors45;
1075 assert ( factors45.size() == 2 );
1078 options_->
GetOpt(
"particle_flow",
"usePFMuonMomAssign", usePFMuonMomAssign);
1086 usePFMuonMomAssign);
1089 cerr<<
"exception setting PFAlgo Muon and Fake parameters: "
1090 <<err.what()<<
". terminating."<<endl;
1096 options_->
GetOpt(
"particle_flow",
"postHFCleaning", postHFCleaning);
1098 options_->
GetOpt(
"particle_flow",
"minHFCleaningPt", minHFCleaningPt);
1100 options_->
GetOpt(
"particle_flow",
"minSignificance", minSignificance);
1102 options_->
GetOpt(
"particle_flow",
"maxSignificance", maxSignificance);
1104 options_->
GetOpt(
"particle_flow",
"minSignificanceReduction", minSignificanceReduction);
1106 options_->
GetOpt(
"particle_flow",
"maxDeltaPhiPt", maxDeltaPhiPt);
1116 minSignificanceReduction,
1121 cerr<<
"exception setting post HF cleaning parameters: "
1122 <<err.what()<<
". terminating."<<endl;
1133 options_->
GetOpt(
"particle_flow",
"usePFElectrons", usePFElectrons);
1134 cout<<
"use PFElectrons "<<usePFElectrons<<endl;
1136 if( usePFElectrons ) {
1138 double mvaEleCut = -1.;
1141 bool applyCrackCorrections=
true;
1142 options_->
GetOpt(
"particle_flow",
"electron_crackCorrection",applyCrackCorrections);
1144 string mvaWeightFileEleID =
"";
1146 mvaWeightFileEleID);
1147 mvaWeightFileEleID =
expand(mvaWeightFileEleID);
1153 thePFSCEnergyCalibration,
1154 sumEtEcalIsoForEgammaSC_barrel,
1155 sumEtEcalIsoForEgammaSC_endcap,
1156 coneEcalIsoForEgammaSC,
1157 sumPtTrackIsoForEgammaSC_barrel,
1158 sumPtTrackIsoForEgammaSC_endcap,
1159 nTrackIsoForEgammaSC,
1160 coneTrackIsoForEgammaSC,
1161 applyCrackCorrections,
1164 useEGammaSupercluster);
1167 cerr<<
"exception setting PFAlgo Electron parameters: "
1168 <<err.what()<<
". terminating."<<endl;
1179 bool usePFV0s =
false;
1185 options_->
GetOpt(
"particle_flow",
"usePFConversions", usePFConversions);
1187 options_->
GetOpt(
"particle_flow",
"usePFNuclearInteractions", usePFNuclearInteractions);
1188 options_->
GetOpt(
"particle_flow",
"dptRel_DispVtx", dptRel_DispVtx);
1192 rejectTracks_Step45,
1193 usePFNuclearInteractions,
1200 cerr<<
"exception setting PFAlgo displaced vertex parameters: "
1201 <<err.what()<<
". terminating."<<endl;
1206 bool bCorrect =
false;
1207 bool bCalibPrimary =
false;
1208 double dptRel_PrimaryTrack = 0;
1209 double dptRel_MergedTrack = 0;
1210 double ptErrorSecondary = 0;
1211 vector<double> nuclCalibFactors;
1214 options_->
GetOpt(
"particle_flow",
"bCalibPrimary", bCalibPrimary);
1215 options_->
GetOpt(
"particle_flow",
"dptRel_PrimaryTrack", dptRel_PrimaryTrack);
1216 options_->
GetOpt(
"particle_flow",
"dptRel_MergedTrack", dptRel_MergedTrack);
1217 options_->
GetOpt(
"particle_flow",
"ptErrorSecondary", ptErrorSecondary);
1218 options_->
GetOpt(
"particle_flow",
"nuclCalibFactors", nuclCalibFactors);
1224 cerr<<
"exception setting PFAlgo cand connector parameters: "
1225 <<err.what()<<
". terminating."<<endl;
1251 double mEtInputCut = 0.5;
1254 double mEInputCut = 0.;
1257 double seedThreshold = 1.0;
1260 double coneRadius = 0.5;
1263 double coneAreaFraction= 1.0;
1269 int maxIterations=100;
1272 double overlapThreshold = 0.75;
1278 double rparam = 1.0;
1296 cout <<
"----------------------------------" << endl;
1305 double coneAngle = 0.5;
1308 double seedEt = 0.4;
1311 double coneMerge = 100.0;
1319 cout <<
"Tau Benchmark Options : ";
1320 cout <<
"Angle=" << coneAngle <<
" seedEt=" << seedEt
1321 <<
" Merge=" << coneMerge << endl;
1385 cout<<
"Opening input root files"<<endl;
1394 catch(
string& err) {
1402 cout <<
"The rootfile(s) " << endl;
1405 cout <<
" is (are) not valid file(s) to open" << endl;
1408 cout <<
"The rootfile(s) : " << endl;
1411 cout<<
" are opened with " <<
ev_->
size() <<
" events." <<endl;
1415 std::string rechitsECALtagname;
1416 options_->
GetOpt(
"root",
"rechits_ECAL_inputTag", rechitsECALtagname);
1419 std::string rechitsHCALtagname;
1420 options_->
GetOpt(
"root",
"rechits_HCAL_inputTag", rechitsHCALtagname);
1423 std::string rechitsHFEMtagname;
1424 options_->
GetOpt(
"root",
"rechits_HFEM_inputTag", rechitsHFEMtagname);
1427 std::string rechitsHFHADtagname;
1428 options_->
GetOpt(
"root",
"rechits_HFHAD_inputTag", rechitsHFHADtagname);
1431 std::vector<string> rechitsCLEANEDtagnames;
1432 options_->
GetOpt(
"root",
"rechits_CLEANED_inputTags", rechitsCLEANEDtagnames);
1433 for (
unsigned tags = 0;
tags<rechitsCLEANEDtagnames.size(); ++
tags )
1440 std::string rechitsPStagname;
1441 options_->
GetOpt(
"root",
"rechits_PS_inputTag", rechitsPStagname);
1444 std::string recTrackstagname;
1448 std::string displacedRecTrackstagname;
1449 options_->
GetOpt(
"root",
"displacedRecTracks_inputTag", displacedRecTrackstagname);
1452 std::string primaryVerticestagname;
1453 options_->
GetOpt(
"root",
"primaryVertices_inputTag", primaryVerticestagname);
1456 std::string stdTrackstagname;
1460 std::string gsfrecTrackstagname;
1461 options_->
GetOpt(
"root",
"gsfrecTracks_inputTag", gsfrecTrackstagname);
1467 std::string convBremGsfrecTrackstagname;
1468 options_->
GetOpt(
"root",
"convBremGsfrecTracks_inputTag", convBremGsfrecTrackstagname);
1477 std::string muonstagname;
1485 std::string conversiontagname;
1486 options_->
GetOpt(
"root",
"conversion_inputTag", conversiontagname);
1494 std::string v0tagname;
1503 std::string pfNuclearTrackerVertextagname;
1504 options_->
GetOpt(
"root",
"PFDisplacedVertex_inputTag", pfNuclearTrackerVertextagname);
1508 std::string trueParticlestagname;
1509 options_->
GetOpt(
"root",
"trueParticles_inputTag", trueParticlestagname);
1512 std::string MCTruthtagname;
1516 std::string caloTowerstagname;
1517 options_->
GetOpt(
"root",
"caloTowers_inputTag", caloTowerstagname);
1520 std::string genJetstagname;
1525 std::string genParticlesforMETtagname;
1526 options_->
GetOpt(
"root",
"genParticlesforMET_inputTag", genParticlesforMETtagname);
1529 std::string genParticlesforJetstagname;
1530 options_->
GetOpt(
"root",
"genParticlesforJets_inputTag", genParticlesforJetstagname);
1534 std::string pfCandidatetagname;
1535 options_->
GetOpt(
"root",
"particleFlowCand_inputTag", pfCandidatetagname);
1538 std::string caloJetstagname;
1542 std::string corrcaloJetstagname;
1543 options_->
GetOpt(
"root",
"corrCaloJets_inputTag", corrcaloJetstagname);
1546 std::string pfJetstagname;
1550 std::string pfMetstagname;
1554 std::string caloMetstagname;
1558 std::string tcMetstagname;
1609 LumisMap::const_iterator iL = iR->second.find( lumi );
1610 if( iL != iR->second.end() ) {
1611 EventToEntry::const_iterator iE = iL->second.find( event );
1612 if( iE != iL->second.end() ) {
1616 cout<<
"event "<<
event<<
" not found in run "<<run<<
", lumi "<<lumi<<endl;
1620 cout<<
"lumi "<<lumi<<
" not found in run "<<run<<endl;
1624 cout<<
"run "<<run<<
" not found"<<endl;
1633 cout<<
"event "<<
event<<
" is not present, sorry."<<endl;
1647 bool exists =
ev_->
to(entry);
1649 std::cout <<
"Entry " << entry <<
" does not exist " << std::endl;
1658 (entry < 100 && entry%10 == 0) ||
1659 (entry < 1000 && entry%100 == 0) ||
1661 cout<<
"process entry "<< entry
1662 <<
", run "<<iEvent.
id().
run()
1664 <<
", event:"<<iEvent.
id().
event()
1683 cout<<
"number of muons : "<<
muons_.size()<<endl;
1686 cout<<
"number of v0 : "<<
v0_.size()<<endl;
1699 cout<<
"clustering is OFF - clusters come from the input file"<<endl;
1751 cout <<
" =====================PFJetBenchmark =================" << endl;
1752 cout<<
"Resol Pt max "<<resPt
1753 <<
" resChargedHadEnergy Max " << resChargedHadEnergy
1754 <<
" resNeutralHadEnergy Max " << resNeutralHadEnergy
1755 <<
" resNeutralEmEnergy Max "<< resNeutralEmEnergy << endl;
1764 if ( resPt < -1. ) {
1765 cout <<
" =====================PFJetBenchmark =================" << endl;
1766 cout<<
"process entry "<< entry << endl;
1767 cout<<
"Resol Pt max "<<resPt
1768 <<
" resChargedHadEnergy Max " << resChargedHadEnergy
1769 <<
" resNeutralHadEnergy Max " << resNeutralHadEnergy
1770 <<
" resNeutralEmEnergy Max "<< resNeutralEmEnergy
1771 <<
" Jet pt " <<
genJets_[0].pt() << endl;
1818 double deltaEt = 0.;
1866 if( pfc.
pt() >
ptMin )
return true;
1875 cout <<
"start reading from simulation"<<endl;
1885 if ( foundstdTracks ) {
1889 cerr<<
"PFRootEventManager::ProcessEntry : stdTracks Collection not found : "
1894 if ( foundMCTruth ) {
1916 cerr<<
"PFRootEventManager::ProcessEntry : rechitsECAL Collection not found : "
1925 cerr<<
"PFRootEventManager::ProcessEntry : rechitsHCAL Collection not found : "
1934 cerr<<
"PFRootEventManager::ProcessEntry : rechitsHFEM Collection not found : "
1943 cerr<<
"PFRootEventManager::ProcessEntry : rechitsHFHAD Collection not found : "
1950 if ( foundCLEANED ) {
1954 cerr<<
"PFRootEventManager::ProcessEntry : rechitsCLEANED Collection not found : "
1965 cerr<<
"PFRootEventManager::ProcessEntry : rechitsPS Collection not found : "
1974 cerr<<
"PFRootEventManager::ProcessEntry : caloTowers Collection not found : "
1983 cerr<<
"PFRootEventManager::ProcessEntry : primaryVertices Collection not found : "
1992 cerr<<
"PFRootEventManager::ProcessEntry : pfNuclearTrackerVertex Collection not found : "
1997 if ( foundrecTracks ) {
2001 cerr<<
"PFRootEventManager::ProcessEntry : recTracks Collection not found : "
2006 if ( founddisplacedRecTracks ) {
2010 cerr<<
"PFRootEventManager::ProcessEntry : displacedRecTracks Collection not found : "
2016 if ( foundgsfrecTracks ) {
2020 cerr<<
"PFRootEventManager::ProcessEntry : gsfrecTracks Collection not found : "
2025 if ( foundconvBremGsfrecTracks ) {
2029 cerr<<
"PFRootEventManager::ProcessEntry : convBremGsfrecTracks Collection not found : "
2045 cerr<<
"PFRootEventManager::ProcessEntry : muons Collection not found : "
2050 if ( foundconversion ) {
2054 cerr<<
"PFRootEventManager::ProcessEntry : conversion Collection not found : "
2063 cerr<<
"PFRootEventManager::ProcessEntry : v0 Collection not found : "
2064 <<entry <<
" " <<
v0Tag_<<endl;
2068 if ( foundgenJets ) {
2077 if ( foundgenParticlesforJets ) {
2086 if ( foundgenParticlesforMET ) {
2095 if ( foundcaloJets ) {
2099 cerr<<
"PFRootEventManager::ProcessEntry : caloJets Collection not found : "
2104 if ( foundcorrcaloJets ) {
2113 if ( foundpfJets ) {
2117 cerr<<
"PFRootEventManager::ProcessEntry : PFJets Collection not found : "
2122 if ( foundpfCands ) {
2126 cerr<<
"PFRootEventManager::ProcessEntry : PFCandidate Collection not found : "
2131 if ( foundpfMets ) {
2135 cerr<<
"PFRootEventManager::ProcessEntry : PFMets Collection not found : "
2140 if ( foundtcMets ) {
2144 cerr<<
"TCRootEventManager::ProcessEntry : TCMets Collection not found : "
2149 if ( foundcaloMets ) {
2153 cerr<<
"CALORootEventManager::ProcessEntry : CALOMets Collection not found : "
2159 bool goodevent =
true;
2164 cout <<
"PFRootEventManager : event discarded Nparticles="
2169 cout <<
"PFRootEventManager : leptonic tau discarded " << endl;
2175 cout <<
"PFRootEventManager : tau discarded: "
2176 <<
"number of charged and neutral particles different from "
2222 cout <<
"preprocessing rec tracks" << endl;
2243 const std::vector<int>& ptcdaughters = ptc.
daughterIds();
2245 for (
unsigned int dapt=0; dapt < ptcdaughters.size(); ++dapt) {
2251 int pdgdaugther = daughter.
pdgCode();
2252 int abspdgdaughter =
std::abs(pdgdaugther);
2255 if (abspdgdaughter == 11 ||
2256 abspdgdaughter == 13) {
2277 const std::vector<int>& daughters = ptc.
daughterIds();
2281 if(!daughters.empty() )
continue;
2284 double pdgCode = ptc.
pdgCode();
2288 else if( pdgCode==22 )
2336 int kqa,kq1,kq2,kq3,kqj,irt,kqx,kqn;
2340 int ichg[109]={-1,2,-1,2,-1,2,-1,2,0,0,-3,0,-3,0,-3,0,
2341 -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,
2342 -3,0,-3,0,-3,0,0,0,0,0,-1,2,-1,2,-1,2,0,0,0,0,
2343 -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};
2349 kqn=kqa/1000000000%10;
2359 if(kqa==0 || kqa >= 10000000) {
2361 if(kqn==1) {hepchg=0;}
2364 else if(kqa<=100) {hepchg = ichg[kqa-1];}
2366 else if(kqa==100 || kqa==101) {hepchg = -3;}
2368 else if(kqa==102 || kqa==104) {hepchg = -6;}
2370 else if(kqj == 0) {hepchg = 0;}
2372 else if(kqx>0 && irt<100)
2374 hepchg = ichg[irt-1];
2375 if(kqa==1000017 || kqa==1000018) {hepchg = 0;}
2376 if(kqa==1000034 || kqa==1000052) {hepchg = 0;}
2377 if(kqa==1000053 || kqa==1000054) {hepchg = 0;}
2378 if(kqa==5100061 || kqa==5100062) {hepchg = 6;}
2384 hepchg = ichg[kq2-1]-ichg[kq1-1];
2386 if((kq2==3) || (kq2==5)) {hepchg = ichg[kq1-1]-ichg[kq2-1];}
2390 hepchg = ichg[kq3-1] + ichg[kq2-1];
2395 hepchg = ichg[kq3-1]+ichg[kq2-1]+ichg[kq1-1];
2399 if(Id<0 && hepchg!=0) {hepchg = -1*hepchg;}
2409 for(
unsigned i=0;
i<recTracks.size(); ++
i ) {
2410 recTracks[
i].calculatePositionREP();
2416 for(
unsigned i=0;
i<recTracks.size(); ++
i ) {
2417 recTracks[
i].calculatePositionREP();
2418 recTracks[
i].calculateBremPositionREP();
2426 bool findNeighbours) {
2429 map<unsigned, unsigned> detId2index;
2431 for(
unsigned i=0;
i<rechits.size();
i++) {
2432 rechits[
i].calculatePositionREP();
2435 detId2index.insert( make_pair(rechits[
i].detId(),
i) );
2438 if(findNeighbours) {
2439 for(
unsigned i=0;
i<rechits.size();
i++) {
2448 const map<unsigned, unsigned>& detId2index ) {
2455 for(
unsigned i=0;
i<neighbours4DetId.size();
i++) {
2456 unsigned detId = neighbours4DetId[
i];
2458 const map<unsigned, unsigned>::const_iterator& it = detId2index.find(detId);
2460 if(it != detId2index.end() ) {
2466 for(
unsigned i=0;
i<neighbours8DetId.size();
i++) {
2467 unsigned detId = neighbours8DetId[
i];
2469 const map<unsigned, unsigned>::const_iterator& it = detId2index.find(detId);
2471 if(it != detId2index.end() ) {
2484 cout <<
"start clustering"<<endl;
2544 for(
unsigned i=0;
i<clusters.size();
i++) {
2546 cluster.
eta = clusters[
i].position().Eta();
2547 cluster.
phi = clusters[
i].position().Phi();
2548 cluster.
e = clusters[
i].energy();
2549 cluster.
layer = clusters[
i].layer();
2554 switch( clusters[
i].layer() ) {
2574 cluster.
eta, cluster.
phi,
2600 for (
unsigned i=0;
i < trueParticles.size();
i++) {
2610 if(ntrajpoints == 3) {
2638 for (
unsigned i=0;
i < pfCandidates.size();
i++) {
2643 outptc.
eta = candidate.
eta();
2644 outptc.
phi = candidate.
phi();
2645 outptc.
e = candidate.
energy();
2659 for (
unsigned i=0;
i < cts.
size();
i++) {
2679 for (
unsigned i=0;
i < blocks.size();
i++) {
2694 cout <<
"start particle flow"<<endl;
2699 cout<<
"PFRootEventManager::particleFlow start"<<endl;
2751 vector<bool> trackMask;
2753 vector<bool> gsftrackMask;
2755 vector<bool> ecalMask;
2757 vector<bool> hcalMask;
2759 vector<bool> hfemMask;
2761 vector<bool> hfhadMask;
2763 vector<bool> psMask;
2769 muonh, nuclearh, displacedtrackh, convh, v0,
2770 ecalh, hcalh, hfemh, hfhadh, psh,
2771 trackMask,gsftrackMask,
2772 ecalMask, hcalMask, hfemMask, hfhadMask, psMask );
2775 trackMask, ecalMask, hcalMask, psMask );
2798 if(
debug_)
cout<<
"PFRootEventManager::particleFlow stop"<<endl;
2804 if ( differentSize ) {
2805 cout <<
"+++WARNING+++ PFCandidate size changed for entry "
2806 << entry <<
" !" << endl
2807 <<
" - original size : " <<
pfCandCMSSW_.size() << endl
2811 double deltaE = (*pfCandidates_)[
i].energy()-
pfCandCMSSW_[
i].energy();
2812 double deltaEta = (*pfCandidates_)[
i].eta()-
pfCandCMSSW_[
i].eta();
2814 if ( fabs(deltaE) > 1E-5 ||
2815 fabs(deltaEta) > 1E-9 ||
2816 fabs(deltaPhi) > 1E-9 ) {
2817 cout <<
"+++WARNING+++ PFCandidate " <<
i
2818 <<
" changed for entry " << entry <<
" ! " << endl
2820 <<
" - Current : " << (*pfCandidates_)[
i] << endl
2821 <<
" DeltaE = : " << deltaE << endl
2822 <<
" DeltaEta = : " << deltaEta << endl
2823 <<
" DeltaPhi = : " << deltaPhi << endl << endl;
2835 cout<<
"start reconstruct GenJets --- "<<endl;
2836 cout<<
" input gen particles for jet: all neutrinos removed ; muons present" << endl;
2856 cout <<
" #" <<
i <<
" PDG code:" << genPart.
pdgId()
2857 <<
" status " << genPart.
status()
2858 <<
", p/pt/eta/phi: " << genPart.
p() <<
'/' << genPart.
pt()
2859 <<
'/' << genPart.
eta() <<
'/' << genPart.
phi() << endl;
2865 vector<ProtoJet> protoJets;
2871 typedef vector <ProtoJet>::const_iterator IPJ;
2872 for (IPJ ipj = protoJets.begin(); ipj != protoJets.end (); ipj++) {
2880 GenJet newJet (protojet.
p4(), vertex, specific);
2888 ProtoJet::Constituents::const_iterator constituent = constituents.
begin();
2889 for (; constituent != constituents.end(); ++constituent) {
2892 uint
index = constituent->index();
2896 newJet.setJetArea(protojet.
jetArea());
2897 newJet.setPileup(protojet.
pileup());
2898 newJet.setNPasses(protojet.
nPasses());
2900 if (
jetsDebug_ )
cout<<
" gen jet "<<ijet<<
" "<<newJet.print()<<endl;
2911 cout<<
"start reconstruct CaloJets --- "<<endl;
2924 for(
unsigned ipj=0; ipj<
caloJets_.size(); ipj++) {
2926 cout<<
" calo jet "<<ipj<<
" "<<protojet.
pt() <<endl;
2937 cout<<
"start reconstruct PF Jets --- "<<endl;
2947 vector<ProtoJet> protoJets;
2953 typedef vector <ProtoJet>::const_iterator IPJ;
2954 for (IPJ ipj = protoJets.begin(); ipj != protoJets.end (); ipj++) {
2962 PFJet newJet (protojet.
p4(), vertex, specific);
2970 ProtoJet::Constituents::const_iterator constituent = constituents.
begin();
2971 for (; constituent != constituents.end(); ++constituent) {
2974 uint
index = constituent->index();
2978 newJet.setJetArea(protojet.
jetArea());
2979 newJet.setPileup(protojet.
pileup());
2980 newJet.setNPasses(protojet.
nPasses());
2982 if (
jetsDebug_ )
cout<<
" PF jet "<<ijet<<
" "<<newJet.print()<<endl;
3050 TLorentzVector partTOTMC;
3051 bool tauFound =
false;
3052 bool tooManyTaus =
false;
3059 if(
i ) tooManyTaus =
true;
3064 if(!tauFound || tooManyTaus ) {
3070 const std::vector<int>& ptcdaughters =
trueParticles_[0].daughterIds();
3076 for (
unsigned int dapt=0; dapt < ptcdaughters.size(); ++dapt) {
3080 TLorentzVector partMC;
3081 partMC.SetPxPyPzE(tpatvtx.
momentum().Px(),
3086 partTOTMC += partMC;
3090 cout << pdgcode << endl;
3091 cout << tpatvtx << endl;
3092 cout << partMC.Px() <<
" " << partMC.Py() <<
" "
3093 << partMC.Pz() <<
" " << partMC.E()
3095 <<
sqrt(partMC.Px()*partMC.Px()+partMC.Py()*partMC.Py())
3103 for ( HepMC::GenEvent::particle_const_iterator
3104 piter = myGenEvent->particles_begin();
3105 piter != myGenEvent->particles_end();
3109 if (
std::abs((*piter)->pdg_id())==15){
3112 for ( HepMC::GenVertex::particles_out_const_iterator bp =
3113 (*piter)->end_vertex()->particles_out_const_begin();
3114 bp != (*piter)->end_vertex()->particles_out_const_end(); ++bp ) {
3115 uint nuId=
std::abs((*bp)->pdg_id());
3116 bool isNeutrino=(nuId==12)||(nuId==14)||(nuId==16);
3120 TLorentzVector partMC;
3121 partMC.SetPxPyPzE((*bp)->momentum().x(),
3122 (*bp)->momentum().y(),
3123 (*bp)->momentum().z(),
3124 (*bp)->momentum().e());
3125 partTOTMC += partMC;
3130 if (itau>1) tooManyTaus=
true;
3132 if(!tauFound || tooManyTaus ) {
3133 cerr<<
"PFRootEventManager::tauBenchmark : not a single tau event"<<endl;
3146 jetmc.
eta = partTOTMC.Eta();
3147 jetmc.
phi = partTOTMC.Phi();
3148 jetmc.
et = partTOTMC.Et();
3149 jetmc.
e = partTOTMC.E();
3185 cout <<
" ET Vector=" << partTOTMC.Et()
3186 <<
" " << partTOTMC.Eta()
3187 <<
" " << partTOTMC.Phi() << endl;
cout << endl;
3195 vector<TLorentzVector> allcalotowers;
3198 double threshCaloTowers = 1E-10;
3206 TLorentzVector caloT;
3211 caloT.SetPxPyPzE(pxyz.X(),pxyz.Y(),pxyz.Z(),
caloTowers_[
i].energy());
3212 allcalotowers.push_back(caloT);
3217 cout <<
" RETRIEVED " << allcalotowers.size()
3218 <<
" CALOTOWER 4-VECTORS " << endl;
3222 const vector< PFJetAlgorithm::Jet >& caloTjets
3226 double JetEHTETmax = 0.0;
3227 for (
unsigned i = 0;
i < caloTjets.size();
i++) {
3228 TLorentzVector jetmom = caloTjets[
i].GetMomentum();
3229 double jetcalo_pt =
sqrt(jetmom.Px()*jetmom.Px()+jetmom.Py()*jetmom.Py());
3230 double jetcalo_et = jetmom.Et();
3235 jet.
eta = jetmom.Eta();
3236 jet.
phi = jetmom.Phi();
3237 jet.
et = jetmom.Et();
3240 const vector<int>& indexes = caloTjets[
i].GetIndexes();
3241 for(
unsigned ii=0; ii<indexes.size(); ii++){
3251 cout <<
" ECAL+HCAL jet : " << caloTjets[
i] << endl;
3252 cout << jetmom.Px() <<
" " << jetmom.Py() <<
" "
3253 << jetmom.Pz() <<
" " << jetmom.E()
3254 <<
" PT=" << jetcalo_pt << endl;
3257 if (jetcalo_et >= JetEHTETmax)
3258 JetEHTETmax = jetcalo_et;
3263 vector<TLorentzVector> allrecparticles;
3275 for(
unsigned i=0;
i<candidates.size();
i++) {
3284 cout <<
i <<
" " << candidate << endl;
3286 cout <<
" type= " << type <<
" " << candidate.
charge()
3292 TLorentzVector partRec(PFpart.Px(),
3298 allrecparticles.push_back( partRec );
3304 cout <<
" THERE ARE " << allrecparticles.size()
3305 <<
" RECONSTRUCTED 4-VECTORS" << endl;
3308 const vector< PFJetAlgorithm::Jet >& PFjets
3312 cout << PFjets.size() <<
" PF Jets found" << endl;
3313 double JetPFETmax = 0.0;
3314 for (
unsigned i = 0;
i < PFjets.size();
i++) {
3315 TLorentzVector jetmom = PFjets[
i].GetMomentum();
3316 double jetpf_pt =
sqrt(jetmom.Px()*jetmom.Px()+jetmom.Py()*jetmom.Py());
3317 double jetpf_et = jetmom.Et();
3320 jet.
eta = jetmom.Eta();
3321 jet.
phi = jetmom.Phi();
3322 jet.
et = jetmom.Et();
3328 cout <<
" Rec jet : "<< PFjets[
i] <<endl;
3329 cout << jetmom.Px() <<
" " << jetmom.Py() <<
" "
3330 << jetmom.Pz() <<
" " << jetmom.E()
3331 <<
" PT=" << jetpf_pt <<
" eta="<< jetmom.Eta()
3332 <<
" Phi=" << jetmom.Phi() << endl;
3333 cout <<
"------------------------------------------------" << endl;
3336 if (jetpf_et >= JetPFETmax)
3337 JetPFETmax = jetpf_et;
3342 double deltaEtEHT = JetEHTETmax - partTOTMC.Et();
3345 double deltaEt = JetPFETmax - partTOTMC.Et();
3349 cout <<
"tau benchmark E_T(PF) - E_T(true) = " << deltaEt << endl;
3352 return deltaEt/partTOTMC.Et();
3407 string newString = oldString;
3409 string dollar =
"$";
3413 int dollarPos = newString.find(dollar,0);
3414 if( dollarPos == -1 )
return oldString;
3416 int lengh = newString.find(slash,0) - newString.find(dollar,0) + 1;
3417 string env_variable =
3418 newString.substr( ( newString.find(dollar,0) + 1 ), lengh -2);
3420 int begin = env_variable.find_first_of(
"{");
3421 int end = env_variable.find_last_of(
"}");
3426 env_variable = env_variable.substr( begin+1, end-1 );
3431 char*
directory = getenv( env_variable.c_str() );
3434 cerr<<
"please define environment variable $"<<env_variable<<endl;
3441 newString.replace( 0, lengh , sdir);
3444 cout <<
"expand " <<oldString<<
" to "<< newString << endl;
3459 if(!myGenEvent)
return;
3461 for ( HepMC::GenEvent::particle_const_iterator
3462 piter = myGenEvent->particles_begin();
3463 piter != myGenEvent->particles_end();
3466 if ( nGen != 1 || nSim != 1 )
return;
3469 if (
genJets_.size() != 1 )
return;
3471 double true_eta =
genJets_[0].eta();
3472 double true_phi =
genJets_[0].phi();
3476 double rec_ECALEnergy = 0.;
3477 double rec_HCALEnergy = 0.;
3478 double deltaRMin = 999.;
3479 unsigned int theJet = 0;
3480 for (
unsigned int ijet=0; ijet<
pfJets_.size(); ++ijet ) {
3481 double rec_ECAL =
pfJets_[ijet].neutralEmEnergy();
3482 double rec_HCAL =
pfJets_[ijet].neutralHadronEnergy();
3483 double rec_eta =
pfJets_[0].eta();
3484 double rec_phi =
pfJets_[0].phi();
3486 + (rec_phi-true_phi)*(rec_phi-true_phi) );
3487 if ( deltaR < deltaRMin ) {
3489 rec_ECALEnergy = rec_ECAL;
3490 rec_HCALEnergy = rec_HCAL;
3493 if ( deltaRMin > 0.1 )
return;
3495 std::vector < PFCandidatePtr > constituents =
pfJets_[theJet].getPFConstituents ();
3496 double pat_ECALEnergy = 0.;
3497 double pat_HCALEnergy = 0.;
3498 for (
unsigned ic = 0; ic < constituents.size (); ++ic) {
3499 if ( constituents[ic]->particleId() < 4 )
continue;
3500 if ( constituents[ic]->particleId() == 4 )
3501 pat_ECALEnergy += constituents[ic]->rawEcalEnergy();
3502 else if ( constituents[ic]->particleId() == 5 )
3503 pat_HCALEnergy += constituents[ic]->rawHcalEnergy();
3506 double col_ECALEnergy = rec_ECALEnergy * 1.05;
3507 double col_HCALEnergy = rec_HCALEnergy;
3508 if ( col_HCALEnergy > 1E-6 )
3509 col_HCALEnergy = col_ECALEnergy > 1E-6 ?
3510 6. + 1.06*rec_HCALEnergy : (2.17*rec_HCALEnergy+1.73)/(1.+
std::exp(2.49/rec_HCALEnergy));
3512 double jam_ECALEnergy = rec_ECALEnergy;
3513 double jam_HCALEnergy = rec_HCALEnergy;
3515 getCalibratedEnergyEmbedAInHcal(jam_ECALEnergy, jam_HCALEnergy, true_eta, true_phi);
3517 out << true_eta <<
" " << true_phi <<
" " << true_E
3518 <<
" " << rec_ECALEnergy <<
" " << rec_HCALEnergy
3519 <<
" " << pat_ECALEnergy <<
" " << pat_HCALEnergy
3520 <<
" " << deltaRMin << std::endl;
3530 std::vector< std::list <simMatch> > candSimMatchTrack;
3531 std::vector< std::list <simMatch> > candSimMatchEcal;
3541 out<<
"ECAL RecHits ==============================================="<<endl;
3543 out<<
"HCAL RecHits ==============================================="<<endl;
3545 out<<
"HFEM RecHits ==============================================="<<endl;
3547 out<<
"HFHAD RecHits =============================================="<<endl;
3549 out<<
"PS RecHits ================================================="<<endl;
3554 out<<
"ECAL Clusters ============================================="<<endl;
3556 out<<
"HCAL Clusters ============================================="<<endl;
3558 out<<
"HFEM Clusters ============================================="<<endl;
3560 out<<
"HFHAD Clusters ============================================"<<endl;
3562 out<<
"PS Clusters ============================================="<<endl;
3565 bool printTracks =
true;
3570 out<<
"Particle Flow Blocks ======================================"<<endl;
3572 out<<
i<<
" "<<(*pfBlocks_)[
i]<<endl;
3577 out<<
"Particle Flow Candidates =================================="<<endl;
3588 out<<
"MEX, MEY, MET ============================================" <<endl
3589 << mex <<
" " << mey <<
" " <<
sqrt(mex*mex+mey*mey);
3596 cout<<
"MCTruthMatching Results"<<endl;
3599 out <<icand<<
" " <<(*pfCandidates_)[icand]<<endl;
3600 out <<
"is matching:" << endl;
3603 ITM it_t = candSimMatchTrack[icand].begin();
3604 ITM itend_t = candSimMatchTrack[icand].end();
3605 for(;it_t!=itend_t;++it_t){
3606 unsigned simid = it_t->second;
3609 out <<
"\t\tthrough Track matching pTrectrack="
3610 << it_t->first <<
" GeV" << endl;
3613 ITM it_e = candSimMatchEcal[icand].begin();
3614 ITM itend_e = candSimMatchEcal[icand].end();
3615 for(;it_e!=itend_e;++it_e){
3616 unsigned simid = it_e->second;
3619 out <<
"\t\tsimparticle contributing to a total of "
3621 <<
" GeV of its ECAL cluster"
3624 cout<<
"________________"<<endl;
3629 out<<
"Jets ====================================================="<<endl;
3630 out<<
"Particle Flow: "<<endl;
3636 out<<
"Generated: "<<endl;
3643 out<<
"Calo: "<<endl;
3650 out<<
"Sim Particles ==========================================="<<endl;
3668 cout<<
"MCTruthMatching Results"<<endl;
3670 cout <<
"==== Particle Simulated " <<
i << endl;
3675 cout <<
"Look at the desintegration products" << endl;
3682 cout <<
"matching pfCandidate (trough tracking): " << endl;
3686 ITM it = candSimMatchTrack[icand].begin();
3687 ITM itend = candSimMatchTrack[icand].end();
3688 for(;it!=itend;++it)
3689 if(
i == it->second ){
3690 out<<icand<<
" "<<(*pfCandidates_)[icand]<<endl;
3697 vector<unsigned> rechitSimIDs
3699 vector<double> rechitSimFrac
3702 if( !rechitSimIDs.size() )
continue;
3704 cout <<
"matching pfCandidate (through ECAL): " << endl;
3707 double totalEcalE = 0.0;
3709 for (
unsigned isimrh=0; isimrh < rechitSimIDs.size();
3713 cout <<
"For info, this particle deposits E=" << totalEcalE
3714 <<
"(GeV) in the ECAL" << endl;
3719 ITM it = candSimMatchEcal[icand].begin();
3720 ITM itend = candSimMatchEcal[icand].end();
3721 for(;it!=itend;++it)
3722 if(
i == it->second )
3723 out<<icand<<
" "<<it->first<<
"GeV "<<(*pfCandidates_)[icand]<<endl;
3740 int maxNLines)
const {
3744 if(!myGenEvent)
return;
3746 out<<
"GenParticles ==========================================="<<endl;
3748 std::cout <<
"Id Gen Name eta phi pT E Vtx1 "
3750 <<
"Moth Vtx2 eta phi R Z Da1 Da2 Ecal?"
3754 for ( HepMC::GenEvent::particle_const_iterator
3755 piter = myGenEvent->particles_begin();
3756 piter != myGenEvent->particles_end();
3759 if( nLines == maxNLines)
break;
3764 int partId = p->pdg_id();
3871 std::string latexString;
3877 p->momentum().e() );
3883 if ( !p->production_vertex() && p->pdg_id() == 2212 )
continue;
3888 if(p->production_vertex() ) {
3889 vertex1.SetCoordinates( p->production_vertex()->position().x()/10.,
3890 p->production_vertex()->position().y()/10.,
3891 p->production_vertex()->position().z()/10. );
3892 vertexId1 = p->production_vertex()->barcode();
3895 out.setf(std::ios::fixed, std::ios::floatfield);
3896 out.setf(std::ios::right, std::ios::adjustfield);
3898 out << std::setw(4) << p->barcode() <<
" "
3901 for(
unsigned int k=0;
k<11-name.length() &&
k<12;
k++) out <<
" ";
3903 double eta = momentum1.eta();
3904 if ( eta > +10. ) eta = +10.;
3905 if ( eta < -10. ) eta = -10.;
3907 out << std::setw(6) << std::setprecision(2) << eta <<
" "
3908 << std::setw(6) << std::setprecision(2) << momentum1.phi() <<
" "
3909 << std::setw(7) << std::setprecision(2) << momentum1.pt() <<
" "
3910 << std::setw(7) << std::setprecision(2) << momentum1.e() <<
" "
3911 << std::setw(4) << vertexId1 <<
" "
3912 << std::setw(6) << std::setprecision(1) << vertex1.x() <<
" "
3913 << std::setw(6) << std::setprecision(1) << vertex1.y() <<
" "
3914 << std::setw(6) << std::setprecision(1) << vertex1.z() <<
" ";
3917 if( p->production_vertex() ) {
3918 if ( p->production_vertex()->particles_in_size() ) {
3920 *(p->production_vertex()->particles_in_const_begin());
3922 out << std::setw(4) << mother->barcode() <<
" ";
3928 if ( p->end_vertex() ) {
3930 p->end_vertex()->position().y()/10.,
3931 p->end_vertex()->position().z()/10.,
3932 p->end_vertex()->position().t()/10.);
3933 int vertexId2 = p->end_vertex()->barcode();
3935 std::vector<const HepMC::GenParticle*> children;
3936 HepMC::GenVertex::particles_out_const_iterator firstDaughterIt =
3937 p->end_vertex()->particles_out_const_begin();
3938 HepMC::GenVertex::particles_out_const_iterator lastDaughterIt =
3939 p->end_vertex()->particles_out_const_end();
3940 for ( ; firstDaughterIt != lastDaughterIt ; ++firstDaughterIt ) {
3941 children.push_back(*firstDaughterIt);
3944 out << std::setw(4) << vertexId2 <<
" "
3945 << std::setw(6) << std::setprecision(2) << vertex2.eta() <<
" "
3946 << std::setw(6) << std::setprecision(2) << vertex2.phi() <<
" "
3947 << std::setw(5) << std::setprecision(1) << vertex2.pt() <<
" "
3948 << std::setw(6) << std::setprecision(1) << vertex2.z() <<
" ";
3950 for (
unsigned id=0;
id<children.size(); ++
id )
3951 out << std::setw(4) << children[
id]->barcode() <<
" ";
3959 for(
unsigned i=0;
i<rechits.size();
i++) {
3960 string seedstatus =
" ";
3962 seedstatus =
"SEED";
3970 const char* seedstatus,
3971 ostream&
out)
const {
3980 TCutG* cutg = (TCutG*) gROOT->FindObject(
"CUTG");
3981 if( !cutg || cutg->IsInside( eta, phi ) )
3982 out<<index<<
"\t"<<seedstatus<<
" "<<rh<<endl;
3986 ostream&
out )
const {
3987 for(
unsigned i=0;
i<clusters.size();
i++) {
3994 ostream&
out )
const {
4004 TCutG* cutg = (TCutG*) gROOT->FindObject(
"CUTG");
4005 if( !cutg || cutg->IsInside( eta, phi ) )
4015 TCutG* cutg = (TCutG*) gROOT->FindObject(
"CUTG");
4016 if(!cutg)
return true;
4018 const vector< reco::PFTrajectoryPoint >& points = track.
trajectoryPoints();
4020 for(
unsigned i=0;
i<points.size();
i++) {
4021 if( ! points[
i].isValid() )
continue;
4024 if( cutg->IsInside( pos.Eta(), pos.Phi() ) )
return true;
4037 TCutG* cutg = (TCutG*) gROOT->FindObject(
"CUTG");
4041 mask.reserve( rechits.size() );
4042 for(
unsigned i=0;
i<rechits.size();
i++) {
4044 double eta = rechits[
i].position().Eta();
4045 double phi = rechits[
i].position().Phi();
4047 if( cutg->IsInside( eta, phi ) )
4048 mask.push_back(
true );
4050 mask.push_back(
false );
4059 TCutG* cutg = (TCutG*) gROOT->FindObject(
"CUTG");
4063 mask.reserve( clusters.size() );
4064 for(
unsigned i=0;
i<clusters.size();
i++) {
4066 double eta = clusters[
i].position().Eta();
4067 double phi = clusters[
i].position().Phi();
4069 if( cutg->IsInside( eta, phi ) )
4070 mask.push_back(
true );
4072 mask.push_back(
false );
4081 TCutG* cutg = (TCutG*) gROOT->FindObject(
"CUTG");
4085 mask.reserve( tracks.size() );
4086 for(
unsigned i=0;
i<tracks.size();
i++) {
4088 mask.push_back(
true );
4090 mask.push_back(
false );
4099 TCutG* cutg = (TCutG*) gROOT->FindObject(
"CUTG");
4103 mask.reserve( tracks.size() );
4104 for(
unsigned i=0;
i<tracks.size();
i++) {
4106 mask.push_back(
true );
4108 mask.push_back(
false );
4116 double& peta,
double& pphi,
double& pe)
4121 string err =
"PFRootEventManager::closestParticle : ";
4122 err +=
"vector of PFSimParticles is empty";
4123 throw std::length_error( err.c_str() );
4126 double mindist2 = 99999999;
4127 unsigned iClosest=0;
4147 double deta = peta -
eta;
4148 double dphi = pphi -
phi;
4150 double dist2 = deta*deta + dphi*dphi;
4152 if(dist2<mindist2) {
4185 case 1: { name =
"d";latexString=
"d";
break; }
4186 case 2: { name =
"u";latexString=
"u";
break; }
4187 case 3: { name =
"s";latexString=
"s" ;
break; }
4188 case 4: { name =
"c";latexString=
"c" ;
break; }
4189 case 5: { name =
"b";latexString=
"b" ;
break; }
4190 case 6: { name =
"t";latexString=
"t" ;
break; }
4191 case -1: { name =
"~d";latexString=
"#bar{d}" ;
break; }
4192 case -2: { name =
"~u";latexString=
"#bar{u}" ;
break; }
4193 case -3: { name =
"~s";latexString=
"#bar{s}" ;
break; }
4194 case -4: { name =
"~c";latexString=
"#bar{c}" ;
break; }
4195 case -5: { name =
"~b";latexString=
"#bar{b}" ;
break; }
4196 case -6: { name =
"~t";latexString=
"#bar{t}" ;
break; }
4197 case 11: { name =
"e-";latexString=
name ;
break; }
4198 case -11: { name =
"e+";latexString=
name ;
break; }
4199 case 12: { name =
"nu_e";latexString=
"#nu_{e}" ;
break; }
4200 case -12: { name =
"~nu_e";latexString=
"#bar{#nu}_{e}" ;
break; }
4201 case 13: { name =
"mu-";latexString=
"#mu-" ;
break; }
4202 case -13: { name =
"mu+";latexString=
"#mu+" ;
break; }
4203 case 14: { name =
"nu_mu";latexString=
"#nu_{mu}" ;
break; }
4204 case -14: { name =
"~nu_mu";latexString=
"#bar{#nu}_{#mu}";
break; }
4205 case 15: { name =
"tau-";latexString=
"#tau^{-}" ;
break; }
4206 case -15: { name =
"tau+";latexString=
"#tau^{+}" ;
break; }
4207 case 16: { name =
"nu_tau";latexString=
"#nu_{#tau}" ;
break; }
4208 case -16: { name =
"~nu_tau";latexString=
"#bar{#nu}_{#tau}";
break; }
4209 case 21: { name =
"gluon";latexString=
name;
break; }
4210 case 22: { name =
"gamma";latexString=
"#gamma";
break; }
4211 case 23: { name =
"Z0";latexString=
"Z^{0}" ;
break; }
4212 case 24: { name =
"W+";latexString=
"W^{+}" ;
break; }
4213 case 25: { name =
"H0";latexString=
name ;
break; }
4214 case -24: { name =
"W-";latexString=
"W^{-}" ;
break; }
4215 case 111: { name =
"pi0";latexString=
"#pi^{0}" ;
break; }
4216 case 113: { name =
"rho0";latexString=
"#rho^{0}" ;
break; }
4217 case 223: { name =
"omega";latexString=
"#omega" ;
break; }
4218 case 333: { name =
"phi";latexString=
"#phi";
break; }
4219 case 443: { name =
"J/psi";latexString=
"J/#psi" ;
break; }
4220 case 553: { name =
"Upsilon";latexString=
"#Upsilon" ;
break; }
4221 case 130: { name =
"K0L";latexString=
name ;
break; }
4222 case 211: { name =
"pi+";latexString=
"#pi^{+}" ;
break; }
4223 case -211: { name =
"pi-";latexString=
"#pi^{-}" ;
break; }
4224 case 213: { name =
"rho+";latexString=
"#rho^{+}" ;
break; }
4225 case -213: { name =
"rho-";latexString=
"#rho^{-}" ;
break; }
4226 case 221: { name =
"eta";latexString=
"#eta" ;
break; }
4227 case 331: { name =
"eta'";latexString=
"#eta'" ;
break; }
4228 case 441: { name =
"etac";latexString=
"#eta_{c}" ;
break; }
4229 case 551: { name =
"etab";latexString=
"#eta_{b}";
break; }
4230 case 310: { name =
"K0S";latexString=
name ;
break; }
4231 case 311: { name =
"K0";latexString=
"K^{0}" ;
break; }
4232 case -311: { name =
"Kbar0";latexString=
"#bar{#Kappa}^{0}" ;
break; }
4233 case 321: { name =
"K+";latexString=
"K^{+}";
break; }
4234 case -321: { name =
"K-";latexString=
"K^{-}";
break; }
4235 case 411: { name =
"D+";latexString=
"D^{+}" ;
break; }
4236 case -411: { name =
"D-";latexString=
"D^{-}";
break; }
4237 case 421: { name =
"D0";latexString=
name ;
break; }
4238 case 431: { name =
"Ds_+";latexString=
"Ds_{+}" ;
break; }
4239 case -431: { name =
"Ds_-";latexString=
"Ds_{-}" ;
break; }
4240 case 511: { name =
"B0";latexString=
name;
break; }
4241 case 521: { name =
"B+";latexString=
"B^{+}" ;
break; }
4242 case -521: { name =
"B-";latexString=
"B^{-}" ;
break; }
4243 case 531: { name =
"Bs_0";latexString=
"Bs_{0}" ;
break; }
4244 case 541: { name =
"Bc_+";latexString=
"Bc_{+}" ;
break; }
4245 case -541: { name =
"Bc_+";latexString=
"Bc_{+}" ;
break; }
4246 case 313: { name =
"K*0";latexString=
"K^{*0}" ;
break; }
4247 case -313: { name =
"K*bar0";latexString=
"#bar{K}^{*0}" ;
break; }
4248 case 323: { name =
"K*+";latexString=
"#K^{*+}";
break; }
4249 case -323: { name =
"K*-";latexString=
"#K^{*-}" ;
break; }
4250 case 413: { name =
"D*+";latexString=
"D^{*+}";
break; }
4251 case -413: { name =
"D*-";latexString=
"D^{*-}" ;
break; }
4252 case 423: { name =
"D*0";latexString=
"D^{*0}" ;
break; }
4253 case 513: { name =
"B*0";latexString=
"B^{*0}" ;
break; }
4254 case 523: { name =
"B*+";latexString=
"B^{*+}" ;
break; }
4255 case -523: { name =
"B*-";latexString=
"B^{*-}" ;
break; }
4256 case 533: { name =
"B*_s0";latexString=
"B^{*}_{s0}" ;
break; }
4257 case 543: { name =
"B*_c+";latexString=
"B^{*}_{c+}";
break; }
4258 case -543: { name =
"B*_c-";latexString=
"B^{*}_{c-}";
break; }
4259 case 1114: { name =
"Delta-";latexString=
"#Delta^{-}" ;
break; }
4260 case -1114: { name =
"Deltabar+";latexString=
"#bar{#Delta}^{+}" ;
break; }
4261 case -2112: { name =
"nbar0";latexString=
"{bar}n^{0}" ;
break; }
4262 case 2112: { name =
"n"; latexString=
name ;
break;}
4263 case 2114: { name =
"Delta0"; latexString=
"#Delta^{0}" ;
break; }
4264 case -2114: { name =
"Deltabar0"; latexString=
"#bar{#Delta}^{0}" ;
break; }
4265 case 3122: { name =
"Lambda0";latexString=
"#Lambda^{0}";
break; }
4266 case -3122: { name =
"Lambdabar0";latexString=
"#bar{#Lambda}^{0}" ;
break; }
4267 case 3112: { name =
"Sigma-"; latexString=
"#Sigma" ;
break; }
4268 case -3112: { name =
"Sigmabar+"; latexString=
"#bar{#Sigma}^{+}" ;
break; }
4269 case 3212: { name =
"Sigma0";latexString=
"#Sigma^{0}" ;
break; }
4270 case -3212: { name =
"Sigmabar0";latexString=
"#bar{#Sigma}^{0}" ;
break; }
4271 case 3214: { name =
"Sigma*0"; latexString=
"#Sigma^{*0}" ;
break; }
4272 case -3214: { name =
"Sigma*bar0";latexString=
"#bar{#Sigma}^{*0}" ;
break; }
4273 case 3222: { name =
"Sigma+"; latexString=
"#Sigma^{+}" ;
break; }
4274 case -3222: { name =
"Sigmabar-"; latexString=
"#bar{#Sigma}^{-}";
break; }
4275 case 2212: { name =
"p";latexString=
name ;
break; }
4276 case -2212: { name =
"~p";latexString=
"#bar{p}" ;
break; }
4277 case -2214: { name =
"Delta-";latexString=
"#Delta^{-}" ;
break; }
4278 case 2214: { name =
"Delta+";latexString=
"#Delta^{+}" ;
break; }
4279 case -2224: { name =
"Deltabar--"; latexString=
"#bar{#Delta}^{--}" ;
break; }
4280 case 2224: { name =
"Delta++"; latexString=
"#Delta^{++}";
break; }
4284 cout <<
"Unknown code : " << partId << endl;
4297 std::vector< std::list <simMatch> >& candSimMatchTrack,
4298 std::vector< std::list <simMatch> >& candSimMatchEcal)
const
4303 out <<
"Running Monte Carlo Truth Matching Tool" << endl;
4307 candSimMatchTrack.resize(candidates.size());
4308 candSimMatchEcal.resize(candidates.size());
4310 for(
unsigned i=0;
i<candidates.size();
i++) {
4315 out <<
i<<
" " <<(*pfCandidates_)[
i]<<endl;
4316 out <<
"is matching:" << endl;
4322 for(
unsigned iel=0; iel<eleInBlocks.size(); ++iel) {
4323 PFBlockRef blockRef = eleInBlocks[iel].first;
4324 unsigned indexInBlock = eleInBlocks[iel].second;
4333 = elements_h[ indexInBlock ].type();
4340 = elements_h[ indexInBlock ].trackRefPF();
4341 assert( !trackref.
isNull() );
4344 unsigned rtrkID = track.trackId();
4350 if(trackIDM != 99999
4351 && trackIDM == rtrkID){
4354 out <<
"\tSimParticle " << isim
4355 <<
" through Track matching pTrectrack="
4356 << trkREF->pt() <<
" GeV" << endl;
4359 std::pair<double, unsigned> simtrackmatch
4360 = make_pair(trkREF->pt(),trackIDM);
4361 candSimMatchTrack[
i].push_back(simtrackmatch);
4371 = elements_h[ indexInBlock ].clusterRef();
4372 assert( !clusterref.
isNull() );
4375 const std::vector< reco::PFRecHitFraction >&
4376 fracs = cluster.recHitFractions();
4380 vector<unsigned> simpID;
4383 for(
unsigned int rhit = 0; rhit < fracs.size(); ++rhit){
4386 if(rh.
isNull())
continue;
4397 vector<unsigned> rechitSimIDs
4399 vector<double> rechitSimFrac
4402 if( !rechitSimIDs.size() )
continue;
4404 for (
unsigned isimrh=0; isimrh < rechitSimIDs.size(); isimrh++) {
4405 if( rechitSimIDs[isimrh] == rechit_cluster.
detId() ){
4407 bool takenalready =
false;
4408 for(
unsigned iss = 0; iss < simpID.size(); ++iss)
4409 if(simpID[iss] == isim) takenalready =
true;
4410 if(!takenalready) simpID.push_back(isim);
4413 ((rechit_cluster.
energy()*rechitSimFrac[isimrh])/100.0)
4414 *fracs[rhit].fraction();
4426 for(
unsigned is=0; is < simpID.size(); ++is)
4428 double frac_of_cluster
4429 = (simpEC[simpID[is]]/cluster.energy())*100.0;
4432 std::pair<double, unsigned> simecalmatch
4433 = make_pair(simpEC[simpID[is]],simpID[is]);
4434 candSimMatchEcal[
i].push_back(simecalmatch);
4437 out <<
"\tSimParticle " << simpID[is]
4438 <<
" through ECAL matching Epfcluster="
4440 <<
" GeV with N=" << simpCN[simpID[is]]
4441 <<
" rechits in common "
4443 out <<
"\t\tsimparticle contributing to a total of "
4444 << simpEC[simpID[is]]
4445 <<
" GeV of this cluster ("
4446 << frac_of_cluster <<
"%) "
4455 cout <<
"==============================================================="
4462 cout <<
"=================================================================="
4464 cout <<
"SimParticles" << endl;
4468 cout <<
"==== Particle Simulated " <<
i << endl;
4473 cout <<
"Look at the desintegration products" << endl;
4480 cout <<
"matching pfCandidate (trough tracking): " << endl;
4481 for(
unsigned icand=0; icand<candidates.size(); icand++ )
4483 ITM it = candSimMatchTrack[icand].begin();
4484 ITM itend = candSimMatchTrack[icand].end();
4485 for(;it!=itend;++it)
4486 if(
i == it->second ){
4487 out<<icand<<
" "<<(*pfCandidates_)[icand]<<endl;
4495 vector<unsigned> rechitSimIDs
4497 vector<double> rechitSimFrac
4500 if( !rechitSimIDs.size() )
continue;
4502 cout <<
"matching pfCandidate (through ECAL): " << endl;
4505 double totalEcalE = 0.0;
4507 for (
unsigned isimrh=0; isimrh < rechitSimIDs.size();
4511 cout <<
"For info, this particle deposits E=" << totalEcalE
4512 <<
"(GeV) in the ECAL" << endl;
4514 for(
unsigned icand=0; icand<candidates.size(); icand++ )
4516 ITM it = candSimMatchEcal[icand].begin();
4517 ITM itend = candSimMatchEcal[icand].end();
4518 for(;it!=itend;++it)
4519 if(
i == it->second )
4520 out<<icand<<
" "<<it->first<<
"GeV "<<(*pfCandidates_)[icand]<<endl;
4532 if ( tagname.size() == 1 )
4535 else if ( tagname.size() == 2 )
4538 else if ( tagname.size() == 3 )
4539 return tagname[2] ==
'*' ?
4543 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
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.
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
virtual int pdgId() const
PDG identifier.
void reset()
reset before next event
virtual double p() const
magnitude of momentum vector
void setThreshDoubleSpikeEndcap(double thresh)
set endcap thresholds for double spike cleaning
void reconstructPFJets()
reconstruct pf jets
PFClusterAlgo clusterAlgoHFEM_
clustering algorithm for HF, electro-magnetic layer
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_
tuple coneTrackIsoForEgammaSC
bool printPFJets_
print PFJets yes/no
ParticleType
particle types
edm::Handle< reco::PFRecHitCollection > rechitsHFEMHandle_
rechits HF EM
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.
tuple coneEcalIsoForEgammaSC
General option file parser.
tuple sumEtEcalIsoForEgammaSC_barrel
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
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.
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_
double deltaPhi(float phi1, float phi2)
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
edm::Handle< reco::PFRecHitCollection > rechitsHCALHandle_
rechits HCAL
virtual int status() const
status word
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
bool usePFV0s_
Use of V0 in PFAlgo.
bool isSeed(unsigned rhi) const
tuple usePFNuclearInteractions
double printClustersEMin_
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
tuple sumEtEcalIsoForEgammaSC_endcap
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
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_
Base class for particle flow input reconstructed tracks and simulated particles.
Exp< T >::type exp(const T &t)
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
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
reco::PFRecHitCollection rechitsPS_
Jets made from PFObjects.
void applyCuts(const reco::CandidatePtrVector &Candidates, JetReco::InputCollection *input)
virtual double eta() const
momentum pseudorapidity
void particleFlow()
performs particle flow
std::vector< ElementInBlock > ElementsInBlocks
void setNumber(int number)
double printGenParticlesPtMin_
double tauBenchmark(const reco::PFCandidateCollection &candidates)
COLIN need to get rid of this mess.
edm::Handle< std::vector< reco::CaloJet > > caloJetsHandle_
CMSSW calo Jets.
bool GetOpt(const char *tag, const char *key, std::vector< T > &values) const
reads a vector of T
const ElementsInBlocks & elementsInBlocks() const
bool getByLabel(const InputTag &, Handle< T > &) const
bool doPFMETBenchmark_
PFMET benchmark on/off.
void setPFEleParameters(double mvaEleCut, std::string mvaWeightFileEleID, bool usePFElectrons, const boost::shared_ptr< PFSCEnergyCalibration > &thePFSCEnergyCalibration, 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)
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
tuple rejectTracks_Step45
virtual double energy() const
energy
Algorithm for particle flow clustering.
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.
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
std::auto_ptr< reco::PFClusterCollection > clustersPS_
std::vector< GsfPFRecTrack > GsfPFRecTrackCollection
collection of GsfPFRecTrack objects
void printRecHits(const reco::PFRecHitCollection &rechits, const PFClusterAlgo &clusterAlgo, std::ostream &out=std::cout) const
print rechits
tuple minSignificanceReduction
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 mcTruthMatching(std::ostream &out, const reco::PFCandidateCollection &candidates, std::vector< std::list< simMatch > > &candSimMatchTrack, std::vector< std::list< simMatch > > &candSimMatchEcal) const
tuple nTrackIsoForEgammaSC
std::pair< std::string, MonitorElement * > entry
void setDebug(bool debug)
sets debug printout flag
std::ofstream * calibFile_
void setNNeighbours(int n)
set number of neighbours for
TH1F * h_deltaETvisible_MCPF_
output histo dET ( PF - MC)
edm::InputTag pfNuclearTrackerVertexTag_
virtual int charge() const
electric charge
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
tuple nuclearInteractionsPurity
void setMask(const std::vector< bool > &mask)
set rechit mask
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 > &hfemh, const T< reco::PFClusterCollection > &hfhadh, const T< reco::PFClusterCollection > &psh, const Mask &trackMask=dummyMask_, const Mask &gsftrackMask=dummyMask_, const Mask &ecalMask=dummyMask_, const Mask &hcalMask=dummyMask_, const Mask &hfemMask=dummyMask_, const Mask &hfhadMask=dummyMask_, const Mask &psMask=dummyMask_)
set input collections of tracks and clusters
edm::InputTag genParticlesforJetsTag_
edm::InputTag caloTowersTag_
PFClusterAlgo clusterAlgoHCAL_
clustering algorithm for HCAL
tuple calibPFSCEle_barrel
float jetArea() const
Jet area as calculated by algorithm.
Jets made from MC generator particles.
PFCandidateManager pfCandidateManager_
edm::InputTag recTracksTag_
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_
tuple sumPtTrackIsoForEgammaSC_endcap
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.
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)
void setPFMuonAndFakeParameters(std::vector< double > muonHCAL, std::vector< double > muonECAL, double nSigmaTRACK, double ptError, std::vector< double > factors45, bool usePFMuonMomAssign)
reco::PFRecHitCollection rechitsHFEM_
void setDebug(bool aDebug)
PFAlgo pfAlgo_
particle flow algorithm
true particle for particle flow
double energy() const
cluster energy
void clustering()
read data from testbeam tree
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
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_
void setDirectory(TDirectory *dir)
set directory (to use in ROOT)
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 printGenParticles(std::ostream &out=std::cout, int maxNLines=-1) const
print the HepMC truth
const math::XYZTLorentzVector & momentum() const
4-momenta quadrivector
void setPFVertexParameters(bool useVertex, const reco::VertexCollection &primaryVertices)
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
virtual double px() const
x coordinate of momentum vector
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 setParameters(double nSigmaECAL, double nSigmaHCAL, const boost::shared_ptr< PFEnergyCalibration > &calibration, const boost::shared_ptr< pftools::PFClusterCalibration > &clusterCalibration, const boost::shared_ptr< PFEnergyCalibrationHF > &thepfEnergyCalibrationHF, unsigned int newCalib)
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 double pt() const
transverse momentum
std::auto_ptr< reco::PFClusterCollection > clustersHFHAD_
tuple calibPFSCEle_endcap
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_
tuple useEGammaSupercluster
void addParticle(const Particle &ptc)
PFClusterAlgo clusterAlgoPS_
clustering algorithm for PS
void setRecHitNeigbours(reco::PFRecHit &rh, const std::map< unsigned, unsigned > &detId2index)
void findBlocks()
build blocks
float pileup() const
pileup energy contribution as calculated by algorithm
edm::Handle< edm::HepMCProduct > MCTruthHandle_
MC truth.
reco::PFDisplacedTrackerVertexCollection pfNuclearTrackerVertex_
tuple sumPtTrackIsoForEgammaSC_barrel
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.
double energy() const
rechit energy
boost::shared_ptr< pftools::PFClusterCalibration > clusterCalibration_
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 postMuonCleaning(const edm::Handle< reco::MuonCollection > &muonh, const reco::VertexCollection &primaryVertices)
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)
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)
virtual ParticleType particleId() const
void setMaxPairSize(int aMaxPairSize)
????
void setThreshCleanEndcap(double thresh)
set endcap clean threshold
std::vector< reco::CaloJet > caloJetsCMSSW_
void setHistos(TFile *file, TH2F *hB, TH2F *hE)
set endcap clean threshold
bool JECinCaloMet_
propagate the Jet Energy Corrections to the caloMET on/off
bool fastsim_
Fastsim or fullsim.
reco::METCollection tcMetsCMSSW_
void setPtMin(double aPtMin)
LayerType
Define the different layers where the track can be propagated.
virtual double phi() const
momentum azimuthal angle
virtual const LorentzVector & p4() const
four-momentum Lorentz vector
static const HistoName names[]
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
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
bool useAtHLT
Use HLT tracking.
tuple size
Write out results.
edm::Handle< reco::MuonCollection > muonsHandle_
muons
void setParameters(std::vector< double > &DPtovPtCut, std::vector< unsigned > &NHitCut, bool useConvBremPFRecTracks, bool useIterTracking, int nuclearInteractionsPurity)
virtual double py() const
y coordinate of momentum vector
void PreprocessRecTracks(reco::PFRecTrackCollection &rectracks)
preprocess a rectrack vector from a given rectrack branch
void setup()
book histograms
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
edm::Handle< reco::PFRecTrackCollection > recTracksHandle_
reconstructed tracks
int eventToEntry(int run, int lumi, int event) const