12 vector<FreeTrajectoryState> HICFTSfromL1orL2::createFTSfromL1(vector<L1MuGMTExtendedCand>& gmt)
19 vector<FreeTrajectoryState> ftsL1;
21 int ngmt = gmt.size();
23 cout <<
"Number of muons found by the L1 Global Muon TRIGGER : "
30 for ( vector<L1MuGMTExtendedCand>::const_iterator gmt_it = gmt.begin(); gmt_it != gmt.end(); gmt_it++ )
32 ftsL1.push_back(FTSfromL1((*gmt_it)));
46 vector<FreeTrajectoryState> ftsL2;
49 RecoChargedCandidateCollection::const_iterator recmuon = recmuons.begin();
53 cout <<
"Number of muons found by the L2 TRIGGER : "
56 for(recmuon=recmuons.begin(); recmuon!=recmuons.end(); recmuon++)
58 ftsL2.push_back(FTSfromL2((*recmuon)));
64 vector<FreeTrajectoryState> HICFTSfromL1orL2::createFTSfromStandAlone(
const TrackCollection& recmuons)
71 vector<FreeTrajectoryState> ftsL2;
74 TrackCollection::const_iterator recmuon = recmuons.begin();
78 cout <<
"Number of muons found by the StandAlone : "
81 for(recmuon=recmuons.begin(); recmuon!=recmuons.end(); recmuon++)
83 ftsL2.push_back(FTSfromStandAlone((*recmuon)));
88 vector<FreeTrajectoryState> HICFTSfromL1orL2::createFTSfromL2(
const TrackCollection& recmuons)
95 vector<FreeTrajectoryState> ftsL2;
98 TrackCollection::const_iterator recmuon = recmuons.begin();
102 cout <<
"Number of muons found by the StandAlone : "
105 for(recmuon=recmuons.begin(); recmuon!=recmuons.end(); recmuon++)
107 ftsL2.push_back(FTSfromStandAlone((*recmuon)));
119 double pi=4.*atan(1.);
120 double twopi=8.*atan(1.);
122 vector<FreeTrajectoryState> ftsL1orL2;
123 vector<FreeTrajectoryState> ftsL1 = createFTSfromL1(gmt);
124 vector<FreeTrajectoryState> ftsL2 = createFTSfromL2(recmuons);
128 vector<FreeTrajectoryState*>::iterator itused;
129 vector<FreeTrajectoryState*> used;
131 for(vector<FreeTrajectoryState>::iterator tl1 = ftsL1.begin(); tl1 != ftsL1.end(); tl1++)
134 float etaL1 = (*tl1).parameters().momentum().eta();
135 float phiL1 = (*tl1).parameters().momentum().phi();
136 if( phiL1 < 0.) phiL1 = twopi + phiL1;
140 for(vector<FreeTrajectoryState>::iterator tl2 = ftsL2.begin(); tl2 != ftsL2.end(); tl2++)
142 itused =
find(used.begin(),used.end(),&(*tl2));
144 float etaL2 = (*tl2).parameters().momentum().eta();
145 float phiL2 = (*tl2).parameters().momentum().phi();
146 if( phiL2 < 0.) phiL2 = twopi + phiL2;
148 float dphi =
abs(phiL1-phiL2);
149 if( dphi > pi ) dphi = twopi - dphi;
150 float dr =
sqrt((etaL1 - etaL2)*(etaL1 - etaL2)+dphi*dphi);
153 cout<<
" ===== Trigger Level 1 candidate: ptL1 "<<ptL1<<
" EtaL1 "<<etaL1<<
" PhiL1 "<<phiL1<<
154 " chargeL1 "<<chargeL1<<endl;
155 cout<<
" ===== Trigger Level 2 candidate: ptL2 "<<ptL2<<
" EtaL2 "<<etaL2<<
" PhiL2 "<<phiL2<<
156 " chargeL2 "<<chargeL2<<endl;
157 cout<<
" abs(EtaL1 - EtaL2) "<<
abs(etaL1 - etaL2)<<
" dphi "<<dphi<<
" dr "<<dr<<
158 " dQ "<<chargeL1 - chargeL2
159 <<
" the same muon or not L2 "<<L2<<endl;
162 if ( itused != used.end() ) {
170 if(
abs(etaL1) > 1.9 ) drmax = 0.6;
173 cout<<
" Drmax= "<<drmax<<endl;
181 ftsL1orL2.push_back((*tl2));
182 used.push_back(&(*tl2));
198 ftsL1orL2.push_back((*tl1));
204 if( ftsL2.size() > 0 )
206 for(vector<FreeTrajectoryState>::iterator tl2 = ftsL2.begin(); tl2 != ftsL2.end(); tl2++)
208 itused =
find(used.begin(),used.end(),&(*tl2));
209 if ( itused != used.end() )
214 ftsL1orL2.push_back((*tl2));
224 double pi=4.*atan(1.);
225 unsigned int det = gmt.
isFwd();
226 double px,py,pz,
x,
y,
z;
234 if(det) barrel =
false;
242 if(eta<0.) radius=-1.*
radius;
245 if ( barrel && pt < 3.5 ) pt = 3.5;
246 if ( !barrel && pt < 1.0 ) pt = 1.0;
255 if(
abs(theta-pi/2.)<0.00001){
285 m(0,0)=0.6*pt;
m(1,1)=1.;
m(2,2)=1.;
304 double pp =
sqrt(mom0.x()*mom0.x()+mom0.y()*mom0.y()+mom0.z()*mom0.z());
305 double pt =
sqrt(mom0.x()*mom0.x()+mom0.y()*mom0.y());
306 double theta = mom0.theta();
307 double pz = mom0.z();
313 pt = 4.;
if (
abs(pz) > 0. ) pz = pt/
tan(theta);
315 GlobalVector mom1( corr*mom0.x(), corr*mom0.y(), corr*mom0.z() );
333 m(0,0)=0.6*mom.perp();
m(1,1)=1.;
m(2,2)=1.;
354 double pp =
sqrt(mom0.x()*mom0.x()+mom0.y()*mom0.y()+mom0.z()*mom0.z());
355 double pt =
sqrt(mom0.x()*mom0.x()+mom0.y()*mom0.y());
356 double theta = mom0.theta();
357 double pz = mom0.z();
363 pt = 4.;
if (
abs(pz) > 0. ) pz = pt/
tan(theta);
365 GlobalVector mom1( corr*mom0.x(), corr*mom0.y(), corr*mom0.z() );
383 m(0,0)=0.6*mom.perp();
m(1,1)=1.;
m(2,2)=1.;
Sin< T >::type sin(const T &t)
std::vector< Track > TrackCollection
collection of Tracks
Geom::Theta< T > theta() const
ROOT::Math::SMatrix< double, 5, 5, ROOT::Math::MatRepSym< double, 5 > > AlgebraicSymMatrix55
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
const math::XYZPoint & innerPosition() const
position of the innermost hit
Cos< T >::type cos(const T &t)
T get() const
get a component
Tan< T >::type tan(const T &t)
std::vector< RecoChargedCandidate > RecoChargedCandidateCollection
collectin of RecoChargedCandidate objects
XYZVectorD XYZVector
spatial vector with cartesian internal representation
XYZPointD XYZPoint
point in space with cartesian internal representation
const math::XYZVector & innerMomentum() const
momentum vector at the innermost hit position
int charge() const
track electric charge
bool isFwd() const
get forward bit (true=forward, false=barrel)
int charge() const
get charge (+1 -1)