25 hltElectronTag(iConfig.getParameter< edm::InputTag > (
"HltElectronTag")),
26 sourceJetTag(iConfig.getParameter< edm::InputTag > (
"SourceJetTag")),
30 minDeltaR_(iConfig.getParameter< double > (
"minDeltaR"))
36 produces<TCollectionVector> ();
56 desc.
add<
double> (
"minDeltaR", 0.5);
76 typedef vector<T> TCollection;
84 iEvent.
getByLabel(hltElectronTag,PrevFilterOutput);
87 std::vector<edm::Ref<reco::RecoEcalCandidateCollection> > clusCands;
90 std::vector<edm::Ref<reco::ElectronCollection> > eleCands;
94 std::vector<TVector3> ElePs;
96 if(!clusCands.empty()){
97 for(
size_t candNr=0;candNr<clusCands.size();candNr++){
98 TVector3 positionVector(
99 clusCands[candNr]->superCluster()->
position().
x(),
100 clusCands[candNr]->superCluster()->
position().
y(),
101 clusCands[candNr]->superCluster()->
position().
z());
102 ElePs.push_back(positionVector);
104 }
else if(!eleCands.empty()){
105 for(
size_t candNr=0;candNr<eleCands.size();candNr++){
106 TVector3 positionVector(
107 eleCands[candNr]->superCluster()->
position().
x(),
108 eleCands[candNr]->superCluster()->
position().
y(),
109 eleCands[candNr]->superCluster()->
position().
z());
110 ElePs.push_back(positionVector);
115 iEvent.
getByLabel(sourceJetTag, theJetCollectionHandle);
118 const TCollection & theJetCollection = *theJetCollectionHandle;
122 std::auto_ptr < TCollectionVector > allSelections(
new TCollectionVector());
126 for (
unsigned int i = 0;
i < ElePs.size();
i++) {
130 TRefVector refVector;
132 for (
unsigned int j = 0;
j < theJetCollection.size();
j++) {
133 TVector3 JetP(theJetCollection[
j].px(), theJetCollection[
j].py(), theJetCollection[
j].pz());
134 double DR = ElePs[
i].DeltaR(JetP);
137 refVector.push_back(TRef(theJetCollectionHandle,
j));
139 allSelections->push_back(refVector);
143 iEvent.
put(allSelections);
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
~HLTJetCollectionsForElePlusJets()
static int position[TOTALCHAMBERS][3]
HLTJetCollectionsForElePlusJets(const edm::ParameterSet &)
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
ParameterDescriptionBase * add(U const &iLabel, T const &value)
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
void add(std::string const &label, ParameterSetDescription const &psetDescription)
virtual void produce(edm::Event &, const edm::EventSetup &)