167 const float etaPhiDistance=0.01;
178 LogInfo(
"ConvertedPhotonAnalyzer") <<
"ConvertedPhotonAnalyzer Analyzing event number: " << e.
id() <<
" Global Counter " <<
nEvt_ <<
"\n";
180 std::cout <<
"ConvertedPhotonAnalyzer Analyzing event number: " << e.
id() <<
" Global Counter " <<
nEvt_ <<
"\n";
187 std::cout <<
"ConvertedPhotonAnalyzer Photons with conversions collection size " << photonCollection.size() <<
"\n";
191 std::cout <<
" ConvertedPhotonAnalyzer Looking for MC truth " <<
"\n";
194 std::vector<SimTrack> theSimTracks;
195 std::vector<SimVertex> theSimVertices;
202 theSimTracks.insert(theSimTracks.end(),SimTk->begin(),SimTk->end());
203 theSimVertices.insert(theSimVertices.end(),SimVtx->begin(),SimVtx->end());
206 std::cout <<
" ConvertedPhotonAnalyzer mcPhotons size " << mcPhotons.size() << std::endl;
215 for ( std::vector<PhotonMCTruth>::const_iterator mcPho=mcPhotons.begin(); mcPho !=mcPhotons.end(); mcPho++) {
216 float mcPhi= (*mcPho).fourMomentum().phi();
217 float mcEta= (*mcPho).fourMomentum().pseudoRapidity();
220 if ( (*mcPho).fourMomentum().et() < 20 )
continue;
227 h_MCphoE_->Fill( (*mcPho).fourMomentum().e());
234 if ( (*mcPho).isAConversion() == 0 )
continue;
239 h_MCConvEta_ ->Fill ( fabs( (*mcPho).fourMomentum().pseudoRapidity()) - 0.001);
247 for( reco::PhotonCollection::const_iterator iPho = photonCollection.begin(); iPho != photonCollection.end(); iPho++) {
252 float phiClu=(*iPho).superCluster()->phi();
253 float etaClu=(*iPho).superCluster()->eta();
255 float deltaEta = etaClu-mcEta;
260 deltaPhi=
pow(deltaPhi,2);
261 deltaEta=
pow(deltaEta,2);
262 float delta = deltaPhi+deltaEta ;
263 if ( delta >= etaPhiDistance ) REJECTED=
true;
268 if ( REJECTED )
continue;
278 h_ErecoEMC_->Fill( (*iPho).superCluster()->energy()/(*mcPho).fourMomentum().e());
282 h_scE_->Fill( (*iPho).superCluster()->energy() );
283 h_scEt_->Fill( (*iPho).superCluster()->energy()/cosh( (*iPho).superCluster()->position().eta()) );
284 h_scEta_->Fill( (*iPho).superCluster()->position().eta() );
285 h_scPhi_->Fill( (*iPho).superCluster()->position().phi() );
288 h_phoE_->Fill( (*iPho).energy() );
292 if ( !(*iPho).hasConversionTracks() )
continue;
298 for (
unsigned int i=0;
i<conversions.
size();
i++) {
300 std::vector< edm::RefToBase<reco::Track> >
tracks = conversions[
i]->tracks();
302 for (
unsigned int i=0;
i<tracks.size();
i++) {
308 h2_tk_inPtVsR_->Fill ( (*mcPho).vertex().perp(),
sqrt( tracks[
i]->innerMomentum().Mag2() ) );
std::string photonCollectionProducer_
double deltaPhi(float phi1, float phi2)
PhotonMCTruthFinder * thePhotonMCTruthFinder_
std::string photonCollection_
void Fill(HcalDetId &id, double val, std::vector< TH2F > &depth)
float etaTransformation(float a, float b)
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
std::vector< PhotonMCTruth > find(std::vector< SimTrack > simTracks, std::vector< SimVertex > simVertices)
std::vector< Photon > PhotonCollection
collectin of Photon objects
size_type size() const
Size of the RefVector.
Power< A, B >::type pow(const A &a, const B &b)