63 std::vector<std::pair<std::string, PileupJetIdAlgo *> >
algos_;
85 std::vector<edm::ParameterSet> algos = iConfig.
getParameter<std::vector<edm::ParameterSet> >(
"algos");
89 if( !
runMvas_ ) assert( algos.size() == 1 );
91 if( produceJetIds_ ) {
92 produces<edm::ValueMap<StoredPileupJetIdentifier> > (
"");
94 for(std::vector<edm::ParameterSet>::iterator it=algos.begin(); it!=algos.end(); ++it) {
98 produces<edm::ValueMap<float> > (label+
"Discriminant");
99 produces<edm::ValueMap<int> > (label+
"Id");
118 using namespace reco;
140 vector<StoredPileupJetIdentifier> ids;
141 map<string, vector<float> > mvas;
142 map<string, vector<int> > idflags;
144 VertexCollection::const_iterator vtx;
147 vtx = vertexes.begin();
148 while( vtx != vertexes.end() && ( vtx->isFake() || vtx->ndof() < 4 ) ) {
151 if( vtx == vertexes.end() ) { vtx = vertexes.begin(); }
155 for (
unsigned int i=0;
i<
jets.size(); ++
i ) {
157 vector<pair<string,PileupJetIdAlgo *> >::iterator algoi =
algos_.begin();
199 const reco::Jet * theJet = ( applyJec ? corrJet : &
jet );
205 ids.push_back( puIdentifier );
208 puIdentifier = (*vmap)[
jets.refAt(
i)];
209 puIdentifier.jetPt(theJet->
pt());
210 puIdentifier.jetEta(theJet->
eta());
211 puIdentifier.jetPhi(theJet->
phi());
212 ialgo->
set(puIdentifier);
218 mvas[algoi->first].push_back( puIdentifier.mva() );
219 idflags[algoi->first].push_back( puIdentifier.idFlag() );
220 for( ++algoi; algoi!=
algos_.end(); ++algoi) {
221 ialgo = algoi->second;
222 ialgo->
set(puIdentifier);
224 mvas[algoi->first].push_back(
id.mva() );
225 idflags[algoi->first].push_back(
id.idFlag() );
230 if( corrJet ) {
delete corrJet; }
235 for(vector<pair<string,PileupJetIdAlgo *> >::iterator ialgo =
algos_.begin(); ialgo!=
algos_.end(); ++ialgo) {
237 vector<float> & mva = mvas[ialgo->first];
240 mvafiller.insert(jetHandle,mva.begin(),mva.end());
242 iEvent.
put(mvaout,ialgo->first+
"Discriminant");
245 vector<int> & idflag = idflags[ialgo->first];
248 idflagfiller.insert(jetHandle,idflag.begin(),idflag.end());
250 iEvent.
put(idflagout,ialgo->first+
"Id");
255 assert( jetHandle->size() == ids.size() );
258 idsfiller.insert(jetHandle,ids.begin(),ids.end());
282 std::vector<std::string> jecLevels;
283 jecLevels.push_back(
"L1FastJet");
284 jecLevels.push_back(
"L2Relative");
285 jecLevels.push_back(
"L3Absolute");
291 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_
std::vector< std::pair< std::string, PileupJetIdAlgo * > > algos_
#define DEFINE_FWK_MODULE(type)
Base class for all types of Jets.
std::vector< Vertex > VertexCollection
collection of Vertex objects
virtual void scaleEnergy(double fScale)
scale energy of the jet
PileupJetIdProducer(const edm::ParameterSet &)
void setJetEta(float fEta)
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
virtual CompositePtrCandidate * clone() const
returns a clone of the candidate
virtual float phi() const GCC11_FINAL
momentum azimuthal angle
FactorizedJetCorrector * jecCor_
void addDefault(ParameterSetDescription const &psetDescription)
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
edm::FileInPath residualsTxt_
PileupJetIdentifier computeIdVariables(const reco::Jet *jet, float jec, const reco::Vertex *, const reco::VertexCollection &, bool calculateMva=false)
void initJetEnergyCorrector(const edm::EventSetup &iSetup, bool isData)
virtual void produce(edm::Event &, const edm::EventSetup &) override
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
virtual float eta() const GCC11_FINAL
momentum pseudorapidity
PileupJetIdentifier computeMva()
virtual float jetArea() const
get jet area
std::string fullPath() const
virtual float pt() const GCC11_FINAL
transverse momentum