Skip to content

Commit

Permalink
closer to saving the mva inputs and outputs
Browse files Browse the repository at this point in the history
  • Loading branch information
beaudett authored and lgray committed Nov 15, 2013
1 parent 301fd22 commit 1714bd0
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 0 deletions.
3 changes: 3 additions & 0 deletions RecoEgamma/EgammaElectronAlgos/interface/GsfElectronAlgo.h
Expand Up @@ -210,6 +210,8 @@ class GsfElectronAlgo {
void removeNotPreselectedElectrons() ;
void removeAmbiguousElectrons() ;
void copyElectrons( reco::GsfElectronCollection & ) ;
void setMVAInputs(const std::map<reco::GsfTrackRef,reco::GsfElectron::MvaInput> & mvaInputs) ;
void setMVAOutputs(const std::map<reco::GsfTrackRef,reco::GsfElectron::MvaOutput> & mvaOutputs) ;
void endEvent() ;

private :
Expand All @@ -231,6 +233,7 @@ class GsfElectronAlgo {
bool isPreselected( reco::GsfElectron * ele ) ;
void calculateShowerShape( const reco::SuperClusterRef &, bool pflow, reco::GsfElectron::ShowerShape & ) ;


// associations
const reco::SuperClusterRef getTrSuperCluster( const reco::GsfTrackRef & trackRef ) ;
} ;
Expand Down
26 changes: 26 additions & 0 deletions RecoEgamma/EgammaElectronAlgos/src/GsfElectronAlgo.cc
Expand Up @@ -1115,6 +1115,32 @@ void GsfElectronAlgo::setPflowPreselectionFlag( GsfElectron * ele )
// { LogTrace("GsfElectronAlgo") << "Mva criteria are satisfied" ; }
}

void GsfElectronAlgo::setMVAInputs(const std::map<reco::GsfTrackRef,reco::GsfElectron::MvaInput> & mvaInputs)
{
GsfElectronPtrCollection::iterator el ;
for
( el = eventData_->electrons->begin() ;
el != eventData_->electrons->end() ;
el++ )
{
std::map<reco::GsfTrackRef,reco::GsfElectron::MvaInput>::const_iterator itcheck=mvaInputs.find((*el)->gsfTrack());
(*el)->setMvaInput(itcheck->second);
}
}

void GsfElectronAlgo::setMVAOutputs(const std::map<reco::GsfTrackRef,reco::GsfElectron::MvaOutput> & mvaOutputs)
{
GsfElectronPtrCollection::iterator el ;
for
( el = eventData_->electrons->begin() ;
el != eventData_->electrons->end() ;
el++ )
{
std::map<reco::GsfTrackRef,reco::GsfElectron::MvaOutput>::const_iterator itcheck=mvaOutputs.find((*el)->gsfTrack());
(*el)->setMvaOutput(itcheck->second);
}
}

void GsfElectronAlgo::createElectron()
{
// eventually check ctf track
Expand Down
Expand Up @@ -46,6 +46,8 @@ void GEDGsfElectronProducer::produce( edm::Event & event, const edm::EventSetup
beginEvent(event,setup) ;
matchWithPFCandidates(event);
algo_->completeElectrons() ;
algo_->setMVAOutputs(gsfMVAOutputMap_);
algo_->setMVAInputs(gsfMVAInputMap_);
fillEvent(event) ;

// ValueMap
Expand Down

0 comments on commit 1714bd0

Please sign in to comment.