8 beamSpotHandle_(beamSpotHandle),
26 SLconversions.
clear();
29 for(
unsigned int c=0;
c<conversions.
size(); ++
c){
30 const std::vector<edm::RefToBase<reco::Track> >
tracks = conversions[
c]->tracks();
31 for (
unsigned int t=0;
t<tracks.size();
t++){
38 for(
unsigned int SLc=0; SLc<SLConversions.
size(); ++SLc){
39 const std::vector<edm::RefToBase<reco::Track> >
tracks = SLConversions[SLc]->tracks();
40 SLconversions.
push_back(SLConversions[SLc]);
42 for (
unsigned int t=0;
t<tracks.size();
t++){
43 SLTracks.push_back(tracks[
t]);
57 std::pair<float,float> Zint(0,0);
60 TVector3 SCPos(sc->position().x()-beamspot[0], sc->position().y()-beamspot[1], sc->position().z()-beamspot[2]);
64 int c_index=-1;
int SLc_index=-1;
65 if(conversions.
size()>0)
67 for(
unsigned int c=0;
c<conversions.
size(); ++
c){
68 float convR=
sqrt(conversions[
c]->conversionVertex().
x()* conversions[
c]->conversionVertex().
x() + conversions[
c]->conversionVertex().
y()* conversions[
c]->conversionVertex().
y());
76 if(SLconversions.
size()>0){
77 for(
unsigned int SLc=0; SLc<SLconversions.
size(); ++SLc){
78 std::vector<math::XYZPointF> innerPos=SLconversions[SLc]->tracksInnerPosition();
79 for (
unsigned int t=0;
t<innerPos.size();
t++){
80 float convR=
sqrt( innerPos[
t].
X()* innerPos[
t].
X() + innerPos[
t].Y()* innerPos[
t].Y());
90 TVector3 TkPos(beamspot[0],beamspot[1],beamspot[2]);
92 if(convRMin<SLConvRMin && c_index>-1){
94 TkPos.SetXYZ(conversions[c_index]->conversionVertex().
x()-beamspot[0],
95 conversions[c_index]->conversionVertex().
y()-beamspot[1],
96 conversions[c_index]->conversionVertex().
z()-beamspot[2] );
98 if(SLConvRMin<convRMin && SLc_index>-1){
100 TkPos.SetXYZ(conv.
x()-beamspot[0],
101 conv.
y()-beamspot[1],
102 conv.
z()-beamspot[2] );
105 float R1=
sqrt(SCPos.X()* SCPos.X() + SCPos.Y()*SCPos.Y());
106 float R2=
sqrt(TkPos.X()* TkPos.X() + TkPos.Y()*TkPos.Y());
109 float slope=(Z1-Z2)/(R1-R2);
110 Zint.first=Z2 - R2*
slope;
115 float sigmaFwd1=0.18;
116 float sigmaFwd2=0.61;
117 float sigmaFwd3=0.99;
123 if(sc->eta()<1.4442){
125 if(convRMin<SLConvRMin && c_index>-1){
126 if(convRMin<=15)Zint.second=sigmaPix;
127 else if(convRMin>15 && convRMin<=60)Zint.second=sigmaTib;
128 else Zint.second=sigmaTob;
131 if(SLConvRMin<convRMin && SLc_index>-1){
132 if(SLConvRMin<39)Zint.second=EBLR;
133 else Zint.second=EBHR;
138 if(convRMin<SLConvRMin && c_index>-1){
139 float convz=conversions[c_index]->conversionVertex().z();
140 if(convz<=50)Zint.second=sigmaFwd1;
141 else if(convz>50 && convz<=60)Zint.second=sigmaFwd2;
142 else Zint.second=sigmaFwd3;
145 if(SLConvRMin<convRMin && SLc_index>-1){
146 if(SLConvRMin<39)Zint.second=EELR;
147 else Zint.second=EEHR;
159 std::pair<float,float> ZProj(0,0);
168 if(SLconversions.
size()>0){
169 for(
unsigned int SLc=0; SLc<SLconversions.
size(); ++SLc){
171 float convR=
sqrt( conv.
x() * conv.
x() + conv.
y() * conv.
y());
178 const std::vector<edm::RefToBase<reco::Track> >
tracks = SLconversions[SLind]->tracks();
179 float theta =tracks[0]->theta();
181 float tkR=
sqrt( conv.
x() * conv.
x() + conv.
y() * conv.
y());
182 float thetErr=tracks[0]->thetaError();
183 float Z=tkz-tkR/
tan(theta);
184 float Zerr=((-1*(
cos(theta)*
cos(theta))/(
sin(theta)*
sin(theta))-1)*tkR*thetErr);
187 if(tkR<39 && isEb)Zerr=0.234;
188 if(tkR<39 && !isEb)Zerr=0.341;
189 ZProj.first=
Z; ZProj.second=Zerr;
202 float theta =gsf->innerMomentum().theta();
204 float tkz=gsf->innerPosition().Z();
205 float tkR=
sqrt(gsf->innerPosition().X()* gsf->innerPosition().X()+ gsf->innerPosition().Y()* gsf->innerPosition().Y());
206 float thetErr=gsf->thetaError();
207 float Z=tkz-tkR/
tan(theta);
208 float Zerr=((-1*(
cos(theta)*
cos(theta))/(
sin(theta)*
sin(theta))-1)*tkR*thetErr);
209 std::pair<float,float> ZProj(0,0);
210 ZProj.first=
Z; ZProj.second=Zerr;
224 float thetErr=gsf.
gsfTrack()->thetaError();
225 float Z=tkz-tkR/
tan(theta);
226 float Zerr=((-1*(
cos(theta)*
cos(theta))/(
sin(theta)*
sin(theta))-1)*tkR*thetErr);
227 std::pair<float,float> ZProj(0,0);
228 ZProj.first=
Z; ZProj.second=Zerr;
242 std::pair<float, float> combZ(0,0);
246 if(fabs(sc->eta())<1.4442)isEb=
true;
248 std::pair< float,float> SCZ=
BeamLineInt(sc, Tracks, conversions,SLTracks, SLconversions);
249 std::pair<float, float> TkPjZ=
TrackProj(isEb,gsf,SLTracks, SLconversions);
251 float sigZProj=TkPjZ.second;
252 float sigSCPoint=SCZ.second;
254 if(gsf.
isNonnull()){combZ=TkPjZ;
return combZ;}
256 float Z=((SCZ.first/(sigSCPoint*sigSCPoint))+ (TkPjZ.first/( sigZProj* sigZProj)))/(1/(sigSCPoint * sigSCPoint)+ 1/(sigZProj * sigZProj));
258 float sigZ=
sqrt((sigSCPoint * sigSCPoint)+ (sigZProj * sigZProj));
259 combZ.first=
Z; combZ.second=sigZ;
268 std::pair<float, float> combZ(0,0);
271 bool isEb=phot.
isEB();
273 vector<edm::RefToBase<reco::Track> >
convTracks;
277 vector<edm::RefToBase<reco::Track> >SLTracks;
281 if(SLConversions.
size()>0){
283 vector<edm::RefToBase<reco::Track> >dummy;
285 std::pair<float, float> TkPjZ=
TrackProj(isEb,gsfdummy,SLTracks, SLConversions);
288 float sigZProj=TkPjZ.second;
289 float sigSCPoint=SCZ.second;
291 float Z=((SCZ.first/(sigSCPoint*sigSCPoint))+ (TkPjZ.first/(sigZProj * sigZProj)))/(1/(sigSCPoint*sigSCPoint)+ 1/(sigZProj * sigZProj));
293 float sigZ=
sqrt((sigSCPoint*sigSCPoint)+ (sigZProj * sigZProj));
294 combZ.first=
Z; combZ.second=sigZ;
296 else if(pairConv.
size()>0){
298 combZ.first=SCZ.first;
299 combZ.second=SCZ.second;
303 combZ.first=beamspot.Z();
const double Z[kNumberCalorimeter]
Handle< BeamSpot > beamSpotHandle_
virtual void getPFConvTracks(reco::Photon phot, vector< edm::RefToBase< reco::Track > > &Tracks, reco::ConversionRefVector &conversions, vector< edm::RefToBase< reco::Track > > &SLTracks, reco::ConversionRefVector &SLconversions)
static HepMC::IO_HEPEVT conv
reco::ConversionRefVector conversionsOneLeg() const
vector of references to one leg Conversion's
double y() const
y coordinate
static const double slope[3]
math::XYZVectorF trackMomentumAtVtx() const
Sin< T >::type sin(const T &t)
Geom::Theta< T > theta() const
reco::SuperClusterRef superCluster() const
Ref to SuperCluster.
std::pair< float, float > SLCombZVtx(reco::Photon phot, bool &hasSL)
std::pair< float, float > BeamLineInt(reco::SuperClusterRef sc, vector< edm::RefToBase< reco::Track > > &Tracks, reco::ConversionRefVector &conversions, vector< edm::RefToBase< reco::Track > > &SLTracks, reco::ConversionRefVector &SLconversions)
ggPFTracks(edm::Handle< BeamSpot > &beamSpotHandle)
bool isNonnull() const
Checks for non-null.
reco::ConversionRefVector conversions() const
vector of references to Conversion's
std::pair< float, float > CombZVtx(reco::SuperClusterRef sc, reco::GsfTrackRef gsf, vector< edm::RefToBase< reco::Track > > &Tracks, reco::ConversionRefVector &conversions, vector< edm::RefToBase< reco::Track > > &SLTracks, reco::ConversionRefVector &SLconversions)
Cos< T >::type cos(const T &t)
Tan< T >::type tan(const T &t)
double z() const
y coordinate
std::pair< float, float > gsfTrackProj(reco::GsfTrackRef gsf)
std::pair< float, float > gsfElectronProj(reco::GsfElectron gsf)
double x() const
x coordinate
void clear()
Clear the vector.
std::pair< float, float > TrackProj(bool isEb, reco::GsfTrackRef gsf, vector< edm::RefToBase< reco::Track > > &SLTracks, reco::ConversionRefVector &SLconversions)
math::XYZPointF trackPositionAtVtx() const
void push_back(value_type const &ref)
Add a Ref<C, T> to the RefVector.
size_type size() const
Size of the RefVector.
virtual GsfTrackRef gsfTrack() const
reference to a GsfTrack