61 GenPlane(
string name,
double etaminval1,
double etamaxval1,
double etaminval2,
double etamaxval2,
int orderval){
69 order = (double) orderval;
74 if((eta>=etamin1 && eta<etamax1) ||
75 (etamin2!= etamax2 && eta>=etamin2 && eta<etamax2 )) {
91 double q = sv*sv+cv*
cv;
92 if(q>0) ang = atan2(sv,cv)/order;
118 virtual void endJob() ;
174 produces<reco::EvtPlaneCollection>(
"recoLevel");
199 using namespace reco;
207 iEvent.
getByToken(vtxCollection_,vertexCollection3);
209 vs_sell = vertices3->size();
211 vzr_sell = vertices3->begin()->z();
216 if(vzr_sell>minvtx_ && vzr_sell<maxvtx_) {
219 double tower_eta, tower_phi;
220 double tower_energyet, tower_energyet_e, tower_energyet_h;
221 double s1,
s2, s13,s23,s14,s24,s15,s25,s16,s26;
228 tower_eta =
j->eta();
229 tower_phi =
j->phi();
230 tower_energyet_e =
j->emEt();
231 tower_energyet_h =
j->hadEt();
232 tower_energyet = tower_energyet_e + tower_energyet_h;
234 s1 =
sin(2.*tower_phi);
235 s2 =
cos(2.*tower_phi);
236 s13 =
sin(3.*tower_phi);
237 s23 =
cos(3.*tower_phi);
238 s14 =
sin(4.*tower_phi);
239 s24 =
cos(4.*tower_phi);
240 s15 =
sin(5.*tower_phi);
241 s25 =
cos(5.*tower_phi);
242 s16 =
sin(6.*tower_phi);
243 s26 =
cos(6.*tower_phi);
245 if(tower_energyet<minet_)
continue;
246 if(tower_energyet>maxet_)
continue;;
248 rp[
etEcal ]->addParticle (tower_energyet_e, s1, s2, tower_eta);
249 rp[
etEcalP ]->addParticle (tower_energyet_e, s1, s2, tower_eta);
250 rp[
etEcalM ]->addParticle (tower_energyet_e, s1, s2, tower_eta);
251 rp[
etHcal ]->addParticle (tower_energyet_h, s1, s2, tower_eta);
252 rp[
etHcalP ]->addParticle (tower_energyet_h, s1, s2, tower_eta);
253 rp[
etHcalM ]->addParticle (tower_energyet_h, s1, s2, tower_eta);
254 rp[
etHF ]->addParticle (tower_energyet, s1, s2, tower_eta);
255 rp[
etHFp ]->addParticle (tower_energyet, s1, s2, tower_eta);
256 rp[
etHFm ]->addParticle (tower_energyet, s1, s2, tower_eta);
257 rp[
etCaloHFP ]->addParticle (tower_energyet, s1, s2, tower_eta);
258 rp[
etCaloHFM ]->addParticle (tower_energyet, s1, s2, tower_eta);
260 rp[
etHF3 ]->addParticle (tower_energyet, s13, s23, tower_eta);
261 rp[
etHFp3 ]->addParticle (tower_energyet, s13, s23, tower_eta);
262 rp[
etHFm3 ]->addParticle (tower_energyet, s13, s23, tower_eta);
264 rp[
etHF4 ]->addParticle (tower_energyet, s14, s24, tower_eta);
265 rp[
etHFp4 ]->addParticle (tower_energyet, s14, s24, tower_eta);
266 rp[
etHFm4 ]->addParticle (tower_energyet, s14, s24, tower_eta);
268 rp[
etHF5 ]->addParticle (tower_energyet, s15, s25, tower_eta);
269 rp[
etHFp5 ]->addParticle (tower_energyet, s15, s25, tower_eta);
270 rp[
etHFm5 ]->addParticle (tower_energyet, s15, s25, tower_eta);
272 rp[
etHF6 ]->addParticle (tower_energyet, s16, s26, tower_eta);
273 rp[
etHFp6 ]->addParticle (tower_energyet, s16, s26, tower_eta);
274 rp[
etHFm6 ]->addParticle (tower_energyet, s16, s26, tower_eta);
287 for(reco::TrackCollection::const_iterator
j = tracks->begin();
j != tracks->end();
j++){
297 double vzErr =0.0, vxErr=0.0, vyErr=0.0;
298 if(vertex->size()>0) {
299 vtxPoint=vertex->begin()->position();
300 vzErr=vertex->begin()->zError();
301 vxErr=vertex->begin()->xError();
302 vyErr=vertex->begin()->yError();
304 bool accepted =
true;
305 bool isPixel =
false;
307 if (
j->numberOfValidHits() < 7 ) isPixel =
true;
310 double d0=0.0, dz=0.0, d0sigma=0.0, dzsigma=0.0;
311 d0 = -1.*
j->dxy(vtxPoint);
312 dz =
j->dz(vtxPoint);
313 d0sigma =
sqrt(
j->d0Error()*
j->d0Error()+vxErr*vyErr);
314 dzsigma =
sqrt(
j->dzError()*
j->dzError()+vzErr*vzErr);
320 if ( fabs(dz/dzsigma) > dzerr_ ) accepted =
false;
323 if (
j->normalizedChi2() > chi2_ ) accepted =
false;
330 if ( fabs(dz/dzsigma) > 3 ) accepted =
false;
331 if ( fabs(d0/d0sigma) > 3 ) accepted =
false;
334 if (
j->ptError()/
j->pt() > 0.05 ) accepted =
false;
337 if (
j->numberOfValidHits() < 12 ) accepted =
false;
340 track_eta =
j->eta();
341 track_phi =
j->phi();
343 double s =
sin(2*track_phi);
344 double c =
cos(2*track_phi);
345 double s3 =
sin(3*track_phi);
346 double c3 =
cos(3*track_phi);
347 double s4 =
sin(4*track_phi);
348 double c4 =
cos(4*track_phi);
349 double s5 =
sin(5*track_phi);
350 double c5 =
cos(5*track_phi);
351 double s6 =
sin(6*track_phi);
352 double c6 =
cos(6*track_phi);
354 if(useTrackPtWeight_) {
358 if(track_pt<minpt_)
continue;
359 if(track_pt>maxpt_)
continue;
390 rp[
i]->getAngle(ang,sv,
cv);
395 for(
int i = 0;
i<9;
i++) {
396 evtplaneOutput->push_back(*ep[
i]);
400 if(useECAL_ && !useHCAL_) {
401 if(
EPNames[
i].rfind(
"Ecal")!=string::npos) {
402 evtplaneOutput->push_back(*ep[
i]);
404 }
else if (useHCAL_ && !useECAL_) {
405 if(
EPNames[
i].rfind(
"Hcal")!=string::npos) {
406 evtplaneOutput->push_back(*ep[
i]);
408 }
else if (useECAL_ && useHCAL_) {
409 evtplaneOutput->push_back(*ep[
i]);
413 iEvent.
put(evtplaneOutput,
"recoLevel");
double getAngle(double &ang, double &sv, double &cv)
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
GenPlane(string name, double etaminval1, double etamaxval1, double etaminval2, double etamaxval2, int orderval)
edm::EDGetTokenT< reco::VertexCollection > vtxCollection_
bool getByToken(EDGetToken token, Handle< PROD > &result) const
#define DEFINE_FWK_MODULE(type)
Sin< T >::type sin(const T &t)
std::vector< CaloTower >::const_iterator const_iterator
std::vector< Vertex > VertexCollection
collection of Vertex objects
const std::string EPNames[]
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
Cos< T >::type cos(const T &t)
std::vector< EvtPlane > EvtPlaneCollection
virtual void produce(edm::Event &, const edm::EventSetup &)
edm::EDGetTokenT< CaloTowerCollection > caloCollection_
EvtPlaneProducer(const edm::ParameterSet &)
edm::EDGetTokenT< reco::TrackCollection > trackCollection_
void addParticle(double w, double s, double c, double eta)
XYZPointD XYZPoint
point in space with cartesian internal representation
char data[epos_bytes_allocation]
static const int NumEPNames
void reset(double vett[256])