17 ecalLabels_=iConfig.
getParameter<std::vector<edm::InputTag> >(
"ecalInputs");
21 allowMissingInputs_ =
true;
24 const unsigned nLabels = ecalLabels_.size();
25 for (
unsigned i=0;
i != nLabels;
i++ )
26 toks_ecal_.push_back(consumes<EcalRecHitCollection>(ecalLabels_[
i]));
29 produces<CaloJetCollection>(
"DiJetsBackToBackCollection");
30 produces<EcalRecHitCollection>(
"DiJetsEcalRecHitCollection");
31 produces<HBHERecHitCollection>(
"DiJetsHBHERecHitCollection");
32 produces<HORecHitCollection>(
"DiJetsHORecHitCollection");
33 produces<HFRecHitCollection>(
"DiJetsHFRecHitCollection");
40 AlCaDiJetsProducer::~AlCaDiJetsProducer()
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){
81 result->push_back(fJet1);
82 result->push_back(fJet2);
83 jetv.push_back(fJet1);
84 jetv.push_back(fJet2);
87 result->push_back(fJet3);
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;
102 for (i=toks_ecal_.begin(); i!=toks_ecal_.end(); 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");
T getParameter(std::string const &) const
Jets made from CaloTowers.
bool getByToken(EDGetToken token, Handle< PROD > &result) const
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.
T const * product() const
virtual double phi() const
momentum azimuthal angle
std::vector< CaloJet > CaloJetCollection
collection of CaloJet objects