75 std::vector<TrackingRegion* >
result;
86 LogDebug(
"CosmicRegionalSeedGenerator") <<
"Seeding on stand alone muons ";
96 edm::LogError(
"CollectionNotFound") <<
"Error::No reco muons collection (" <<
recoMuonsCollection_ <<
") in the event - Please verify the name of the muon collection";
100 LogDebug(
"CosmicRegionalSeedGenerator") <<
"Muons collection size = " << muonsHandle->size();
121 for (reco::MuonCollection::const_iterator staMuon = muonsHandle->begin(); staMuon != muonsHandle->end(); ++staMuon) {
124 if (!staMuon->isStandAloneMuon()) {
125 LogDebug(
"CosmicRegionalSeedGenerator") <<
"This muon is not a stand alone muon";
130 if (
abs( staMuon->standAloneMuon()->eta() ) > 1.5 )
continue;
134 LogDebug(
"CosmicRegionalSeedGenerator") <<
"Muon stand alone found in the collection - in muons chambers: \n "
135 <<
"Position = " << staMuon->standAloneMuon()->outerPosition() <<
"\n "
136 <<
"Momentum = " << staMuon->standAloneMuon()->outerMomentum() <<
"\n "
137 <<
"Eta = " << staMuon->standAloneMuon()->eta() <<
"\n "
138 <<
"Phi = " << staMuon->standAloneMuon()->phi();
142 GlobalPoint initialRegionPosition(staMuon->standAloneMuon()->referencePoint().x(), staMuon->standAloneMuon()->referencePoint().y(), staMuon->standAloneMuon()->referencePoint().z());
143 GlobalVector initialRegionMomentum(staMuon->standAloneMuon()->momentum().x(), staMuon->standAloneMuon()->momentum().y(), staMuon->standAloneMuon()->momentum().z());
144 int charge = (int) staMuon->standAloneMuon()->charge();
146 LogDebug(
"CosmicRegionalSeedGenerator") <<
"Initial region - Reference point of the sta muon: \n "
147 <<
"Position = " << initialRegionPosition <<
"\n "
148 <<
"Momentum = " << initialRegionMomentum <<
"\n "
149 <<
"Eta = " << initialRegionPosition.eta() <<
"\n "
150 <<
"Phi = " << initialRegionPosition.phi() <<
"\n "
154 if ( staMuon->standAloneMuon()->outerPosition().y()>0 ) initialRegionMomentum *=-1;
156 initialRegionMomentum,
158 thePropagator->magneticField());
163 if (!outer.isValid())
166 LogDebug(
"CosmicRegionalSeedGenerator") <<
"Trajectory state on surface not valid" ;
172 GlobalPoint regionPosition = outer.globalPosition();
175 LogDebug(
"CosmicRegionalSeedGenerator") <<
"Region after propagation: \n "
176 <<
"Position = " << outer.globalPosition() <<
"\n "
177 <<
"Momentum = " << outer.globalMomentum() <<
"\n "
178 <<
"R = " << regionPosition.
perp() <<
" ---- z = " << regionPosition.
z() <<
"\n "
179 <<
"Eta = " << outer.globalPosition().eta() <<
"\n "
180 <<
"Phi = " << outer.globalPosition().phi();
187 LogDebug(
"CosmicRegionalSeedGenerator") <<
"Step back vector = " << v <<
"\n";
191 double delta_R_min = 1000.;
192 for ( CaloJetCollection::const_iterator
jet = caloJetsHandle->begin ();
jet != caloJetsHandle->end();
jet++ ) {
195 double deta = center.
eta() -
jet->eta();
196 double dphi = fabs( center.
phi() -
jet->phi() );
200 if ( delta_R < delta_R_min ) delta_R_min =
delta_R;
205 LogDebug(
"CosmicRegionalSeedGenerator") <<
"Region built too close from a jet";
225 result.push_back(etaphiRegion);
227 LogDebug(
"CosmicRegionalSeedGenerator") <<
"Final CosmicTrackingRegion \n "
228 <<
"Position = "<< center <<
"\n "
229 <<
"Direction = "<< etaphiRegion->
direction() <<
"\n "
230 <<
"Distance from the region on the layer = " << (regionPosition -center).
mag() <<
"\n "
231 <<
"Eta = " << center.
eta() <<
"\n "
232 <<
"Phi = " << center.
phi();
251 LogDebug(
"CosmicRegionalSeedGenerator") <<
"Seeding on cosmic muons tracks";
259 if (!cosmicMuonsHandle.
isValid())
265 LogDebug(
"CosmicRegionalSeedGenerator") <<
"Cosmic muons tracks collection size = " << cosmicMuonsHandle->size();
285 for (reco::TrackCollection::const_iterator cosmicMuon = cosmicMuonsHandle->begin(); cosmicMuon != cosmicMuonsHandle->end(); ++cosmicMuon) {
288 if (
abs( cosmicMuon->eta() ) > 1.5 )
continue;
293 GlobalPoint initialRegionPosition(cosmicMuon->referencePoint().x(), cosmicMuon->referencePoint().y(), cosmicMuon->referencePoint().z());
294 GlobalVector initialRegionMomentum(cosmicMuon->momentum().x(), cosmicMuon->momentum().y(), cosmicMuon->momentum().z());
295 int charge = (int) cosmicMuon->charge();
297 LogDebug(
"CosmicRegionalSeedGenerator") <<
"Position and momentum of the muon track in the muon chambers: \n "
298 <<
"x = " << cosmicMuon->outerPosition().x() <<
"\n "
299 <<
"y = " << cosmicMuon->outerPosition().y() <<
"\n "
300 <<
"y = " << cosmicMuon->pt() <<
"\n "
301 <<
"Initial region - Reference point of the cosmic muon track: \n "
302 <<
"Position = " << initialRegionPosition <<
"\n "
303 <<
"Momentum = " << initialRegionMomentum <<
"\n "
304 <<
"Eta = " << initialRegionPosition.eta() <<
"\n "
305 <<
"Phi = " << initialRegionPosition.phi() <<
"\n "
309 if ( cosmicMuon->outerPosition().y()>0 && cosmicMuon->momentum().y()<0 ) initialRegionMomentum *=-1;
311 initialRegionMomentum,
313 thePropagator->magneticField());
318 if (!outer.isValid())
321 LogDebug(
"CosmicRegionalSeedGenerator") <<
"Trajectory state on surface not valid" ;
327 GlobalPoint regionPosition = outer.globalPosition();
330 LogDebug(
"CosmicRegionalSeedGenerator") <<
"Region after propagation: \n "
331 <<
"Position = " << outer.globalPosition() <<
"\n "
332 <<
"Momentum = " << outer.globalMomentum() <<
"\n "
333 <<
"R = " << regionPosition.
perp() <<
" ---- z = " << regionPosition.
z() <<
"\n "
334 <<
"Eta = " << outer.globalPosition().eta() <<
"\n "
335 <<
"Phi = " << outer.globalPosition().phi();
342 LogDebug(
"CosmicRegionalSeedGenerator") <<
"Step back vector = " << v <<
"\n";
346 double delta_R_min = 1000.;
347 for ( CaloJetCollection::const_iterator
jet = caloJetsHandle->begin ();
jet != caloJetsHandle->end();
jet++ ) {
350 double deta = center.
eta() -
jet->eta();
351 double dphi = fabs( center.
phi() -
jet->phi() );
354 double delta_R =
sqrt(deta*deta + dphi*dphi);
355 if ( delta_R < delta_R_min ) delta_R_min =
delta_R;
360 LogDebug(
"CosmicRegionalSeedGenerator") <<
"Region built too close from a jet";
378 result.push_back(etaphiRegion);
380 LogDebug(
"CosmicRegionalSeedGenerator") <<
"Final CosmicTrackingRegion \n "
381 <<
"Position = "<< center <<
"\n "
382 <<
"Direction = "<< etaphiRegion->
direction() <<
"\n "
383 <<
"Distance from the region on the layer = " << (regionPosition -center).
mag() <<
"\n "
384 <<
"Eta = " << center.
eta() <<
"\n "
385 <<
"Phi = " << center.
phi();
399 LogDebug(
"CosmicRegionalSeedGenerator") <<
"Seeding on L2 muons";
414 LogDebug(
"CosmicRegionalSeedGenerator") <<
"L2 muons collection size = " << L2MuonsHandle->size();
430 for (reco::RecoChargedCandidateCollection::const_iterator L2Muon = L2MuonsHandle->begin(); L2Muon != L2MuonsHandle->end(); ++L2Muon) {
434 if (
abs( tkL2Muon->eta() ) > 1.5 )
continue;
439 GlobalPoint initialRegionPosition(tkL2Muon->referencePoint().x(), tkL2Muon->referencePoint().y(), tkL2Muon->referencePoint().z());
440 GlobalVector initialRegionMomentum(tkL2Muon->momentum().x(), tkL2Muon->momentum().y(), tkL2Muon->momentum().z());
441 int charge = (int) tkL2Muon->charge();
443 LogDebug(
"CosmicRegionalSeedGenerator") <<
"Position and momentum of the L2 muon track in the muon chambers: \n "
444 <<
"x = " << tkL2Muon->outerPosition().x() <<
"\n "
445 <<
"y = " << tkL2Muon->outerPosition().y() <<
"\n "
446 <<
"y = " << tkL2Muon->pt() <<
"\n "
447 <<
"Initial region - Reference point of the L2 muon track: \n "
448 <<
"Position = " << initialRegionPosition <<
"\n "
449 <<
"Momentum = " << initialRegionMomentum <<
"\n "
450 <<
"Eta = " << initialRegionPosition.eta() <<
"\n "
451 <<
"Phi = " << initialRegionPosition.phi() <<
"\n "
456 if ( tkL2Muon->outerPosition().y() > 0 )
458 LogDebug(
"CosmicRegionalSeedGenerator") <<
"L2 muon in the TOP --- Region not created";
463 initialRegionMomentum,
465 thePropagator->magneticField());
470 if (!outer.isValid())
473 LogDebug(
"CosmicRegionalSeedGenerator") <<
"Trajectory state on surface not valid" ;
479 GlobalPoint regionPosition = outer.globalPosition();
482 LogDebug(
"CosmicRegionalSeedGenerator") <<
"Region after propagation: \n "
483 <<
"Position = " << outer.globalPosition() <<
"\n "
484 <<
"Momentum = " << outer.globalMomentum() <<
"\n "
485 <<
"R = " << regionPosition.
perp() <<
" ---- z = " << regionPosition.
z() <<
"\n "
486 <<
"Eta = " << outer.globalPosition().eta() <<
"\n "
487 <<
"Phi = " << outer.globalPosition().phi();
494 LogDebug(
"CosmicRegionalSeedGenerator") <<
"Step back vector = " << v <<
"\n";
508 result.push_back(etaphiRegion);
510 LogDebug(
"CosmicRegionalSeedGenerator") <<
"Final L2TrackingRegion \n "
511 <<
"Position = "<< center <<
"\n "
512 <<
"Direction = "<< etaphiRegion->
direction() <<
"\n "
513 <<
"Distance from the region on the layer = " << (regionPosition -center).
mag() <<
"\n "
514 <<
"Eta = " << center.
eta() <<
"\n "
515 <<
"Phi = " << center.
phi();
edm::ParameterSet regionPSet
bool doJetsExclusionCheck_
double deltaRExclusionSize_
edm::InputTag recoL2MuonsCollection_
edm::InputTag recoTrackMuonsCollection_
Geom::Phi< T > phi() const
virtual GlobalVector direction() const
the direction around which region is constructed
T mag() const
The vector magnitude. Equivalent to sqrt(vec.mag2())
double delta_R(double eta1, double phi1, double eta2, double phi2)
Vector3DBase unit() const
std::string thePropagatorName_
T const * product() const
edm::InputTag recoMuonsCollection_
T const * get() const
Returns C++ pointer to the item.
edm::InputTag recoCaloJetsCollection_