164 ElectronCollection::const_iterator
electron ;
165 ElectronCollection::iterator ele ;
170 ele!=oldElectrons->end();
189 int run =
event.run();
191 float r9 = ele->r9();
192 double correctedEcalEnergy = ele->correctedEcalEnergy();
193 double correctedEcalEnergyError = ele->correctedEcalEnergyError();
195 double trackMomentumError = ele->trackMomentumError();
196 double combinedMomentum = ele->p();
197 double combinedMomentumError = 0;
198 if ( ele->candidateP4Kind() != GsfElectron::P4_UNKNOWN )
200 combinedMomentumError = ele->p4Error(ele->candidateP4Kind());
205 if( !ele->ecalDrivenSeed() )
207 double error = 999. ;
208 double momentum = (combinedMomentum<15. ? 15. : combinedMomentum);
211 float parEB[3] = { 5.24e-02, 2.01e-01, 1.00e-02} ;
212 error = momentum *
sqrt(
pow(parEB[0]/
sqrt(momentum),2) +
pow(parEB[1]/momentum,2) +
pow(parEB[2],2) );
214 else if ( ele->isEE() )
216 float parEE[3] = { 1.46e-01, 9.21e-01, 1.94e-03} ;
217 error = momentum *
sqrt(
pow(parEE[0]/
sqrt(momentum),2) +
pow(parEE[1]/momentum,2) +
pow(parEE[2],2) );
219 combinedMomentumError =
error;
234 correctedEcalEnergyError,
237 ele->ecalRegressionEnergy(),
238 ele->ecalRegressionError(),
240 combinedMomentumError,
241 ele->superCluster()->eta(),
245 ele->trackerDrivenSeed()
260 std::cout <<
"[CalibratedPATElectronProducer] "
261 <<
"You choose not to combine." << std::endl;
267 std::cout <<
"[CalibratedPATElectronProducer] "
268 <<
"You choose corrected regression energy for standard combination" << std::endl;
276 std::cout <<
"[CalibratedPATElectronProducer] "
277 <<
"You choose uncorrected regression energy for standard combination" << std::endl;
285 std::cout <<
"[CalibratedPATElectronProducer] "
286 <<
"You choose regression combination." << std::endl;
293 <<
"Unknown combination Type !!!" ;
299 ( oldMomentum.x()*mySimpleElectron.getCombinedMomentum()/oldMomentum.t(),
300 oldMomentum.y()*mySimpleElectron.getCombinedMomentum()/oldMomentum.t(),
301 oldMomentum.z()*mySimpleElectron.getCombinedMomentum()/oldMomentum.t(),
302 mySimpleElectron.getCombinedMomentum() ) ;
307 mySimpleElectron.getTrackerMomentumError(),
308 mySimpleElectron.getCombinedMomentumError()
313 std::cout <<
"[CalibratedPATElectronProducer] Combined momentum after saving "
314 << ele->p4().t() << std::endl;
322 std::cout <<
"[CalibratedPATElectronProducer] "
323 <<
"You choose not to correct. Uncorrected Regression Energy is taken." << std::endl;
edm::EDGetTokenT< edm::View< reco::Candidate > > inputPatElectronsToken
void calibrate(SimpleElectron &electron, edm::StreamID const &)
XYZTLorentzVectorD XYZTLorentzVector
Lorentz vector with cylindrical internal representation using pseudorapidity.
std::vector< Electron > ElectronCollection
collectin of Electron objects
void correctLinearity(SimpleElectron &electron)
EpCombinationTool * myEpCombinationTool
ElectronEPcombinator * myCombinator
void setCombinationMode(int mode)
Analysis-level electron class.
TEveGeoShape * clone(const TEveElement *element, TEveElement *parent)
boost::indirect_iterator< typename seq_t::const_iterator > const_iterator
StreamID streamID() const
void combine(SimpleElectron &electron)
const_iterator begin() const
first daughter const_iterator
ElectronEnergyCalibrator * theEnCorrector
Power< A, B >::type pow(const A &a, const B &b)