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");
104 produces<int>(
"NumberOfConsideredJets");
121 std::auto_ptr<std::vector<std::vector<int> > >
match(
new std::vector<std::vector<int> >);
122 std::auto_ptr<std::vector<double> > sumPt(
new std::vector<double>);
123 std::auto_ptr<std::vector<double> > sumDR(
new std::vector<double>);
124 std::auto_ptr<int> pJetsConsidered(
new int);
137 std::vector<const reco::Candidate*> partons = partons_.vec(*genEvt);
140 std::vector<const reco::Candidate*>
jets;
141 for(
unsigned int ij=0; ij<topJets->size(); ++ij) {
147 if(maxNJets_>=(
int)partons.size()) {
148 if((
int)ij==maxNJets_)
break;
151 if(ij==partons.size())
break;
156 *pJetsConsidered = jets.size();
159 JetPartonMatching jetPartonMatch(partons, jets, algorithm_, useMaxDist_, useDeltaR_, maxDist_);
164 jetPartonMatch.
print();
167 if((
int)ic>=maxNComb_ && maxNComb_>=0)
break;
169 partons_.expand(matches);
170 match->push_back( matches );
175 evt.
put(sumPt,
"SumPt");
176 evt.
put(sumDR,
"SumDR");
177 evt.
put(pJetsConsidered,
"NumberOfConsideredJets");
189 <<
"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
void setup(std::vector< TH2F > &depth, std::string name, std::string units="")
double getSumDeltaPt(const unsigned int comb=0)
virtual void produce(edm::Event &, const edm::EventSetup &)
write jet parton match objects into the event