1 #ifndef TtJetPartonMatch_h
2 #define TtJetPartonMatch_h
86 partons_ (cfg.getParameter<std::vector<std::string> >(
"partonsToIgnore")),
87 jets_ (cfg.getParameter<edm::InputTag> (
"jets" )),
88 maxNJets_ (cfg.getParameter<int> (
"maxNJets" )),
89 maxNComb_ (cfg.getParameter<int> (
"maxNComb" )),
90 algorithm_ (readAlgorithm(cfg.getParameter<std::string>(
"algorithm" ))),
91 useDeltaR_ (cfg.getParameter<bool> (
"useDeltaR" )),
92 useMaxDist_(cfg.getParameter<bool> (
"useMaxDist" )),
93 maxDist_ (cfg.getParameter<double> (
"maxDist" )),
94 verbosity_ (cfg.getParameter<int> (
"verbosity" ))
101 produces< std::vector<std::vector<int> > >();
102 produces< std::vector<double> >(
"SumPt");
103 produces< std::vector<double> >(
"SumDR");
125 std::vector<const reco::Candidate*> partons = partons_.vec(*genEvt);
128 std::vector<const reco::Candidate*>
jets;
129 for(
unsigned int ij=0; ij<topJets->size(); ++ij) {
135 if(maxNJets_>=(
int)partons.size()) {
136 if((
int)ij==maxNJets_)
break;
139 if(ij==partons.size())
break;
146 JetPartonMatching jetPartonMatch(partons, jets, algorithm_, useMaxDist_, useDeltaR_, maxDist_);
151 jetPartonMatch.
print();
158 std::auto_ptr< std::vector<std::vector<int> > >
match(
new std::vector<std::vector<int> >);
159 std::auto_ptr< std::vector<double> > sumPt(
new std::vector<double>);
160 std::auto_ptr< std::vector<double> > sumDR(
new std::vector<double>);
163 if((
int)ic>=maxNComb_ && maxNComb_>=0)
break;
165 partons_.expand(matches);
166 match->push_back( matches );
171 evt.
put(sumPt,
"SumPt");
172 evt.
put(sumDR,
"SumDR");
184 <<
"Chosen algorithm is not supported: " << str <<
"\n";
edm::InputTag jets_
jet collection input
unsigned int getNumberOfAvailableCombinations()
JetPartonMatching::algorithms readAlgorithm(const std::string &str)
convert string for algorithm into corresponding enumerator type
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
std::vector< int > getMatchesForPartons(const unsigned int comb=0)
bool useDeltaR_
switch to choose between deltaR/deltaTheta matching
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
JetPartonMatching::algorithms algorithm_
choice of algorithm
int verbosity_
verbosity level
double getSumDeltaR(const unsigned int comb=0)
std::pair< typename Association::data_type::first_type, double > match(Reference key, Association association, bool bestMatchByMaxValue)
Generic matching function.
TtJetPartonMatch(const edm::ParameterSet &)
default conructor
~TtJetPartonMatch()
default destructor
double getSumDeltaPt(const unsigned int comb=0)
virtual void produce(edm::Event &, const edm::EventSetup &)
write jet parton match objects into the event