@@ -50,7 +50,6 @@ GEDPhotonCoreProducer::GEDPhotonCoreProducer(const edm::ParameterSet& config) :
50
50
51
51
// Register the product
52
52
produces<reco::PhotonCoreCollection>(GEDPhotonCoreCollection_);
53
- produces<reco::ConversionCollection>(PFConversionCollection_);
54
53
55
54
}
56
55
@@ -68,9 +67,6 @@ void GEDPhotonCoreProducer::produce(edm::Event &theEvent, const edm::EventSetup&
68
67
reco::PhotonCoreCollection outputPhotonCoreCollection;
69
68
std::auto_ptr< reco::PhotonCoreCollection > outputPhotonCoreCollection_p (new reco::PhotonCoreCollection);
70
69
71
- reco::ConversionCollection outputOneLegConversionCollection;
72
- std::auto_ptr<reco::ConversionCollection> SingleLeg_p (new reco::ConversionCollection (outputOneLegConversionCollection));
73
-
74
70
// Get the PF refined cluster collection
75
71
Handle <reco::PFCandidateCollection> pfCandidateHandle;
76
72
theEvent.getByToken (pfEgammaCandidates_,pfCandidateHandle);
@@ -104,6 +100,7 @@ void GEDPhotonCoreProducer::produce(edm::Event &theEvent, const edm::EventSetup&
104
100
reco::SuperClusterRef refinedSC= pfPhoRef->superClusterRef ();
105
101
reco::SuperClusterRef boxSC= pfPhoRef->superClusterPFECALRef ();
106
102
const reco::ConversionRefVector & doubleLegConv = pfPhoRef->conversionRef ();
103
+ const reco::ConversionRefVector & singleLegConv = pfPhoRef->singleLegConversionRef ();
107
104
reco::CaloClusterPtr refinedSCPtr= edm::refToPtr (refinedSC);
108
105
109
106
// std::cout << "newCandidate doubleLegConv="<<doubleLegConv.size()<< std::endl;
@@ -121,6 +118,10 @@ void GEDPhotonCoreProducer::produce(edm::Event &theEvent, const edm::EventSetup&
121
118
for (unsigned int lConv=0 ; lConv < doubleLegConv.size (); lConv++) {
122
119
newCandidate.addConversion (doubleLegConv[lConv]);
123
120
}
121
+
122
+ for (unsigned int lConv=0 ; lConv < singleLegConv.size (); lConv++) {
123
+ newCandidate.addOneLegConversion (singleLegConv[lConv]);
124
+ }
124
125
125
126
// std::cout << "newCandidate pf refined SC energy="<< newCandidate.superCluster()->energy()<<std::endl;
126
127
// std::cout << "newCandidate pf SC energy="<< newCandidate.parentSuperCluster()->energy()<<std::endl;
@@ -135,39 +136,9 @@ void GEDPhotonCoreProducer::produce(edm::Event &theEvent, const edm::EventSetup&
135
136
}
136
137
}
137
138
138
-
139
-
140
- //
141
- createSingleLegConversions (refinedSCPtr, pfPhoRef->singleLegConvTrackRef (), pfPhoRef->singleLegConvMva (), outputOneLegConversionCollection);
142
139
outputPhotonCoreCollection.push_back (newCandidate);
143
140
}
144
141
145
- SingleLeg_p->assign (outputOneLegConversionCollection.begin (),outputOneLegConversionCollection.end ());
146
- const edm::OrphanHandle<reco::ConversionCollection> singleLegConvOrhpHandle = theEvent.put (SingleLeg_p,PFConversionCollection_);
147
-
148
- // std::cout << " GEDPhotonCoreProducer::produce orphanHandle to single legs " << singleLegConvOrhpHandle->size() << std::endl;
149
- // std::cout << " GEDPhotonCoreProducer::produce photon size " << outputPhotonCoreCollection.size() << std::endl;
150
-
151
-
152
-
153
- int ipho=0 ;
154
- for (reco::PhotonCoreCollection::iterator gamIter=outputPhotonCoreCollection.begin (); gamIter != outputPhotonCoreCollection.end (); ++gamIter){
155
-
156
- for ( unsigned int icp = 0 ; icp < singleLegConvOrhpHandle->size (); icp++) {
157
- const reco::ConversionRef cpRef (reco::ConversionRef (singleLegConvOrhpHandle,icp));
158
- if ( !cpRef->caloCluster ().size ()) continue ;
159
- if (!( gamIter->superCluster ().id () == cpRef->caloCluster ()[0 ].id () && gamIter->superCluster ().key () == cpRef->caloCluster ()[0 ].key () )) continue ;
160
- gamIter->addOneLegConversion (cpRef);
161
- }
162
- // debug
163
- // std::cout << "PhotonCoreCollection i="<<ipho<<" pf refined SC energy="<<gamIter->superCluster()->energy()<<std::endl;
164
- // std::cout << "PhotonCoreCollection i="<<ipho<<" pf SC energy="<<gamIter->parentSuperCluster()->energy()<<std::endl;
165
- // std::cout << "PhotonCoreCollection i="<<ipho<<" nconv2leg="<<gamIter->conversions().size()<<" nconv1leg="<<gamIter->conversionsOneLeg().size()<<std::endl;
166
- ipho++;
167
- }
168
-
169
-
170
-
171
142
// put the product in the event
172
143
// edm::LogInfo("GEDPhotonCoreProducer") << " Put in the event " << iSC << " Photon Candidates \n";
173
144
outputPhotonCoreCollection_p->assign (outputPhotonCoreCollection.begin (),outputPhotonCoreCollection.end ());
@@ -177,56 +148,3 @@ void GEDPhotonCoreProducer::produce(edm::Event &theEvent, const edm::EventSetup&
177
148
178
149
179
150
}
180
-
181
-
182
- void GEDPhotonCoreProducer::createSingleLegConversions (reco::CaloClusterPtr sc, const std::vector<reco::TrackRef>& conv, const std::vector<float >& mva, reco::ConversionCollection &oneLegConversions) {
183
- // this method translates the single track into the Conversion Data Format
184
-
185
- math::Error<3 >::type error;
186
- for (unsigned int itk=0 ; itk<conv.size (); itk++){
187
- const reco::Vertex convVtx (conv[itk]->innerPosition (), error);
188
- std::vector<reco::TrackRef> OneLegConvVector;
189
- OneLegConvVector.push_back (conv[itk]);
190
- std::vector< float > OneLegMvaVector;
191
- OneLegMvaVector.push_back (mva[itk]);
192
- std::vector<reco::CaloClusterPtr> dummymatchingBC;
193
- reco::CaloClusterPtrVector scPtrVec;
194
- scPtrVec.push_back (sc);
195
-
196
-
197
- std::vector<math::XYZPointF>trackPositionAtEcalVec;
198
- std::vector<math::XYZPointF>innPointVec;
199
- std::vector<math::XYZVectorF>trackPinVec;
200
- std::vector<math::XYZVectorF>trackPoutVec;
201
- math::XYZPointF trackPositionAtEcal (conv[itk]->outerPosition ().X (), conv[itk]->outerPosition ().Y (), conv[itk]->outerPosition ().Z ());
202
- trackPositionAtEcalVec.push_back (trackPositionAtEcal);
203
-
204
- math::XYZPointF innPoint (conv[itk]->innerPosition ().X (), conv[itk]->innerPosition ().Y (), conv[itk]->innerPosition ().Z ());
205
- innPointVec.push_back (innPoint);
206
-
207
- math::XYZVectorF trackPin (conv[itk]->innerMomentum ().X (), conv[itk]->innerMomentum ().Y (), conv[itk]->innerMomentum ().Z ());
208
- trackPinVec.push_back (trackPin);
209
-
210
- math::XYZVectorF trackPout (conv[itk]->outerMomentum ().X (), conv[itk]->outerMomentum ().Y (), conv[itk]->outerMomentum ().Z ());
211
- trackPoutVec.push_back ( trackPout );
212
-
213
- float DCA = conv[itk]->d0 () ;
214
- reco::Conversion singleLegConvCandidate (scPtrVec,
215
- OneLegConvVector,
216
- trackPositionAtEcalVec,
217
- convVtx,
218
- dummymatchingBC,
219
- DCA,
220
- innPointVec,
221
- trackPinVec,
222
- trackPoutVec,
223
- mva[itk],
224
- reco::Conversion::pflow);
225
- singleLegConvCandidate.setOneLegMVA (OneLegMvaVector);
226
- oneLegConversions.push_back (singleLegConvCandidate);
227
-
228
- }
229
-
230
-
231
-
232
- }
0 commit comments