18 hltElectronTag(iConfig.getParameter< edm::
InputTag > (
"HltElectronTag")),
19 sourceJetTag(iConfig.getParameter< edm::
InputTag > (
"SourceJetTag")),
23 minDeltaR_(iConfig.getParameter< double > (
"minDeltaR"))
31 produces<TCollectionVector> ();
51 desc.
add<
double> (
"minDeltaR", 0.5);
71 typedef vector<T> TCollection;
79 iEvent.
getByToken(m_theElectronToken,PrevFilterOutput);
83 std::vector<edm::Ref<reco::RecoEcalCandidateCollection> > clusCands;
86 std::vector<edm::Ref<reco::ElectronCollection> > eleCands;
93 std::vector<TVector3> ElePs;
95 if(!clusCands.empty()){
96 for(
size_t candNr=0;candNr<clusCands.size();candNr++){
97 TVector3 positionVector(
98 clusCands[candNr]->superCluster()->
position().
x(),
99 clusCands[candNr]->superCluster()->
position().y(),
100 clusCands[candNr]->superCluster()->
position().z());
101 ElePs.push_back(positionVector);
103 }
else if(!eleCands.empty()){
104 for(
size_t candNr=0;candNr<eleCands.size();candNr++){
105 TVector3 positionVector(
106 eleCands[candNr]->superCluster()->
position().
x(),
107 eleCands[candNr]->superCluster()->
position().y(),
108 eleCands[candNr]->superCluster()->
position().z());
109 ElePs.push_back(positionVector);
112 else if(!photonCands.empty()){
113 for(
size_t candNr=0;candNr<photonCands.size();candNr++){
114 TVector3 positionVector(
115 photonCands[candNr]->superCluster()->
position().
x(),
116 photonCands[candNr]->superCluster()->
position().y(),
117 photonCands[candNr]->superCluster()->
position().z());
118 ElePs.push_back(positionVector);
123 iEvent.
getByToken(m_theJetToken, theJetCollectionHandle);
125 const TCollection & theJetCollection = *theJetCollectionHandle;
129 std::auto_ptr < TCollectionVector > allSelections(
new TCollectionVector());
133 for (
unsigned int i = 0;
i < ElePs.size();
i++) {
137 TRefVector refVector;
139 for (
unsigned int j = 0;
j < theJetCollection.size();
j++) {
140 TVector3 JetP(theJetCollection[
j].px(), theJetCollection[
j].py(), theJetCollection[
j].pz());
141 double DR = ElePs[
i].DeltaR(JetP);
144 refVector.push_back(TRef(theJetCollectionHandle,
j));
146 allSelections->push_back(refVector);
150 iEvent.
put(allSelections);
std::string defaultModuleLabel()
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
T x() const
Cartesian x coordinate.
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)
static int position[264][3]
std::vector< reco::RecoEcalCandidateRef > VRphoton
virtual void produce(edm::Event &, const edm::EventSetup &)