CMS 3D CMS Logo

List of all members | Public Member Functions | Private Types | Private Member Functions | Private Attributes
TtEvtBuilder< C > Class Template Reference

Template class to fill the TtEvent structure. More...

Inheritance diagram for TtEvtBuilder< C >:
edm::global::EDProducer<> edm::global::EDProducerBase edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

 TtEvtBuilder (const edm::ParameterSet &)
 default constructor More...
 
- Public Member Functions inherited from edm::global::EDProducer<>
 EDProducer ()=default
 
 EDProducer (const EDProducer &)=delete
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginProcessBlocks () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndProcessBlocks () const final
 
bool hasAbilityToProduceInEndRuns () const final
 
EDProduceroperator= (const EDProducer &)=delete
 
bool wantsGlobalLuminosityBlocks () const final
 
bool wantsGlobalRuns () const final
 
bool wantsInputProcessBlocks () const final
 
bool wantsProcessBlocks () const final
 
bool wantsStreamLuminosityBlocks () const final
 
bool wantsStreamRuns () const final
 
- Public Member Functions inherited from edm::global::EDProducerBase
 EDProducerBase ()
 
ModuleDescription const & moduleDescription () const
 
 ~EDProducerBase () override
 
- Public Member Functions inherited from edm::ProducerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
std::vector< edm::ProductResolverIndex > const & indiciesForPutProducts (BranchType iBranchType) const
 
 ProducerBase ()
 
std::vector< edm::ProductResolverIndex > const & putTokenIndexToProductResolverIndex () const
 
std::vector< bool > const & recordProvenanceList () const
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
std::function< void(BranchDescription const &)> registrationCallback () const
 used by the fwk to register list of products More...
 
void resolvePutIndicies (BranchType iBranchType, ModuleToResolverIndicies const &iIndicies, std::string const &moduleLabel)
 
TypeLabelList const & typeLabelList () const
 used by the fwk to register the list of products of this module More...
 
 ~ProducerBase () noexcept(false) override
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
void convertCurrentProcessAlias (std::string const &processName)
 Convert "@currentProcess" in InputTag process names to the actual current process name. More...
 
 EDConsumerBase ()
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
 EDConsumerBase (EDConsumerBase &&)=default
 
ESResolverIndex const * esGetTokenIndices (edm::Transition iTrans) const
 
std::vector< ESResolverIndex > const & esGetTokenIndicesVector (edm::Transition iTrans) const
 
std::vector< ESRecordIndex > const & esGetTokenRecordIndicesVector (edm::Transition iTrans) const
 
ProductResolverIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
std::vector< ProductResolverIndexAndSkipBit > const & itemsToGetFrom (BranchType iType) const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesWhoseProductsAreConsumed (std::array< std::vector< ModuleDescription const *> *, NumBranchTypes > &modulesAll, std::vector< ModuleProcessName > &modulesInPreviousProcesses, ProductRegistry const &preg, std::map< std::string, ModuleDescription const *> const &labelsToDesc, std::string const &processName) const
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
void selectInputProcessBlocks (ProductRegistry const &productRegistry, ProcessBlockHelperBase const &processBlockHelperBase)
 
ProductResolverIndexAndSkipBit uncheckedIndexFrom (EDGetToken) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
void updateLookup (eventsetup::ESRecordsToProductResolverIndices const &)
 
virtual ~EDConsumerBase () noexcept(false)
 

Private Types

typedef std::vector< edm::EDGetTokenT< int > >::const_iterator EventHypoIntToken
 
typedef std::vector< edm::EDGetTokenT< std::vector< TtEvent::HypoCombPair > > >::const_iterator EventHypoToken
 

Private Member Functions

void fillSpecific (C &, const edm::Event &) const
 fill data members that are decay-channel specific More...
 
template<>
void fillSpecific (TtFullHadronicEvent &ttEvent, const edm::Event &evt) const
 
template<>
void fillSpecific (TtFullLeptonicEvent &ttEvent, const edm::Event &evt) const
 
template<>
void fillSpecific (TtSemiLeptonicEvent &ttEvent, const edm::Event &evt) const
 
void produce (edm::StreamID, edm::Event &, const edm::EventSetup &) const override
 

Private Attributes

int decayChnTop1_
 
int decayChnTop2_
 
edm::EDGetTokenT< std::vector< double > > discToken_
 
edm::EDGetTokenT< std::vector< double > > fitChi2Token_
 
edm::EDGetTokenT< std::vector< double > > fitProbToken_
 
edm::InputTag genEvt_
 TtGenEvent. More...
 
edm::EDGetTokenT< TtGenEventgenEvtToken_
 
edm::ParameterSet genMatch_
 
edm::ParameterSet hitFit_
 
edm::EDGetTokenT< std::vector< double > > hitFitChi2Token_
 
edm::EDGetTokenT< std::vector< double > > hitFitMTToken_
 
edm::EDGetTokenT< std::vector< double > > hitFitProbToken_
 
edm::EDGetTokenT< std::vector< double > > hitFitSigMTToken_
 
std::vector< edm::EDGetTokenT< int > > hypJetTokens_
 
std::vector< edm::EDGetTokenT< int > > hypKeyTokens_
 vector of hypothesis class names More...
 
std::vector< edm::EDGetTokenT< int > > hypNeutrTokens_
 
std::vector< edm::EDGetTokenT< std::vector< TtEvent::HypoCombPair > > > hypTokens_
 
edm::ParameterSet kinFit_
 
edm::ParameterSet kinSolution_
 
edm::EDGetTokenT< std::string > methToken_
 
edm::ParameterSet mvaDisc_
 
edm::EDPutTokenT< C > putToken_
 
edm::EDGetTokenT< std::vector< double > > solWeightToken_
 
edm::EDGetTokenT< std::vector< double > > sumDRToken_
 
edm::EDGetTokenT< std::vector< double > > sumPtToken_
 
int verbosity_
 vebosity level More...
 
edm::EDGetTokenT< bool > wrongChargeToken_
 

Additional Inherited Members

- Public Types inherited from edm::global::EDProducerBase
typedef EDProducerBase ModuleType
 
- Public Types inherited from edm::ProducerBase
template<typename T >
using BranchAliasSetterT = ProductRegistryHelper::BranchAliasSetterT< T >
 
using ModuleToResolverIndicies = std::unordered_multimap< std::string, std::tuple< edm::TypeID const *, const char *, edm::ProductResolverIndex > >
 
typedef ProductRegistryHelper::TypeLabelList TypeLabelList
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Static Public Member Functions inherited from edm::global::EDProducerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 
- Protected Member Functions inherited from edm::ProducerBase
template<Transition Tr = Transition::Event>
auto produces (std::string instanceName) noexcept
 declare what type of product will make and with which optional label More...
 
template<Transition B>
BranchAliasSetter produces (const TypeID &id, std::string instanceName=std::string(), bool recordProvenance=true)
 
template<BranchType B>
BranchAliasSetter produces (const TypeID &id, std::string instanceName=std::string(), bool recordProvenance=true)
 
BranchAliasSetter produces (const TypeID &id, std::string instanceName=std::string(), bool recordProvenance=true)
 
template<typename ProductType , Transition B>
BranchAliasSetterT< ProductType > produces (std::string instanceName)
 
template<class ProductType >
BranchAliasSetterT< ProductType > produces ()
 
template<typename ProductType , BranchType B>
BranchAliasSetterT< ProductType > produces (std::string instanceName)
 
template<typename ProductType , BranchType B>
BranchAliasSetterT< ProductType > produces ()
 
template<class ProductType >
BranchAliasSetterT< ProductType > produces (std::string instanceName)
 
template<typename ProductType , Transition B>
BranchAliasSetterT< ProductType > produces ()
 
template<Transition Tr = Transition::Event>
auto produces () noexcept
 
ProducesCollector producesCollector ()
 
- Protected Member Functions inherited from edm::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
template<BranchType B = InEvent>
EDConsumerBaseAdaptor< Bconsumes (edm::InputTag tag) noexcept
 
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken consumes (TypeToGet const &id, edm::InputTag const &tag)
 
ConsumesCollector consumesCollector ()
 Use a ConsumesCollector to gather consumes information from helper functions. More...
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes ()
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes (ESInputTag const &tag)
 
template<Transition Tr = Transition::Event>
constexpr auto esConsumes ()
 
template<Transition Tr = Transition::Event>
auto esConsumes (ESInputTag tag)
 
template<Transition Tr = Transition::Event>
ESGetTokenGeneric esConsumes (eventsetup::EventSetupRecordKey const &iRecord, eventsetup::DataKey const &iKey)
 Used with EventSetupRecord::doGet. More...
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
void resetItemsToGetFrom (BranchType iType)
 

Detailed Description

template<typename C>
class TtEvtBuilder< C >

Template class to fill the TtEvent structure.

Template class to fill the TtEvent structure for:

TtSemiLeptonicEvent TtFullLeptonicEvent TtFullHadronicEvent

event hypothesis, genEvent and extra information (if available) are read from the event and contracted into the TtEvent

Definition at line 31 of file TtEvtBuilder.cc.

Member Typedef Documentation

◆ EventHypoIntToken

template<typename C >
typedef std::vector<edm::EDGetTokenT<int> >::const_iterator TtEvtBuilder< C >::EventHypoIntToken
private

Definition at line 51 of file TtEvtBuilder.cc.

◆ EventHypoToken

template<typename C >
typedef std::vector<edm::EDGetTokenT<std::vector<TtEvent::HypoCombPair> > >::const_iterator TtEvtBuilder< C >::EventHypoToken
private

Definition at line 52 of file TtEvtBuilder.cc.

Constructor & Destructor Documentation

◆ TtEvtBuilder()

template<typename C >
TtEvtBuilder< C >::TtEvtBuilder ( const edm::ParameterSet cfg)
explicit

default constructor

Definition at line 93 of file TtEvtBuilder.cc.

References ProducerED_cfi::InputTag, and makeGlobalPositionRcd_cfg::tag.

94  : verbosity_(cfg.getParameter<int>("verbosity")),
96  cfg.getParameter<std::vector<edm::InputTag> >("hypotheses"),
97  [this](edm::InputTag const& tag) { return consumes<int>(edm::InputTag(tag.label(), "Key")); })),
99  cfg.getParameter<std::vector<edm::InputTag> >("hypotheses"),
100  [this](edm::InputTag const& tag) { return consumes<std::vector<TtEvent::HypoCombPair> >(tag); })),
101  hypNeutrTokens_(edm::vector_transform(cfg.getParameter<std::vector<edm::InputTag> >("hypotheses"),
102  [this](edm::InputTag const& tag) {
103  return consumes<int>(
104  edm::InputTag(tag.label(), "NumberOfRealNeutrinoSolutions"));
105  })),
106  hypJetTokens_(edm::vector_transform(cfg.getParameter<std::vector<edm::InputTag> >("hypotheses"),
107  [this](edm::InputTag const& tag) {
108  return consumes<int>(edm::InputTag(tag.label(), "NumberOfConsideredJets"));
109  })),
110  genEvt_(cfg.getParameter<edm::InputTag>("genEvent")),
111  genEvtToken_(mayConsume<TtGenEvent>(genEvt_)),
112  decayChnTop1_(cfg.getParameter<int>("decayChannel1")),
113  decayChnTop2_(cfg.getParameter<int>("decayChannel2")) {
114  // parameter subsets for kKinFit
115  if (cfg.exists("kinFit")) {
116  kinFit_ = cfg.getParameter<edm::ParameterSet>("kinFit");
117  fitChi2Token_ = mayConsume<std::vector<double> >(kinFit_.getParameter<edm::InputTag>("chi2"));
118  fitProbToken_ = mayConsume<std::vector<double> >(kinFit_.getParameter<edm::InputTag>("prob"));
119  }
120  // parameter subsets for kHitFit
121  if (cfg.exists("hitFit")) {
122  hitFit_ = cfg.getParameter<edm::ParameterSet>("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"));
127  }
128  // parameter subsets for kKinSolution
129  if (cfg.exists("kinSolution")) {
130  kinSolution_ = cfg.getParameter<edm::ParameterSet>("kinSolution");
131  solWeightToken_ = mayConsume<std::vector<double> >(kinSolution_.getParameter<edm::InputTag>("solWeight"));
132  wrongChargeToken_ = mayConsume<bool>(kinSolution_.getParameter<edm::InputTag>("wrongCharge"));
133  }
134  // parameter subsets for kGenMatch
135  if (cfg.exists("genMatch")) {
136  genMatch_ = cfg.getParameter<edm::ParameterSet>("genMatch");
137  sumPtToken_ = mayConsume<std::vector<double> >(genMatch_.getParameter<edm::InputTag>("sumPt"));
138  sumDRToken_ = mayConsume<std::vector<double> >(genMatch_.getParameter<edm::InputTag>("sumDR"));
139  }
140  // parameter subsets for kMvaDisc
141  if (cfg.exists("mvaDisc")) {
142  mvaDisc_ = cfg.getParameter<edm::ParameterSet>("mvaDisc");
143  methToken_ = mayConsume<std::string>(mvaDisc_.getParameter<edm::InputTag>("meth"));
144  discToken_ = mayConsume<std::vector<double> >(mvaDisc_.getParameter<edm::InputTag>("disc"));
145  }
146  // produces a TtEventEvent for:
147  // * TtSemiLeptonicEvent
148  // * TtFullLeptonicEvent
149  // * TtFullHadronicEvent
150  // from hypotheses and associated extra information
151  putToken_ = produces<C>();
152 }
edm::EDGetTokenT< std::vector< double > > solWeightToken_
Definition: TtEvtBuilder.cc:76
T getParameter(std::string const &) const
Definition: ParameterSet.h:307
edm::EDGetTokenT< std::vector< double > > hitFitMTToken_
Definition: TtEvtBuilder.cc:71
edm::EDGetTokenT< std::string > methToken_
Definition: TtEvtBuilder.cc:86
edm::InputTag genEvt_
TtGenEvent.
Definition: TtEvtBuilder.cc:54
std::vector< edm::EDGetTokenT< std::vector< TtEvent::HypoCombPair > > > hypTokens_
Definition: TtEvtBuilder.cc:48
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 >
Definition: transform.h:11
edm::ParameterSet genMatch_
Definition: TtEvtBuilder.cc:80
std::vector< edm::EDGetTokenT< int > > hypNeutrTokens_
Definition: TtEvtBuilder.cc:49
edm::EDGetTokenT< std::vector< double > > sumDRToken_
Definition: TtEvtBuilder.cc:82
std::vector< edm::EDGetTokenT< int > > hypKeyTokens_
vector of hypothesis class names
Definition: TtEvtBuilder.cc:47
edm::EDGetTokenT< std::vector< double > > discToken_
Definition: TtEvtBuilder.cc:87
std::vector< edm::EDGetTokenT< int > > hypJetTokens_
Definition: TtEvtBuilder.cc:50
int verbosity_
vebosity level
Definition: TtEvtBuilder.cc:45
edm::EDGetTokenT< std::vector< double > > hitFitSigMTToken_
Definition: TtEvtBuilder.cc:72
edm::ParameterSet mvaDisc_
Definition: TtEvtBuilder.cc:85
edm::EDGetTokenT< bool > wrongChargeToken_
Definition: TtEvtBuilder.cc:77
edm::EDGetTokenT< std::vector< double > > fitChi2Token_
Definition: TtEvtBuilder.cc:64
edm::ParameterSet kinFit_
Definition: TtEvtBuilder.cc:63
edm::ParameterSet kinSolution_
Definition: TtEvtBuilder.cc:75
edm::EDGetTokenT< std::vector< double > > hitFitChi2Token_
Definition: TtEvtBuilder.cc:69
edm::ParameterSet hitFit_
Definition: TtEvtBuilder.cc:68
edm::EDGetTokenT< std::vector< double > > fitProbToken_
Definition: TtEvtBuilder.cc:65
edm::EDPutTokenT< C > putToken_
Definition: TtEvtBuilder.cc:89
edm::EDGetTokenT< std::vector< double > > sumPtToken_
Definition: TtEvtBuilder.cc:81
edm::EDGetTokenT< TtGenEvent > genEvtToken_
Definition: TtEvtBuilder.cc:55
edm::EDGetTokenT< std::vector< double > > hitFitProbToken_
Definition: TtEvtBuilder.cc:70

Member Function Documentation

◆ fillSpecific() [1/4]

template<typename C >
void TtEvtBuilder< C >::fillSpecific ( C &  ,
const edm::Event  
) const
private

fill data members that are decay-channel specific

◆ fillSpecific() [2/4]

template<>
void TtEvtBuilder< TtFullHadronicEvent >::fillSpecific ( TtFullHadronicEvent ttEvent,
const edm::Event evt 
) const
inlineprivate

Definition at line 218 of file TtEvtBuilder.cc.

218  {
219 }

◆ fillSpecific() [3/4]

template<>
void TtEvtBuilder< TtFullLeptonicEvent >::fillSpecific ( TtFullLeptonicEvent ttEvent,
const edm::Event evt 
) const
inlineprivate

Definition at line 222 of file TtEvtBuilder.cc.

References edm::Event::get(), TtEvent::isHypoAvailable(), TtEvent::kKinSolution, TtFullLeptonicEvent::setSolWeight(), and TtFullLeptonicEvent::setWrongCharge().

222  {
223  // set kKinSolution extras
224  if (ttEvent.isHypoAvailable(TtEvent::kKinSolution)) {
225  ttEvent.setSolWeight(evt.get(solWeightToken_));
226  ttEvent.setWrongCharge(evt.get(wrongChargeToken_));
227  }
228 }
edm::EDGetTokenT< std::vector< double > > solWeightToken_
Definition: TtEvtBuilder.cc:76
void setWrongCharge(const bool &val)
set right or wrong charge combination of kKinSolution hypothesis
bool get(ProductID const &oid, Handle< PROD > &result) const
Definition: Event.h:344
bool isHypoAvailable(const std::string &key, const unsigned &cmb=0) const
Definition: TtEvent.h:70
edm::EDGetTokenT< bool > wrongChargeToken_
Definition: TtEvtBuilder.cc:77
void setSolWeight(const std::vector< double > &val)
set weight of kKinSolution hypothesis

◆ fillSpecific() [4/4]

template<>
void TtEvtBuilder< TtSemiLeptonicEvent >::fillSpecific ( TtSemiLeptonicEvent ttEvent,
const edm::Event evt 
) const
inlineprivate

Definition at line 231 of file TtEvtBuilder.cc.

References edm::Event::get(), submitPVResolutionJobs::key, TtEvent::setNumberOfConsideredJets(), and TtSemiLeptonicEvent::setNumberOfRealNeutrinoSolutions().

231  {
232  EventHypoIntToken hKey = hypKeyTokens_.begin();
233  EventHypoIntToken hNeutr = hypNeutrTokens_.begin();
234  EventHypoIntToken hJet = hypJetTokens_.begin();
235  for (; hKey != hypKeyTokens_.end(); ++hKey, ++hNeutr, ++hJet) {
236  const int key = evt.get(*hKey);
237 
238  // set number of real neutrino solutions for all hypotheses
239  const int numberOfRealNeutrinoSolutions = evt.get(*hNeutr);
240  ttEvent.setNumberOfRealNeutrinoSolutions(static_cast<TtEvent::HypoClassKey>(key), numberOfRealNeutrinoSolutions);
241 
242  // set number of considered jets for all hypotheses
243  const int numberOfConsideredJets = evt.get(*hJet);
244  ttEvent.setNumberOfConsideredJets(static_cast<TtEvent::HypoClassKey>(key), numberOfConsideredJets);
245  }
246 }
bool get(ProductID const &oid, Handle< PROD > &result) const
Definition: Event.h:344
void setNumberOfRealNeutrinoSolutions(const HypoClassKey &key, const int &nr)
set number of real neutrino solutions for a given hypo class
std::vector< edm::EDGetTokenT< int > >::const_iterator EventHypoIntToken
Definition: TtEvtBuilder.cc:51
std::vector< edm::EDGetTokenT< int > > hypNeutrTokens_
Definition: TtEvtBuilder.cc:49
std::vector< edm::EDGetTokenT< int > > hypKeyTokens_
vector of hypothesis class names
Definition: TtEvtBuilder.cc:47
std::vector< edm::EDGetTokenT< int > > hypJetTokens_
Definition: TtEvtBuilder.cc:50
key
prepare the HTCondor submission files and eventually submit them
void setNumberOfConsideredJets(const HypoClassKey &key, const unsigned int nJets)
set number of jets considered when building a given hypothesis
Definition: TtEvent.h:162

◆ produce()

template<typename C >
void TtEvtBuilder< C >::produce ( edm::StreamID  ,
edm::Event evt,
const edm::EventSetup setup 
) const
overrideprivatevirtual

produce function (this one is not even accessible for derived classes)

Implements edm::global::EDProducerBase.

Definition at line 155 of file TtEvtBuilder.cc.

References correctionTermsCaloMet_cff::C, edm::Event::emplace(), TtGenEvtProducer_cfi::genEvt, edm::Event::get(), edm::Event::getByToken(), h, submitPVResolutionJobs::key, TtEvent::kGenMatch, TtEvent::kHitFit, TtEvent::kKinFit, TtEvent::kMVADisc, and eostools::move().

155  {
156  C ttEvent;
157 
158  // set leptonic decay channels
160 
161  // set genEvent (if available)
163  if (!genEvt_.label().empty())
164  if (evt.getByToken(genEvtToken_, genEvt))
165  ttEvent.setGenEvent(genEvt);
166 
167  // add event hypotheses for all given
168  // hypothesis classes to the TtEvent
169  EventHypoIntToken hKey = hypKeyTokens_.begin();
170  EventHypoToken h = hypTokens_.begin();
171  for (; hKey != hypKeyTokens_.end(); ++hKey, ++h) {
172  const int key = evt.get(*hKey);
173 
174  const std::vector<TtEvent::HypoCombPair>& hypMatchVec = evt.get(*h);
175 
176  for (const auto& hm : hypMatchVec) {
177  ttEvent.addEventHypo(static_cast<TtEvent::HypoClassKey>(key), hm);
178  }
179  }
180 
181  // set kKinFit extras
182  if (ttEvent.isHypoAvailable(TtEvent::kKinFit)) {
183  ttEvent.setFitChi2(evt.get(fitChi2Token_));
184  ttEvent.setFitProb(evt.get(fitProbToken_));
185  }
186 
187  // set kHitFit extras
188  if (ttEvent.isHypoAvailable(TtEvent::kHitFit)) {
189  ttEvent.setHitFitChi2(evt.get(hitFitChi2Token_));
190  ttEvent.setHitFitProb(evt.get(hitFitProbToken_));
191  ttEvent.setHitFitMT(evt.get(hitFitMTToken_));
192  ttEvent.setHitFitSigMT(evt.get(hitFitSigMTToken_));
193  }
194 
195  // set kGenMatch extras
196  if (ttEvent.isHypoAvailable(TtEvent::kGenMatch)) {
197  ttEvent.setGenMatchSumPt(evt.get(sumPtToken_));
198  ttEvent.setGenMatchSumDR(evt.get(sumDRToken_));
199  }
200 
201  // set kMvaDisc extras
202  if (ttEvent.isHypoAvailable(TtEvent::kMVADisc)) {
203  ttEvent.setMvaMethod(evt.get(methToken_));
204  ttEvent.setMvaDiscriminators(evt.get(discToken_));
205  }
206 
207  // fill data members that are decay-channel specific
208  fillSpecific(ttEvent, evt);
209 
210  // print summary via MessageLogger if verbosity_>0
211  ttEvent.print(verbosity_);
212 
213  // write object into the edm::Event
214  evt.emplace(putToken_, std::move(ttEvent));
215 }
bool get(ProductID const &oid, Handle< PROD > &result) const
Definition: Event.h:344
edm::EDGetTokenT< std::vector< double > > hitFitMTToken_
Definition: TtEvtBuilder.cc:71
edm::EDGetTokenT< std::string > methToken_
Definition: TtEvtBuilder.cc:86
edm::InputTag genEvt_
TtGenEvent.
Definition: TtEvtBuilder.cc:54
std::vector< edm::EDGetTokenT< std::vector< TtEvent::HypoCombPair > > > hypTokens_
Definition: TtEvtBuilder.cc:48
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:528
std::string const & label() const
Definition: InputTag.h:36
std::vector< edm::EDGetTokenT< int > >::const_iterator EventHypoIntToken
Definition: TtEvtBuilder.cc:51
edm::EDGetTokenT< std::vector< double > > sumDRToken_
Definition: TtEvtBuilder.cc:82
std::vector< edm::EDGetTokenT< int > > hypKeyTokens_
vector of hypothesis class names
Definition: TtEvtBuilder.cc:47
edm::EDGetTokenT< std::vector< double > > discToken_
Definition: TtEvtBuilder.cc:87
key
prepare the HTCondor submission files and eventually submit them
int verbosity_
vebosity level
Definition: TtEvtBuilder.cc:45
edm::EDGetTokenT< std::vector< double > > hitFitSigMTToken_
Definition: TtEvtBuilder.cc:72
edm::EDGetTokenT< std::vector< double > > fitChi2Token_
Definition: TtEvtBuilder.cc:64
void fillSpecific(C &, const edm::Event &) const
fill data members that are decay-channel specific
OrphanHandle< PROD > emplace(EDPutTokenT< PROD > token, Args &&... args)
puts a new product
Definition: Event.h:431
edm::EDGetTokenT< std::vector< double > > hitFitChi2Token_
Definition: TtEvtBuilder.cc:69
std::vector< edm::EDGetTokenT< std::vector< TtEvent::HypoCombPair > > >::const_iterator EventHypoToken
Definition: TtEvtBuilder.cc:52
edm::EDGetTokenT< std::vector< double > > fitProbToken_
Definition: TtEvtBuilder.cc:65
edm::EDPutTokenT< C > putToken_
Definition: TtEvtBuilder.cc:89
edm::EDGetTokenT< std::vector< double > > sumPtToken_
Definition: TtEvtBuilder.cc:81
The Signals That Services Can Subscribe To This is based on ActivityRegistry h
Helper function to determine trigger accepts.
Definition: Activities.doc:4
edm::EDGetTokenT< TtGenEvent > genEvtToken_
Definition: TtEvtBuilder.cc:55
edm::EDGetTokenT< std::vector< double > > hitFitProbToken_
Definition: TtEvtBuilder.cc:70
def move(src, dest)
Definition: eostools.py:511

Member Data Documentation

◆ decayChnTop1_

template<typename C >
int TtEvtBuilder< C >::decayChnTop1_
private

decay channels of the two top decay branches; to be filled according to WDecay::LeptonTypes in TtGenEvent

Definition at line 58 of file TtEvtBuilder.cc.

◆ decayChnTop2_

template<typename C >
int TtEvtBuilder< C >::decayChnTop2_
private

Definition at line 59 of file TtEvtBuilder.cc.

◆ discToken_

template<typename C >
edm::EDGetTokenT<std::vector<double> > TtEvtBuilder< C >::discToken_
private

Definition at line 87 of file TtEvtBuilder.cc.

◆ fitChi2Token_

template<typename C >
edm::EDGetTokenT<std::vector<double> > TtEvtBuilder< C >::fitChi2Token_
private

Definition at line 64 of file TtEvtBuilder.cc.

◆ fitProbToken_

template<typename C >
edm::EDGetTokenT<std::vector<double> > TtEvtBuilder< C >::fitProbToken_
private

Definition at line 65 of file TtEvtBuilder.cc.

◆ genEvt_

template<typename C >
edm::InputTag TtEvtBuilder< C >::genEvt_
private

TtGenEvent.

Definition at line 54 of file TtEvtBuilder.cc.

◆ genEvtToken_

template<typename C >
edm::EDGetTokenT<TtGenEvent> TtEvtBuilder< C >::genEvtToken_
private

Definition at line 55 of file TtEvtBuilder.cc.

◆ genMatch_

template<typename C >
edm::ParameterSet TtEvtBuilder< C >::genMatch_
private

input parameters for the kGenMatch hypothesis class extras

Definition at line 80 of file TtEvtBuilder.cc.

◆ hitFit_

template<typename C >
edm::ParameterSet TtEvtBuilder< C >::hitFit_
private

input parameters for the kHitFit hypothesis class extras

Definition at line 68 of file TtEvtBuilder.cc.

◆ hitFitChi2Token_

template<typename C >
edm::EDGetTokenT<std::vector<double> > TtEvtBuilder< C >::hitFitChi2Token_
private

Definition at line 69 of file TtEvtBuilder.cc.

◆ hitFitMTToken_

template<typename C >
edm::EDGetTokenT<std::vector<double> > TtEvtBuilder< C >::hitFitMTToken_
private

Definition at line 71 of file TtEvtBuilder.cc.

◆ hitFitProbToken_

template<typename C >
edm::EDGetTokenT<std::vector<double> > TtEvtBuilder< C >::hitFitProbToken_
private

Definition at line 70 of file TtEvtBuilder.cc.

◆ hitFitSigMTToken_

template<typename C >
edm::EDGetTokenT<std::vector<double> > TtEvtBuilder< C >::hitFitSigMTToken_
private

Definition at line 72 of file TtEvtBuilder.cc.

◆ hypJetTokens_

template<typename C >
std::vector<edm::EDGetTokenT<int> > TtEvtBuilder< C >::hypJetTokens_
private

Definition at line 50 of file TtEvtBuilder.cc.

◆ hypKeyTokens_

template<typename C >
std::vector<edm::EDGetTokenT<int> > TtEvtBuilder< C >::hypKeyTokens_
private

vector of hypothesis class names

Definition at line 47 of file TtEvtBuilder.cc.

◆ hypNeutrTokens_

template<typename C >
std::vector<edm::EDGetTokenT<int> > TtEvtBuilder< C >::hypNeutrTokens_
private

Definition at line 49 of file TtEvtBuilder.cc.

◆ hypTokens_

template<typename C >
std::vector<edm::EDGetTokenT<std::vector<TtEvent::HypoCombPair> > > TtEvtBuilder< C >::hypTokens_
private

Definition at line 48 of file TtEvtBuilder.cc.

◆ kinFit_

template<typename C >
edm::ParameterSet TtEvtBuilder< C >::kinFit_
private

input parameters for the kKinFit hypothesis class extras

Definition at line 63 of file TtEvtBuilder.cc.

◆ kinSolution_

template<typename C >
edm::ParameterSet TtEvtBuilder< C >::kinSolution_
private

input parameters for the kKinSolution hypothesis class extras

Definition at line 75 of file TtEvtBuilder.cc.

◆ methToken_

template<typename C >
edm::EDGetTokenT<std::string> TtEvtBuilder< C >::methToken_
private

Definition at line 86 of file TtEvtBuilder.cc.

◆ mvaDisc_

template<typename C >
edm::ParameterSet TtEvtBuilder< C >::mvaDisc_
private

input parameters for the kMVADisc hypothesis class extras

Definition at line 85 of file TtEvtBuilder.cc.

◆ putToken_

template<typename C >
edm::EDPutTokenT<C> TtEvtBuilder< C >::putToken_
private

Definition at line 89 of file TtEvtBuilder.cc.

◆ solWeightToken_

template<typename C >
edm::EDGetTokenT<std::vector<double> > TtEvtBuilder< C >::solWeightToken_
private

Definition at line 76 of file TtEvtBuilder.cc.

◆ sumDRToken_

template<typename C >
edm::EDGetTokenT<std::vector<double> > TtEvtBuilder< C >::sumDRToken_
private

Definition at line 82 of file TtEvtBuilder.cc.

◆ sumPtToken_

template<typename C >
edm::EDGetTokenT<std::vector<double> > TtEvtBuilder< C >::sumPtToken_
private

Definition at line 81 of file TtEvtBuilder.cc.

◆ verbosity_

template<typename C >
int TtEvtBuilder< C >::verbosity_
private

vebosity level

Definition at line 45 of file TtEvtBuilder.cc.

◆ wrongChargeToken_

template<typename C >
edm::EDGetTokenT<bool> TtEvtBuilder< C >::wrongChargeToken_
private

Definition at line 77 of file TtEvtBuilder.cc.