26 edm::LogInfo (
"CosmicRegionalSeedGenerator") <<
"Begin Run:: Constructing CosmicRegionalSeedGenerator";
47 jetsPtMin_ = regionInJetsCheckPSet.getParameter<
double>(
"jetsPtMin");
55 edm::LogInfo (
"CosmicRegionalSeedGenerator") <<
"Reco muons collection: " << recoMuonsCollection_ <<
"\n" 56 <<
"Reco tracks muons collection: " << recoTrackMuonsCollection_<<
"\n" 63 std::vector<std::unique_ptr<TrackingRegion> >
result;
70 measurementTracker = hmte.
product();
80 LogDebug(
"CosmicRegionalSeedGenerator") <<
"Seeding on stand alone muons ";
90 edm::LogError(
"CollectionNotFound") <<
"Error::No reco muons collection (" <<
recoMuonsCollection_ <<
") in the event - Please verify the name of the muon collection";
94 LogDebug(
"CosmicRegionalSeedGenerator") <<
"Muons collection size = " << muonsHandle->size();
114 for (reco::MuonCollection::const_iterator staMuon = muonsHandle->begin(); staMuon != muonsHandle->end(); ++staMuon) {
117 if (!staMuon->isStandAloneMuon()) {
118 LogDebug(
"CosmicRegionalSeedGenerator") <<
"This muon is not a stand alone muon";
123 if (
abs( staMuon->standAloneMuon()->eta() ) > 1.5 )
continue;
127 LogDebug(
"CosmicRegionalSeedGenerator") <<
"Muon stand alone found in the collection - in muons chambers: \n " 128 <<
"Position = " << staMuon->standAloneMuon()->outerPosition() <<
"\n " 129 <<
"Momentum = " << staMuon->standAloneMuon()->outerMomentum() <<
"\n " 130 <<
"Eta = " << staMuon->standAloneMuon()->eta() <<
"\n " 131 <<
"Phi = " << staMuon->standAloneMuon()->phi();
135 GlobalPoint initialRegionPosition(staMuon->standAloneMuon()->referencePoint().x(), staMuon->standAloneMuon()->referencePoint().y(), staMuon->standAloneMuon()->referencePoint().z());
136 GlobalVector initialRegionMomentum(staMuon->standAloneMuon()->momentum().x(), staMuon->standAloneMuon()->momentum().y(), staMuon->standAloneMuon()->momentum().z());
137 int charge = (
int) staMuon->standAloneMuon()->charge();
139 LogDebug(
"CosmicRegionalSeedGenerator") <<
"Initial region - Reference point of the sta muon: \n " 140 <<
"Position = " << initialRegionPosition <<
"\n " 141 <<
"Momentum = " << initialRegionMomentum <<
"\n " 142 <<
"Eta = " << initialRegionPosition.eta() <<
"\n " 143 <<
"Phi = " << initialRegionPosition.phi() <<
"\n " 147 if ( staMuon->standAloneMuon()->outerPosition().y()>0 ) initialRegionMomentum *=-1;
149 initialRegionMomentum,
156 if (!outer.isValid())
159 LogDebug(
"CosmicRegionalSeedGenerator") <<
"Trajectory state on surface not valid" ;
165 GlobalPoint regionPosition = outer.globalPosition();
168 LogDebug(
"CosmicRegionalSeedGenerator") <<
"Region after propagation: \n " 169 <<
"Position = " << outer.globalPosition() <<
"\n " 170 <<
"Momentum = " << outer.globalMomentum() <<
"\n " 171 <<
"R = " << regionPosition.
perp() <<
" ---- z = " << regionPosition.
z() <<
"\n " 172 <<
"Eta = " << outer.globalPosition().eta() <<
"\n " 173 <<
"Phi = " << outer.globalPosition().phi();
180 LogDebug(
"CosmicRegionalSeedGenerator") <<
"Step back vector = " << v <<
"\n";
184 double delta_R_min = 1000.;
185 for ( CaloJetCollection::const_iterator
jet = caloJetsHandle->begin ();
jet != caloJetsHandle->end();
jet++ ) {
188 double deta = center.
eta() -
jet->eta();
189 double dphi = fabs( center.
phi() -
jet->phi() );
193 if ( delta_R < delta_R_min ) delta_R_min =
delta_R;
198 LogDebug(
"CosmicRegionalSeedGenerator") <<
"Region built too close from a jet";
206 result.push_back(std::make_unique<CosmicTrackingRegion>((-1)*regionMom,
214 measurementTracker));
216 LogDebug(
"CosmicRegionalSeedGenerator") <<
"Final CosmicTrackingRegion \n " 217 <<
"Position = "<< center <<
"\n " 218 <<
"Direction = "<< result.back()->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();
273 for (reco::TrackCollection::const_iterator cosmicMuon = cosmicMuonsHandle->begin(); cosmicMuon != cosmicMuonsHandle->end(); ++cosmicMuon) {
276 if (
abs( cosmicMuon->eta() ) > 1.5 )
continue;
281 GlobalPoint initialRegionPosition(cosmicMuon->referencePoint().x(), cosmicMuon->referencePoint().y(), cosmicMuon->referencePoint().z());
282 GlobalVector initialRegionMomentum(cosmicMuon->momentum().x(), cosmicMuon->momentum().y(), cosmicMuon->momentum().z());
285 LogDebug(
"CosmicRegionalSeedGenerator") <<
"Position and momentum of the muon track in the muon chambers: \n " 286 <<
"x = " << cosmicMuon->outerPosition().x() <<
"\n " 287 <<
"y = " << cosmicMuon->outerPosition().y() <<
"\n " 288 <<
"y = " << cosmicMuon->pt() <<
"\n " 289 <<
"Initial region - Reference point of the cosmic muon track: \n " 290 <<
"Position = " << initialRegionPosition <<
"\n " 291 <<
"Momentum = " << initialRegionMomentum <<
"\n " 292 <<
"Eta = " << initialRegionPosition.eta() <<
"\n " 293 <<
"Phi = " << initialRegionPosition.phi() <<
"\n " 297 if ( cosmicMuon->outerPosition().y()>0 && cosmicMuon->momentum().y()<0 ) initialRegionMomentum *=-1;
299 initialRegionMomentum,
306 if (!outer.isValid())
309 LogDebug(
"CosmicRegionalSeedGenerator") <<
"Trajectory state on surface not valid" ;
315 GlobalPoint regionPosition = outer.globalPosition();
318 LogDebug(
"CosmicRegionalSeedGenerator") <<
"Region after propagation: \n " 319 <<
"Position = " << outer.globalPosition() <<
"\n " 320 <<
"Momentum = " << outer.globalMomentum() <<
"\n " 321 <<
"R = " << regionPosition.
perp() <<
" ---- z = " << regionPosition.
z() <<
"\n " 322 <<
"Eta = " << outer.globalPosition().eta() <<
"\n " 323 <<
"Phi = " << outer.globalPosition().phi();
330 LogDebug(
"CosmicRegionalSeedGenerator") <<
"Step back vector = " << v <<
"\n";
334 double delta_R_min = 1000.;
335 for ( CaloJetCollection::const_iterator
jet = caloJetsHandle->begin ();
jet != caloJetsHandle->end();
jet++ ) {
338 double deta = center.
eta() -
jet->eta();
339 double dphi = fabs( center.
phi() -
jet->phi() );
343 if ( delta_R < delta_R_min ) delta_R_min =
delta_R;
348 LogDebug(
"CosmicRegionalSeedGenerator") <<
"Region built too close from a jet";
354 result.push_back(std::make_unique<CosmicTrackingRegion>((-1)*regionMom,
362 measurementTracker));
364 LogDebug(
"CosmicRegionalSeedGenerator") <<
"Final CosmicTrackingRegion \n " 365 <<
"Position = "<< center <<
"\n " 366 <<
"Direction = "<< result.back()->direction() <<
"\n " 367 <<
"Distance from the region on the layer = " << (regionPosition -center).
mag() <<
"\n " 368 <<
"Eta = " << center.
eta() <<
"\n " 369 <<
"Phi = " << center.
phi();
383 LogDebug(
"CosmicRegionalSeedGenerator") <<
"Seeding on L2 muons";
398 LogDebug(
"CosmicRegionalSeedGenerator") <<
"L2 muons collection size = " << L2MuonsHandle->size();
413 for (reco::RecoChargedCandidateCollection::const_iterator L2Muon = L2MuonsHandle->begin(); L2Muon != L2MuonsHandle->end(); ++L2Muon) {
417 if (
abs( tkL2Muon->eta() ) > 1.5 )
continue;
422 GlobalPoint initialRegionPosition(tkL2Muon->referencePoint().x(), tkL2Muon->referencePoint().y(), tkL2Muon->referencePoint().z());
423 GlobalVector initialRegionMomentum(tkL2Muon->momentum().x(), tkL2Muon->momentum().y(), tkL2Muon->momentum().z());
426 LogDebug(
"CosmicRegionalSeedGenerator") <<
"Position and momentum of the L2 muon track in the muon chambers: \n " 427 <<
"x = " << tkL2Muon->outerPosition().x() <<
"\n " 428 <<
"y = " << tkL2Muon->outerPosition().y() <<
"\n " 429 <<
"y = " << tkL2Muon->pt() <<
"\n " 430 <<
"Initial region - Reference point of the L2 muon track: \n " 431 <<
"Position = " << initialRegionPosition <<
"\n " 432 <<
"Momentum = " << initialRegionMomentum <<
"\n " 433 <<
"Eta = " << initialRegionPosition.eta() <<
"\n " 434 <<
"Phi = " << initialRegionPosition.phi() <<
"\n " 439 if ( tkL2Muon->outerPosition().y() > 0 )
441 LogDebug(
"CosmicRegionalSeedGenerator") <<
"L2 muon in the TOP --- Region not created";
446 initialRegionMomentum,
453 if (!outer.isValid())
456 LogDebug(
"CosmicRegionalSeedGenerator") <<
"Trajectory state on surface not valid" ;
462 GlobalPoint regionPosition = outer.globalPosition();
465 LogDebug(
"CosmicRegionalSeedGenerator") <<
"Region after propagation: \n " 466 <<
"Position = " << outer.globalPosition() <<
"\n " 467 <<
"Momentum = " << outer.globalMomentum() <<
"\n " 468 <<
"R = " << regionPosition.
perp() <<
" ---- z = " << regionPosition.
z() <<
"\n " 469 <<
"Eta = " << outer.globalPosition().eta() <<
"\n " 470 <<
"Phi = " << outer.globalPosition().phi();
477 LogDebug(
"CosmicRegionalSeedGenerator") <<
"Step back vector = " << v <<
"\n";
481 result.push_back(std::make_unique<CosmicTrackingRegion>((-1)*regionMom,
489 measurementTracker));
491 LogDebug(
"CosmicRegionalSeedGenerator") <<
"Final L2TrackingRegion \n " 492 <<
"Position = "<< center <<
"\n " 493 <<
"Direction = "<< result.back()->direction() <<
"\n " 494 <<
"Distance from the region on the layer = " << (regionPosition -center).
mag() <<
"\n " 495 <<
"Eta = " << center.
eta() <<
"\n " 496 <<
"Phi = " << center.
phi();
edm::EDGetTokenT< reco::TrackCollection > recoTrackMuonsToken_
edm::ParameterSet regionPSet
T getParameter(std::string const &) const
bool doJetsExclusionCheck_
edm::EDGetTokenT< reco::CaloJetCollection > recoCaloJetsToken_
double deltaRExclusionSize_
edm::InputTag recoL2MuonsCollection_
edm::InputTag recoTrackMuonsCollection_
T mag() const
The vector magnitude. Equivalent to sqrt(vec.mag2())
Geom::Phi< T > phi() const
std::vector< Track > TrackCollection
collection of Tracks
std::vector< Muon > MuonCollection
collection of Muon objects
virtual const MagneticField * magneticField() const =0
Abs< T >::type abs(const T &t)
T const * get() const
Returns C++ pointer to the item.
edm::EDGetTokenT< reco::MuonCollection > recoMuonsToken_
double delta_R(double eta1, double phi1, double eta2, double phi2)
edm::EDGetTokenT< MeasurementTrackerEvent > measurementTrackerEventToken_
std::vector< std::unique_ptr< TrackingRegion > > regions(const edm::Event &event, const edm::EventSetup &es) const override
Vector3DBase unit() const
std::vector< RecoChargedCandidate > RecoChargedCandidateCollection
collectin of RecoChargedCandidate objects
std::string thePropagatorName_
T const * product() const
edm::InputTag recoMuonsCollection_
bool isUninitialized() const
edm::EDGetTokenT< reco::RecoChargedCandidateCollection > recoL2MuonsToken_
CosmicRegionalSeedGenerator(const edm::ParameterSet &conf, edm::ConsumesCollector &&iC)
T const * product() const
std::vector< CaloJet > CaloJetCollection
collection of CaloJet objects
edm::InputTag recoCaloJetsCollection_