18 using namespace trigger;
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<TrackingRegion* >
result;
74 LogDebug(
"CosmicRegionalSeedGenerator") <<
"Seeding on stand alone muons ";
84 edm::LogError(
"CollectionNotFound") <<
"Error::No reco muons collection (" <<
recoMuonsCollection_ <<
") in the event - Please verify the name of the muon collection";
88 LogDebug(
"CosmicRegionalSeedGenerator") <<
"Muons collection size = " << muonsHandle->size();
109 for (reco::MuonCollection::const_iterator staMuon = muonsHandle->begin(); staMuon != muonsHandle->end(); ++staMuon) {
112 if (!staMuon->isStandAloneMuon()) {
113 LogDebug(
"CosmicRegionalSeedGenerator") <<
"This muon is not a stand alone muon";
118 if (
abs( staMuon->standAloneMuon()->eta() ) > 1.5 )
continue;
122 LogDebug(
"CosmicRegionalSeedGenerator") <<
"Muon stand alone found in the collection - in muons chambers: \n "
123 <<
"Position = " << staMuon->standAloneMuon()->outerPosition() <<
"\n "
124 <<
"Momentum = " << staMuon->standAloneMuon()->outerMomentum() <<
"\n "
125 <<
"Eta = " << staMuon->standAloneMuon()->eta() <<
"\n "
126 <<
"Phi = " << staMuon->standAloneMuon()->phi();
130 GlobalPoint initialRegionPosition(staMuon->standAloneMuon()->referencePoint().x(), staMuon->standAloneMuon()->referencePoint().y(), staMuon->standAloneMuon()->referencePoint().z());
131 GlobalVector initialRegionMomentum(staMuon->standAloneMuon()->momentum().x(), staMuon->standAloneMuon()->momentum().y(), staMuon->standAloneMuon()->momentum().z());
132 int charge = (int) staMuon->standAloneMuon()->charge();
134 LogDebug(
"CosmicRegionalSeedGenerator") <<
"Initial region - Reference point of the sta muon: \n "
135 <<
"Position = " << initialRegionPosition <<
"\n "
136 <<
"Momentum = " << initialRegionMomentum <<
"\n "
137 <<
"Eta = " << initialRegionPosition.eta() <<
"\n "
138 <<
"Phi = " << initialRegionPosition.phi() <<
"\n "
139 <<
"Charge = " << charge;
142 if ( staMuon->standAloneMuon()->outerPosition().y()>0 ) initialRegionMomentum *=-1;
144 initialRegionMomentum,
146 thePropagator->magneticField());
151 if (!outer.isValid())
154 LogDebug(
"CosmicRegionalSeedGenerator") <<
"Trajectory state on surface not valid" ;
160 GlobalPoint regionPosition = outer.globalPosition();
163 LogDebug(
"CosmicRegionalSeedGenerator") <<
"Region after propagation: \n "
164 <<
"Position = " << outer.globalPosition() <<
"\n "
165 <<
"Momentum = " << outer.globalMomentum() <<
"\n "
166 <<
"R = " << regionPosition.
perp() <<
" ---- z = " << regionPosition.
z() <<
"\n "
167 <<
"Eta = " << outer.globalPosition().eta() <<
"\n "
168 <<
"Phi = " << outer.globalPosition().phi();
175 LogDebug(
"CosmicRegionalSeedGenerator") <<
"Step back vector = " << v <<
"\n";
179 double delta_R_min = 1000.;
180 for ( CaloJetCollection::const_iterator
jet = caloJetsHandle->begin ();
jet != caloJetsHandle->end();
jet++ ) {
183 double deta = center.
eta() -
jet->eta();
184 double dphi = fabs( center.
phi() -
jet->phi() );
188 if ( delta_R < delta_R_min ) delta_R_min =
delta_R;
193 LogDebug(
"CosmicRegionalSeedGenerator") <<
"Region built too close from a jet";
213 result.push_back(etaphiRegion);
215 LogDebug(
"CosmicRegionalSeedGenerator") <<
"Final CosmicTrackingRegion \n "
216 <<
"Position = "<< center <<
"\n "
217 <<
"Direction = "<< etaphiRegion->
direction() <<
"\n "
218 <<
"Distance from the region on the layer = " << (regionPosition -center).
mag() <<
"\n "
219 <<
"Eta = " << center.
eta() <<
"\n "
220 <<
"Phi = " << center.
phi();
239 LogDebug(
"CosmicRegionalSeedGenerator") <<
"Seeding on cosmic muons tracks";
247 if (!cosmicMuonsHandle.
isValid())
253 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());
283 int charge = (int) cosmicMuon->charge();
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 "
294 <<
"Charge = " << charge;
297 if ( cosmicMuon->outerPosition().y()>0 && cosmicMuon->momentum().y()<0 ) initialRegionMomentum *=-1;
299 initialRegionMomentum,
301 thePropagator->magneticField());
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";
366 result.push_back(etaphiRegion);
368 LogDebug(
"CosmicRegionalSeedGenerator") <<
"Final CosmicTrackingRegion \n "
369 <<
"Position = "<< center <<
"\n "
370 <<
"Direction = "<< etaphiRegion->
direction() <<
"\n "
371 <<
"Distance from the region on the layer = " << (regionPosition -center).
mag() <<
"\n "
372 <<
"Eta = " << center.
eta() <<
"\n "
373 <<
"Phi = " << center.
phi();
387 LogDebug(
"CosmicRegionalSeedGenerator") <<
"Seeding on L2 muons";
402 LogDebug(
"CosmicRegionalSeedGenerator") <<
"L2 muons collection size = " << L2MuonsHandle->size();
418 for (reco::RecoChargedCandidateCollection::const_iterator L2Muon = L2MuonsHandle->begin(); L2Muon != L2MuonsHandle->end(); ++L2Muon) {
422 if (
abs( tkL2Muon->eta() ) > 1.5 )
continue;
427 GlobalPoint initialRegionPosition(tkL2Muon->referencePoint().x(), tkL2Muon->referencePoint().y(), tkL2Muon->referencePoint().z());
428 GlobalVector initialRegionMomentum(tkL2Muon->momentum().x(), tkL2Muon->momentum().y(), tkL2Muon->momentum().z());
429 int charge = (int) tkL2Muon->charge();
431 LogDebug(
"CosmicRegionalSeedGenerator") <<
"Position and momentum of the L2 muon track in the muon chambers: \n "
432 <<
"x = " << tkL2Muon->outerPosition().x() <<
"\n "
433 <<
"y = " << tkL2Muon->outerPosition().y() <<
"\n "
434 <<
"y = " << tkL2Muon->pt() <<
"\n "
435 <<
"Initial region - Reference point of the L2 muon track: \n "
436 <<
"Position = " << initialRegionPosition <<
"\n "
437 <<
"Momentum = " << initialRegionMomentum <<
"\n "
438 <<
"Eta = " << initialRegionPosition.eta() <<
"\n "
439 <<
"Phi = " << initialRegionPosition.phi() <<
"\n "
440 <<
"Charge = " << charge;
444 if ( tkL2Muon->outerPosition().y() > 0 )
446 LogDebug(
"CosmicRegionalSeedGenerator") <<
"L2 muon in the TOP --- Region not created";
451 initialRegionMomentum,
453 thePropagator->magneticField());
458 if (!outer.isValid())
461 LogDebug(
"CosmicRegionalSeedGenerator") <<
"Trajectory state on surface not valid" ;
467 GlobalPoint regionPosition = outer.globalPosition();
470 LogDebug(
"CosmicRegionalSeedGenerator") <<
"Region after propagation: \n "
471 <<
"Position = " << outer.globalPosition() <<
"\n "
472 <<
"Momentum = " << outer.globalMomentum() <<
"\n "
473 <<
"R = " << regionPosition.
perp() <<
" ---- z = " << regionPosition.
z() <<
"\n "
474 <<
"Eta = " << outer.globalPosition().eta() <<
"\n "
475 <<
"Phi = " << outer.globalPosition().phi();
482 LogDebug(
"CosmicRegionalSeedGenerator") <<
"Step back vector = " << v <<
"\n";
496 result.push_back(etaphiRegion);
498 LogDebug(
"CosmicRegionalSeedGenerator") <<
"Final L2TrackingRegion \n "
499 <<
"Position = "<< center <<
"\n "
500 <<
"Direction = "<< etaphiRegion->
direction() <<
"\n "
501 <<
"Distance from the region on the layer = " << (regionPosition -center).
mag() <<
"\n "
502 <<
"Eta = " << center.
eta() <<
"\n "
503 <<
"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
GlobalVector const & direction() const
the direction around which region is constructed
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)
How EventSelector::AcceptEvent() decides whether to accept an event for output otherwise it is excluding the probing of A single or multiple positive and the trigger will pass if any such matching triggers are PASS or EXCEPTION[A criterion thatmatches no triggers at all is detected and causes a throw.] A single negative with an expectation of appropriate bit checking in the decision and the trigger will pass if any such matching triggers are FAIL or EXCEPTION A wildcarded negative criterion that matches more than one trigger in the trigger but the state exists so we define the behavior If all triggers are the negative crieriion will lead to accepting the event(this again matches the behavior of"!*"before the partial wildcard feature was incorporated).The per-event"cost"of each negative criterion with multiple relevant triggers is about the same as!*was in the past
Vector3DBase unit() const
std::vector< RecoChargedCandidate > RecoChargedCandidateCollection
collectin of RecoChargedCandidate objects
std::string thePropagatorName_
T const * product() const
edm::InputTag recoMuonsCollection_
virtual std::vector< TrackingRegion * > regions(const edm::Event &event, const edm::EventSetup &es) const
edm::EDGetTokenT< reco::RecoChargedCandidateCollection > recoL2MuonsToken_
CosmicRegionalSeedGenerator(const edm::ParameterSet &conf, edm::ConsumesCollector &&iC)
std::vector< CaloJet > CaloJetCollection
collection of CaloJet objects
edm::InputTag recoCaloJetsCollection_