21 hltElectronTag(iConfig.getParameter< edm::InputTag > (
"HltElectronTag")),
22 sourceJetTag(iConfig.getParameter< edm::InputTag > (
"SourceJetTag")),
26 minDeltaR_(iConfig.getParameter< double > (
"minDeltaR"))
34 produces<TCollectionVector> ();
54 desc.
add<
double> (
"minDeltaR", 0.5);
74 typedef vector<T> TCollection;
82 iEvent.
getByToken(m_theElectronToken,PrevFilterOutput);
85 std::vector<edm::Ref<reco::RecoEcalCandidateCollection> > clusCands;
88 std::vector<edm::Ref<reco::ElectronCollection> > eleCands;
92 std::vector<TVector3> ElePs;
94 if(!clusCands.empty()){
95 for(
size_t candNr=0;candNr<clusCands.size();candNr++){
96 TVector3 positionVector(
97 clusCands[candNr]->superCluster()->
position().
x(),
98 clusCands[candNr]->superCluster()->
position().
y(),
99 clusCands[candNr]->superCluster()->
position().
z());
100 ElePs.push_back(positionVector);
102 }
else if(!eleCands.empty()){
103 for(
size_t candNr=0;candNr<eleCands.size();candNr++){
104 TVector3 positionVector(
105 eleCands[candNr]->superCluster()->
position().
x(),
106 eleCands[candNr]->superCluster()->
position().
y(),
107 eleCands[candNr]->superCluster()->
position().
z());
108 ElePs.push_back(positionVector);
113 iEvent.
getByToken(m_theJetToken, theJetCollectionHandle);
115 const TCollection & theJetCollection = *theJetCollectionHandle;
119 std::auto_ptr < TCollectionVector > allSelections(
new TCollectionVector());
123 for (
unsigned int i = 0;
i < ElePs.size();
i++) {
127 TRefVector refVector;
129 for (
unsigned int j = 0;
j < theJetCollection.size();
j++) {
130 TVector3 JetP(theJetCollection[
j].px(), theJetCollection[
j].py(), theJetCollection[
j].pz());
131 double DR = ElePs[
i].DeltaR(JetP);
134 refVector.push_back(TRef(theJetCollectionHandle,
j));
136 allSelections->push_back(refVector);
140 iEvent.
put(allSelections);
edm::EDGetTokenT< std::vector< T > > m_theJetToken
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
edm::InputTag sourceJetTag
~HLTJetCollectionsForElePlusJets()
bool getByToken(EDGetToken token, Handle< PROD > &result) const
static int position[TOTALCHAMBERS][3]
HLTJetCollectionsForElePlusJets(const edm::ParameterSet &)
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
edm::InputTag hltElectronTag
ParameterDescriptionBase * add(U const &iLabel, T const &value)
edm::EDGetTokenT< trigger::TriggerFilterObjectWithRefs > m_theElectronToken
void add(std::string const &label, ParameterSetDescription const &psetDescription)
virtual void produce(edm::Event &, const edm::EventSetup &)