Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:15:32

0001 /**
0002    \file
0003    Declaration of OniaPhotonConversionProducer
0004 
0005    \author Stefano Argiro
0006    \modifier Alberto Sanchez
0007 */
0008 
0009 #ifndef __OniaPhotonConversionProducer_h_
0010 #define __OniaPhotonConversionProducer_h_
0011 
0012 #include "FWCore/Framework/interface/stream/EDProducer.h"
0013 #include "FWCore/Framework/interface/Frameworkfwd.h"
0014 #include "FWCore/Framework/interface/Event.h"
0015 #include "FWCore/Framework/interface/ConsumesCollector.h"
0016 #include "FWCore/Utilities/interface/InputTag.h"
0017 
0018 #include "FWCore/Framework/interface/MakerMacros.h"
0019 #include "FWCore/ParameterSet/interface/ParameterSet.h"
0020 
0021 #include "DataFormats/EgammaCandidates/interface/ConversionFwd.h"
0022 #include "DataFormats/TrackReco/interface/HitPattern.h"
0023 #include "DataFormats/VertexReco/interface/VertexFwd.h"
0024 #include "DataFormats/VertexReco/interface/Vertex.h"
0025 #include "DataFormats/PatCandidates/interface/CompositeCandidate.h"
0026 #include "DataFormats/ParticleFlowCandidate/interface/PFCandidateFwd.h"
0027 
0028 #include "CommonTools/Utils/interface/StringCutObjectSelector.h"
0029 
0030 #include <vector>
0031 
0032 /**
0033    Select photon conversions and produce a conversion candidate collection
0034 
0035  */
0036 
0037 class OniaPhotonConversionProducer : public edm::stream::EDProducer<> {
0038 public:
0039   explicit OniaPhotonConversionProducer(const edm::ParameterSet& ps);
0040 
0041 private:
0042   void produce(edm::Event& event, const edm::EventSetup& esetup) override;
0043   void endStream() override;
0044   void removeDuplicates(reco::ConversionCollection&);
0045   bool checkTkVtxCompatibility(const reco::Conversion&, const reco::VertexCollection&);
0046   bool foundCompatibleInnerHits(const reco::HitPattern& hitPatA, const reco::HitPattern& hitPatB);
0047   bool HighpuritySubset(const reco::Conversion&, const reco::VertexCollection&);
0048   pat::CompositeCandidate* makePhotonCandidate(const reco::Conversion&);
0049   reco::Candidate::LorentzVector convertVector(const math::XYZTLorentzVectorF&);
0050   int PackFlags(const reco::Conversion&, bool, bool, bool, bool, bool);
0051   const reco::PFCandidateCollection selectPFPhotons(const reco::PFCandidateCollection&);
0052   bool CheckPi0(const reco::Conversion&, const reco::PFCandidateCollection&, bool&);
0053 
0054   edm::EDGetTokenT<reco::ConversionCollection> convCollectionToken_;
0055   edm::EDGetTokenT<reco::VertexCollection> thePVsToken_;
0056   edm::EDGetTokenT<reco::PFCandidateCollection> pfCandidateCollectionToken_;
0057 
0058   bool wantTkVtxCompatibility_;
0059   uint32_t sigmaTkVtxComp_;
0060   bool wantCompatibleInnerHits_;
0061   uint32_t TkMinNumOfDOF_;
0062   bool wantHighpurity_;
0063   double _vertexChi2ProbCut;
0064   double _trackchi2Cut;
0065   double _minDistanceOfApproachMinCut;
0066   double _minDistanceOfApproachMaxCut;
0067   bool pi0OnlineSwitch_;
0068   // low and high window limits
0069   std::vector<double> pi0SmallWindow_;
0070   std::vector<double> pi0LargeWindow_;
0071 
0072   int convAlgo_;
0073   std::vector<int> convQuality_;
0074 
0075   std::string convSelectionCuts_;
0076   std::unique_ptr<StringCutObjectSelector<reco::Conversion>> convSelection_;
0077 };
0078 
0079 #endif