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;
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 "
145 <<
"Charge = " << charge;
148 if ( staMuon->standAloneMuon()->outerPosition().y()>0 ) initialRegionMomentum *=-1;
150 initialRegionMomentum,
152 thePropagator->magneticField());
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";
220 result.push_back(etaphiRegion);
222 LogDebug(
"CosmicRegionalSeedGenerator") <<
"Final CosmicTrackingRegion \n "
223 <<
"Position = "<< center <<
"\n "
224 <<
"Direction = "<< etaphiRegion->
direction() <<
"\n "
225 <<
"Distance from the region on the layer = " << (regionPosition -center).
mag() <<
"\n "
226 <<
"Eta = " << center.
eta() <<
"\n "
227 <<
"Phi = " << center.
phi();
246 LogDebug(
"CosmicRegionalSeedGenerator") <<
"Seeding on cosmic muons tracks";
254 if (!cosmicMuonsHandle.
isValid())
260 LogDebug(
"CosmicRegionalSeedGenerator") <<
"Cosmic muons tracks collection size = " << cosmicMuonsHandle->size();
280 for (reco::TrackCollection::const_iterator cosmicMuon = cosmicMuonsHandle->begin(); cosmicMuon != cosmicMuonsHandle->end(); ++cosmicMuon) {
283 if (
abs( cosmicMuon->eta() ) > 1.5 )
continue;
288 GlobalPoint initialRegionPosition(cosmicMuon->referencePoint().x(), cosmicMuon->referencePoint().y(), cosmicMuon->referencePoint().z());
289 GlobalVector initialRegionMomentum(cosmicMuon->momentum().x(), cosmicMuon->momentum().y(), cosmicMuon->momentum().z());
290 int charge = (int) cosmicMuon->charge();
292 LogDebug(
"CosmicRegionalSeedGenerator") <<
"Position and momentum of the muon track in the muon chambers: \n "
293 <<
"x = " << cosmicMuon->outerPosition().x() <<
"\n "
294 <<
"y = " << cosmicMuon->outerPosition().y() <<
"\n "
295 <<
"y = " << cosmicMuon->pt() <<
"\n "
296 <<
"Initial region - Reference point of the cosmic muon track: \n "
297 <<
"Position = " << initialRegionPosition <<
"\n "
298 <<
"Momentum = " << initialRegionMomentum <<
"\n "
299 <<
"Eta = " << initialRegionPosition.eta() <<
"\n "
300 <<
"Phi = " << initialRegionPosition.phi() <<
"\n "
301 <<
"Charge = " << charge;
304 if ( cosmicMuon->outerPosition().y()>0 && cosmicMuon->momentum().y()<0 ) initialRegionMomentum *=-1;
306 initialRegionMomentum,
308 thePropagator->magneticField());
313 if (!outer.isValid())
316 LogDebug(
"CosmicRegionalSeedGenerator") <<
"Trajectory state on surface not valid" ;
322 GlobalPoint regionPosition = outer.globalPosition();
325 LogDebug(
"CosmicRegionalSeedGenerator") <<
"Region after propagation: \n "
326 <<
"Position = " << outer.globalPosition() <<
"\n "
327 <<
"Momentum = " << outer.globalMomentum() <<
"\n "
328 <<
"R = " << regionPosition.
perp() <<
" ---- z = " << regionPosition.
z() <<
"\n "
329 <<
"Eta = " << outer.globalPosition().eta() <<
"\n "
330 <<
"Phi = " << outer.globalPosition().phi();
337 LogDebug(
"CosmicRegionalSeedGenerator") <<
"Step back vector = " << v <<
"\n";
341 double delta_R_min = 1000.;
342 for ( CaloJetCollection::const_iterator
jet = caloJetsHandle->begin ();
jet != caloJetsHandle->end();
jet++ ) {
345 double deta = center.
eta() -
jet->eta();
346 double dphi = fabs( center.
phi() -
jet->phi() );
350 if ( delta_R < delta_R_min ) delta_R_min =
delta_R;
355 LogDebug(
"CosmicRegionalSeedGenerator") <<
"Region built too close from a jet";
373 result.push_back(etaphiRegion);
375 LogDebug(
"CosmicRegionalSeedGenerator") <<
"Final CosmicTrackingRegion \n "
376 <<
"Position = "<< center <<
"\n "
377 <<
"Direction = "<< etaphiRegion->
direction() <<
"\n "
378 <<
"Distance from the region on the layer = " << (regionPosition -center).
mag() <<
"\n "
379 <<
"Eta = " << center.
eta() <<
"\n "
380 <<
"Phi = " << center.
phi();
394 LogDebug(
"CosmicRegionalSeedGenerator") <<
"Seeding on L2 muons";
409 LogDebug(
"CosmicRegionalSeedGenerator") <<
"L2 muons collection size = " << L2MuonsHandle->size();
425 for (reco::RecoChargedCandidateCollection::const_iterator L2Muon = L2MuonsHandle->begin(); L2Muon != L2MuonsHandle->end(); ++L2Muon) {
429 if (
abs( tkL2Muon->eta() ) > 1.5 )
continue;
434 GlobalPoint initialRegionPosition(tkL2Muon->referencePoint().x(), tkL2Muon->referencePoint().y(), tkL2Muon->referencePoint().z());
435 GlobalVector initialRegionMomentum(tkL2Muon->momentum().x(), tkL2Muon->momentum().y(), tkL2Muon->momentum().z());
436 int charge = (int) tkL2Muon->charge();
438 LogDebug(
"CosmicRegionalSeedGenerator") <<
"Position and momentum of the L2 muon track in the muon chambers: \n "
439 <<
"x = " << tkL2Muon->outerPosition().x() <<
"\n "
440 <<
"y = " << tkL2Muon->outerPosition().y() <<
"\n "
441 <<
"y = " << tkL2Muon->pt() <<
"\n "
442 <<
"Initial region - Reference point of the L2 muon track: \n "
443 <<
"Position = " << initialRegionPosition <<
"\n "
444 <<
"Momentum = " << initialRegionMomentum <<
"\n "
445 <<
"Eta = " << initialRegionPosition.eta() <<
"\n "
446 <<
"Phi = " << initialRegionPosition.phi() <<
"\n "
447 <<
"Charge = " << charge;
451 if ( tkL2Muon->outerPosition().y() > 0 )
453 LogDebug(
"CosmicRegionalSeedGenerator") <<
"L2 muon in the TOP --- Region not created";
458 initialRegionMomentum,
460 thePropagator->magneticField());
465 if (!outer.isValid())
468 LogDebug(
"CosmicRegionalSeedGenerator") <<
"Trajectory state on surface not valid" ;
474 GlobalPoint regionPosition = outer.globalPosition();
477 LogDebug(
"CosmicRegionalSeedGenerator") <<
"Region after propagation: \n "
478 <<
"Position = " << outer.globalPosition() <<
"\n "
479 <<
"Momentum = " << outer.globalMomentum() <<
"\n "
480 <<
"R = " << regionPosition.
perp() <<
" ---- z = " << regionPosition.
z() <<
"\n "
481 <<
"Eta = " << outer.globalPosition().eta() <<
"\n "
482 <<
"Phi = " << outer.globalPosition().phi();
489 LogDebug(
"CosmicRegionalSeedGenerator") <<
"Step back vector = " << v <<
"\n";
503 result.push_back(etaphiRegion);
505 LogDebug(
"CosmicRegionalSeedGenerator") <<
"Final L2TrackingRegion \n "
506 <<
"Position = "<< center <<
"\n "
507 <<
"Direction = "<< etaphiRegion->
direction() <<
"\n "
508 <<
"Distance from the region on the layer = " << (regionPosition -center).
mag() <<
"\n "
509 <<
"Eta = " << center.
eta() <<
"\n "
510 <<
"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
tuple MeasurementTrackerEvent
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
edm::EDGetTokenT< MeasurementTrackerEvent > measurementTrackerEventToken_
Vector3DBase unit() const
std::vector< RecoChargedCandidate > RecoChargedCandidateCollection
collectin of RecoChargedCandidate objects
std::string thePropagatorName_
T const * product() const
T const * product() const
edm::InputTag recoMuonsCollection_
bool isUninitialized() const
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_