50 double pi = 4.*atan(1.);
55 std::auto_ptr<HORecHitCollection> miniDiJetsHORecHitCollection(
new HORecHitCollection);
56 std::auto_ptr<HFRecHitCollection> miniDiJetsHFRecHitCollection(
new HFRecHitCollection);
73 double dphi = fabs(fJet1.
phi() - fJet2.
phi());
74 if(dphi > pi){dphi = 2*pi - dphi;}
75 double degreedphi = dphi*180./
pi;
76 if(fabs(degreedphi-180)<30.){iflag_select = 1;}
78 if(iflag_select == 1){
81 jetv.push_back(fJet1);
82 jetv.push_back(fJet2);
86 jetv.push_back(fJet3);
89 iEvent.
put(
result,
"DiJetsBackToBackCollection");
90 iEvent.
put( miniDiJetsEcalRecHitCollection,
"DiJetsEcalRecHitCollection");
91 iEvent.
put( miniDiJetsHBHERecHitCollection,
"DiJetsHBHERecHitCollection");
92 iEvent.
put( miniDiJetsHORecHitCollection,
"DiJetsHORecHitCollection");
93 iEvent.
put( miniDiJetsHFRecHitCollection,
"DiJetsHFRecHitCollection");
99 std::vector<edm::InputTag>::const_iterator
i;
104 ecItr != (*ec).end(); ++ecItr)
108 double phihit = pos.
phi();
109 double etahit = pos.
eta();
110 int iflag_select = 0;
111 for(
unsigned int i=0; i<jetv.size(); i++){
112 double deta = fabs(etahit - jetv[i].
eta());
113 double dphi = fabs(phihit - jetv[i].
phi());
114 if(dphi > pi) dphi = 2*pi - dphi;
115 double dr =
sqrt(deta*deta+dphi*dphi);
116 if(dr < 1.4){iflag_select = 1;}
118 if(iflag_select==1){miniDiJetsEcalRecHitCollection->push_back(*ecItr);}
128 hbheItr!=hbhe->end(); hbheItr++)
131 double phihit = pos.
phi();
132 double etahit = pos.
eta();
133 int iflag_select = 0;
134 for(
unsigned int i=0; i<jetv.size(); i++){
135 double deta = fabs(etahit - jetv[i].
eta());
136 double dphi = fabs(phihit - jetv[i].
phi());
137 if(dphi > pi) dphi = 2*pi - dphi;
138 double dr =
sqrt(deta*deta+dphi*dphi);
139 if(dr < 1.4){iflag_select = 1;}
141 if(iflag_select==1){miniDiJetsHBHERecHitCollection->push_back(*hbheItr);}
151 hoItr!=ho->end(); hoItr++)
154 double phihit = pos.
phi();
155 double etahit = pos.
eta();
156 int iflag_select = 0;
157 for(
unsigned int i=0; i<jetv.size(); i++){
158 double deta = fabs(etahit - jetv[i].
eta());
159 double dphi = fabs(phihit - jetv[i].
phi());
160 if(dphi > pi) dphi = 2*pi - dphi;
161 double dr =
sqrt(deta*deta+dphi*dphi);
162 if(dr < 1.4){iflag_select = 1;}
164 if(iflag_select==1){miniDiJetsHORecHitCollection->push_back(*hoItr);}
173 hfItr!=hf->end(); hfItr++)
176 double phihit = pos.
phi();
177 double etahit = pos.
eta();
178 int iflag_select = 0;
179 for(
unsigned int i=0; i<jetv.size(); i++){
180 double deta = fabs(etahit - jetv[i].
eta());
181 double dphi = fabs(phihit - jetv[i].
phi());
182 if(dphi > pi) dphi = 2*pi - dphi;
183 double dr =
sqrt(deta*deta+dphi*dphi);
184 if(dr < 1.4){iflag_select = 1;}
186 if(iflag_select==1){miniDiJetsHFRecHitCollection->push_back(*hfItr);}
192 iEvent.
put(
result,
"DiJetsBackToBackCollection");
193 iEvent.
put( miniDiJetsEcalRecHitCollection,
"DiJetsEcalRecHitCollection");
194 iEvent.
put( miniDiJetsHBHERecHitCollection,
"DiJetsHBHERecHitCollection");
195 iEvent.
put( miniDiJetsHORecHitCollection,
"DiJetsHORecHitCollection");
196 iEvent.
put( miniDiJetsHFRecHitCollection,
"DiJetsHFRecHitCollection");
std::vector< edm::InputTag > ecalLabels_
Jets made from CaloTowers.
Geom::Phi< T > phi() const
std::vector< EcalRecHit >::const_iterator const_iterator
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.
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
T const * product() const
virtual double phi() const
momentum azimuthal angle
std::vector< CaloJet > CaloJetCollection
collection of CaloJet objects