#include <EndcapPiZeroDiscriminatorAlgo.h>
|
float | Activation_fun (float SUM) |
|
void | calculateBarrelNNInputVariables (float et, double s1, double s9, double s25, double m2, double cee, double cep, double cpp, double s4, double s6, double ratio, double xcog, double ycog) |
|
bool | calculateNNInputVariables (std::vector< float > &vph1, std::vector< float > &vph2, float pS1_max, float pS9_max, float pS25_max, int EScorr) |
|
| EndcapPiZeroDiscriminatorAlgo () |
|
| EndcapPiZeroDiscriminatorAlgo (double stripEnergyCut, int nStripCut, const std::string &path) |
|
void | findPi0Road (ESDetId strip, EcalPreshowerNavigator &theESNav, int plane, std::vector< ESDetId > &vout) |
|
std::vector< float > | findPreshVector (ESDetId strip, RecHitsMap *rechits_map, CaloSubdetectorTopology *topology_p) |
|
float * | get_input_vector () |
|
float | GetBarrelNNOutput (float EB_Et) |
|
float | getNNoutput (int sel_wfile) |
|
float | GetNNOutput (float EE_Et) |
|
bool | goodPi0Strip (RecHitsMap::iterator candidate_it, ESDetId lastID) |
|
void | readWeightFile (const char *WFile) |
|
| ~EndcapPiZeroDiscriminatorAlgo () |
|
EndcapPiZeroDiscriminatorAlgo::EndcapPiZeroDiscriminatorAlgo |
( |
| ) |
|
|
inline |
EndcapPiZeroDiscriminatorAlgo::EndcapPiZeroDiscriminatorAlgo |
( |
double |
stripEnergyCut, |
|
|
int |
nStripCut, |
|
|
const std::string & |
path |
|
) |
| |
EndcapPiZeroDiscriminatorAlgo::~EndcapPiZeroDiscriminatorAlgo |
( |
| ) |
|
|
inline |
Definition at line 29 of file EndcapPiZeroDiscriminatorAlgo.h.
References Activation_fun(), calculateBarrelNNInputVariables(), calculateNNInputVariables(), stringResolutionProvider_cfi::et, findPi0Road(), findPreshVector(), GetBarrelNNOutput(), getNNoutput(), GetNNOutput(), goodPi0Strip(), particleFlowDisplacedVertex_cfi::ratio, readWeightFile(), rechits_map, digi_MixPreMix_cfi::strip, and SUM.
float EndcapPiZeroDiscriminatorAlgo::Activation_fun |
( |
float |
SUM | ) |
|
void EndcapPiZeroDiscriminatorAlgo::calculateBarrelNNInputVariables |
( |
float |
et, |
|
|
double |
s1, |
|
|
double |
s9, |
|
|
double |
s25, |
|
|
double |
m2, |
|
|
double |
cee, |
|
|
double |
cep, |
|
|
double |
cpp, |
|
|
double |
s4, |
|
|
double |
s6, |
|
|
double |
ratio, |
|
|
double |
xcog, |
|
|
double |
ycog |
|
) |
| |
bool EndcapPiZeroDiscriminatorAlgo::calculateNNInputVariables |
( |
std::vector< float > & |
vph1, |
|
|
std::vector< float > & |
vph2, |
|
|
float |
pS1_max, |
|
|
float |
pS9_max, |
|
|
float |
pS25_max, |
|
|
int |
EScorr |
|
) |
| |
Definition at line 358 of file EndcapPiZeroDiscriminatorAlgo.cc.
References MillePedeFileConverter_cfg::e, gen::k, GetRecoTauVFromDQM_MC_cff::kk, and LogTrace.
Referenced by ~EndcapPiZeroDiscriminatorAlgo().
363 bool valid_NNinput =
true;
376 for(
int k = 0;
k<11;
k++) {
379 LogTrace(
"EcalClusters") <<
"EndcapPiZeroDiscriminatorAlgo: Oops!!! Preshower Info for strip : " <<
k <<
" of X plane Do not exists" ;
384 LogTrace(
"EcalClusters") <<
"EndcapPiZeroDiscriminatorAlgo: Oops!!! Preshower Info for strip : " <<
k <<
" of Y plane Do not exists" ;
445 for(
int kk1=0;kk1<22;kk1++){
451 float ECAL_norm_factor = 500.;
452 if(pS25_max>500&&pS25_max<=1000) ECAL_norm_factor = 1000;
453 if(pS25_max>1000) ECAL_norm_factor = 7000;
455 input_var[22] = pS1_max/ECAL_norm_factor;
456 input_var[23] = pS9_max/ECAL_norm_factor;
457 input_var[24] = pS25_max/ECAL_norm_factor;
459 LogTrace(
"EcalClusters") <<
"EndcapPiZeroDiscriminatorAlgo: S1/ECAL_norm_factor = " <<
input_var[22];
460 LogTrace(
"EcalClusters") <<
"EndcapPiZeroDiscriminatorAlgo: S9/ECAL_norm_factor = " <<
input_var[23];
461 LogTrace(
"EcalClusters") <<
"EndcapPiZeroDiscriminatorAlgo: S25/ECAL_norm_factor = " <<
input_var[24] ;
465 valid_NNinput =
false;
470 LogTrace(
"EcalClusters") <<
" valid_NNinput = " << valid_NNinput ;
473 return valid_NNinput;
Definition at line 163 of file EndcapPiZeroDiscriminatorAlgo.cc.
References CaloNavigator< T, TOPO >::east(), CaloNavigator< T, TOPO >::home(), LogTrace, GetRecoTauVFromDQM_MC_cff::next, CaloNavigator< T, TOPO >::north(), CaloNavigator< T, TOPO >::setHome(), CaloNavigator< T, TOPO >::south(), digi_MixPreMix_cfi::strip, and CaloNavigator< T, TOPO >::west().
Referenced by ~EndcapPiZeroDiscriminatorAlgo().
165 if ( strip ==
ESDetId(0) )
return;
168 LogTrace(
"EcalClusters") <<
"EndcapPiZeroDiscriminatorAlgo: findPi0Road: starts from strip " <<
strip ;
173 LogTrace(
"EcalClusters") <<
"EndcapPiZeroDiscriminatorAlgo: findPi0Road: Go to the East " ;
176 LogTrace(
"EcalClusters") <<
"EndcapPiZeroDiscriminatorAlgo: findPi0Road: East: " << n_east <<
" current strip is " <<
next ;
178 vout.push_back(next);
184 LogTrace(
"EcalClusters") <<
"EndcapPiZeroDiscriminatorAlgo: findPi0Road: Go to the West " ;
188 LogTrace(
"EcalClusters") <<
"findPi0Road: West: " << n_west <<
" current strip is " <<
next ;
190 vout.push_back(next);
194 LogTrace(
"EcalClusters") <<
"EndcapPiZeroDiscriminatorAlgo: findPi0Road: Total number of strips found in the road at 1-st plane is " << n_east+n_west ;
197 else if (plane == 2) {
200 LogTrace(
"EcalClusters") <<
"EndcapPiZeroDiscriminatorAlgo: findPi0Road: Go to the North " ;
203 LogTrace(
"EcalClusters") <<
"EndcapPiZeroDiscriminatorAlgo: findPi0Road: North: " << n_north <<
" current strip is " <<
next;
205 vout.push_back(next);
211 LogTrace(
"EcalClusters") <<
"EndcapPiZeroDiscriminatorAlgo: findPi0Road: Go to the South " ;
215 LogTrace(
"EcalClusters") <<
"EndcapPiZeroDiscriminatorAlgo: findPi0Road: South: " << n_south <<
" current strip is " <<
next ;
217 vout.push_back(next);
221 LogTrace(
"EcalClusters") <<
"EndcapPiZeroDiscriminatorAlgo: findPi0Road: Total number of strips found in the road at 2-nd plane is " << n_south+n_north ;
225 LogTrace(
"EcalClusters") <<
"EndcapPiZeroDiscriminatorAlgo: findPi0Road: Wrong plane number, null cluster will be returned! " ;
void setHome(const T &startingPoint)
set the starting position
T west() const
move the navigator west
T south() const
move the navigator south
T east() const
move the navigator east
void home() const
move the navigator back to the starting point
T north() const
move the navigator north
Definition at line 62 of file EndcapPiZeroDiscriminatorAlgo.cc.
References mps_fire::i, LogTrace, particleFlowRecHitECAL_cfi::navigator, ESDetId::plane(), CaloNavigator< T, TOPO >::setHome(), and ESDetId::strip().
Referenced by ~EndcapPiZeroDiscriminatorAlgo().
65 vector<float> vout_stripE;
69 edm::LogWarning(
"EndcapPiZeroDiscriminatorAlgo") <<
"RecHitsMap has size 0.";
75 vector<ESDetId> road_2d;
78 int plane = strip.
plane();
80 LogTrace(
"EcalClusters") <<
"EndcapPiZeroDiscriminatorAlgo: findPreshVectors: Preshower Seeded Algorithm - looking for clusters" <<
"n"<<
"findPreshVectors: Preshower is intersected at strip " << strip.
strip() <<
", at plane " << plane ;
84 for(
int i=0;
i<11;
i++) {
85 vout_stripE.push_back(-100.);
90 road_2d.push_back(strip);
98 LogTrace(
"EcalClusters") <<
"EndcapPiZeroDiscriminatorAlgo:findPreshVectors: Total number of strips in the central road: " << road_2d.size() ;
101 RecHitsMap::iterator final_strip =
rechits_map->end();
105 ESDetId last_stripID = final_strip->first;
108 vector<ESDetId>::iterator itID;
109 for (itID = road_2d.begin(); itID != road_2d.end(); itID++) {
110 LogTrace(
"EcalClusters") <<
"EndcapPiZeroDiscriminatorAlgo: findPreshVectors: ID = " << *itID ;
112 RecHitsMap::iterator strip_it =
rechits_map->find(*itID);
114 E = strip_it->second.energy();
116 vout_stripE.push_back(E);
117 LogTrace(
"EcalClusters") <<
"EndcapPiZeroDiscriminatorAlgo: findPreshVectors: E = " << E ;
124 vector<float> vout_ElevenStrips_Energy;
125 for(
int i=0;
i<11;
i++)
127 vout_ElevenStrips_Energy.push_back(0.);
130 for(
unsigned int i=0;
i<vout_stripE.size();
i++)
132 vout_ElevenStrips_Energy[
i] = vout_stripE.at(
i);
136 return vout_ElevenStrips_Energy;
void findPi0Road(ESDetId strip, EcalPreshowerNavigator &theESNav, int plane, std::vector< ESDetId > &vout)
bool goodPi0Strip(RecHitsMap::iterator candidate_it, ESDetId lastID)
float* EndcapPiZeroDiscriminatorAlgo::get_input_vector |
( |
| ) |
|
|
inline |
float EndcapPiZeroDiscriminatorAlgo::GetBarrelNNOutput |
( |
float |
EB_Et | ) |
|
Definition at line 601 of file EndcapPiZeroDiscriminatorAlgo.cc.
References LogTrace.
Referenced by ~EndcapPiZeroDiscriminatorAlgo().
609 LogTrace(
"EcalClusters") <<
"EndcapPiZeroDiscriminatorAlgo::GetBarrelNNoutput :nn_invar_presh = " ;
611 for(
int k1=0;k1<
Indim;k1++) {
619 if(EB_Et<25.0) {sel_wfile = 0;}
620 else if(EB_Et>=25.0 && EB_Et<35.0) {sel_wfile = 1;}
621 else if(EB_Et>=35.0 && EB_Et<45.0) {sel_wfile = 2;}
622 else if(EB_Et>=45.0 && EB_Et<55.0) {sel_wfile = 3;}
623 else {sel_wfile = 4;}
624 LogTrace(
"EcalClusters") <<
"EndcapPiZeroDiscriminatorAlgo: E_SC = " << EB_Et <<
" and I select Weight file Number = " << sel_wfile ;
628 LogTrace(
"EcalClusters") <<
"EndcapPiZeroDiscriminatorAlgo: ===================> GetNNOutput : NNout = " << nnout ;
float getNNoutput(int sel_wfile)
float EndcapPiZeroDiscriminatorAlgo::getNNoutput |
( |
int |
sel_wfile | ) |
|
float EndcapPiZeroDiscriminatorAlgo::GetNNOutput |
( |
float |
EE_Et | ) |
|
Definition at line 561 of file EndcapPiZeroDiscriminatorAlgo.cc.
References LogTrace.
Referenced by ~EndcapPiZeroDiscriminatorAlgo().
568 LogTrace(
"EcalClusters") <<
"EndcapPiZeroDiscriminatorAlgo::GetNNoutput :nn_invar_presh = " ;
570 for(
int k1=0;k1<
Indim;k1++) {
578 if(EE_Et<25.0) {sel_wfile = 0;}
579 else if(EE_Et>=25.0 && EE_Et<35.0) {sel_wfile = 1;}
580 else if(EE_Et>=35.0 && EE_Et<45.0) {sel_wfile = 2;}
581 else if(EE_Et>=45.0 && EE_Et<55.0) {sel_wfile = 3;}
582 else {sel_wfile = 4;}
584 LogTrace(
"EcalClusters") <<
"EndcapPiZeroDiscriminatorAlgo: Et_SC = " << EE_Et <<
" and I select Weight file Number = " << sel_wfile ;
589 LogTrace(
"EcalClusters") <<
"EndcapPiZeroDiscriminatorAlgo: ===================> GetNNOutput : NNout = " << nnout ;
float getNNoutput(int sel_wfile)
bool EndcapPiZeroDiscriminatorAlgo::goodPi0Strip |
( |
RecHitsMap::iterator |
candidate_it, |
|
|
ESDetId |
lastID |
|
) |
| |
Definition at line 142 of file EndcapPiZeroDiscriminatorAlgo.cc.
References LogTrace.
Referenced by ~EndcapPiZeroDiscriminatorAlgo().
144 RecHitsMap::iterator candidate_tmp = candidate_it;
147 if (candidate_tmp->first == lastID )
148 LogTrace(
"EcalClusters") <<
"EndcapPiZeroDiscriminatorAlgo: goodPi0Strip No such a strip in rechits_map " ;
150 LogTrace(
"EcalClusters") <<
"EndcapPiZeroDiscriminatorAlgo: goodPi0Strip Strip energy " << candidate_it->second.energy() <<
" is below threshold " ;
153 if ( (candidate_tmp->first == lastID ) ||
double preshStripEnergyCut_
void EndcapPiZeroDiscriminatorAlgo::readWeightFile |
( |
const char * |
WFile | ) |
|
Definition at line 238 of file EndcapPiZeroDiscriminatorAlgo.cc.
References geometryCSVtoXML::line, LogTrace, and create_public_lumi_plots::weights.
Referenced by ~EndcapPiZeroDiscriminatorAlgo().
244 bool checkinit=
false;
248 weights = fopen(Weights_file,
"r");
249 LogTrace(
"EcalClusters") <<
"EndcapPiZeroDiscriminatorAlgo: I opeded the Weights file = " << Weights_file ;
252 while( !feof(weights) ){
253 fscanf(weights,
"%s", line);
254 if (line[0] ==
'A') {
255 fscanf(weights,
"%d", &
Layers);
256 fscanf(weights,
"%d", &
Indim);
257 fscanf(weights,
"%d", &
Hidden);
258 fscanf(weights,
"%d", &
Outdim);
267 }
else if (line[0] ==
'B') {
270 for (
int j = 0; j<
Hidden; j++){
274 }
else if (line[0] ==
'C'){
279 }
else if (line[0] ==
'D'){
284 }
else if (line[0] ==
'E'){
291 else{
edm::LogError(
"EEPi0Discrim")<<
"EndcapPiZeroDiscriminatorAlgo: Not a Net file of Corrupted Net file " << endl;
int EndcapPiZeroDiscriminatorAlgo::barrelstart |
|
private |
int EndcapPiZeroDiscriminatorAlgo::debugLevel_ |
|
private |
int EndcapPiZeroDiscriminatorAlgo::EB_Hidden |
|
private |
int EndcapPiZeroDiscriminatorAlgo::EB_Indim |
|
private |
int EndcapPiZeroDiscriminatorAlgo::EB_Layers |
|
private |
int EndcapPiZeroDiscriminatorAlgo::EB_Outdim |
|
private |
int EndcapPiZeroDiscriminatorAlgo::EE_Hidden |
|
private |
int EndcapPiZeroDiscriminatorAlgo::EE_Indim |
|
private |
int EndcapPiZeroDiscriminatorAlgo::EE_Layers |
|
private |
int EndcapPiZeroDiscriminatorAlgo::EE_Outdim |
|
private |
float* EndcapPiZeroDiscriminatorAlgo::H_O_Weight |
|
private |
std::vector<float> EndcapPiZeroDiscriminatorAlgo::H_O_Weight_all |
|
private |
float* EndcapPiZeroDiscriminatorAlgo::H_Thresh |
|
private |
std::vector<float> EndcapPiZeroDiscriminatorAlgo::H_Thresh_all |
|
private |
int EndcapPiZeroDiscriminatorAlgo::Hidden |
|
private |
float* EndcapPiZeroDiscriminatorAlgo::I_H_Weight |
|
private |
std::vector<float> EndcapPiZeroDiscriminatorAlgo::I_H_Weight_all |
|
private |
int EndcapPiZeroDiscriminatorAlgo::Indim |
|
private |
int EndcapPiZeroDiscriminatorAlgo::inp_var |
|
private |
float* EndcapPiZeroDiscriminatorAlgo::input_var |
|
private |
int EndcapPiZeroDiscriminatorAlgo::Layers |
|
private |
int EndcapPiZeroDiscriminatorAlgo::Nfiles_EB |
|
private |
int EndcapPiZeroDiscriminatorAlgo::Nfiles_EE |
|
private |
float* EndcapPiZeroDiscriminatorAlgo::O_Thresh |
|
private |
std::vector<float> EndcapPiZeroDiscriminatorAlgo::O_Thresh_all |
|
private |
int EndcapPiZeroDiscriminatorAlgo::Outdim |
|
private |
std::string EndcapPiZeroDiscriminatorAlgo::pathToFiles_ |
|
private |
int EndcapPiZeroDiscriminatorAlgo::preshSeededNstr_ |
|
private |
double EndcapPiZeroDiscriminatorAlgo::preshStripEnergyCut_ |
|
private |
RecHitsMap* EndcapPiZeroDiscriminatorAlgo::rechits_map |
|
private |