94 cout <<
"\n PiZeroDiscriminatorProducer: ....... Event " << evt.
id() <<
" with Number = " <<
nEvt_+1
95 <<
" is analyzing ....... " << endl << endl;
102 cout <<
"\n PiZeroDiscriminatorProducer: pPreshowerShapeClustersX->size() = " << clustersX->size() << endl;
109 cout <<
"\n PiZeroDiscriminatorProducer: pPreshowerShapeClustersY->size() = " << clustersY->size() << endl;
130 int Photon_index = 0;
135 cout <<
" PiZeroDiscriminatorProducer: Photon Collection size : " << corrPhoCollection.size() << endl;
138 for( PhotonCollection::const_iterator iPho = corrPhoCollection.begin(); iPho != corrPhoCollection.end(); iPho++) {
140 float Phot_En = iPho->energy();
141 float Phot_Et = Phot_En*
sin(2*atan(
exp(-iPho->eta())));
142 float Phot_eta = iPho->eta();
143 float Phot_phi = iPho->phi();
144 float Phot_R9 = iPho->r9();
147 cout <<
" PiZeroDiscriminatorProducer: Photon index : " << Photon_index
148 <<
" with Energy = " << Phot_En
149 <<
" Et = " << Phot_Et
150 <<
" ETA = " << Phot_eta
151 <<
" PHI = " << Phot_phi
152 <<
" R9 = " << Phot_R9 << endl;
156 float SC_En = it_super->energy();
157 float SC_Et = SC_En*
sin(2*atan(
exp(-it_super->eta())));
158 float SC_eta = it_super->eta();
159 float SC_phi = it_super->phi();
162 cout <<
" PiZeroDiscriminatorProducer: superE = " << SC_En
163 <<
" superEt = " << SC_Et
164 <<
" superETA = " << SC_eta
165 <<
" superPHI = " << SC_phi << endl;
175 float nnoutput = -1.;
176 if(fabs(SC_eta) >= 1.65 && fabs(SC_eta) <= 2.5) {
177 const GlobalPoint pointSC(it_super->x(),it_super->y(),it_super->z());
179 double SC_seed_energy = it_super->seed()->energy();
190 cout <<
"PiZeroDiscriminatorProducer: ( SeedBC_energy, E1, E3x3, E5x5) = "
191 << SC_seed_energy <<
" "
192 << SC_seed_Shape_E1 <<
" "
193 << SC_seed_Shape_E3x3 <<
" "
194 << SC_seed_Shape_E5x5 << endl;
198 vector<float> vout_stripE1;
199 vector<float> vout_stripE2;
200 for(reco::PreshowerClusterShapeCollection::const_iterator esClus = clustersX->begin();
201 esClus !=clustersX->end(); esClus++) {
203 float dR =
sqrt((SC_eta-sc_ref->eta())*(SC_eta-sc_ref->eta()) +
204 (SC_phi-sc_ref->phi())*(SC_phi-sc_ref->phi()));
207 vout_stripE1 = esClus->getStripEnergies();
211 for(reco::PreshowerClusterShapeCollection::const_iterator esClus = clustersY->begin();
212 esClus !=clustersY->end(); esClus++) {
214 float dR =
sqrt((SC_eta-sc_ref->eta())*(SC_eta-sc_ref->eta()) +
215 (SC_phi-sc_ref->phi())*(SC_phi-sc_ref->phi()));
218 vout_stripE2 = esClus->getStripEnergies();
223 if(vout_stripE1.size() == 0 || vout_stripE2.size() == 0 ) {
224 cout <<
" PiZeroDiscriminatorProducer: Attention!!!!! Not Valid ES NN input Variables Return NNout = -1" << endl;
230 cout <<
"PiZeroDiscriminatorProducer : vout_stripE1.size = " << vout_stripE1.size()
231 <<
" vout_stripE2.size = " << vout_stripE2.size() << endl;
232 cout <<
"PiZeroDiscriminatorProducer : ES_input_vector = " ;
233 for(
int k1=0;k1<11;k1++) {
234 cout << vout_stripE1[k1] <<
" " ;
236 for(
int k1=0;k1<11;k1++) {
237 cout << vout_stripE2[k1] <<
" " ;
243 SC_seed_Shape_E1, SC_seed_Shape_E3x3, SC_seed_Shape_E5x5,
EScorr_);
246 cout <<
" PiZeroDiscriminatorProducer: Attention!!!!! Not Valid ES NN input Variables Return NNout = -1" << endl;
254 cout <<
" PiZeroDiscriminatorProducer: NN_ESEndcap_input_vector+Et+Eta+Phi+R9 = " ;
255 for(
int k1=0;k1<25;k1++) {
256 cout << nn_input_var[k1] <<
" " ;
258 cout << SC_Et <<
" " << SC_eta <<
" " << SC_phi <<
" " << Phot_R9 << endl;
264 cout <<
" PiZeroDiscriminatorProducer: Event : " << evt.
id()
265 <<
" SC id = " << Photon_index
266 <<
" with Pt = " << SC_Et
267 <<
" eta = " << SC_eta
268 <<
" phi = " << SC_phi
269 <<
" contains: " << it_super->clustersSize() <<
" BCs "
270 <<
" has NNout = " << nnoutput << endl;
275 }
else if((fabs(SC_eta) <= 1.4442) || (fabs(SC_eta) < 1.65 && fabs(SC_eta) >= 1.566) || fabs(SC_eta) >= 2.5) {
286 double SC_seed_Shape_cEE = vCov[0];
287 double SC_seed_Shape_cEP = vCov[1];
288 double SC_seed_Shape_cPP = vCov[2];
293 double SC_seed_Shape_E3x2r = 0.0;
299 double DA = SC_seed_Shape_E2x2 - SC_seed_Shape_E2 - SC_seed_Shape_E1;
301 if(SC_seed_Shape_E2==SC_seed_Shape_ETop || SC_seed_Shape_E2==SC_seed_Shape_EBottom) {
302 if( SC_seed_Shape_ELeft > SC_seed_Shape_ERight ) {
303 SC_seed_Shape_E3x2r = (DA - SC_seed_Shape_ELeft)/(0.25+SC_seed_Shape_ELeft);
305 SC_seed_Shape_E3x2r = (DA - SC_seed_Shape_ERight)/(0.25+SC_seed_Shape_ERight);
308 }
else if(SC_seed_Shape_E2==SC_seed_Shape_ELeft || SC_seed_Shape_E2==SC_seed_Shape_ERight) {
310 if( SC_seed_Shape_ETop > SC_seed_Shape_EBottom ) {
311 SC_seed_Shape_E3x2r = (DA - SC_seed_Shape_ETop)/(0.25+SC_seed_Shape_ETop);
313 SC_seed_Shape_E3x2r = (DA - SC_seed_Shape_EBottom)/(0.25+SC_seed_Shape_EBottom);
323 cout <<
"PiZeroDiscriminatorProduce: lazyTool (E1,E3x3,E5x5,E2,cEE,cEP,cPP,E2x2,E3x2_E3x2r,Xcog,Ycog,E2x5Bottom,E2x5Top,Et,Eta,PhiR9) = ( "
324 << SC_seed_Shape_E1 <<
" "
325 << SC_seed_Shape_E3x3 <<
" "
326 << SC_seed_Shape_E5x5 <<
" "
327 << SC_seed_Shape_E2 <<
" "
328 << SC_seed_Shape_cEE <<
" "
329 << SC_seed_Shape_cEP <<
" "
330 << SC_seed_Shape_cPP <<
" "
331 << SC_seed_Shape_E2x2 <<
" "
332 << SC_seed_Shape_E3x2 <<
" "
333 << SC_seed_Shape_E3x2r <<
" "
334 << SC_seed_Shape_xcog <<
" "
335 << SC_seed_Shape_ycog <<
" "
341 << Phot_R9 <<
" )" << endl;
344 float SC_et = it_super->energy()*
sin(2*atan(
exp(-it_super->eta())));
347 SC_seed_Shape_E5x5, SC_seed_Shape_E2,
348 SC_seed_Shape_cEE, SC_seed_Shape_cEP,
349 SC_seed_Shape_cPP, SC_seed_Shape_E2x2,
350 SC_seed_Shape_E3x2, SC_seed_Shape_E3x2r,
351 SC_seed_Shape_xcog, SC_seed_Shape_ycog);
356 cout <<
" PiZeroDiscriminatorProducer : NN_barrel_nonESEndcap_variables+Et+Eta+Phi+R9 = " ;
357 for(
int k3=0;k3<12;k3++) {
358 cout << nn_input_var[k3] <<
" " ;
360 cout << SC_Et <<
" " << SC_eta <<
" " << SC_phi <<
" " << Phot_R9 << endl;
368 cout <<
"PiZeroDiscriminatorProducer : Event : " << evt.
id()
369 <<
" SC id = " << Photon_index
370 <<
" with Pt = " << SC_Et
371 <<
" eta = " << SC_eta
372 <<
" phi = " << SC_phi
373 <<
" contains: " << it_super->clustersSize() <<
" BCs "
374 <<
" has NNout = " << nnoutput
388 LogDebug(
"PiZeroDiscriminatorDebug") << ostr.str();
edm::InputTag barrelRecHitCollection_
float * get_input_vector()
float GetNNOutput(float EE_Et)
std::string preshClusterShapeProducer_
Sin< T >::type sin(const T &t)
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)
Exp< T >::type exp(const T &t)
EndcapPiZeroDiscriminatorAlgo::DebugLevel_pi0 debugL_pi0
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
std::vector< PreshowerClusterShape > PreshowerClusterShapeCollection
collection of PreshowerClusterShape objects
std::string preshClusterShapeCollectionY_
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
float GetBarrelNNOutput(float EB_Et)
std::string PhotonPi0DiscriminatorAssociationMap_
T const * product() const
std::vector< Photon > PhotonCollection
collectin of Photon objects
T const * product() const
ESHandle< TrackerGeometry > geometry
std::string photonCorrCollectionProducer_
bool calculateNNInputVariables(std::vector< float > &vph1, std::vector< float > &vph2, float pS1_max, float pS9_max, float pS25_max, int EScorr)
std::string correctedPhotonCollection_
EndcapPiZeroDiscriminatorAlgo * presh_pi0_algo
edm::InputTag endcapRecHitCollection_
std::string preshClusterShapeCollectionX_