ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/MitProd/TreeFiller/src/FillerElectrons.cc
Revision: 1.49
Committed: Mon Oct 18 01:34:48 2010 UTC (14 years, 6 months ago) by bendavid
Content type: text/plain
Branch: MAIN
CVS Tags: Mit_016, Mit_015b, Mit_015a, Mit_015
Changes since 1.48: +32 -6 lines
Log Message:
fill corrected expected hits inner, ambiguous gsf tracks

File Contents

# User Rev Content
1 bendavid 1.49 // $Id: FillerElectrons.cc,v 1.48 2010/06/24 13:04:04 peveraer Exp $
2 loizides 1.1
3     #include "MitProd/TreeFiller/interface/FillerElectrons.h"
4     #include "DataFormats/TrackReco/interface/Track.h"
5     #include "DataFormats/GsfTrackReco/interface/GsfTrack.h"
6     #include "DataFormats/TrackReco/interface/TrackFwd.h"
7 sixie 1.11 #include "DataFormats/EgammaCandidates/interface/GsfElectron.h"
8     #include "DataFormats/EgammaCandidates/interface/GsfElectronFwd.h"
9     #include "DataFormats/EgammaReco/interface/ClusterShape.h"
10     #include "DataFormats/EgammaReco/interface/BasicClusterShapeAssociation.h"
11 bendavid 1.18 #include "DataFormats/Common/interface/RefToPtr.h"
12 loizides 1.35 #include "DataFormats/Common/interface/ValueMap.h"
13     #include "AnalysisDataFormats/Egamma/interface/ElectronID.h"
14     #include "AnalysisDataFormats/Egamma/interface/ElectronIDAssociation.h"
15 sixie 1.11 #include "RecoEgamma/EgammaIsolationAlgos/interface/ElectronTkIsolation.h"
16     #include "RecoEgamma/EgammaIsolationAlgos/interface/EgammaEcalIsolation.h"
17 sixie 1.14 #include "RecoEgamma/EgammaIsolationAlgos/interface/EgammaTowerIsolation.h"
18 loizides 1.35 #include "RecoEcal/EgammaCoreTools/interface/EcalClusterLazyTools.h"
19 bendavid 1.43 #include "DataFormats/VertexReco/interface/VertexFwd.h"
20     #include "TrackingTools/TransientTrack/interface/TransientTrackBuilder.h"
21     #include "TrackingTools/TransientTrack/plugins/TransientTrackBuilderESProducer.h"
22 bendavid 1.44 #include "RecoVertex/GaussianSumVertexFit/interface/GsfVertexTrackCompatibilityEstimator.h"
23 bendavid 1.43 #include "TrackingTools/IPTools/interface/IPTools.h"
24     #include "RecoEgamma/EgammaTools/interface/ConversionFinder.h"
25     #include "MagneticField/Records/interface/IdealMagneticFieldRecord.h"
26     #include "MagneticField/Engine/interface/MagneticField.h"
27 loizides 1.35 #include "MitAna/DataTree/interface/ElectronCol.h"
28     #include "MitAna/DataTree/interface/Names.h"
29     #include "MitAna/DataTree/interface/Track.h"
30 loizides 1.33 #include "MitEdm/DataFormats/interface/RefToBaseToPtr.h"
31 loizides 1.35 #include "MitProd/ObjectService/interface/ObjectService.h"
32 bendavid 1.45 #include "MitEdm/DataFormats/interface/DecayPart.h"
33     #include "MitEdm/ConversionRejection/interface/ConversionMatcher.h"
34 sixie 1.13
35 loizides 1.1 using namespace std;
36     using namespace edm;
37     using namespace mithep;
38    
39 loizides 1.5 //--------------------------------------------------------------------------------------------------
40 loizides 1.28 FillerElectrons::FillerElectrons(const edm::ParameterSet &cfg, const char *name, bool active) :
41     BaseFiller(cfg,name,active),
42 loizides 1.1 edmName_(Conf().getUntrackedParameter<string>("edmName","pixelMatchGsfElectrons")),
43 bendavid 1.49 expectedHitsName_(Conf().getUntrackedParameter<string>("expectedHitsName","")),
44 loizides 1.1 mitName_(Conf().getUntrackedParameter<string>("mitName",Names::gkElectronBrn)),
45 loizides 1.10 gsfTrackMapName_(Conf().getUntrackedParameter<string>("gsfTrackMapName","")),
46     trackerTrackMapName_(Conf().getUntrackedParameter<string>("trackerTrackMapName","")),
47 sixie 1.12 barrelSuperClusterMapName_(Conf().getUntrackedParameter<string>("barrelSuperClusterMapName","")),
48     endcapSuperClusterMapName_(Conf().getUntrackedParameter<string>("endcapSuperClusterMapName","")),
49 bendavid 1.36 pfSuperClusterMapName_(Conf().getUntrackedParameter<string>("pfSuperClusterMapName","")),
50 loizides 1.16 eIDCutBasedTightName_(Conf().getUntrackedParameter<string>("eIDCutBasedTightName","eidTight")),
51 bendavid 1.43 eIDCutBasedLooseName_(Conf().getUntrackedParameter<string>("eIDCutBasedLooseName","eidLoose")),
52 bendavid 1.49 eIDLikelihoodName_(Conf().getUntrackedParameter<string>("eIDLikelihoodName","")),
53 bendavid 1.43 pvEdmName_(Conf().getUntrackedParameter<string>("pvEdmName","offlinePrimaryVertices")),
54     pvBSEdmName_(Conf().getUntrackedParameter<string>("pvEdmName","offlinePrimaryVerticesWithBS")),
55 loizides 1.8 electrons_(new mithep::ElectronArr(16)),
56 loizides 1.10 gsfTrackMap_(0),
57 sixie 1.11 trackerTrackMap_(0),
58 sixie 1.12 barrelSuperClusterMap_(0),
59     endcapSuperClusterMap_(0)
60 loizides 1.1 {
61     // Constructor.
62     }
63    
64 loizides 1.5 //--------------------------------------------------------------------------------------------------
65 loizides 1.1 FillerElectrons::~FillerElectrons()
66     {
67     // Destructor.
68 loizides 1.6
69     delete electrons_;
70 loizides 1.1 }
71    
72 loizides 1.5 //--------------------------------------------------------------------------------------------------
73 bendavid 1.42 void FillerElectrons::BookDataBlock(TreeWriter &tws)
74 loizides 1.1 {
75 loizides 1.10 // Add electron branch to our tree and get our maps.
76 loizides 1.1
77 loizides 1.29 tws.AddBranch(mitName_,&electrons_);
78     OS()->add<mithep::ElectronArr>(electrons_,mitName_);
79 loizides 1.10
80 loizides 1.29 if (!gsfTrackMapName_.empty()) {
81     gsfTrackMap_ = OS()->get<TrackMap>(gsfTrackMapName_);
82     if (gsfTrackMap_)
83     AddBranchDep(mitName_,gsfTrackMap_->GetBrName());
84     }
85     if (!trackerTrackMapName_.empty()) {
86     trackerTrackMap_ = OS()->get<TrackMap>(trackerTrackMapName_);
87     if (trackerTrackMap_)
88     AddBranchDep(mitName_,trackerTrackMap_->GetBrName());
89     }
90     if (!barrelSuperClusterMapName_.empty()) {
91     barrelSuperClusterMap_ = OS()->get<SuperClusterMap>(barrelSuperClusterMapName_);
92     if (barrelSuperClusterMap_)
93     AddBranchDep(mitName_,barrelSuperClusterMap_->GetBrName());
94     }
95     if (!endcapSuperClusterMapName_.empty()) {
96     endcapSuperClusterMap_ = OS()->get<SuperClusterMap>(endcapSuperClusterMapName_);
97     if (endcapSuperClusterMap_)
98     AddBranchDep(mitName_,endcapSuperClusterMap_->GetBrName());
99     }
100 bendavid 1.36 if (!pfSuperClusterMapName_.empty()) {
101     pfSuperClusterMap_ = OS()->get<SuperClusterMap>(pfSuperClusterMapName_);
102     if (pfSuperClusterMap_)
103     AddBranchDep(mitName_,pfSuperClusterMap_->GetBrName());
104     }
105 loizides 1.1 }
106    
107 loizides 1.5 //--------------------------------------------------------------------------------------------------
108 loizides 1.29 void FillerElectrons::FillDataBlock(const edm::Event &event, const edm::EventSetup &setup)
109 loizides 1.1 {
110     // Fill electrons from edm collection into our collection.
111    
112 bendavid 1.26 electrons_->Delete();
113 loizides 1.1
114 sixie 1.11 Handle<reco::GsfElectronCollection> hElectronProduct;
115 loizides 1.7 GetProduct(edmName_, hElectronProduct, event);
116 loizides 1.1
117 loizides 1.29 // handles to get the electron ID information
118 peveraer 1.47 Handle<edm::ValueMap<float> > eidLooseMap;
119     GetProduct(eIDCutBasedLooseName_, eidLooseMap, event);
120     Handle<edm::ValueMap<float> > eidTightMap;
121 peveraer 1.48 GetProduct(eIDCutBasedTightName_, eidTightMap, event);
122 bendavid 1.49 edm::Handle<edm::ValueMap<float> > eidLikelihoodMap;
123     if (!eIDLikelihoodName_.empty()) {
124     GetProduct(eIDLikelihoodName_, eidLikelihoodMap, event);
125     }
126    
127 bendavid 1.43 edm::Handle<reco::VertexCollection> hVertex;
128     event.getByLabel(pvEdmName_, hVertex);
129     const reco::VertexCollection *pvCol = hVertex.product();
130    
131     edm::Handle<reco::VertexCollection> hVertexBS;
132     event.getByLabel(pvBSEdmName_, hVertexBS);
133     const reco::VertexCollection *pvBSCol = hVertexBS.product();
134    
135     edm::Handle<reco::TrackCollection> hGeneralTracks;
136     event.getByLabel("generalTracks", hGeneralTracks);
137     //const reco::VertexCollection *trackCol = hGeneralTracks.product();
138 bendavid 1.45
139     edm::Handle<std::vector<mitedm::DecayPart> > hConversions;
140     event.getByLabel("mvfConversionRemoval", hConversions);
141    
142     mitedm::ConversionMatcher convMatcher;
143 bendavid 1.49
144     edm::Handle<edm::ValueMap<int> > vmEl;
145     if(!expectedHitsName_.empty()) {
146     event.getByLabel("expectedHitsEle",vmEl);
147     }
148    
149 bendavid 1.43 edm::ESHandle<TransientTrackBuilder> hTransientTrackBuilder;
150     setup.get<TransientTrackRecord>().get("TransientTrackBuilder",hTransientTrackBuilder);
151     const TransientTrackBuilder *transientTrackBuilder = hTransientTrackBuilder.product();
152 bendavid 1.19
153 bendavid 1.44 GsfVertexTrackCompatibilityEstimator gsfEstimator;
154    
155 bendavid 1.43 //Get Magnetic Field from event setup, taking value at (0,0,0)
156     edm::ESHandle<MagneticField> magneticField;
157     setup.get<IdealMagneticFieldRecord>().get(magneticField);
158     const double bfield = magneticField->inTesla(GlobalPoint(0.,0.,0.)).z();
159    
160 sixie 1.11 const reco::GsfElectronCollection inElectrons = *(hElectronProduct.product());
161 loizides 1.29 // loop over electrons
162 sixie 1.11 for (reco::GsfElectronCollection::const_iterator iM = inElectrons.begin();
163 loizides 1.1 iM != inElectrons.end(); ++iM) {
164 sixie 1.13
165 loizides 1.29 // the index and Ref are needed for the eID association Map
166 sixie 1.13 unsigned int iElectron = iM - inElectrons.begin();
167     reco::GsfElectronRef eRef(hElectronProduct, iElectron);
168    
169 loizides 1.8 mithep::Electron *outElectron = electrons_->AddNew();
170 bendavid 1.31
171     outElectron->SetPtEtaPhi(iM->pt(),iM->eta(),iM->phi());
172 sixie 1.12
173 bendavid 1.40 outElectron->SetCharge(iM->charge());
174     outElectron->SetScPixCharge(iM->scPixCharge());
175    
176 loizides 1.30 outElectron->SetESuperClusterOverP(iM->eSuperClusterOverP());
177     outElectron->SetESeedClusterOverPout(iM->eSeedClusterOverPout());
178     outElectron->SetPIn(iM->trackMomentumAtVtx().R());
179 loizides 1.29 outElectron->SetPOut(iM->trackMomentumOut().R());
180 loizides 1.30 outElectron->SetDeltaEtaSuperClusterTrackAtVtx(iM->deltaEtaSuperClusterTrackAtVtx());
181     outElectron->SetDeltaEtaSeedClusterTrackAtCalo(iM->deltaEtaSeedClusterTrackAtCalo());
182     outElectron->SetDeltaPhiSuperClusterTrackAtVtx(iM->deltaPhiSuperClusterTrackAtVtx());
183     outElectron->SetDeltaPhiSeedClusterTrackAtCalo(iM->deltaPhiSeedClusterTrackAtCalo());
184     outElectron->SetIsEnergyScaleCorrected(iM->isEnergyScaleCorrected());
185     outElectron->SetIsMomentumCorrected(iM->isMomentumCorrected());
186 bendavid 1.36 outElectron->SetNumberOfClusters(iM->basicClustersSize());
187 loizides 1.30 outElectron->SetClassification(iM->classification());
188 bendavid 1.37 outElectron->SetFBrem(iM->fbrem());
189    
190 loizides 1.38 // pflow electron stuff
191 bendavid 1.41 outElectron->SetIsEcalDriven(iM->ecalDrivenSeed());
192     outElectron->SetIsTrackerDriven(iM->trackerDrivenSeed());
193 bendavid 1.37 outElectron->SetMva(iM->mva());
194    
195 loizides 1.29 // shower shape variables
196 bendavid 1.37 outElectron->SetE15(iM->e1x5());
197     outElectron->SetE25Max(iM->e2x5Max());
198     outElectron->SetE55(iM->e5x5());
199     outElectron->SetCovEtaEta(iM->sigmaEtaEta());
200     outElectron->SetCoviEtaiEta(iM->sigmaIetaIeta());
201     outElectron->SetHadronicOverEm(iM->hcalOverEcal());
202     outElectron->SetHcalDepth1OverEcal(iM->hcalDepth1OverEcal());
203     outElectron->SetHcalDepth2OverEcal(iM->hcalDepth2OverEcal());
204 sixie 1.12
205 loizides 1.38 // fill isolation variables for both cone sizes
206 bendavid 1.37 outElectron->SetEcalRecHitIsoDr04(iM->dr04EcalRecHitSumEt());
207     outElectron->SetHcalDepth1TowerSumEtDr04(iM->dr04HcalDepth1TowerSumEt());
208     outElectron->SetHcalDepth2TowerSumEtDr04(iM->dr04HcalDepth2TowerSumEt());
209     outElectron->SetTrackIsolationDr04(iM->dr04TkSumPt());
210     outElectron->SetEcalRecHitIsoDr03(iM->dr03EcalRecHitSumEt());
211     outElectron->SetHcalTowerSumEtDr03(iM->dr03HcalTowerSumEt());
212     outElectron->SetHcalDepth1TowerSumEtDr03(iM->dr03HcalDepth1TowerSumEt());
213     outElectron->SetHcalDepth2TowerSumEtDr03(iM->dr03HcalDepth2TowerSumEt());
214     outElectron->SetTrackIsolationDr03(iM->dr03TkSumPt());
215    
216 loizides 1.38 // fiducial flags
217 bendavid 1.37 outElectron->SetIsEB(iM->isEB());
218     outElectron->SetIsEE(iM->isEE());
219     outElectron->SetIsEBEEGap(iM->isEBEEGap());
220     outElectron->SetIsEBEtaGap(iM->isEBEtaGap());
221     outElectron->SetIsEBPhiGap(iM->isEBPhiGap());
222     outElectron->SetIsEEDeeGap(iM->isEEDeeGap());
223     outElectron->SetIsEERingGap(iM->isEERingGap());
224 sixie 1.12
225 loizides 1.38 // gsf-tracker match quality
226 bendavid 1.37 outElectron->SetFracSharedHits(iM->shFracInnerHits());
227 sixie 1.15
228 loizides 1.29 // make proper links to Tracks and Super Clusters
229 bendavid 1.49 if (gsfTrackMap_ && iM->gsfTrack().isNonnull()) {
230 bendavid 1.18 outElectron->SetGsfTrk(gsfTrackMap_->GetMit(refToPtr(iM->gsfTrack())));
231 bendavid 1.49 }
232     // make links to ambigous gsf tracks
233     if (gsfTrackMap_) {
234     for (reco::GsfTrackRefVector::const_iterator agsfi = iM->ambiguousGsfTracksBegin(); agsfi != iM->ambiguousGsfTracksEnd(); ++agsfi) {
235     outElectron->AddAmbiguousGsfTrack(gsfTrackMap_->GetMit(refToPtr(*agsfi)));
236     }
237     }
238    
239     // make tracker track links,
240 bendavid 1.37 if (trackerTrackMap_ && iM->closestCtfTrackRef().isNonnull()) {
241 bendavid 1.36 outElectron->SetTrackerTrk(trackerTrackMap_->GetMit(refToPtr(iM->closestCtfTrackRef())));
242 bendavid 1.19 }
243 loizides 1.38 if (barrelSuperClusterMap_ && endcapSuperClusterMap_ &&
244     pfSuperClusterMap_ && iM->superCluster().isNonnull()) {
245 bendavid 1.37 if(barrelSuperClusterMap_->HasMit(iM->superCluster())) {
246 sixie 1.12 outElectron->SetSuperCluster(barrelSuperClusterMap_->GetMit(iM->superCluster()));
247 bendavid 1.36 }
248     else if (endcapSuperClusterMap_->HasMit(iM->superCluster())) {
249 sixie 1.12 outElectron->SetSuperCluster(endcapSuperClusterMap_->GetMit(iM->superCluster()));
250     }
251 bendavid 1.36 else if (pfSuperClusterMap_->HasMit(iM->superCluster())) {
252     outElectron->SetSuperCluster(pfSuperClusterMap_->GetMit(iM->superCluster()));
253     }
254     else throw edm::Exception(edm::errors::Configuration, "FillerElectrons:FillDataBlock()\n")
255     << "Error! SuperCluster reference in unmapped collection " << edmName_ << endl;
256     }
257 sixie 1.13
258 bendavid 1.43 //compute impact parameter with respect to PV
259     if (iM->gsfTrack().isNonnull()) {
260     const reco::TransientTrack &tt = transientTrackBuilder->build(iM->gsfTrack());
261    
262     const std::pair<bool,Measurement1D> &d0pv = IPTools::absoluteTransverseImpactParameter(tt,pvCol->at(0));
263     if (d0pv.first) {
264     outElectron->SetD0PV(d0pv.second.value());
265     outElectron->SetD0PVErr(d0pv.second.error());
266     }
267 bendavid 1.44 else {
268     outElectron->SetD0PV(-99.0);
269     }
270    
271 bendavid 1.43
272     const std::pair<bool,Measurement1D> &ip3dpv = IPTools::absoluteImpactParameter3D(tt,pvCol->at(0));
273     if (ip3dpv.first) {
274     outElectron->SetIp3dPV(ip3dpv.second.value());
275     outElectron->SetIp3dPVErr(ip3dpv.second.error());
276     }
277 bendavid 1.44 else {
278     outElectron->SetIp3dPV(-99.0);
279     }
280 bendavid 1.43
281     const std::pair<bool,Measurement1D> &d0pvbs = IPTools::absoluteTransverseImpactParameter(tt,pvBSCol->at(0));
282     if (d0pvbs.first) {
283     outElectron->SetD0PVBS(d0pvbs.second.value());
284     outElectron->SetD0PVBSErr(d0pvbs.second.error());
285     }
286 bendavid 1.44 else {
287     outElectron->SetD0PVBS(-99.0);
288     }
289 bendavid 1.43
290     const std::pair<bool,Measurement1D> &ip3dpvbs = IPTools::absoluteImpactParameter3D(tt,pvBSCol->at(0));
291     if (ip3dpvbs.first) {
292     outElectron->SetIp3dPVBS(ip3dpvbs.second.value());
293     outElectron->SetIp3dPVBSErr(ip3dpvbs.second.error());
294     }
295 bendavid 1.44 else {
296     outElectron->SetIp3dPVBS(-99.0);
297     }
298    
299     //compute compatibility with PV using full GSF state mixture (but skip in AOD)
300     if (iM->gsfTrack()->gsfExtra().isAvailable()) {
301    
302     const std::pair<bool,double> &pvGsfCompat = gsfEstimator.estimate(pvCol->at(0),tt);
303     if (pvGsfCompat.first) {
304     outElectron->SetGsfPVCompatibility(pvGsfCompat.second);
305     }
306     else {
307     outElectron->SetGsfPVCompatibility(-99.0);
308     }
309    
310    
311     const std::pair<bool,double> &pvbsGsfCompat = gsfEstimator.estimate(pvBSCol->at(0),tt);
312     if (pvbsGsfCompat.first) {
313     outElectron->SetGsfPVBSCompatibility(pvbsGsfCompat.second);
314     }
315     else {
316     outElectron->SetGsfPVBSCompatibility(-99.0);
317     }
318    
319     //compute signal vertex compatibility with full GSF state mixture excluding matching ckf track
320     //from vertex
321     if (iM->closestCtfTrackRef().isNonnull() && iM->closestCtfTrackRef()->extra().isAvailable()) {
322     const reco::TransientTrack &ttCkf = transientTrackBuilder->build(iM->closestCtfTrackRef());
323    
324     const std::pair<bool,double> &pvGsfCompatMatched = gsfEstimator.estimate(pvCol->at(0),tt, ttCkf);
325     if (pvGsfCompatMatched.first) {
326     outElectron->SetGsfPVCompatibilityMatched(pvGsfCompatMatched.second);
327     }
328     else {
329     outElectron->SetGsfPVCompatibilityMatched(-99.0);
330     }
331    
332    
333     const std::pair<bool,double> &pvbsGsfCompatMatched = gsfEstimator.estimate(pvBSCol->at(0),tt, ttCkf);
334     if (pvbsGsfCompatMatched.first) {
335     outElectron->SetGsfPVBSCompatibilityMatched(pvbsGsfCompatMatched.second);
336     }
337     else {
338     outElectron->SetGsfPVBSCompatibilityMatched(-99.0);
339     }
340    
341     if (verbose_>1) {
342     printf("gsf compat = %5f\n", pvGsfCompat.second);
343     printf("gsf compat matched = %5f\n", pvGsfCompatMatched.second);
344     }
345     }
346     else {
347     //no matching ckf track, so copy existing values
348     if (pvGsfCompat.first) {
349     outElectron->SetGsfPVCompatibilityMatched(pvGsfCompat.second);
350     }
351     else {
352     outElectron->SetGsfPVCompatibilityMatched(-99.0);
353     }
354    
355     if (pvbsGsfCompat.first) {
356     outElectron->SetGsfPVBSCompatibilityMatched(pvbsGsfCompat.second);
357     }
358     else {
359     outElectron->SetGsfPVBSCompatibilityMatched(-99.0);
360     }
361     }
362    
363     }
364 bendavid 1.43
365     if (verbose_>1) {
366     printf("gsf track pt = %5f\n",iM->gsfTrack()->pt());
367     printf("gsf track mode pt = %5f\n",iM->gsfTrack()->ptMode());
368     printf("ttrack pt = %5f\n",tt.initialFreeState().momentum().perp());
369     //printf("ttrackgsf pt = %5f\n",ttgsf.innermostMeasurementState().globalMomentum().perp());
370 bendavid 1.44 printf("ip3dpv reduced chisquared = %5f, probability = %5f\n", ip3dpv.second.value()/ip3dpv.second.error(), TMath::Prob(ip3dpv.second.value()/ip3dpv.second.error(),1));
371     //printf("gsf reduced chisquared = %5f, probability = %5f\n", pvGsfCompat.second/2, TMath::Prob(pvGsfCompat.second,2));
372 bendavid 1.43 }
373    
374     }
375    
376     //fill conversion partner track info
377     ConversionFinder convFinder;
378     ConversionInfo convInfo = convFinder.getConversionInfo(*iM, hGeneralTracks, bfield);
379     outElectron->SetConvPartnerDCotTheta(convInfo.dcot());
380     outElectron->SetConvPartnerDist(convInfo.dist());
381     outElectron->SetConvPartnerRadius(convInfo.radiusOfConversion());
382 bendavid 1.45 outElectron->SetConversionXYZ(convInfo.pointOfConversion().x(),convInfo.pointOfConversion().y(),convInfo.pointOfConversion().z());
383     reco::TrackRef convTrackRef = convInfo.conversionPartnerTk();
384     if (trackerTrackMap_ && convTrackRef.isNonnull()) {
385     outElectron->SetConvPartnerTrk(trackerTrackMap_->GetMit(refToPtr(convTrackRef)));
386     }
387 bendavid 1.43
388 loizides 1.29 // fill Electron ID information
389 peveraer 1.47 outElectron->SetPassLooseID((*eidLooseMap)[eRef]);
390     outElectron->SetPassTightID((*eidTightMap)[eRef]);
391 bendavid 1.49 if (!eIDLikelihoodName_.empty()) {
392     outElectron->SetIDLikelihood((*eidLikelihoodMap)[eRef]);
393     }
394    
395     // fill corrected expected inner hits
396     if(!expectedHitsName_.empty()) {
397     outElectron->SetCorrectedNExpectedHitsInner((*vmEl)[eRef]);
398     }
399 bendavid 1.31
400 bendavid 1.45 //fill additional conversion flag
401     outElectron->SetMatchesVertexConversion(convMatcher.matchesGoodConversion(*iM,hConversions));
402    
403 bendavid 1.31 if (verbose_>1) {
404     double recomass = sqrt(iM->energy()*iM->energy() - iM->p()*iM->p());
405 loizides 1.32 printf(" mithep::Electron, pt=%5f, eta=%5f, phi=%5f, energy=%5f, p=%5f, mass=%5f\n",
406     outElectron->Pt(), outElectron->Eta(), outElectron->Phi(),
407     outElectron->E(), outElectron->P(), outElectron->Mass());
408     printf("reco::GsfElectron , pt=%5f, eta=%5f, phi=%5f, energy=%5f, p=%5f, mass=%5f\n",
409     iM->pt(), iM->eta(), iM->phi(), iM->energy(), iM->p(), recomass);
410 bendavid 1.31 }
411 sixie 1.12 }
412 loizides 1.1 electrons_->Trim();
413     }