52 double pi = 4.*atan(1.);
57 std::auto_ptr<HORecHitCollection> miniDiJetsHORecHitCollection(
new HORecHitCollection);
58 std::auto_ptr<HFRecHitCollection> miniDiJetsHFRecHitCollection(
new HFRecHitCollection);
75 double dphi = fabs(fJet1.
phi() - fJet2.
phi());
76 if(dphi > pi){dphi = 2*pi - dphi;}
77 double degreedphi = dphi*180./
pi;
78 if(fabs(degreedphi-180)<30.){iflag_select = 1;}
80 if(iflag_select == 1){
83 jetv.push_back(fJet1);
84 jetv.push_back(fJet2);
88 jetv.push_back(fJet3);
91 iEvent.
put(
result,
"DiJetsBackToBackCollection");
92 iEvent.
put( miniDiJetsEcalRecHitCollection,
"DiJetsEcalRecHitCollection");
93 iEvent.
put( miniDiJetsHBHERecHitCollection,
"DiJetsHBHERecHitCollection");
94 iEvent.
put( miniDiJetsHORecHitCollection,
"DiJetsHORecHitCollection");
95 iEvent.
put( miniDiJetsHFRecHitCollection,
"DiJetsHFRecHitCollection");
101 std::vector<edm::EDGetTokenT<EcalRecHitCollection> >::const_iterator
i;
106 ecItr != (*ec).end(); ++ecItr)
110 double phihit = pos.
phi();
111 double etahit = pos.
eta();
112 int iflag_select = 0;
113 for(
unsigned int i=0; i<jetv.size(); i++){
114 double deta = fabs(etahit - jetv[i].
eta());
115 double dphi = fabs(phihit - jetv[i].
phi());
116 if(dphi > pi) dphi = 2*pi - dphi;
117 double dr =
sqrt(deta*deta+dphi*dphi);
118 if(dr < 1.4){iflag_select = 1;}
120 if(iflag_select==1){miniDiJetsEcalRecHitCollection->push_back(*ecItr);}
130 hbheItr!=hbhe->end(); hbheItr++)
133 double phihit = pos.
phi();
134 double etahit = pos.
eta();
135 int iflag_select = 0;
136 for(
unsigned int i=0; i<jetv.size(); i++){
137 double deta = fabs(etahit - jetv[i].
eta());
138 double dphi = fabs(phihit - jetv[i].
phi());
139 if(dphi > pi) dphi = 2*pi - dphi;
140 double dr =
sqrt(deta*deta+dphi*dphi);
141 if(dr < 1.4){iflag_select = 1;}
143 if(iflag_select==1){miniDiJetsHBHERecHitCollection->push_back(*hbheItr);}
153 hoItr!=ho->end(); hoItr++)
156 double phihit = pos.
phi();
157 double etahit = pos.
eta();
158 int iflag_select = 0;
159 for(
unsigned int i=0; i<jetv.size(); i++){
160 double deta = fabs(etahit - jetv[i].
eta());
161 double dphi = fabs(phihit - jetv[i].
phi());
162 if(dphi > pi) dphi = 2*pi - dphi;
163 double dr =
sqrt(deta*deta+dphi*dphi);
164 if(dr < 1.4){iflag_select = 1;}
166 if(iflag_select==1){miniDiJetsHORecHitCollection->push_back(*hoItr);}
175 hfItr!=hf->end(); hfItr++)
178 double phihit = pos.
phi();
179 double etahit = pos.
eta();
180 int iflag_select = 0;
181 for(
unsigned int i=0; i<jetv.size(); i++){
182 double deta = fabs(etahit - jetv[i].
eta());
183 double dphi = fabs(phihit - jetv[i].
phi());
184 if(dphi > pi) dphi = 2*pi - dphi;
185 double dr =
sqrt(deta*deta+dphi*dphi);
186 if(dr < 1.4){iflag_select = 1;}
188 if(iflag_select==1){miniDiJetsHFRecHitCollection->push_back(*hfItr);}
194 iEvent.
put(
result,
"DiJetsBackToBackCollection");
195 iEvent.
put( miniDiJetsEcalRecHitCollection,
"DiJetsEcalRecHitCollection");
196 iEvent.
put( miniDiJetsHBHERecHitCollection,
"DiJetsHBHERecHitCollection");
197 iEvent.
put( miniDiJetsHORecHitCollection,
"DiJetsHORecHitCollection");
198 iEvent.
put( miniDiJetsHFRecHitCollection,
"DiJetsHFRecHitCollection");
Jets made from CaloTowers.
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Geom::Phi< T > phi() const
std::vector< EcalRecHit >::const_iterator const_iterator
edm::EDGetTokenT< HFRecHitCollection > tok_hf_
virtual float phi() const GCC11_FINAL
momentum azimuthal angle
std::vector< edm::EDGetTokenT< EcalRecHitCollection > > toks_ecal_
edm::EDGetTokenT< HORecHitCollection > tok_ho_
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
const GlobalPoint & getPosition(const DetId &id) const
Get the position of a given detector id.
edm::EDGetTokenT< HBHERecHitCollection > tok_hbhe_
T const * product() const
edm::EDGetTokenT< reco::CaloJetCollection > tok_jets_
std::vector< CaloJet > CaloJetCollection
collection of CaloJet objects