22 #include "CLHEP/Random/RandFlat.h"
55 (*m_msgStream) <<
MSG::DEBUG <<
" -- ElectronSelector::Init -- START -- " <<
endmsg;
61 (*m_msgStream) << MSG::INFO <<
"ElectronSelector::Init -- Setting up electron LH tool." <<
endmsg;
64 const std::string elecWorkingPoint =
"LooseLHElectron";
66 if((
m_LHTool2015->setProperty(
"WorkingPoint",elecWorkingPoint.c_str())).isFailure()) {
67 (*m_msgStream) << MSG::WARNING <<
"Failure loading ConfigFile for electron likelihood tool with working point: " << elecWorkingPoint.c_str() <<
endmsg;
70 (*m_msgStream) << MSG::INFO <<
"Loading ConfigFile for electron likelihood tool with working point: " << elecWorkingPoint <<
". SUCCESS " <<
endmsg;
74 std::string confDir =
"ElectronPhotonSelectorTools/offline/mc20_20210514/ElectronLikelihoodVeryLooseOfflineConfig2017_Smooth.conf";
75 if ( (
m_LHTool2015->setProperty(
"ConfigFile", confDir)).isSuccess()) {
76 (*m_msgStream) << MSG::INFO <<
"Electron likelihood config ("<< confDir.c_str() <<
") setting SUCCESS!" <<
endmsg;
79 (*m_msgStream) << MSG::WARNING <<
"Electron likelihood config ("<< confDir.c_str() <<
") setting FAILURE" <<
endmsg;
83 (*m_msgStream) << MSG::INFO <<
"Electron likelihood tool initialize() SUCCESS!" <<
endmsg;
86 (*m_msgStream) << MSG::WARNING <<
"Electron likelihood tool initialize() FAILURE!" <<
endmsg;
89 (*m_msgStream) <<
MSG::DEBUG <<
" --ElectronSelector::Init -- COMPLETED -- " <<
endmsg;
96 (*m_msgStream) <<
MSG::DEBUG <<
" --ElectronSelector::PrepareElectronList -- START -- " <<
endmsg;
100 electron_iterator iter = pxElecContainer->
begin();
101 electron_iterator iterEnd = pxElecContainer->
end();
104 int electroncount = 0;
105 for(; iter != iterEnd ; ++iter) {
107 (*m_msgStream) <<
MSG::DEBUG <<
" -- ElectronSelector::PrepareElectronList -- candiate electron " << electroncount
112 (*m_msgStream) <<
MSG::DEBUG <<
" -- ElectronSelector::PrepareElectronList -- candiate electron " << electroncount
117 bool progressingwell =
true;
119 (*m_msgStream) <<
MSG::DEBUG <<
" -- ElectronSelector::PrepareElectronList -- finished recording electrons. "
121 <<
" out of tested electron candidates:" << electroncount <<
endmsg;
126 if (!progressingwell) {
127 (*m_msgStream) <<
MSG::DEBUG <<
" -- ElectronSelector::PrepareElectronList -- FAILED -- this event has not even a good e+e- pair " <<
endmsg;
131 (*m_msgStream) <<
MSG::DEBUG <<
" -- ElectronSelector::PrepareElectronList -- COMPLETED -- electroncount -- m_pxElTrackList.size() / all = "
141 bool electronisgood =
true;
145 electronisgood =
false;
146 (*m_msgStream) <<
MSG::DEBUG <<
" -- electron fails workingpoint selection -- " <<
endmsg;
152 if (!theTrackParticle) {
153 electronisgood =
false;
154 (*m_msgStream) <<
MSG::DEBUG <<
" -- electron fails trackparticle -- " <<
endmsg;
158 electronisgood =
false;
163 electronisgood =
false;
164 (*m_msgStream) <<
MSG::DEBUG <<
" -- electron fails pt cut -- pt= " << theTrackParticle->
pt()
165 <<
" < " <<
m_ptCut <<
" (cut value) "
171 electronisgood =
false;
172 (*m_msgStream) <<
MSG::DEBUG <<
" -- electron candidate has no CaloCluster " <<
endmsg;
176 electronisgood =
false;
177 (*m_msgStream) <<
MSG::DEBUG <<
" -- electron fails cluster Et cut -- Et= " << (cluster->
e() *
cos(theTrackParticle->
theta()))*
m_CGeV
178 <<
" < " <<
m_ptCut <<
" (cut value) "
182 if (electronisgood && (std::abs(cluster->
eta())>
m_etaCut || std::abs(theTrackParticle->
eta())>
m_etaCut) ) {
183 electronisgood =
false;
184 (*m_msgStream) <<
MSG::DEBUG <<
" -- electron fails eta cut -- cluster_eta= " << cluster->
eta() <<
endmsg;
187 if (electronisgood) {
191 (*m_msgStream) <<
MSG::DEBUG <<
" * RecordElectron * good electron found -> store this electron with pt " << theTrackParticle->
pt()
196 return electronisgood;
220 bool goodlist =
true;
223 double ptMinus1 = 0.;
224 double ptMinus2 = 0.;
228 int elecnegcount = 0;
229 int elecposcount = 0;
268 if (elecposcount == 0 || elecnegcount == 0) {
270 if (
m_doDebug) std::cout <<
" -- ElectronSelector::OrderElectronList -- No opposite charge electrons --> DISCARD ALL ELECTRONS -- " << std::endl;
277 if (
m_doDebug && elecposcount + elecnegcount >= 2 ){
278 std::cout <<
" -- ElectronSelector::OrderElectronList -- electron summary list taking " << elecposcount + elecnegcount
279 <<
" electrons from the input list of " <<
m_pxElTrackList.size() <<
" electrons: " << std::endl;
280 if (
m_elecneg1 >= 0) std::cout <<
" leading e-: " <<
m_elecneg1 <<
" Pt = " << ptMinus1 << std::endl;
281 if (
m_elecneg2 >= 0) std::cout <<
" second e-: " <<
m_elecneg2 <<
" Pt = " << ptMinus2 << std::endl;
282 if (
m_elecpos1 >= 0) std::cout <<
" leading e+: " <<
m_elecpos1 <<
" Pt = " << ptPlus1 << std::endl;
283 if (
m_elecpos2 >= 0) std::cout <<
" second e+: " <<
m_elecpos2 <<
" Pt = " << ptPlus2 << std::endl;
286 if (elecposcount + elecnegcount >= 2){
294 (*m_msgStream) <<
MSG::DEBUG <<
" -- ElectronSelector::OrderElectronList -- COMPLETED -- status: "<< goodlist << std::endl;
301 if (
m_doDebug) std::cout <<
" -- ElectronSelector::RetrieveVertices -- START -- list size: "
304 bool goodvertices =
false;
305 int nverticesfound = 1;
342 if (nverticesfound >= 1) goodvertices =
true;
344 if (
m_doDebug) std::cout <<
" -- ElectronSelector::RetrieveVertices -- COMPLETED -- status: " << goodvertices << std::endl;