24 template <
typename jetType>
26 hltLeptonTag(iConfig.getParameter< edm::
InputTag > (
"HltLeptonTag")),
27 sourceJetTag(iConfig.getParameter< edm::
InputTag > (
"SourceJetTag")),
28 minDeltaR_(iConfig.getParameter< double > (
"minDeltaR"))
35 produces<JetCollectionVector> ();
38 template <
typename jetType>
46 template <
typename jetType>
54 desc.
add<
double> (
"minDeltaR", 0.5);
65 template <
typename jetType>
88 vector<Ref<reco::RecoEcalCandidateCollection> > clusCands;
91 vector<Ref<reco::ElectronCollection> > eleCands;
97 vector<reco::RecoChargedCandidateRef> muonCands;
103 const JetCollection & theJetCollection = *theJetCollectionHandle;
105 auto_ptr < JetCollectionVector > allSelections(
new JetCollectionVector());
107 if(!clusCands.empty()){
108 for(
size_t candNr=0;candNr<clusCands.size();candNr++){
110 for (
unsigned int j = 0;
j < theJetCollection.size();
j++) {
114 std::vector<reco::PFCandidatePtr> pfConstituents = theJetCollection[
j].getPFConstituents();
115 for(std::vector<reco::PFCandidatePtr>::const_iterator i_candidate = pfConstituents.begin(); i_candidate != pfConstituents.end(); ++i_candidate){
116 TVector3 ClusP(clusCands[candNr]->
p4().Px(),clusCands[candNr]->
p4().Py(), clusCands[candNr]->
p4().Pz());
117 TVector3 PFJetConstP((*i_candidate)->px(),(*i_candidate)->py(),(*i_candidate)->pz());
118 double deltaRPFConste = ClusP.DeltaR(PFJetConstP);
119 if(deltaRPFConste < 0.001 && w==0){
120 const_cast<LorentzVector&
>(theJetCollection[
j].p4()) = theJetCollection[j].
p4() - clusCands[candNr]->p4();
124 refVector.push_back(
JetRef(theJetCollectionHandle, j));
127 allSelections->push_back(refVector);
131 if(!eleCands.empty()){
132 for(
size_t candNr=0;candNr<eleCands.size();candNr++){
134 for (
unsigned int j = 0;
j < theJetCollection.size();
j++) {
138 std::vector<reco::PFCandidatePtr> pfConstituents = theJetCollection[
j].getPFConstituents();
139 for(std::vector<reco::PFCandidatePtr>::const_iterator i_candidate = pfConstituents.begin(); i_candidate != pfConstituents.end(); ++i_candidate){
140 TVector3 ElectronP(eleCands[candNr]->
p4().Px(),eleCands[candNr]->
p4().Py(), eleCands[candNr]->
p4().Pz());
141 TVector3 PFJetConstP((*i_candidate)->px(),(*i_candidate)->py(),(*i_candidate)->pz());
142 double deltaRPFConste = ElectronP.DeltaR(PFJetConstP);
143 if(deltaRPFConste < 0.001 && w==0){
144 const_cast<LorentzVector&
>(theJetCollection[
j].p4()) = theJetCollection[j].
p4() - eleCands[candNr]->p4();
148 refVector.push_back(
JetRef(theJetCollectionHandle, j));
152 allSelections->push_back(refVector);
156 if(!photonCands.empty()){
157 for(
size_t candNr=0;candNr<photonCands.size();candNr++){
159 for (
unsigned int j = 0;
j < theJetCollection.size();
j++) {
163 std::vector<reco::PFCandidatePtr> pfConstituents = theJetCollection[
j].getPFConstituents();
164 for(std::vector<reco::PFCandidatePtr>::const_iterator i_candidate = pfConstituents.begin(); i_candidate != pfConstituents.end(); ++i_candidate){
165 TVector3 PhotonP(photonCands[candNr]->
p4().Px(),photonCands[candNr]->
p4().Py(), photonCands[candNr]->
p4().Pz());
166 TVector3 PFJetConstP((*i_candidate)->px(),(*i_candidate)->py(),(*i_candidate)->pz());
167 double deltaRPFConste = PhotonP.DeltaR(PFJetConstP);
168 if(deltaRPFConste < 0.001 && w==0){
169 const_cast<LorentzVector&
>(theJetCollection[
j].p4()) = theJetCollection[j].
p4() - photonCands[candNr]->p4();
173 refVector.push_back(
JetRef(theJetCollectionHandle, j));
176 allSelections->push_back(refVector);
180 if(!muonCands.empty()){
181 for(
size_t candNr=0;candNr<muonCands.size();candNr++){
183 for (
unsigned int j = 0;
j < theJetCollection.size();
j++) {
184 if (
deltaR(muonCands[candNr]->
p4(),theJetCollection[
j]) >
minDeltaR_) refVector.push_back(
JetRef(theJetCollectionHandle, j));
187 std::vector<reco::PFCandidatePtr> pfConstituents = theJetCollection[
j].getPFConstituents();
188 for(std::vector<reco::PFCandidatePtr>::const_iterator i_candidate = pfConstituents.begin(); i_candidate != pfConstituents.end(); ++i_candidate){
189 TVector3 MuP(muonCands[candNr]->
p4().Px(),muonCands[candNr]->
p4().Py(), muonCands[candNr]->
p4().Pz());
190 TVector3 PFJetConstP((*i_candidate)->px(),(*i_candidate)->py(),(*i_candidate)->pz());
191 double deltaRPFConste = MuP.DeltaR(PFJetConstP);
192 if(deltaRPFConste < 0.001 && w==0){
193 const_cast<LorentzVector&
>(theJetCollection[
j].p4()) = theJetCollection[j].
p4() - muonCands[candNr]->p4();
197 refVector.push_back(
JetRef(theJetCollectionHandle, j));
200 allSelections->push_back(refVector);
207 iEvent.
put(allSelections);
std::string defaultModuleLabel()
std::vector< Jet > JetCollection
bool getByToken(EDGetToken token, Handle< PROD > &result) const
virtual void produce(edm::Event &, const edm::EventSetup &)
edm::InputTag sourceJetTag
edm::EDGetTokenT< std::vector< jetType > > m_theJetToken
edm::Ref< JetCollection > JetRef
edm::RefVector< JetCollection > JetRefVector
XYZTLorentzVectorD XYZTLorentzVector
Lorentz vector with cylindrical internal representation using pseudorapidity.
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
edm::EDGetTokenT< trigger::TriggerFilterObjectWithRefs > m_theLeptonToken
ParameterDescriptionBase * add(U const &iLabel, T const &value)
double deltaR(double eta1, double eta2, double phi1, double phi2)
edm::InputTag hltLeptonTag
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
~HLTJetCollectionsForBoostedLeptonPlusJets()
void add(std::string const &label, ParameterSetDescription const &psetDescription)
ROOT::Math::LorentzVector< ROOT::Math::PxPyPzE4D< float > > LorentzVector
HLTJetCollectionsForBoostedLeptonPlusJets(const edm::ParameterSet &)
static int position[264][3]
std::vector< reco::RecoEcalCandidateRef > VRphoton
math::PtEtaPhiELorentzVectorF LorentzVector