64 std::vector<std::pair<std::string, PileupJetIdAlgo *> >
algos_;
86 std::vector<edm::ParameterSet> algos = iConfig.
getParameter<std::vector<edm::ParameterSet> >(
"algos");
90 if( !
runMvas_ ) assert( algos.size() == 1 );
92 if( produceJetIds_ ) {
93 produces<edm::ValueMap<StoredPileupJetIdentifier> > (
"");
95 for(std::vector<edm::ParameterSet>::iterator it=algos.begin(); it!=algos.end(); ++it) {
99 produces<edm::ValueMap<float> > (label+
"Discriminant");
100 produces<edm::ValueMap<int> > (label+
"Id");
119 using namespace reco;
141 vector<StoredPileupJetIdentifier> ids;
142 map<string, vector<float> > mvas;
143 map<string, vector<int> > idflags;
145 VertexCollection::const_iterator vtx;
148 vtx = vertexes.begin();
149 while( vtx != vertexes.end() && ( vtx->isFake() || vtx->ndof() < 4 ) ) {
152 if( vtx == vertexes.end() ) { vtx = vertexes.begin(); }
156 for (
unsigned int i=0;
i<
jets.size(); ++
i ) {
158 vector<pair<string,PileupJetIdAlgo *> >::iterator algoi =
algos_.begin();
200 const reco::Jet * theJet = ( applyJec ? corrJet : &
jet );
206 ids.push_back( puIdentifier );
209 puIdentifier = (*vmap)[
jets.refAt(
i)];
210 puIdentifier.jetPt(theJet->
pt());
211 puIdentifier.jetEta(theJet->
eta());
212 puIdentifier.jetPhi(theJet->
phi());
213 ialgo->
set(puIdentifier);
219 mvas[algoi->first].push_back( puIdentifier.mva() );
220 idflags[algoi->first].push_back( puIdentifier.idFlag() );
221 for( ++algoi; algoi!=
algos_.end(); ++algoi) {
222 ialgo = algoi->second;
223 ialgo->
set(puIdentifier);
225 mvas[algoi->first].push_back(
id.mva() );
226 idflags[algoi->first].push_back(
id.idFlag() );
231 if( corrJet ) {
delete corrJet; }
236 for(vector<pair<string,PileupJetIdAlgo *> >::iterator ialgo =
algos_.begin(); ialgo!=
algos_.end(); ++ialgo) {
238 vector<float> & mva = mvas[ialgo->first];
241 mvafiller.insert(jetHandle,mva.begin(),mva.end());
243 iEvent.
put(mvaout,ialgo->first+
"Discriminant");
246 vector<int> & idflag = idflags[ialgo->first];
249 idflagfiller.insert(jetHandle,idflag.begin(),idflag.end());
251 iEvent.
put(idflagout,ialgo->first+
"Id");
256 assert( jetHandle->size() == ids.size() );
259 idsfiller.
insert(jetHandle,ids.begin(),ids.end());
283 std::vector<std::string> jecLevels;
284 jecLevels.push_back(
"L1FastJet");
285 jecLevels.push_back(
"L2Relative");
286 jecLevels.push_back(
"L3Absolute");
292 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.
void insert(const H &h, I begin, I end)
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)
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
virtual void produce(edm::Event &, const edm::EventSetup &)