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();
115 for (reco::MuonCollection::const_iterator staMuon = muonsHandle->begin(); staMuon != muonsHandle->end(); ++staMuon) {
118 if (!staMuon->isStandAloneMuon()) {
119 LogDebug(
"CosmicRegionalSeedGenerator") <<
"This muon is not a stand alone muon";
124 if (
abs( staMuon->standAloneMuon()->eta() ) > 1.5 )
continue;
128 LogDebug(
"CosmicRegionalSeedGenerator") <<
"Muon stand alone found in the collection - in muons chambers: \n " 129 <<
"Position = " << staMuon->standAloneMuon()->outerPosition() <<
"\n " 130 <<
"Momentum = " << staMuon->standAloneMuon()->outerMomentum() <<
"\n " 131 <<
"Eta = " << staMuon->standAloneMuon()->eta() <<
"\n " 132 <<
"Phi = " << staMuon->standAloneMuon()->phi();
136 GlobalPoint initialRegionPosition(staMuon->standAloneMuon()->referencePoint().x(), staMuon->standAloneMuon()->referencePoint().y(), staMuon->standAloneMuon()->referencePoint().z());
137 GlobalVector initialRegionMomentum(staMuon->standAloneMuon()->momentum().x(), staMuon->standAloneMuon()->momentum().y(), staMuon->standAloneMuon()->momentum().z());
138 int charge = (
int) staMuon->standAloneMuon()->charge();
140 LogDebug(
"CosmicRegionalSeedGenerator") <<
"Initial region - Reference point of the sta muon: \n " 141 <<
"Position = " << initialRegionPosition <<
"\n " 142 <<
"Momentum = " << initialRegionMomentum <<
"\n " 143 <<
"Eta = " << initialRegionPosition.eta() <<
"\n " 144 <<
"Phi = " << initialRegionPosition.phi() <<
"\n " 148 if ( staMuon->standAloneMuon()->outerPosition().y()>0 ) initialRegionMomentum *=-1;
150 initialRegionMomentum,
157 if (!outer.isValid())
160 LogDebug(
"CosmicRegionalSeedGenerator") <<
"Trajectory state on surface not valid" ;
166 GlobalPoint regionPosition = outer.globalPosition();
169 LogDebug(
"CosmicRegionalSeedGenerator") <<
"Region after propagation: \n " 170 <<
"Position = " << outer.globalPosition() <<
"\n " 171 <<
"Momentum = " << outer.globalMomentum() <<
"\n " 172 <<
"R = " << regionPosition.
perp() <<
" ---- z = " << regionPosition.
z() <<
"\n " 173 <<
"Eta = " << outer.globalPosition().eta() <<
"\n " 174 <<
"Phi = " << outer.globalPosition().phi();
181 LogDebug(
"CosmicRegionalSeedGenerator") <<
"Step back vector = " << v <<
"\n";
185 double delta_R_min = 1000.;
186 for ( CaloJetCollection::const_iterator
jet = caloJetsHandle->begin ();
jet != caloJetsHandle->end();
jet++ ) {
189 double deta = center.
eta() -
jet->eta();
190 double dphi = fabs( center.
phi() -
jet->phi() );
194 if ( delta_R < delta_R_min ) delta_R_min =
delta_R;
199 LogDebug(
"CosmicRegionalSeedGenerator") <<
"Region built too close from a jet";
207 result.push_back(std::make_unique<CosmicTrackingRegion>((-1)*regionMom,
215 measurementTracker));
217 LogDebug(
"CosmicRegionalSeedGenerator") <<
"Final CosmicTrackingRegion \n " 218 <<
"Position = "<< center <<
"\n " 219 <<
"Direction = "<< result.back()->direction() <<
"\n " 220 <<
"Distance from the region on the layer = " << (regionPosition -center).
mag() <<
"\n " 221 <<
"Eta = " << center.
eta() <<
"\n " 222 <<
"Phi = " << center.
phi();
241 LogDebug(
"CosmicRegionalSeedGenerator") <<
"Seeding on cosmic muons tracks";
249 if (!cosmicMuonsHandle.
isValid())
255 LogDebug(
"CosmicRegionalSeedGenerator") <<
"Cosmic muons tracks collection size = " << cosmicMuonsHandle->size();
275 for (reco::TrackCollection::const_iterator cosmicMuon = cosmicMuonsHandle->begin(); cosmicMuon != cosmicMuonsHandle->end(); ++cosmicMuon) {
278 if (
abs( cosmicMuon->eta() ) > 1.5 )
continue;
283 GlobalPoint initialRegionPosition(cosmicMuon->referencePoint().x(), cosmicMuon->referencePoint().y(), cosmicMuon->referencePoint().z());
284 GlobalVector initialRegionMomentum(cosmicMuon->momentum().x(), cosmicMuon->momentum().y(), cosmicMuon->momentum().z());
287 LogDebug(
"CosmicRegionalSeedGenerator") <<
"Position and momentum of the muon track in the muon chambers: \n " 288 <<
"x = " << cosmicMuon->outerPosition().x() <<
"\n " 289 <<
"y = " << cosmicMuon->outerPosition().y() <<
"\n " 290 <<
"y = " << cosmicMuon->pt() <<
"\n " 291 <<
"Initial region - Reference point of the cosmic muon track: \n " 292 <<
"Position = " << initialRegionPosition <<
"\n " 293 <<
"Momentum = " << initialRegionMomentum <<
"\n " 294 <<
"Eta = " << initialRegionPosition.eta() <<
"\n " 295 <<
"Phi = " << initialRegionPosition.phi() <<
"\n " 299 if ( cosmicMuon->outerPosition().y()>0 && cosmicMuon->momentum().y()<0 ) initialRegionMomentum *=-1;
301 initialRegionMomentum,
308 if (!outer.isValid())
311 LogDebug(
"CosmicRegionalSeedGenerator") <<
"Trajectory state on surface not valid" ;
317 GlobalPoint regionPosition = outer.globalPosition();
320 LogDebug(
"CosmicRegionalSeedGenerator") <<
"Region after propagation: \n " 321 <<
"Position = " << outer.globalPosition() <<
"\n " 322 <<
"Momentum = " << outer.globalMomentum() <<
"\n " 323 <<
"R = " << regionPosition.
perp() <<
" ---- z = " << regionPosition.
z() <<
"\n " 324 <<
"Eta = " << outer.globalPosition().eta() <<
"\n " 325 <<
"Phi = " << outer.globalPosition().phi();
332 LogDebug(
"CosmicRegionalSeedGenerator") <<
"Step back vector = " << v <<
"\n";
336 double delta_R_min = 1000.;
337 for ( CaloJetCollection::const_iterator
jet = caloJetsHandle->begin ();
jet != caloJetsHandle->end();
jet++ ) {
340 double deta = center.
eta() -
jet->eta();
341 double dphi = fabs( center.
phi() -
jet->phi() );
345 if ( delta_R < delta_R_min ) delta_R_min =
delta_R;
350 LogDebug(
"CosmicRegionalSeedGenerator") <<
"Region built too close from a jet";
356 result.push_back(std::make_unique<CosmicTrackingRegion>((-1)*regionMom,
364 measurementTracker));
366 LogDebug(
"CosmicRegionalSeedGenerator") <<
"Final CosmicTrackingRegion \n " 367 <<
"Position = "<< center <<
"\n " 368 <<
"Direction = "<< result.back()->direction() <<
"\n " 369 <<
"Distance from the region on the layer = " << (regionPosition -center).
mag() <<
"\n " 370 <<
"Eta = " << center.
eta() <<
"\n " 371 <<
"Phi = " << center.
phi();
385 LogDebug(
"CosmicRegionalSeedGenerator") <<
"Seeding on L2 muons";
400 LogDebug(
"CosmicRegionalSeedGenerator") <<
"L2 muons collection size = " << L2MuonsHandle->size();
416 for (reco::RecoChargedCandidateCollection::const_iterator L2Muon = L2MuonsHandle->begin(); L2Muon != L2MuonsHandle->end(); ++L2Muon) {
420 if (
abs( tkL2Muon->eta() ) > 1.5 )
continue;
425 GlobalPoint initialRegionPosition(tkL2Muon->referencePoint().x(), tkL2Muon->referencePoint().y(), tkL2Muon->referencePoint().z());
426 GlobalVector initialRegionMomentum(tkL2Muon->momentum().x(), tkL2Muon->momentum().y(), tkL2Muon->momentum().z());
429 LogDebug(
"CosmicRegionalSeedGenerator") <<
"Position and momentum of the L2 muon track in the muon chambers: \n " 430 <<
"x = " << tkL2Muon->outerPosition().x() <<
"\n " 431 <<
"y = " << tkL2Muon->outerPosition().y() <<
"\n " 432 <<
"y = " << tkL2Muon->pt() <<
"\n " 433 <<
"Initial region - Reference point of the L2 muon track: \n " 434 <<
"Position = " << initialRegionPosition <<
"\n " 435 <<
"Momentum = " << initialRegionMomentum <<
"\n " 436 <<
"Eta = " << initialRegionPosition.eta() <<
"\n " 437 <<
"Phi = " << initialRegionPosition.phi() <<
"\n " 442 if ( tkL2Muon->outerPosition().y() > 0 )
444 LogDebug(
"CosmicRegionalSeedGenerator") <<
"L2 muon in the TOP --- Region not created";
449 initialRegionMomentum,
456 if (!outer.isValid())
459 LogDebug(
"CosmicRegionalSeedGenerator") <<
"Trajectory state on surface not valid" ;
465 GlobalPoint regionPosition = outer.globalPosition();
468 LogDebug(
"CosmicRegionalSeedGenerator") <<
"Region after propagation: \n " 469 <<
"Position = " << outer.globalPosition() <<
"\n " 470 <<
"Momentum = " << outer.globalMomentum() <<
"\n " 471 <<
"R = " << regionPosition.
perp() <<
" ---- z = " << regionPosition.
z() <<
"\n " 472 <<
"Eta = " << outer.globalPosition().eta() <<
"\n " 473 <<
"Phi = " << outer.globalPosition().phi();
480 LogDebug(
"CosmicRegionalSeedGenerator") <<
"Step back vector = " << v <<
"\n";
484 result.push_back(std::make_unique<CosmicTrackingRegion>((-1)*regionMom,
492 measurementTracker));
494 LogDebug(
"CosmicRegionalSeedGenerator") <<
"Final L2TrackingRegion \n " 495 <<
"Position = "<< center <<
"\n " 496 <<
"Direction = "<< result.back()->direction() <<
"\n " 497 <<
"Distance from the region on the layer = " << (regionPosition -center).
mag() <<
"\n " 498 <<
"Eta = " << center.
eta() <<
"\n " 499 <<
"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_