52 std::vector<edm::EDGetTokenT<std::vector<TtEvent::HypoCombPair> > >
hypTokens_;
56 typedef std::vector<edm::EDGetTokenT<std::vector<TtEvent::HypoCombPair> > >::const_iterator
EventHypoToken;
96 : verbosity_(cfg.getParameter<int>(
"verbosity")),
101 cfg.getParameter<std::vector<edm::InputTag> >(
"hypotheses"),
102 [
this](
edm::InputTag const&
tag) {
return consumes<std::vector<TtEvent::HypoCombPair> >(tag); })),
105 return consumes<int>(
117 if (
cfg.exists(
"kinFit")) {
119 fitChi2Token_ = mayConsume<std::vector<double> >(kinFit_.getParameter<
edm::InputTag>(
"chi2"));
120 fitProbToken_ = mayConsume<std::vector<double> >(kinFit_.getParameter<
edm::InputTag>(
"prob"));
123 if (
cfg.exists(
"hitFit")) {
125 hitFitChi2Token_ = mayConsume<std::vector<double> >(hitFit_.getParameter<
edm::InputTag>(
"chi2"));
126 hitFitProbToken_ = mayConsume<std::vector<double> >(hitFit_.getParameter<
edm::InputTag>(
"prob"));
127 hitFitMTToken_ = mayConsume<std::vector<double> >(hitFit_.getParameter<
edm::InputTag>(
"mt"));
128 hitFitSigMTToken_ = mayConsume<std::vector<double> >(hitFit_.getParameter<
edm::InputTag>(
"sigmt"));
131 if (
cfg.exists(
"kinSolution")) {
133 solWeightToken_ = mayConsume<std::vector<double> >(kinSolution_.getParameter<
edm::InputTag>(
"solWeight"));
134 wrongChargeToken_ = mayConsume<bool>(kinSolution_.getParameter<
edm::InputTag>(
"wrongCharge"));
137 if (
cfg.exists(
"genMatch")) {
139 sumPtToken_ = mayConsume<std::vector<double> >(genMatch_.getParameter<
edm::InputTag>(
"sumPt"));
140 sumDRToken_ = mayConsume<std::vector<double> >(genMatch_.getParameter<
edm::InputTag>(
"sumDR"));
143 if (
cfg.exists(
"mvaDisc")) {
145 methToken_ = mayConsume<std::string>(mvaDisc_.getParameter<
edm::InputTag>(
"meth"));
146 discToken_ = mayConsume<std::vector<double> >(mvaDisc_.getParameter<
edm::InputTag>(
"disc"));
156 template <
typename C>
167 ttEvent.setGenEvent(genEvt);
173 for (; hKey != hypKeyTokens_.end(); ++hKey, ++
h) {
180 typedef std::vector<TtEvent::HypoCombPair>::const_iterator HypMatch;
181 for (HypMatch hm = hypMatchVec->begin(); hm != hypMatchVec->end(); ++hm) {
190 ttEvent.setFitChi2(*fitChi2);
194 ttEvent.setFitProb(*fitProb);
201 ttEvent.setHitFitChi2(*hitFitChi2);
205 ttEvent.setHitFitProb(*hitFitProb);
209 ttEvent.setHitFitMT(*hitFitMT);
212 evt.
getByToken(hitFitSigMTToken_, hitFitSigMT);
213 ttEvent.setHitFitSigMT(*hitFitSigMT);
220 ttEvent.setGenMatchSumPt(*sumPt);
224 ttEvent.setGenMatchSumDR(*sumDR);
231 ttEvent.setMvaMethod(*meth);
235 ttEvent.setMvaDiscriminators(*disc);
239 fillSpecific(ttEvent, evt);
242 ttEvent.print(verbosity_);
245 std::unique_ptr<C> pOut(
new C);
262 evt.
getByToken(wrongChargeToken_, wrongCharge);
272 for (; hKey != hypKeyTokens_.end(); ++hKey, ++hNeutr, ++hJet) {
278 evt.
getByToken(*hNeutr, numberOfRealNeutrinoSolutions);
283 evt.
getByToken(*hJet, numberOfConsideredJets);
hypJetTokens_(edm::vector_transform(cfg.getParameter< std::vector< edm::InputTag > >("hypotheses"), [this](edm::InputTag const &tag){return consumes< int >(edm::InputTag(tag.label(),"NumberOfConsideredJets"));}))
edm::EDGetTokenT< std::vector< double > > solWeightToken_
void setWrongCharge(const bool &val)
set right or wrong charge combination of kKinSolution hypothesis
HypoClassKey
supported classes of event hypotheses
bool isHypoAvailable(const std::string &key, const unsigned &cmb=0) const
decayChnTop2_(cfg.getParameter< int >("decayChannel2"))
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
edm::EDGetTokenT< std::vector< double > > hitFitMTToken_
hypTokens_(edm::vector_transform(cfg.getParameter< std::vector< edm::InputTag > >("hypotheses"), [this](edm::InputTag const &tag){return consumes< std::vector< TtEvent::HypoCombPair > >(tag);}))
edm::EDGetTokenT< std::string > methToken_
TtEvtBuilder(const edm::ParameterSet &)
default constructor
bool getByToken(EDGetToken token, Handle< PROD > &result) const
edm::InputTag genEvt_
TtGenEvent.
decayChnTop1_(cfg.getParameter< int >("decayChannel1"))
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_
hypNeutrTokens_(edm::vector_transform(cfg.getParameter< std::vector< edm::InputTag > >("hypotheses"), [this](edm::InputTag const &tag){return consumes< int >(edm::InputTag(tag.label(),"NumberOfRealNeutrinoSolutions"));}))
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
static double fitChi2(const CachingVertex< 5 > &vtx)
edm::ParameterSet genMatch_
std::vector< edm::EDGetTokenT< int > > hypNeutrTokens_
edm::EDGetTokenT< std::vector< double > > sumDRToken_
Template class to fill the TtEvent structure.
std::vector< edm::EDGetTokenT< int > > hypKeyTokens_
vector of hypothesis class names
virtual void fillSpecific(C &, const edm::Event &)
fill data members that are decay-channel specific
edm::EDGetTokenT< std::vector< double > > discToken_
tuple key
prepare the HTCondor submission files and eventually submit them
std::vector< edm::EDGetTokenT< int > > hypJetTokens_
int verbosity_
vebosity level
edm::EDGetTokenT< std::vector< double > > hitFitSigMTToken_
edm::ParameterSet mvaDisc_
edm::EDGetTokenT< bool > wrongChargeToken_
~TtEvtBuilder() override
default destructor
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_
Class derived from the TtEvent for the full hadronic decay channel.
edm::EDGetTokenT< std::vector< double > > hitFitChi2Token_
std::vector< edm::EDGetTokenT< std::vector< TtEvent::HypoCombPair > > >::const_iterator EventHypoToken
void produce(edm::Event &, const edm::EventSetup &) override
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
genEvt_(cfg.getParameter< edm::InputTag >("genEvent"))
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_
genEvtToken_(mayConsume< TtGenEvent >(genEvt_))
edm::EDGetTokenT< std::vector< double > > hitFitProbToken_