53 std::vector<edm::EDGetTokenT<std::vector<TtEvent::HypoCombPair> > >
hypTokens_;
57 typedef std::vector<edm::EDGetTokenT<std::vector<TtEvent::HypoCombPair> > >::const_iterator
EventHypoToken;
97 verbosity_ (cfg.getParameter<int> (
"verbosity" )),
105 decayChnTop2_(
cfg.getParameter<
int> (
"decayChannel2"))
108 if(
cfg.exists(
"kinFit") ) {
110 fitChi2Token_ = mayConsume<std::vector<double> >(kinFit_.getParameter<
edm::InputTag>(
"chi2"));
111 fitProbToken_ = mayConsume<std::vector<double> >(kinFit_.getParameter<
edm::InputTag>(
"prob"));
114 if(
cfg.exists(
"hitFit") ) {
116 hitFitChi2Token_ = mayConsume<std::vector<double> >(hitFit_.getParameter<
edm::InputTag>(
"chi2"));
117 hitFitProbToken_ = mayConsume<std::vector<double> >(hitFit_.getParameter<
edm::InputTag>(
"prob"));
118 hitFitMTToken_ = mayConsume<std::vector<double> >(hitFit_.getParameter<
edm::InputTag>(
"mt"));
119 hitFitSigMTToken_ = mayConsume<std::vector<double> >(hitFit_.getParameter<
edm::InputTag>(
"sigmt"));
122 if(
cfg.exists(
"kinSolution") ) {
124 solWeightToken_ = mayConsume<std::vector<double> >(kinSolution_.getParameter<
edm::InputTag>(
"solWeight"));
125 wrongChargeToken_ = mayConsume<bool>(kinSolution_.getParameter<
edm::InputTag>(
"wrongCharge"));
128 if(
cfg.exists(
"genMatch") ) {
130 sumPtToken_ = mayConsume<std::vector<double> >(genMatch_.getParameter<
edm::InputTag>(
"sumPt"));
131 sumDRToken_ = mayConsume<std::vector<double> >(genMatch_.getParameter<
edm::InputTag>(
"sumDR"));
134 if(
cfg.exists(
"mvaDisc") ) {
136 methToken_ = mayConsume<std::string>(mvaDisc_.getParameter<
edm::InputTag>(
"meth"));
137 discToken_ = mayConsume<std::vector<double> >(mvaDisc_.getParameter<
edm::InputTag>(
"disc"));
147 template <
typename C>
158 if (
genEvt_.label().size() > 0 )
160 ttEvent.setGenEvent(genEvt);
166 for( ; hKey != hypKeyTokens_.end(); ++hKey, ++
h){
173 typedef std::vector<TtEvent::HypoCombPair>::const_iterator HypMatch;
174 for(HypMatch hm=hypMatchVec->begin(); hm != hypMatchVec->end(); ++hm){
183 ttEvent.setFitChi2( *fitChi2 );
187 ttEvent.setFitProb( *fitProb );
194 ttEvent.setHitFitChi2( *hitFitChi2 );
198 ttEvent.setHitFitProb( *hitFitProb );
202 ttEvent.setHitFitMT( *hitFitMT );
205 evt.
getByToken(hitFitSigMTToken_, hitFitSigMT);
206 ttEvent.setHitFitSigMT( *hitFitSigMT );
213 ttEvent.setGenMatchSumPt( *sumPt );
217 ttEvent.setGenMatchSumDR( *sumDR );
224 ttEvent.setMvaMethod( *meth );
228 ttEvent.setMvaDiscriminators( *disc );
232 fillSpecific(ttEvent, evt);
235 ttEvent.print(verbosity_);
238 std::auto_ptr<C> pOut(
new C);
259 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
virtual void produce(edm::Event &, const edm::EventSetup &)
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_
~TtEvtBuilder()
default destructor
edm::EDGetTokenT< std::vector< double > > sumDRToken_
Template class to fill the TtEvent structure.
std::vector< edm::EDGetTokenT< int > > hypKeyTokens_
vector of hypothesis class names
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
virtual void fillSpecific(C &, const edm::Event &)
fill data members that are decay-channel specific
edm::EDGetTokenT< std::vector< double > > discToken_
std::vector< edm::EDGetTokenT< int > > hypJetTokens_
The Signals That Services Can Subscribe To This is based on ActivityRegistry h
Helper function to determine trigger accepts.
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_
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
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_
edm::EDGetTokenT< TtGenEvent > genEvtToken_
genEvtToken_(mayConsume< TtGenEvent >(genEvt_))
edm::EDGetTokenT< std::vector< double > > hitFitProbToken_
void setup(std::vector< TH2F > &depth, std::string name, std::string units="")