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");
67 for(std::vector<std::pair<std::string,PileupJetIdAlgo *> >::iterator
102 vector<StoredPileupJetIdentifier> ids;
103 map<string, vector<float> > mvas;
104 map<string, vector<int> > idflags;
106 VertexCollection::const_iterator vtx;
109 vtx = vertexes.begin();
110 while( vtx != vertexes.end() && ( vtx->isFake() || vtx->ndof() < 4 ) ) {
113 if( vtx == vertexes.end() ) { vtx = vertexes.begin(); }
117 for (
unsigned int i=0;
i<
jets.size(); ++
i ) {
119 vector<pair<string,PileupJetIdAlgo *> >::iterator algoi =
algos_.begin();
161 const reco::Jet * theJet = ( applyJec ? corrJet : &
jet );
167 ids.push_back( puIdentifier );
170 puIdentifier = (*vmap)[
jets.refAt(
i)];
171 puIdentifier.
jetPt(theJet->
pt());
174 ialgo->
set(puIdentifier);
180 mvas[algoi->first].push_back( puIdentifier.
mva() );
181 idflags[algoi->first].push_back( puIdentifier.
idFlag() );
182 for( ++algoi; algoi!=
algos_.end(); ++algoi) {
183 ialgo = algoi->second;
184 ialgo->
set(puIdentifier);
186 mvas[algoi->first].push_back(
id.mva() );
187 idflags[algoi->first].push_back(
id.idFlag() );
192 if( corrJet ) {
delete corrJet; }
197 for(vector<pair<string,PileupJetIdAlgo *> >::iterator ialgo =
algos_.begin(); ialgo!=
algos_.end(); ++ialgo) {
199 vector<float> & mva = mvas[ialgo->first];
202 mvafiller.insert(jetHandle,mva.begin(),mva.end());
204 iEvent.
put(mvaout,ialgo->first+
"Discriminant");
207 vector<int> & idflag = idflags[ialgo->first];
210 idflagfiller.insert(jetHandle,idflag.begin(),idflag.end());
212 iEvent.
put(idflagout,ialgo->first+
"Id");
217 assert( jetHandle->size() == ids.size() );
220 idsfiller.insert(jetHandle,ids.begin(),ids.end());
244 std::vector<std::string> jecLevels;
245 jecLevels.push_back(
"L1FastJet");
246 jecLevels.push_back(
"L2Relative");
247 jecLevels.push_back(
"L3Absolute");
253 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