23 const float dummy = -9.;
68 ,
pvNDOF_ ( iConfig.getParameter<
int> (
"pvNDOF") )
70 ,
lxyCUT_ ( iConfig.getParameter<double>(
"lxyCUT") )
71 ,
lxyWRTbsCUT_ ( iConfig.getParameter<double>(
"lxyWRTbsCUT") )
72 ,
debug_ ( iConfig.getUntrackedParameter<bool>(
"debug") )
74 if (
debug_)
std::cout <<
"VertexCompositeCandidateCollectionSelector::VertexCompositeCandidateCollectionSelector" << std::endl;
76 produces<reco::VertexCompositeCandidateCollection>();
93 if (
debug_)
std::cout <<
"VertexCompositeCandidateCollectionSelector::produce" << std::endl;
96 auto result = std::make_unique<reco::VertexCompositeCandidateCollection>();
101 if (beamspotHandle.isValid())
102 bs = &(*beamspotHandle);
109 pv = &pvHandle->front();
118 int n = ( v0Handle.
isValid() ? v0Handle->size() : -1 );
122 auto const& v0s = *v0Handle.
product();
123 for (
auto const& v0 : v0s ) {
128 v0.vy() - bs->
y(v0.vz()),
130 float abslxy = ( pv==
nullptr ?
dummy : displacementFromPV2D.
perp() );
131 float abslxyWRTbs = ( bs==
nullptr ?
dummy : displacementFromBS2D.
perp() );
135 if (abslxy <
lxyCUT_ )
continue;
157 desc.
add<
int>(
"pvNDOF");
158 desc.
add<
double>(
"lxyCUT", 16.);
159 desc.
add<
double>(
"lxyWRTbsCUT", 0.);
161 descriptions.
add(
"VertexCompositeCandidateCollectionSelector",desc);
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
virtual void produce(edm::Event &, const edm::EventSetup &) override
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
std::vector< VertexCompositeCandidate > VertexCompositeCandidateCollection
collection of Candidate objects
ParameterDescriptionBase * addUntracked(U const &iLabel, T const &value)
edm::EDGetTokenT< reco::VertexCompositeCandidateCollection > v0Token_
static PFTauRenderPlugin instance
bool getByToken(EDGetToken token, Handle< PROD > &result) const
#define DEFINE_FWK_MODULE(type)
double y() const
y coordinate
Global3DPoint GlobalPoint
std::vector< Vertex > VertexCollection
collection of Vertex objects
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
VertexCompositeCandidateCollectionSelector(const edm::ParameterSet &)
double z() const
z coordinate
ParameterDescriptionBase * add(U const &iLabel, T const &value)
double x() const
x coordinate
T const * product() const
double x(const double z) const
x coordinate of the beeam spot position at a given z value (it takes into account the dxdz slope) ...
void add(std::string const &label, ParameterSetDescription const &psetDescription)
double y(const double z) const
y coordinate of the beeam spot position at a given z value (it takes into account the dydz slope) ...
edm::EDGetTokenT< reco::VertexCollection > pvToken_
edm::EDGetTokenT< reco::BeamSpot > bsToken_
size_t tracksSize() const
number of tracks