37 std::vector<edm::ParameterSet> algos = iConfig.
getParameter<std::vector<edm::ParameterSet> >(
"algos");
43 if( produceJetIds_ ) {
44 produces<edm::ValueMap<StoredPileupJetIdentifier> > (
"");
46 for(std::vector<edm::ParameterSet>::iterator it=algos.begin(); it!=algos.end(); ++it) {
50 produces<edm::ValueMap<float> > (label+
"Discriminant");
51 produces<edm::ValueMap<int> > (label+
"Id");
98 vector<StoredPileupJetIdentifier> ids;
99 map<string, vector<float> > mvas;
100 map<string, vector<int> > idflags;
102 VertexCollection::const_iterator vtx;
105 vtx = vertexes.begin();
106 while( vtx != vertexes.end() && ( vtx->isFake() || vtx->ndof() < 4 ) ) {
109 if( vtx == vertexes.end() ) { vtx = vertexes.begin(); }
113 for (
unsigned int i=0;
i<
jets.size(); ++
i ) {
115 vector<pair<string,PileupJetIdAlgo *> >::iterator algoi =
algos_.begin();
157 const reco::Jet * theJet = ( applyJec ? corrJet : &
jet );
163 ids.push_back( puIdentifier );
166 puIdentifier = (*vmap)[
jets.refAt(
i)];
167 puIdentifier.
jetPt(theJet->
pt());
170 ialgo->
set(puIdentifier);
176 mvas[algoi->first].push_back( puIdentifier.
mva() );
177 idflags[algoi->first].push_back( puIdentifier.
idFlag() );
178 for( ++algoi; algoi!=
algos_.end(); ++algoi) {
179 ialgo = algoi->second;
180 ialgo->
set(puIdentifier);
182 mvas[algoi->first].push_back(
id.mva() );
183 idflags[algoi->first].push_back(
id.idFlag() );
188 if( corrJet ) {
delete corrJet; }
193 for(vector<pair<string,PileupJetIdAlgo *> >::iterator ialgo =
algos_.begin(); ialgo!=
algos_.end(); ++ialgo) {
195 vector<float> & mva = mvas[ialgo->first];
198 mvafiller.insert(jetHandle,mva.begin(),mva.end());
200 iEvent.
put(mvaout,ialgo->first+
"Discriminant");
203 vector<int> & idflag = idflags[ialgo->first];
206 idflagfiller.insert(jetHandle,idflag.begin(),idflag.end());
208 iEvent.
put(idflagout,ialgo->first+
"Id");
213 assert( jetHandle->size() == ids.size() );
216 idsfiller.insert(jetHandle,ids.begin(),ids.end());
240 std::vector<std::string> jecLevels;
241 jecLevels.push_back(
"L1FastJet");
242 jecLevels.push_back(
"L2Relative");
243 jecLevels.push_back(
"L3Absolute");
249 for(std::vector<std::string>::const_iterator ll = jecLevels.begin(); ll != jecLevels.end(); ++ll)
T getParameter(std::string const &) const
void set(const PileupJetIdentifier &)
std::vector< JetCorrectorParameters > jetCorPars_
virtual void scaleEnergy(double fScale)
scale energy of the jet
edm::EDGetTokenT< reco::VertexCollection > input_vertex_token_
bool getByToken(EDGetToken token, Handle< PROD > &result) const
const int & idFlag() const
std::vector< std::pair< std::string, PileupJetIdAlgo * > > algos_
const float & mva() const
#define DEFINE_FWK_MODULE(type)
Base class for all types of Jets.
edm::EDGetTokenT< edm::View< reco::Jet > > input_jet_token_
std::vector< Vertex > VertexCollection
collection of Vertex objects
const float & jetPt() const
PileupJetIdProducer(const edm::ParameterSet &)
virtual double eta() const
momentum pseudorapidity
virtual double pt() const
transverse momentum
void setJetEta(float fEta)
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
virtual CompositePtrCandidate * clone() const
returns a clone of the candidate
FactorizedJetCorrector * jecCor_
void addDefault(ParameterSetDescription const &psetDescription)
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
edm::EDGetTokenT< double > input_rho_token_
edm::FileInPath residualsTxt_
void initJetEnergyCorrector(const edm::EventSetup &iSetup, bool isData)
virtual void produce(edm::Event &, const edm::EventSetup &) override
const float & jetPhi() const
PileupJetIdentifier computeIdVariables(const reco::Jet *jet, float jec, const reco::Vertex *, const reco::VertexCollection &, double rho)
PileupJetIdentifier computeMva()
virtual float jetArea() const
get jet area
edm::EDGetTokenT< edm::ValueMap< StoredPileupJetIdentifier > > input_vm_pujetid_token_
std::string fullPath() const
virtual double phi() const
momentum azimuthal angle
const float & jetEta() const