19 double Rcurv=pT*33.3*100/38;
24 if (theta>0.5*acos(-1)) theta=acos(-1)-
theta;
25 if (fabs(etaIP)<1.479) {
26 deltaPhi=-charge*asin(0.5*ecRad/Rcurv);
27 double alpha1=2*asin(0.5*ecRad/Rcurv);
28 double z=ecRad/
tan(theta);
29 if (etaIP>0) zNew=z*(Rcurv*alpha1)/ecRad+vtxZ;
30 else zNew=-z*(Rcurv*alpha1)/ecRad+vtxZ;
31 double zAbs=fabs(zNew);
33 etaEC=-
log(
tan(0.5*atan(ecRad/zAbs)));
34 deltaPhi=-charge*asin(0.5*ecRad/Rcurv);
37 zAbs=(fabs(etaIP)/etaIP)*ecDist;
38 double Zflight=fabs(zAbs-vtxZ);
39 double alpha=(Zflight*ecRad)/(z*Rcurv);
40 double Rec=2*Rcurv*
sin(alpha/2);
41 deltaPhi=-charge*alpha/2;
42 etaEC=-
log(
tan(0.5*atan(Rec/ecDist)));
45 zNew=(fabs(etaIP)/etaIP)*ecDist;
46 double Zflight=fabs(zNew-vtxZ);
47 double Rvirt=fabs(Zflight*
tan(theta));
48 double Rec=2*Rcurv*
sin(Rvirt/(2*Rcurv));
49 deltaPhi=-(
charge)*(Rvirt/(2*Rcurv));
50 etaEC=-
log(
tan(0.5*atan(Rec/ecDist)));
53 if (zNew<0) etaEC=-etaEC;
56 if (phiEC<-acos(-1)) phiEC=2*acos(-1)+phiEC;
57 if (phiEC>acos(-1)) phiEC=-2*acos(-1)+phiEC;
59 std::pair<double,double> retVal(etaEC,phiEC);
66 if (fabs(eta1)<1.479) Rec=129;
68 double ce1=cosh(eta1);
69 double ce2=cosh(eta2);
70 double te1=tanh(eta1);
71 double te2=tanh(eta2);
73 double z=
cos(phi1-phi2)/ce1/ce2+te1*te2;
74 if(z!=0) dR=fabs(Rec*ce1*
sqrt(1./z/z-1.));
80 ModuleLabel_(iConfig.getUntrackedParameter(
"ModuleLabel",std::string(
"generator"))),
81 MaxSeedEta_(iConfig.getUntrackedParameter<double>(
"MaxSeedEta", 2.3)),
82 MinSeedMom_(iConfig.getUntrackedParameter<double>(
"MinSeedMom", 20.)),
83 MinIsolTrackMom_(iConfig.getUntrackedParameter<double>(
"MinIsolTrackMom",2.0)),
84 IsolCone_(iConfig.getUntrackedParameter<double>(
"IsolCone", 40.0)),
85 PixelEfficiency_(iConfig.getUntrackedParameter<double>(
"PixelEfficiency", 0.8))
90 throw cms::Exception(
"Configuration") <<
"PythiaFilterIsolatedTrack requires the RandomNumberGeneratorService\n";
112 const HepMC::GenEvent* myGenEvent = evt->GetEvent();
118 std::vector<const HepMC::GenParticle *> seeds;
121 for(HepMC::GenEvent::particle_const_iterator iter=myGenEvent->particles_begin(); iter!=myGenEvent->particles_end(); ++iter) {
123 int charge3 = pdt->particle(p->pdg_id())->
ID().threeCharge();
125 double momentum = p->momentum().rho();
126 double abseta = fabs(p->momentum().eta());
130 chargedParticles.push_back(p);
138 for(std::vector<const HepMC::GenParticle *>::const_iterator it1=seeds.begin(); it1!=seeds.end(); ++it1) {
142 p1->momentum().phi(),
143 p1->momentum().perp(),
144 (pdt->particle(p1->pdg_id()))->ID().threeCharge()/3,
149 for(std::vector<const HepMC::GenParticle *>::const_iterator it2=chargedParticles.begin(); it2!=chargedParticles.end(); ++it2) {
156 p2->momentum().phi(),
157 p2->momentum().perp(),
158 (pdt->particle(p2->pdg_id()))->ID().threeCharge()/3,
171 if(!failsIso)
return true;
Sin< T >::type sin(const T &t)
Geom::Theta< T > theta() const
void getData(T &iHolder) const
Cos< T >::type cos(const T &t)
virtual bool filter(edm::Event &, const edm::EventSetup &)
Tan< T >::type tan(const T &t)
virtual CLHEP::HepRandomEngine & getEngine() const =0
Use this to get the random number engine, this is the only function most users should call...
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
static double getDistInCM(double eta1, double phi1, double eta2, double phi2)
CLHEP::RandFlat * flatDistribution_
PythiaFilterIsolatedTrack(const edm::ParameterSet &)
edm::Service< edm::RandomNumberGenerator > rng_
~PythiaFilterIsolatedTrack()
static std::pair< double, double > GetEtaPhiAtEcal(double etaIP, double phiIP, double pT, int charge, double vtxZ)