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);
86 std::vector<edm::Ref<reco::RecoEcalCandidateCollection> > clusCands;
89 std::vector<edm::Ref<reco::ElectronCollection> > eleCands;
96 std::vector<TVector3> ElePs;
98 if(!clusCands.empty()){
99 for(
size_t candNr=0;candNr<clusCands.size();candNr++){
100 TVector3 positionVector(
101 clusCands[candNr]->superCluster()->
position().
x(),
102 clusCands[candNr]->superCluster()->
position().
y(),
103 clusCands[candNr]->superCluster()->
position().
z());
104 ElePs.push_back(positionVector);
106 }
else if(!eleCands.empty()){
107 for(
size_t candNr=0;candNr<eleCands.size();candNr++){
108 TVector3 positionVector(
109 eleCands[candNr]->superCluster()->
position().
x(),
110 eleCands[candNr]->superCluster()->
position().
y(),
111 eleCands[candNr]->superCluster()->
position().
z());
112 ElePs.push_back(positionVector);
115 else if(!photonCands.empty()){
116 for(
size_t candNr=0;candNr<photonCands.size();candNr++){
117 TVector3 positionVector(
118 photonCands[candNr]->superCluster()->
position().
x(),
119 photonCands[candNr]->superCluster()->
position().
y(),
120 photonCands[candNr]->superCluster()->
position().
z());
121 ElePs.push_back(positionVector);
126 iEvent.
getByToken(m_theJetToken, theJetCollectionHandle);
128 const TCollection & theJetCollection = *theJetCollectionHandle;
132 std::auto_ptr < TCollectionVector > allSelections(
new TCollectionVector());
136 for (
unsigned int i = 0;
i < ElePs.size();
i++) {
140 TRefVector refVector;
142 for (
unsigned int j = 0;
j < theJetCollection.size();
j++) {
143 TVector3 JetP(theJetCollection[
j].px(), theJetCollection[
j].py(), theJetCollection[
j].pz());
144 double DR = ElePs[
i].DeltaR(JetP);
147 refVector.push_back(TRef(theJetCollectionHandle,
j));
149 allSelections->push_back(refVector);
153 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)
std::vector< reco::RecoEcalCandidateRef > VRphoton
virtual void produce(edm::Event &, const edm::EventSetup &)