50 input_VertexPFCandAssociationMap_ = iConfig.
getParameter<
InputTag>(
"VertexPFCandAssociationMap");
54 input_MinQuality_ = iConfig.
getParameter<
int>(
"MinQuality");
58 if ( input_AssociationType_.label() ==
"PFCandsToVertex" ) {
59 produces<PFCandidateCollection>(
"P2V");
61 if ( input_AssociationType_.label() ==
"VertexToPFCands" ) {
62 produces<PFCandidateCollection>(
"V2P");
64 if ( input_AssociationType_.label() ==
"Both" ) {
65 produces<PFCandidateCollection>(
"P2V");
66 produces<PFCandidateCollection>(
"V2P");
68 cout <<
"No correct InputTag for AssociationType!" << endl;
69 cout <<
"Won't produce any PFCandiateCollection!" << endl;
97 bool p2vassmap =
false;
98 bool v2passmap =
false;
104 string asstype = input_AssociationType_.label();
106 if ( ( asstype ==
"PFCandsToVertex" ) || ( asstype ==
"Both" ) ) {
107 if ( iEvent.
getByLabel(input_VertexPFCandAssociationMap_, p2vAM ) ) {
112 if ( ( asstype ==
"VertexToPFCands" ) || ( asstype ==
"Both" ) ) {
113 if ( iEvent.
getByLabel(input_VertexPFCandAssociationMap_, v2pAM ) ) {
118 if ( !p2vassmap && !v2passmap ) {
119 cout <<
"No input collection could be found" << endl;
123 int negativeQuality = 0;
124 if ( input_MinQuality_ >= 2) {
125 negativeQuality = -1;
127 if ( input_MinQuality_ == 1) {
128 negativeQuality = -2;
130 negativeQuality = -3;
139 for (
unsigned int pfccoll_ite = 0; pfccoll_ite < pfccoll.size(); pfccoll_ite++){
142 int quality = pfccoll[pfccoll_ite].second;
144 if ( (quality>=input_MinQuality_) || ( (quality<0) && (quality>=negativeQuality) ) ) {
145 p2v_firstvertex->push_back(*pfcand);
151 iEvent.
put( p2v_firstvertex,
"P2V" );
159 iEvent.
getByLabel(input_VertexCollection_,input_vtxcollH);
161 VertexRef firstVertexRef(input_vtxcollH,0);
165 for(v2p_ite=v2pAM->begin(); v2p_ite!=v2pAM->end(); v2p_ite++){
169 for(
unsigned v_ite = 0; v_ite<(v2p_ite->
val).
size(); v_ite++){
172 int quality = (v2p_ite->
val)[v_ite].
second;
174 if ( (vtxref==firstVertexRef) && ( (quality>=input_MinQuality_) || ( (quality<0) && (quality>=negativeQuality) ) ) ) {
175 v2p_firstvertex->push_back(*pfcand);
182 iEvent.
put( v2p_firstvertex,
"V2P" );
T getParameter(std::string const &) const
DEFINE_FWK_MODULE(HiMixingModule)
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
U second(std::pair< T, U > const &p)
void addDefault(ParameterSetDescription const &psetDescription)
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
std::vector< PFCandQualityPair > PFCandQualityPairVector
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
virtual void produce(edm::Event &, const edm::EventSetup &)
PFCand_NoPU_WithAM(const edm::ParameterSet &)
std::vector< reco::PFCandidate > PFCandidateCollection
collection of PFCandidates
T first(std::pair< T, U > const &p)
tuple size
Write out results.