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(); }
118 for (
unsigned int i=0;
i<
jets.size(); ++
i ) {
120 vector<pair<string,PileupJetIdAlgo *> >::iterator algoi =
algos_.begin();
165 const reco::Jet * theJet = ( applyJec ? corrJet : &
jet );
171 ids.push_back( puIdentifier );
174 puIdentifier = (*vmap)[
jets.refAt(
i)];
175 puIdentifier.
jetPt(theJet->
pt());
178 ialgo->
set(puIdentifier);
184 mvas[algoi->first].push_back( puIdentifier.
mva() );
185 idflags[algoi->first].push_back( puIdentifier.
idFlag() );
186 for( ++algoi; algoi!=
algos_.end(); ++algoi) {
187 ialgo = algoi->second;
188 ialgo->
set(puIdentifier);
190 mvas[algoi->first].push_back(
id.
mva() );
191 idflags[algoi->first].push_back(
id.idFlag() );
196 if( corrJet ) {
delete corrJet; }
201 for(vector<pair<string,PileupJetIdAlgo *> >::iterator ialgo =
algos_.begin(); ialgo!=
algos_.end(); ++ialgo) {
203 vector<float> &
mva = mvas[ialgo->first];
206 mvafiller.insert(jetHandle,mva.begin(),mva.end());
208 iEvent.
put(mvaout,ialgo->first+
"Discriminant");
211 vector<int> & idflag = idflags[ialgo->first];
214 idflagfiller.insert(jetHandle,idflag.begin(),idflag.end());
216 iEvent.
put(idflagout,ialgo->first+
"Id");
221 assert( jetHandle->size() == ids.size() );
224 idsfiller.insert(jetHandle,ids.begin(),ids.end());
248 std::vector<std::string> jecLevels;
249 jecLevels.push_back(
"L1FastJet");
250 jecLevels.push_back(
"L2Relative");
251 jecLevels.push_back(
"L3Absolute");
257 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_
virtual double phi() const final
momentum azimuthal angle
std::vector< Vertex > VertexCollection
collection of Vertex objects
const float & jetPt() const
PileupJetIdProducer(const edm::ParameterSet &)
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()
Analysis-level calorimeter jet class.
virtual float jetArea() const
get jet area
edm::EDGetTokenT< edm::ValueMap< StoredPileupJetIdentifier > > input_vm_pujetid_token_
virtual double eta() const final
momentum pseudorapidity
std::string fullPath() const
Jet correctedJet(const std::string &level, const std::string &flavor="none", const std::string &set="") const
virtual double pt() const final
transverse momentum
const float & jetEta() const