20 template <
typename jetType>
22 hltLeptonTag(iConfig.getParameter< edm::InputTag > (
"HltLeptonTag")),
23 sourceJetTag(iConfig.getParameter< edm::InputTag > (
"SourceJetTag")),
24 minDeltaR_(iConfig.getParameter< double > (
"minDeltaR"))
31 produces<JetCollectionVector> ();
34 template <
typename jetType>
42 template <
typename jetType>
48 desc.
add<
double> (
"minDeltaR", 0.5);
59 template <
typename jetType>
76 vector<Ref<reco::RecoEcalCandidateCollection> > clusCands;
79 vector<Ref<reco::ElectronCollection> > eleCands;
85 vector<reco::RecoChargedCandidateRef> muonCands;
91 const JetCollection & theJetCollection = *theJetCollectionHandle;
93 auto_ptr < JetCollectionVector > allSelections(
new JetCollectionVector());
95 if(!clusCands.empty()){
96 for(
size_t candNr=0;candNr<clusCands.size();candNr++){
98 for (
unsigned int j = 0;
j < theJetCollection.size();
j++) {
101 allSelections->push_back(refVector);
105 if(!eleCands.empty()){
106 for(
size_t candNr=0;candNr<eleCands.size();candNr++){
108 for (
unsigned int j = 0;
j < theJetCollection.size();
j++) {
111 allSelections->push_back(refVector);
115 if(!photonCands.empty()){
116 for(
size_t candNr=0;candNr<photonCands.size();candNr++){
118 for (
unsigned int j = 0;
j < theJetCollection.size();
j++) {
121 allSelections->push_back(refVector);
125 if(!muonCands.empty()){
126 for(
size_t candNr=0;candNr<muonCands.size();candNr++){
128 for (
unsigned int j = 0;
j < theJetCollection.size();
j++) {
129 if (
deltaR(muonCands[candNr]->
p4(),theJetCollection[
j]) >
minDeltaR_) refVector.push_back(
JetRef(theJetCollectionHandle, j));
131 allSelections->push_back(refVector);
138 iEvent.
put(allSelections);
std::vector< Jet > JetCollection
bool getByToken(EDGetToken token, Handle< PROD > &result) const
edm::EDGetTokenT< trigger::TriggerFilterObjectWithRefs > m_theLeptonToken
edm::Ref< JetCollection > JetRef
edm::InputTag hltLeptonTag
edm::RefVector< JetCollection > JetRefVector
edm::InputTag sourceJetTag
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
ParameterDescriptionBase * add(U const &iLabel, T const &value)
double deltaR(double eta1, double eta2, double phi1, double phi2)
~HLTJetCollectionsForLeptonPlusJets()
HLTJetCollectionsForLeptonPlusJets(const edm::ParameterSet &)
void add(std::string const &label, ParameterSetDescription const &psetDescription)
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
static int position[264][3]
edm::EDGetTokenT< std::vector< jetType > > m_theJetToken
virtual void produce(edm::Event &, const edm::EventSetup &)
std::vector< reco::RecoEcalCandidateRef > VRphoton