64 std::vector<TrackingRegion* >
result;
75 LogDebug(
"CosmicRegionalSeedGenerator") <<
"Seeding on stand alone muons ";
85 edm::LogError(
"CollectionNotFound") <<
"Error::No reco muons collection (" <<
recoMuonsCollection_ <<
") in the event - Please verify the name of the muon collection";
89 LogDebug(
"CosmicRegionalSeedGenerator") <<
"Muons collection size = " << muonsHandle->size();
110 for (reco::MuonCollection::const_iterator staMuon = muonsHandle->begin(); staMuon != muonsHandle->end(); ++staMuon) {
113 if (!staMuon->isStandAloneMuon()) {
114 LogDebug(
"CosmicRegionalSeedGenerator") <<
"This muon is not a stand alone muon";
119 if (
abs( staMuon->standAloneMuon()->eta() ) > 1.5 )
continue;
123 LogDebug(
"CosmicRegionalSeedGenerator") <<
"Muon stand alone found in the collection - in muons chambers: \n "
124 <<
"Position = " << staMuon->standAloneMuon()->outerPosition() <<
"\n "
125 <<
"Momentum = " << staMuon->standAloneMuon()->outerMomentum() <<
"\n "
126 <<
"Eta = " << staMuon->standAloneMuon()->eta() <<
"\n "
127 <<
"Phi = " << staMuon->standAloneMuon()->phi();
131 GlobalPoint initialRegionPosition(staMuon->standAloneMuon()->referencePoint().x(), staMuon->standAloneMuon()->referencePoint().y(), staMuon->standAloneMuon()->referencePoint().z());
132 GlobalVector initialRegionMomentum(staMuon->standAloneMuon()->momentum().x(), staMuon->standAloneMuon()->momentum().y(), staMuon->standAloneMuon()->momentum().z());
133 int charge = (int) staMuon->standAloneMuon()->charge();
135 LogDebug(
"CosmicRegionalSeedGenerator") <<
"Initial region - Reference point of the sta muon: \n "
136 <<
"Position = " << initialRegionPosition <<
"\n "
137 <<
"Momentum = " << initialRegionMomentum <<
"\n "
138 <<
"Eta = " << initialRegionPosition.eta() <<
"\n "
139 <<
"Phi = " << initialRegionPosition.phi() <<
"\n "
143 if ( staMuon->standAloneMuon()->outerPosition().y()>0 ) initialRegionMomentum *=-1;
145 initialRegionMomentum,
147 thePropagator->magneticField());
152 if (!outer.isValid())
155 LogDebug(
"CosmicRegionalSeedGenerator") <<
"Trajectory state on surface not valid" ;
161 GlobalPoint regionPosition = outer.globalPosition();
164 LogDebug(
"CosmicRegionalSeedGenerator") <<
"Region after propagation: \n "
165 <<
"Position = " << outer.globalPosition() <<
"\n "
166 <<
"Momentum = " << outer.globalMomentum() <<
"\n "
167 <<
"R = " << regionPosition.
perp() <<
" ---- z = " << regionPosition.
z() <<
"\n "
168 <<
"Eta = " << outer.globalPosition().eta() <<
"\n "
169 <<
"Phi = " << outer.globalPosition().phi();
176 LogDebug(
"CosmicRegionalSeedGenerator") <<
"Step back vector = " << v <<
"\n";
180 double delta_R_min = 1000.;
181 for ( CaloJetCollection::const_iterator
jet = caloJetsHandle->begin ();
jet != caloJetsHandle->end();
jet++ ) {
184 double deta = center.
eta() -
jet->eta();
185 double dphi = fabs( center.
phi() -
jet->phi() );
189 if ( delta_R < delta_R_min ) delta_R_min =
delta_R;
194 LogDebug(
"CosmicRegionalSeedGenerator") <<
"Region built too close from a jet";
214 result.push_back(etaphiRegion);
216 LogDebug(
"CosmicRegionalSeedGenerator") <<
"Final CosmicTrackingRegion \n "
217 <<
"Position = "<< center <<
"\n "
218 <<
"Direction = "<< etaphiRegion->
direction() <<
"\n "
219 <<
"Distance from the region on the layer = " << (regionPosition -center).
mag() <<
"\n "
220 <<
"Eta = " << center.
eta() <<
"\n "
221 <<
"Phi = " << center.
phi();
240 LogDebug(
"CosmicRegionalSeedGenerator") <<
"Seeding on cosmic muons tracks";
248 if (!cosmicMuonsHandle.
isValid())
254 LogDebug(
"CosmicRegionalSeedGenerator") <<
"Cosmic muons tracks collection size = " << cosmicMuonsHandle->size();
274 for (reco::TrackCollection::const_iterator cosmicMuon = cosmicMuonsHandle->begin(); cosmicMuon != cosmicMuonsHandle->end(); ++cosmicMuon) {
277 if (
abs( cosmicMuon->eta() ) > 1.5 )
continue;
282 GlobalPoint initialRegionPosition(cosmicMuon->referencePoint().x(), cosmicMuon->referencePoint().y(), cosmicMuon->referencePoint().z());
283 GlobalVector initialRegionMomentum(cosmicMuon->momentum().x(), cosmicMuon->momentum().y(), cosmicMuon->momentum().z());
284 int charge = (int) cosmicMuon->charge();
286 LogDebug(
"CosmicRegionalSeedGenerator") <<
"Position and momentum of the muon track in the muon chambers: \n "
287 <<
"x = " << cosmicMuon->outerPosition().x() <<
"\n "
288 <<
"y = " << cosmicMuon->outerPosition().y() <<
"\n "
289 <<
"y = " << cosmicMuon->pt() <<
"\n "
290 <<
"Initial region - Reference point of the cosmic muon track: \n "
291 <<
"Position = " << initialRegionPosition <<
"\n "
292 <<
"Momentum = " << initialRegionMomentum <<
"\n "
293 <<
"Eta = " << initialRegionPosition.eta() <<
"\n "
294 <<
"Phi = " << initialRegionPosition.phi() <<
"\n "
298 if ( cosmicMuon->outerPosition().y()>0 && cosmicMuon->momentum().y()<0 ) initialRegionMomentum *=-1;
300 initialRegionMomentum,
302 thePropagator->magneticField());
307 if (!outer.isValid())
310 LogDebug(
"CosmicRegionalSeedGenerator") <<
"Trajectory state on surface not valid" ;
316 GlobalPoint regionPosition = outer.globalPosition();
319 LogDebug(
"CosmicRegionalSeedGenerator") <<
"Region after propagation: \n "
320 <<
"Position = " << outer.globalPosition() <<
"\n "
321 <<
"Momentum = " << outer.globalMomentum() <<
"\n "
322 <<
"R = " << regionPosition.
perp() <<
" ---- z = " << regionPosition.
z() <<
"\n "
323 <<
"Eta = " << outer.globalPosition().eta() <<
"\n "
324 <<
"Phi = " << outer.globalPosition().phi();
331 LogDebug(
"CosmicRegionalSeedGenerator") <<
"Step back vector = " << v <<
"\n";
335 double delta_R_min = 1000.;
336 for ( CaloJetCollection::const_iterator
jet = caloJetsHandle->begin ();
jet != caloJetsHandle->end();
jet++ ) {
339 double deta = center.
eta() -
jet->eta();
340 double dphi = fabs( center.
phi() -
jet->phi() );
343 double delta_R =
sqrt(deta*deta + dphi*dphi);
344 if ( delta_R < delta_R_min ) delta_R_min =
delta_R;
349 LogDebug(
"CosmicRegionalSeedGenerator") <<
"Region built too close from a jet";
367 result.push_back(etaphiRegion);
369 LogDebug(
"CosmicRegionalSeedGenerator") <<
"Final CosmicTrackingRegion \n "
370 <<
"Position = "<< center <<
"\n "
371 <<
"Direction = "<< etaphiRegion->
direction() <<
"\n "
372 <<
"Distance from the region on the layer = " << (regionPosition -center).
mag() <<
"\n "
373 <<
"Eta = " << center.
eta() <<
"\n "
374 <<
"Phi = " << center.
phi();
388 LogDebug(
"CosmicRegionalSeedGenerator") <<
"Seeding on L2 muons";
403 LogDebug(
"CosmicRegionalSeedGenerator") <<
"L2 muons collection size = " << L2MuonsHandle->size();
419 for (reco::RecoChargedCandidateCollection::const_iterator L2Muon = L2MuonsHandle->begin(); L2Muon != L2MuonsHandle->end(); ++L2Muon) {
423 if (
abs( tkL2Muon->eta() ) > 1.5 )
continue;
428 GlobalPoint initialRegionPosition(tkL2Muon->referencePoint().x(), tkL2Muon->referencePoint().y(), tkL2Muon->referencePoint().z());
429 GlobalVector initialRegionMomentum(tkL2Muon->momentum().x(), tkL2Muon->momentum().y(), tkL2Muon->momentum().z());
430 int charge = (int) tkL2Muon->charge();
432 LogDebug(
"CosmicRegionalSeedGenerator") <<
"Position and momentum of the L2 muon track in the muon chambers: \n "
433 <<
"x = " << tkL2Muon->outerPosition().x() <<
"\n "
434 <<
"y = " << tkL2Muon->outerPosition().y() <<
"\n "
435 <<
"y = " << tkL2Muon->pt() <<
"\n "
436 <<
"Initial region - Reference point of the L2 muon track: \n "
437 <<
"Position = " << initialRegionPosition <<
"\n "
438 <<
"Momentum = " << initialRegionMomentum <<
"\n "
439 <<
"Eta = " << initialRegionPosition.eta() <<
"\n "
440 <<
"Phi = " << initialRegionPosition.phi() <<
"\n "
445 if ( tkL2Muon->outerPosition().y() > 0 )
447 LogDebug(
"CosmicRegionalSeedGenerator") <<
"L2 muon in the TOP --- Region not created";
452 initialRegionMomentum,
454 thePropagator->magneticField());
459 if (!outer.isValid())
462 LogDebug(
"CosmicRegionalSeedGenerator") <<
"Trajectory state on surface not valid" ;
468 GlobalPoint regionPosition = outer.globalPosition();
471 LogDebug(
"CosmicRegionalSeedGenerator") <<
"Region after propagation: \n "
472 <<
"Position = " << outer.globalPosition() <<
"\n "
473 <<
"Momentum = " << outer.globalMomentum() <<
"\n "
474 <<
"R = " << regionPosition.
perp() <<
" ---- z = " << regionPosition.
z() <<
"\n "
475 <<
"Eta = " << outer.globalPosition().eta() <<
"\n "
476 <<
"Phi = " << outer.globalPosition().phi();
483 LogDebug(
"CosmicRegionalSeedGenerator") <<
"Step back vector = " << v <<
"\n";
497 result.push_back(etaphiRegion);
499 LogDebug(
"CosmicRegionalSeedGenerator") <<
"Final L2TrackingRegion \n "
500 <<
"Position = "<< center <<
"\n "
501 <<
"Direction = "<< etaphiRegion->
direction() <<
"\n "
502 <<
"Distance from the region on the layer = " << (regionPosition -center).
mag() <<
"\n "
503 <<
"Eta = " << center.
eta() <<
"\n "
504 <<
"Phi = " << center.
phi();
edm::ParameterSet regionPSet
bool doJetsExclusionCheck_
double deltaRExclusionSize_
edm::InputTag recoL2MuonsCollection_
edm::InputTag recoTrackMuonsCollection_
T mag() const
The vector magnitude. Equivalent to sqrt(vec.mag2())
Geom::Phi< T > phi() const
virtual GlobalVector direction() const
the direction around which region is constructed
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_