48 std::vector<edm::EDGetTokenT<std::vector<TtEvent::HypoCombPair> > >
hypTokens_;
52 typedef std::vector<edm::EDGetTokenT<std::vector<TtEvent::HypoCombPair> > >::const_iterator
EventHypoToken;
94 : verbosity_(
cfg.getParameter<
int>(
"verbosity")),
99 cfg.getParameter<std::vector<edm::InputTag> >(
"hypotheses"),
100 [
this](
edm::InputTag const&
tag) { return consumes<std::vector<TtEvent::HypoCombPair> >(tag); })),
103 return consumes<int>(
104 edm::InputTag(tag.label(),
"NumberOfRealNeutrinoSolutions"));
108 return consumes<int>(edm::InputTag(tag.label(),
"NumberOfConsideredJets"));
111 genEvtToken_(mayConsume<TtGenEvent>(genEvt_)),
112 decayChnTop1_(
cfg.getParameter<
int>(
"decayChannel1")),
113 decayChnTop2_(
cfg.getParameter<
int>(
"decayChannel2")) {
115 if (
cfg.exists(
"kinFit")) {
117 fitChi2Token_ = mayConsume<std::vector<double> >(kinFit_.getParameter<
edm::InputTag>(
"chi2"));
118 fitProbToken_ = mayConsume<std::vector<double> >(kinFit_.getParameter<
edm::InputTag>(
"prob"));
121 if (
cfg.exists(
"hitFit")) {
123 hitFitChi2Token_ = mayConsume<std::vector<double> >(hitFit_.getParameter<
edm::InputTag>(
"chi2"));
124 hitFitProbToken_ = mayConsume<std::vector<double> >(hitFit_.getParameter<
edm::InputTag>(
"prob"));
125 hitFitMTToken_ = mayConsume<std::vector<double> >(hitFit_.getParameter<
edm::InputTag>(
"mt"));
126 hitFitSigMTToken_ = mayConsume<std::vector<double> >(hitFit_.getParameter<
edm::InputTag>(
"sigmt"));
129 if (
cfg.exists(
"kinSolution")) {
131 solWeightToken_ = mayConsume<std::vector<double> >(kinSolution_.getParameter<
edm::InputTag>(
"solWeight"));
132 wrongChargeToken_ = mayConsume<bool>(kinSolution_.getParameter<
edm::InputTag>(
"wrongCharge"));
135 if (
cfg.exists(
"genMatch")) {
137 sumPtToken_ = mayConsume<std::vector<double> >(genMatch_.getParameter<
edm::InputTag>(
"sumPt"));
138 sumDRToken_ = mayConsume<std::vector<double> >(genMatch_.getParameter<
edm::InputTag>(
"sumDR"));
141 if (
cfg.exists(
"mvaDisc")) {
143 methToken_ = mayConsume<std::string>(mvaDisc_.getParameter<
edm::InputTag>(
"meth"));
144 discToken_ = mayConsume<std::vector<double> >(mvaDisc_.getParameter<
edm::InputTag>(
"disc"));
151 putToken_ = produces<C>();
154 template <
typename C>
163 if (!genEvt_.label().empty())
165 ttEvent.setGenEvent(
genEvt);
171 for (; hKey != hypKeyTokens_.end(); ++hKey, ++
h) {
172 const int key = evt.
get(*hKey);
174 const std::vector<TtEvent::HypoCombPair>& hypMatchVec = evt.
get(*
h);
176 for (
const auto& hm : hypMatchVec) {
177 ttEvent.addEventHypo(static_cast<TtEvent::HypoClassKey>(
key), hm);
183 ttEvent.setFitChi2(evt.
get(fitChi2Token_));
184 ttEvent.setFitProb(evt.
get(fitProbToken_));
189 ttEvent.setHitFitChi2(evt.
get(hitFitChi2Token_));
190 ttEvent.setHitFitProb(evt.
get(hitFitProbToken_));
191 ttEvent.setHitFitMT(evt.
get(hitFitMTToken_));
192 ttEvent.setHitFitSigMT(evt.
get(hitFitSigMTToken_));
197 ttEvent.setGenMatchSumPt(evt.
get(sumPtToken_));
198 ttEvent.setGenMatchSumDR(evt.
get(sumDRToken_));
203 ttEvent.setMvaMethod(evt.
get(methToken_));
204 ttEvent.setMvaDiscriminators(evt.
get(discToken_));
208 fillSpecific(ttEvent, evt);
211 ttEvent.print(verbosity_);
235 for (; hKey != hypKeyTokens_.end(); ++hKey, ++hNeutr, ++hJet) {
236 const int key = evt.
get(*hKey);
239 const int numberOfRealNeutrinoSolutions = evt.
get(*hNeutr);
243 const int numberOfConsideredJets = evt.
get(*hJet);
edm::EDGetTokenT< std::vector< double > > solWeightToken_
void setWrongCharge(const bool &val)
set right or wrong charge combination of kKinSolution hypothesis
bool get(ProductID const &oid, Handle< PROD > &result) const
edm::EDGetTokenT< std::vector< double > > hitFitMTToken_
edm::EDGetTokenT< std::string > methToken_
TtEvtBuilder(const edm::ParameterSet &)
default constructor
edm::InputTag genEvt_
TtGenEvent.
#define DEFINE_FWK_MODULE(type)
void setNumberOfRealNeutrinoSolutions(const HypoClassKey &key, const int &nr)
set number of real neutrino solutions for a given hypo class
Class derived from the TtEvent for the semileptonic decay channel.
std::vector< edm::EDGetTokenT< std::vector< TtEvent::HypoCombPair > > > hypTokens_
bool getByToken(EDGetToken token, Handle< PROD > &result) const
auto vector_transform(std::vector< InputType > const &input, Function predicate) -> std::vector< typename std::remove_cv< typename std::remove_reference< decltype(predicate(input.front()))>::type >::type >
std::vector< edm::EDGetTokenT< int > >::const_iterator EventHypoIntToken
edm::ParameterSet genMatch_
std::vector< edm::EDGetTokenT< int > > hypNeutrTokens_
edm::EDGetTokenT< std::vector< double > > sumDRToken_
Template class to fill the TtEvent structure.
bool isHypoAvailable(const std::string &key, const unsigned &cmb=0) const
std::vector< edm::EDGetTokenT< int > > hypKeyTokens_
vector of hypothesis class names
edm::EDGetTokenT< std::vector< double > > discToken_
std::vector< edm::EDGetTokenT< int > > hypJetTokens_
int verbosity_
vebosity level
edm::EDGetTokenT< std::vector< double > > hitFitSigMTToken_
edm::ParameterSet mvaDisc_
edm::EDGetTokenT< bool > wrongChargeToken_
Class derived from the TtEvent for the full leptonic decay channel.
edm::EDGetTokenT< std::vector< double > > fitChi2Token_
void setSolWeight(const std::vector< double > &val)
set weight of kKinSolution hypothesis
edm::ParameterSet kinFit_
edm::ParameterSet kinSolution_
void fillSpecific(C &, const edm::Event &) const
fill data members that are decay-channel specific
Class derived from the TtEvent for the full hadronic decay channel.
void produce(edm::StreamID, edm::Event &, const edm::EventSetup &) const override
OrphanHandle< PROD > emplace(EDPutTokenT< PROD > token, Args &&... args)
puts a new product
edm::EDGetTokenT< std::vector< double > > hitFitChi2Token_
std::vector< edm::EDGetTokenT< std::vector< TtEvent::HypoCombPair > > >::const_iterator EventHypoToken
edm::ParameterSet hitFit_
edm::EDGetTokenT< std::vector< double > > fitProbToken_
void setNumberOfConsideredJets(const HypoClassKey &key, const unsigned int nJets)
set number of jets considered when building a given hypothesis
edm::EDPutTokenT< C > putToken_
edm::EDGetTokenT< std::vector< double > > sumPtToken_
The Signals That Services Can Subscribe To This is based on ActivityRegistry h
Helper function to determine trigger accepts.
edm::EDGetTokenT< TtGenEvent > genEvtToken_
edm::EDGetTokenT< std::vector< double > > hitFitProbToken_