58 bool validBarrelSCHandle=
true;
61 if (!scBarrelHandle.isValid()) {
63 <<
"Error! Can't get the scHybridBarrelProducer";
64 validBarrelSCHandle=
false;
69 bool validEndcapSCHandle=
true;
72 if (!scEndcapHandle.isValid()) {
74 <<
"Error! Can't get the scIslandEndcapProducer";
75 validEndcapSCHandle=
false;
96 if (!pixelSeedHandle.isValid()) {
110 outputPhotonCoreCollection,
117 outputPhotonCoreCollection,
121 edm::LogInfo(
"PhotonCoreProducer") <<
" Put in the event " << iSC <<
" Photon Candidates \n";
122 outputPhotonCoreCollection_p->assign(outputPhotonCoreCollection.begin(),outputPhotonCoreCollection.end());
136 reco::ElectronSeedCollection::const_iterator pixelSeedItr;
137 for(
unsigned int lSC=0; lSC < scHandle->size(); lSC++) {
145 if (scRef->energy()/cosh(scRef->eta()) <=
minSCEt_)
continue;
157 for(
unsigned int icp = 0; icp < conversionHandle->size(); icp++) {
159 if ( !cpRef->caloCluster().size())
continue;
160 if (!( scRef.
id() == cpRef->caloCluster()[0].
id() && scRef.
key() == cpRef->caloCluster()[0].
key() ))
continue;
161 if ( !cpRef->isConverted() )
continue;
171 for(
unsigned int icp = 0; icp < pixelSeedHandle->size(); icp++) {
173 if ( ! cpRef->isEcalDriven() )
continue;
174 if (!( scRef.
id() == cpRef->caloCluster().
id() && scRef.
key() == cpRef->caloCluster().
key() ))
continue;
179 outputPhotonCoreCollection.push_back(newCandidate);
192 std::multimap<reco::ConversionRef, double > convMap;
193 for (
unsigned int icp=0; icp< conversionHandle->size(); icp++) {
197 if (!( scRef.
id() == cpRef->caloCluster()[0].
id() && scRef.
key() == cpRef->caloCluster()[0].
key() ))
continue;
198 if ( !cpRef->isConverted() )
continue;
199 double like = cpRef->MVAout();
200 convMap.insert ( std::make_pair(cpRef,like) );
206 std::multimap<reco::ConversionRef, double >::iterator iMap;
210 for (iMap=convMap.begin(); iMap!=convMap.end(); iMap++) {
211 double like = iMap->second;
226 for (iMap=convMap.begin(); iMap!=convMap.end(); iMap++) {
229 const std::vector<edm::RefToBase<reco::Track> >
tracks = convRef->tracks();
230 float px=tracks[0]->innerMomentum().x();
231 float py=tracks[0]->innerMomentum().y();
232 float pz=tracks[0]->innerMomentum().z();
233 float p=
sqrt(px*px+py*py+pz*pz);
234 ep=fabs(1.-convRef->caloCluster()[0]->energy()/
p);
T getParameter(std::string const &) const
virtual void produce(edm::Event &evt, const edm::EventSetup &es)
void addConversion(const reco::ConversionRef &r)
add single ConversionRef to the vector of Refs
bool isNonnull() const
Checks for non-null.
edm::EDGetTokenT< reco::ConversionCollection > conversionProducer_
edm::EDGetTokenT< reco::ElectronSeedCollection > pixelSeedProducer_
void fillPhotonCollection(edm::Event &evt, edm::EventSetup const &es, const edm::Handle< reco::SuperClusterCollection > &scHandle, const edm::Handle< reco::ConversionCollection > &conversionHandle, const edm::Handle< reco::ElectronSeedCollection > &pixelSeeds, reco::PhotonCoreCollection &outputCollection, int &iSC)
bool getByToken(EDGetToken token, Handle< PROD > &result) const
key_type key() const
Accessor for product key.
ProductID id() const
Accessor for product ID.
reco::ConversionRef solveAmbiguity(const edm::Handle< reco::ConversionCollection > &conversionHandle, reco::SuperClusterRef &sc)
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
std::vector< ElectronSeed > ElectronSeedCollection
collection of ElectronSeed objects
PhotonCoreProducer(const edm::ParameterSet &ps)
edm::EDGetTokenT< reco::SuperClusterCollection > scHybridBarrelProducer_
std::vector< PhotonCore > PhotonCoreCollection
collectin of PhotonCore objects
edm::EDGetTokenT< reco::SuperClusterCollection > scIslandEndcapProducer_
std::string PhotonCoreCollection_
void addElectronPixelSeed(const reco::ElectronSeedRef &r)
set electron pixel seed ref