47 for( reco::TrackCollection::const_iterator iTrack = TheCSCTracks->begin() ; iTrack != TheCSCTracks->end() ; iTrack++ )
49 bool StoreTrack =
false;
51 float innermost_global_z = 1500.;
52 float outermost_global_z = 0.;
56 for(
unsigned int j = 0 ;
j < iTrack->extra()->recHits().size();
j++ )
59 if( !
hit->isValid() )
continue;
60 DetId TheDetUnitId(
hit->geographicalId());
69 float z = TheGlobalPosition.
z();
70 if( TMath::Abs(z) < innermost_global_z )
72 innermost_global_z = TMath::Abs(z);
73 InnerMostGlobalPosition =
GlobalPoint( TheGlobalPosition);
75 if( TMath::Abs(z) > outermost_global_z )
77 outermost_global_z = TMath::Abs(z);
78 OuterMostGlobalPosition =
GlobalPoint( TheGlobalPosition );
83 if( nCSCHits < 3 )
continue;
85 if( OuterMostGlobalPosition.x() == 0. || OuterMostGlobalPosition.y() == 0. || OuterMostGlobalPosition.z() == 0. )
87 if( InnerMostGlobalPosition.x() == 0. || InnerMostGlobalPosition.y() == 0. || InnerMostGlobalPosition.z() == 0. )
93 float deta = TMath::Abs( OuterMostGlobalPosition.eta() - InnerMostGlobalPosition.eta() );
94 float dphi = TMath::ACos( TMath::Cos( OuterMostGlobalPosition.phi() - InnerMostGlobalPosition.phi() ) ) ;
95 float theta = iTrack->outerMomentum().theta();
96 float innermost_x = InnerMostGlobalPosition.x() ;
97 float innermost_y = InnerMostGlobalPosition.y();
98 float outermost_x = OuterMostGlobalPosition.x();
99 float outermost_y = OuterMostGlobalPosition.y();
100 float innermost_r = TMath::Sqrt(innermost_x *innermost_x + innermost_y * innermost_y );
101 float outermost_r = TMath::Sqrt(outermost_x *outermost_x + outermost_y * outermost_y );
134 bool EventPasses =
false;
141 if( bit < TheHLTResults->
size() )
144 if( TheHLTResults->accept( bit ) && !TheHLTResults->error( bit ) )
157 if( TheL1GMTReadout.
isValid() )
160 std::vector < L1MuGMTReadoutRecord > gmt_records = gmtrc->
getRecords ();
161 std::vector < L1MuGMTReadoutRecord >::const_iterator igmtrr;
167 for (igmtrr = gmt_records.begin (); igmtrr != gmt_records.end (); igmtrr++)
169 std::vector < L1MuRegionalCand >::const_iterator iter1;
170 std::vector < L1MuRegionalCand > rmc;
171 rmc = igmtrr->getCSCCands ();
172 for (iter1 = rmc.begin (); iter1 != rmc.end (); iter1++)
174 if (!(*iter1).empty ())
176 if ((*iter1).isFineHalo ())
178 float halophi = iter1->phiValue();
180 float haloeta = iter1->etaValue();
181 bool HaloIsGood =
true;
187 for( reco::MuonCollection::const_iterator mu = TheMuons->begin(); mu != TheMuons->end() && HaloIsGood ; mu++ )
190 if( mu->isStandAloneMuon() && !mu->isTrackerMuon() && !mu->isGlobalMuon() )
continue;
208 const std::vector<MuonChamberMatch>
chambers = mu->matches();
209 for(std::vector<MuonChamberMatch>::const_iterator iChamber = chambers.begin();
210 iChamber != chambers.end() ; iChamber ++ )
213 for( std::vector<reco::MuonSegmentMatch>::const_iterator iSegment = iChamber->segmentMatches.begin() ;
214 iSegment != iChamber->segmentMatches.end(); ++iSegment )
217 std::vector<CSCRecHit2D> hits = cscSegment -> specificRecHits();
218 for( std::vector<CSCRecHit2D>::iterator iHit = hits.begin();
219 iHit != hits.end() ; iHit++ )
221 DetId TheDetUnitId(iHit->cscDetId());
223 LocalPoint TheLocalPosition = iHit->localPosition();
224 const BoundPlane& TheSurface = TheUnit->surface();
227 float phi_ = TheGlobalPosition.
phi();
228 float eta_ = TheGlobalPosition.
eta();
229 deta = deta < TMath::Abs( eta_ - haloeta ) ? deta : TMath::Abs( eta_ - haloeta );
230 dphi = dphi < TMath::Abs( phi_ - halophi ) ? dphi : TMath::Abs( phi_ - halophi );
240 if( (*iter1).etaValue() > 0 )
256 short int n_alctsP=0;
257 short int n_alctsM=0;
266 if( (*digiIt).isValid() && ( (*digiIt).getBX() <
expected_BX ) )
268 int digi_endcap = detId.
endcap();
269 int digi_station = detId.station();
270 int digi_ring = detId.ring();
271 int digi_chamber = detId.chamber();
272 int digi_wire = digiIt->getKeyWG();
273 if( digi_station == 1 && digi_ring == 4 )
276 bool DigiIsGood =
true;
281 for(reco::MuonCollection::const_iterator mu = TheMuons->begin(); mu!= TheMuons->end() && DigiIsGood ; mu++ )
283 if( !mu->isTrackerMuon() && !mu->isGlobalMuon() && mu->isStandAloneMuon() )
continue;
300 const std::vector<MuonChamberMatch> chambers = mu->matches();
301 for(std::vector<MuonChamberMatch>::const_iterator iChamber = chambers.begin();
302 iChamber != chambers.end(); iChamber ++ )
305 for( std::vector<reco::MuonSegmentMatch>::const_iterator iSegment = iChamber->segmentMatches.begin();
306 iSegment != iChamber->segmentMatches.end(); iSegment++ )
309 std::vector<CSCRecHit2D> hits = cscSegRef->specificRecHits();
310 for( std::vector<CSCRecHit2D>::iterator iHit = hits.begin();
311 iHit != hits.end(); iHit++ )
313 if( iHit->cscDetId().endcap() != digi_endcap )
continue;
314 if( iHit->cscDetId().station() != digi_station )
continue;
315 if( iHit->cscDetId().ring() != digi_ring )
continue;
316 if( iHit->cscDetId().chamber() != digi_chamber )
continue;
318 int nwires = hitwires.size();
319 int center_id = nwires/2 + 1;
320 int hit_wire = hitwires[center_id -1 ];
321 dwire = dwire < TMath::Abs(hit_wire - digi_wire)? dwire : TMath::Abs(hit_wire - digi_wire );
332 if( detId.endcap() == 1 )
334 else if ( detId.endcap() == 2)
346 short int n_recHitsP = 0;
347 short int n_recHitsM = 0;
351 for (dRHIter = TheCSCRecHits->begin(); dRHIter != TheCSCRecHits->end(); dRHIter++)
353 if ( !((*dRHIter).isValid()) )
continue;
355 float RHTime = (*dRHIter).tpeak();
356 LocalPoint rhitlocal = (*dRHIter).localPosition();
359 float globZ = globalPosition.
z();
386 return TheCSCHaloData;
GlobalPoint toGlobal(const Point2DBase< Scalar, LocalTag > lp) const
GlobalPoint toGlobal(const Local2DPoint &lp) const
Conversion to the global R.F. from the R.F. of the GeomDet.
Geom::Phi< T > phi() const
Global3DPoint GlobalPoint
Geom::Theta< T > theta() const
static char chambers[TOTALCHAMBERS][20]
float matching_dphi_threshold
float matching_deta_threshold
C::const_iterator const_iterator
constant access iterator type
std::vector< edm::InputTag > vIT_HLTBit
unsigned int triggerIndex(std::string const &name) const
virtual const GeomDetUnit * idToDetUnit(DetId) const
Return the pointer to the GeomDetUnit corresponding to a given DetId.
const std::vector< GlobalPoint > & GetCSCTrackImpactPositions() const
std::vector< L1MuGMTReadoutRecord > getRecords() const
void SetHLTBit(bool status)
const CSCChamber * chamber(CSCDetId id) const
Return the chamber corresponding to given DetId.
void SetNumberOfHaloTriggers(int PlusZ, int MinusZ)
std::vector< DigiType >::const_iterator const_iterator
T const * product() const
int matching_dwire_threshold
float norm_chi2_threshold
void push_back(value_type const &ref)
Add a Ref<C, T> to the RefVector.
void SetNOutOfTimeHits(short int num)
std::pair< const_iterator, const_iterator > Range
void SetNOutOfTimeTriggers(short int PlusZ, short int MinusZ)
virtual const BoundPlane & surface() const
The nominal surface of the GeomDet.
tuple size
Write out results.
std::vector< int > ChannelContainer
edm::RefVector< reco::TrackCollection > & GetTracks()