52 m_jetTagComputer(iConfig.getParameter<
string>(
"jetTagComputer"))
54 std::vector<edm::InputTag> m_tagInfos = iConfig.
getParameter< vector<InputTag> >(
"tagInfos");
60 produces<JetTagCollection>();
73 struct JetRefCompare {
76 {
return j1.
id() < j2.
id() || (j1.
id() == j2.
id() && j1.
key() < j2.
key()); }
89 if (nLabels == 0) ++nLabels;
94 if (inputLabels.empty())
95 inputLabels.push_back(
"tagInfo");
96 std::string message(
"VInputTag size mismatch - the following taginfo " 97 "labels are needed:\n");
98 for(vector<string>::const_iterator iter = inputLabels.begin();
99 iter != inputLabels.end(); ++iter)
100 message +=
"\"" + *iter +
"\"\n";
108 typedef vector<const BaseTagInfo*> TagInfoPtrs;
110 typedef map<JetRef, TagInfoPtrs, JetRefCompare> JetToTagInfoMap;
112 JetToTagInfoMap jetToTagInfos;
115 vector< Handle< View<BaseTagInfo> > > tagInfoHandles(
nTagInfos);
121 iter != tagInfoHandle->end(); iter++) {
122 TagInfoPtrs &
tagInfos = jetToTagInfos[iter->jet()];
123 if (tagInfos.empty())
124 tagInfos.resize(nTagInfos);
126 tagInfos[
i] = &*iter;
132 std::unique_ptr<JetTagCollection> jetTagCollection;
133 if (!tagInfoHandle.
product()->empty()) {
137 jetTagCollection = std::make_unique<JetTagCollection>();
140 for(JetToTagInfoMap::const_iterator iter = jetToTagInfos.begin();
141 iter != jetToTagInfos.end(); iter++) {
142 const TagInfoPtrs &tagInfoPtrs = iter->second;
160 std::vector<edm::InputTag>
tagInfos;
161 tagInfos.push_back(
edm::InputTag(
"impactParameterTagInfos"));
162 tagInfos.push_back(
edm::InputTag(
"inclusiveSecondaryVertexFinderTagInfos"));
164 tagInfos.push_back(
edm::InputTag(
"softPFElectronsTagInfos"));
165 desc.
add<std::vector<edm::InputTag> >(
"tagInfos",
tagInfos);
JetTagProducer(const edm::ParameterSet &)
T getParameter(std::string const &) const
void produce(edm::Event &, const edm::EventSetup &) override
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
bool getByToken(EDGetToken token, Handle< PROD > &result) const
std::string m_jetTagComputer
edm::Ref< JetBxCollection > JetRef
#define DEFINE_FWK_MODULE(type)
void addDefault(ParameterSetDescription const &psetDescription)
const std::vector< std::string > & getInputLabels() const
std::vector< edm::EDGetTokenT< edm::View< reco::BaseTagInfo > > > token_tagInfos
ParameterDescriptionBase * add(U const &iLabel, T const &value)
T const * product() const
edm::ESWatcher< JetTagComputerRecord > recordWatcher_
bool check(const edm::EventSetup &iSetup)
RefToBaseProd< T > makeRefToBaseProdFrom(RefToBase< T > const &iRef, Event const &iEvent)
boost::indirect_iterator< typename seq_t::const_iterator > const_iterator
~JetTagProducer() override
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)