CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Attributes
CosmicRegionalSeedGenerator Class Reference

#include <CosmicRegionalSeedGenerator.h>

Inheritance diagram for CosmicRegionalSeedGenerator:
TrackingRegionProducer

Public Member Functions

 CosmicRegionalSeedGenerator (const edm::ParameterSet &conf, edm::ConsumesCollector &&iC)
 
virtual std::vector
< TrackingRegion * > 
regions (const edm::Event &event, const edm::EventSetup &es) const
 
virtual ~CosmicRegionalSeedGenerator ()
 
- Public Member Functions inherited from TrackingRegionProducer
virtual ~TrackingRegionProducer ()
 

Private Attributes

edm::ParameterSet conf_
 
float deltaEta_
 
float deltaPhi_
 
double deltaRExclusionSize_
 
bool doJetsExclusionCheck_
 
double jetsPtMin_
 
edm::EDGetTokenT
< MeasurementTrackerEvent
measurementTrackerEventToken_
 
float ptMin_
 
edm::InputTag recoCaloJetsCollection_
 
edm::EDGetTokenT
< reco::CaloJetCollection
recoCaloJetsToken_
 
edm::InputTag recoL2MuonsCollection_
 
edm::EDGetTokenT
< reco::RecoChargedCandidateCollection
recoL2MuonsToken_
 
edm::InputTag recoMuonsCollection_
 
edm::EDGetTokenT
< reco::MuonCollection
recoMuonsToken_
 
edm::InputTag recoTrackMuonsCollection_
 
edm::EDGetTokenT
< reco::TrackCollection
recoTrackMuonsToken_
 
std::string regionBase_
 
edm::ParameterSet regionPSet
 
float rVertex_
 
std::string thePropagatorName_
 
float zVertex_
 

Detailed Description

Definition at line 49 of file CosmicRegionalSeedGenerator.h.

Constructor & Destructor Documentation

CosmicRegionalSeedGenerator::CosmicRegionalSeedGenerator ( const edm::ParameterSet conf,
edm::ConsumesCollector &&  iC 
)
explicit

Definition at line 22 of file CosmicRegionalSeedGenerator.cc.

References conf_, deltaEta_, deltaPhi_, deltaRExclusionSize_, doJetsExclusionCheck_, edm::ParameterSet::getParameter(), HLT_25ns14e33_v1_cff::InputTag, jetsPtMin_, MeasurementTrackerEventProducer_cfi::MeasurementTrackerEvent, measurementTrackerEventToken_, ptMin_, recoCaloJetsCollection_, recoCaloJetsToken_, recoL2MuonsCollection_, recoL2MuonsToken_, recoMuonsCollection_, recoMuonsToken_, recoTrackMuonsCollection_, recoTrackMuonsToken_, regionBase_, regionPSet, rVertex_, AlCaHLTBitMon_QueryRunRegistry::string, thePropagatorName_, and zVertex_.

23  :
24  conf_(conf)
25 {
26  edm::LogInfo ("CosmicRegionalSeedGenerator") << "Begin Run:: Constructing CosmicRegionalSeedGenerator";
27 
29  ptMin_ = regionPSet.getParameter<double>("ptMin");
30  rVertex_ = regionPSet.getParameter<double>("rVertex");
31  zVertex_ = regionPSet.getParameter<double>("zVertex");
32  deltaEta_ = regionPSet.getParameter<double>("deltaEtaRegion");
33  deltaPhi_ = regionPSet.getParameter<double>("deltaPhiRegion");
34 
35  edm::ParameterSet toolsPSet = conf_.getParameter<edm::ParameterSet>("ToolsPSet");
36  thePropagatorName_ = toolsPSet.getParameter<std::string>("thePropagatorName");
37  regionBase_ = toolsPSet.getParameter<std::string>("regionBase");
38 
39  edm::ParameterSet collectionsPSet = conf_.getParameter<edm::ParameterSet>("CollectionsPSet");
40  recoMuonsCollection_ = collectionsPSet.getParameter<edm::InputTag>("recoMuonsCollection");
41  recoTrackMuonsCollection_ = collectionsPSet.getParameter<edm::InputTag>("recoTrackMuonsCollection");
42  recoL2MuonsCollection_ = collectionsPSet.getParameter<edm::InputTag>("recoL2MuonsCollection");
43 
44  edm::ParameterSet regionInJetsCheckPSet = conf_.getParameter<edm::ParameterSet>("RegionInJetsCheckPSet");
45  doJetsExclusionCheck_ = regionInJetsCheckPSet.getParameter<bool>("doJetsExclusionCheck");
46  deltaRExclusionSize_ = regionInJetsCheckPSet.getParameter<double>("deltaRExclusionSize");
47  jetsPtMin_ = regionInJetsCheckPSet.getParameter<double>("jetsPtMin");
48  recoCaloJetsCollection_ = regionInJetsCheckPSet.getParameter<edm::InputTag>("recoCaloJetsCollection");
54 
55  edm::LogInfo ("CosmicRegionalSeedGenerator") << "Reco muons collection: " << recoMuonsCollection_ << "\n"
56  << "Reco tracks muons collection: " << recoTrackMuonsCollection_<< "\n"
57  << "Reco L2 muons collection: " << recoL2MuonsCollection_;
58 }
edm::EDGetTokenT< reco::TrackCollection > recoTrackMuonsToken_
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
T getParameter(std::string const &) const
edm::EDGetTokenT< reco::CaloJetCollection > recoCaloJetsToken_
std::vector< Track > TrackCollection
collection of Tracks
Definition: TrackFwd.h:13
std::vector< Muon > MuonCollection
collection of Muon objects
Definition: MuonFwd.h:9
edm::EDGetTokenT< reco::MuonCollection > recoMuonsToken_
edm::EDGetTokenT< MeasurementTrackerEvent > measurementTrackerEventToken_
std::vector< RecoChargedCandidate > RecoChargedCandidateCollection
collectin of RecoChargedCandidate objects
edm::EDGetTokenT< reco::RecoChargedCandidateCollection > recoL2MuonsToken_
std::vector< CaloJet > CaloJetCollection
collection of CaloJet objects
virtual CosmicRegionalSeedGenerator::~CosmicRegionalSeedGenerator ( )
inlinevirtual

Definition at line 55 of file CosmicRegionalSeedGenerator.h.

55 {}

Member Function Documentation

std::vector< TrackingRegion *, std::allocator< TrackingRegion * > > CosmicRegionalSeedGenerator::regions ( const edm::Event event,
const edm::EventSetup es 
) const
virtual

Implements TrackingRegionProducer.

Definition at line 60 of file CosmicRegionalSeedGenerator.cc.

References funct::abs(), RecoTauCleanerPlugins::charge, kinem::delta_R(), deltaEta_, deltaPhi_, deltaRExclusionSize_, TrackingRegion::direction(), doJetsExclusionCheck_, PV3DBase< T, PVType, FrameType >::eta(), edm::EventSetup::get(), edm::Ref< C, T, F >::get(), edm::EDGetTokenT< T >::isUninitialized(), edm::HandleBase::isValid(), metsig::jet, jetsPtMin_, LogDebug, mag(), HLT_25ns14e33_v1_cff::measurementTracker, MeasurementTrackerEventProducer_cfi::MeasurementTrackerEvent, measurementTrackerEventToken_, SurfaceOrientation::outer, PV3DBase< T, PVType, FrameType >::perp(), PV3DBase< T, PVType, FrameType >::phi(), Pi, edm::Handle< T >::product(), edm::ESHandle< class >::product(), ptMin_, recoCaloJetsToken_, recoL2MuonsCollection_, recoL2MuonsToken_, recoMuonsCollection_, recoMuonsToken_, recoTrackMuonsCollection_, recoTrackMuonsToken_, regionBase_, regionPSet, query::result, rVertex_, mathSSE::sqrt(), thePropagatorName_, Vector3DBase< T, FrameTag >::unit(), findQualityFiles::v, PV3DBase< T, PVType, FrameType >::z(), and zVertex_.

61 {
62 
63  std::vector<TrackingRegion* > result;
64 
65 
69  event.getByToken(measurementTrackerEventToken_, hmte);
70  measurementTracker = hmte.product();
71  }
72  //________________________________________
73  //
74  //Seeding on Sta muon (MC && Datas)
75  //________________________________________
76 
77 
78  if(regionBase_=="seedOnStaMuon"||regionBase_=="") {
79 
80  LogDebug("CosmicRegionalSeedGenerator") << "Seeding on stand alone muons ";
81 
82  //get collections
83  //+++++++++++++++
84 
85  //get the muon collection
87  event.getByToken(recoMuonsToken_,muonsHandle);
88  if (!muonsHandle.isValid())
89  {
90  edm::LogError("CollectionNotFound") << "Error::No reco muons collection (" << recoMuonsCollection_ << ") in the event - Please verify the name of the muon collection";
91  return result;
92  }
93 
94  LogDebug("CosmicRegionalSeedGenerator") << "Muons collection size = " << muonsHandle->size();
95 
96  //get the jet collection
97  edm::Handle<CaloJetCollection> caloJetsHandle;
98  event.getByToken(recoCaloJetsToken_,caloJetsHandle);
99 
100  //get the propagator
101  edm::ESHandle<Propagator> thePropagator;
102  es.get<TrackingComponentsRecord>().get(thePropagatorName_, thePropagator); // thePropagatorName = "AnalyticalPropagator"
103 
104  //get tracker geometry
105  edm::ESHandle<TrackerGeometry> theTrackerGeometry;
106  es.get<TrackerDigiGeometryRecord>().get(theTrackerGeometry);
107  //const TrackerGeometry& theTracker(*theTrackerGeometry);
108  DetId outerid;
109 
110 
111  //definition of the region
112  //+++++++++++++++++++++++++
113 
114  int nmuons = 0;
115  for (reco::MuonCollection::const_iterator staMuon = muonsHandle->begin(); staMuon != muonsHandle->end(); ++staMuon) {
116 
117  //select sta muons
118  if (!staMuon->isStandAloneMuon()) {
119  LogDebug("CosmicRegionalSeedGenerator") << "This muon is not a stand alone muon";
120  continue;
121  }
122 
123  //bit 25 as a coverage -1.4 < eta < 1.4
124  if ( abs( staMuon->standAloneMuon()->eta() ) > 1.5 ) continue;
125 
126  //debug
127  nmuons++;
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();
133 
134  //initial position, momentum, charge
135 
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();
139 
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;
146 
147  //propagation on the last layers of TOB
148  if ( staMuon->standAloneMuon()->outerPosition().y()>0 ) initialRegionMomentum *=-1;
149  GlobalTrajectoryParameters glb_parameters(initialRegionPosition,
150  initialRegionMomentum,
151  charge,
152  thePropagator->magneticField());
153  FreeTrajectoryState fts(glb_parameters);
154  StateOnTrackerBound onBounds(thePropagator.product());
155  TrajectoryStateOnSurface outer = onBounds(fts);
156 
157  if (!outer.isValid())
158  {
159  //edm::LogError("FailedPropagation") << "Trajectory state on surface not valid" ;
160  LogDebug("CosmicRegionalSeedGenerator") << "Trajectory state on surface not valid" ;
161  continue;
162  }
163 
164 
165  //final position & momentum
166  GlobalPoint regionPosition = outer.globalPosition();
167  GlobalVector regionMom = outer.globalMomentum();
168 
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();
175 
176 
177  //step back
178  double stepBack = 1;
179  GlobalPoint center = regionPosition + stepBack * regionMom.unit();
180  GlobalVector v = stepBack * regionMom.unit();
181  LogDebug("CosmicRegionalSeedGenerator") << "Step back vector = " << v << "\n";
182 
183  //exclude region built in jets
184  if ( doJetsExclusionCheck_ ) {
185  double delta_R_min = 1000.;
186  for ( CaloJetCollection::const_iterator jet = caloJetsHandle->begin (); jet != caloJetsHandle->end(); jet++ ) {
187  if ( jet->pt() < jetsPtMin_ ) continue;
188 
189  double deta = center.eta() - jet->eta();
190  double dphi = fabs( center.phi() - jet->phi() );
191  if ( dphi > TMath::Pi() ) dphi = 2*TMath::Pi() - dphi;
192 
193  double delta_R = sqrt(deta*deta + dphi*dphi);
194  if ( delta_R < delta_R_min ) delta_R_min = delta_R;
195 
196  }//end loop on jets
197 
198  if ( delta_R_min < deltaRExclusionSize_ ) {
199  LogDebug("CosmicRegionalSeedGenerator") << "Region built too close from a jet";
200  continue;
201  }
202  }//end if doJetsExclusionCheck
203 
204 
205  //definition of the region
206 
207  CosmicTrackingRegion *etaphiRegion = new CosmicTrackingRegion((-1)*regionMom,
208  center,
209  ptMin_,
210  rVertex_,
211  zVertex_,
212  deltaEta_,
213  deltaPhi_,
214  regionPSet,
215  measurementTracker);
216 
217 
218 
219  //return the result
220  result.push_back(etaphiRegion);
221 
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();
228 
229 
230  }//end loop on muons
231 
232  }//end if SeedOnStaMuon
233 
234 
235 
236 
237 
238  //________________________________________
239  //
240  //Seeding on cosmic muons (MC && Datas)
241  //________________________________________
242 
243 
244  if(regionBase_=="seedOnCosmicMuon") {
245 
246  LogDebug("CosmicRegionalSeedGenerator") << "Seeding on cosmic muons tracks";
247 
248  //get collections
249  //+++++++++++++++
250 
251  //get the muon collection
252  edm::Handle<reco::TrackCollection> cosmicMuonsHandle;
253  event.getByToken(recoTrackMuonsToken_,cosmicMuonsHandle);
254  if (!cosmicMuonsHandle.isValid())
255  {
256  edm::LogError("CollectionNotFound") << "Error::No cosmic muons collection (" << recoTrackMuonsCollection_ << ") in the event - Please verify the name of the muon reco track collection";
257  return result;
258  }
259 
260  LogDebug("CosmicRegionalSeedGenerator") << "Cosmic muons tracks collection size = " << cosmicMuonsHandle->size();
261 
262  //get the jet collection
263  edm::Handle<CaloJetCollection> caloJetsHandle;
264  event.getByToken(recoCaloJetsToken_,caloJetsHandle);
265 
266  //get the propagator
267  edm::ESHandle<Propagator> thePropagator;
268  es.get<TrackingComponentsRecord>().get(thePropagatorName_, thePropagator); // thePropagatorName = "AnalyticalPropagator"
269 
270  //get tracker geometry
271  edm::ESHandle<TrackerGeometry> theTrackerGeometry;
272  es.get<TrackerDigiGeometryRecord>().get(theTrackerGeometry);
273  DetId outerid;
274 
275 
276  //definition of the region
277  //+++++++++++++++++++++++++
278 
279  int nmuons = 0;
280  for (reco::TrackCollection::const_iterator cosmicMuon = cosmicMuonsHandle->begin(); cosmicMuon != cosmicMuonsHandle->end(); ++cosmicMuon) {
281 
282  //bit 25 as a coverage -1.4 < eta < 1.4
283  if ( abs( cosmicMuon->eta() ) > 1.5 ) continue;
284 
285  nmuons++;
286 
287  //initial position, momentum, charge
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();
291 
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;
302 
303  //propagation on the last layers of TOB
304  if ( cosmicMuon->outerPosition().y()>0 && cosmicMuon->momentum().y()<0 ) initialRegionMomentum *=-1;
305  GlobalTrajectoryParameters glb_parameters(initialRegionPosition,
306  initialRegionMomentum,
307  charge,
308  thePropagator->magneticField());
309  FreeTrajectoryState fts(glb_parameters);
310  StateOnTrackerBound onBounds(thePropagator.product());
311  TrajectoryStateOnSurface outer = onBounds(fts);
312 
313  if (!outer.isValid())
314  {
315  //edm::LogError("FailedPropagation") << "Trajectory state on surface not valid" ;
316  LogDebug("CosmicRegionalSeedGenerator") << "Trajectory state on surface not valid" ;
317  continue;
318  }
319 
320 
321  //final position & momentum
322  GlobalPoint regionPosition = outer.globalPosition();
323  GlobalVector regionMom = outer.globalMomentum();
324 
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();
331 
332 
333  //step back
334  double stepBack = 1;
335  GlobalPoint center = regionPosition + stepBack * regionMom.unit();
336  GlobalVector v = stepBack * regionMom.unit();
337  LogDebug("CosmicRegionalSeedGenerator") << "Step back vector = " << v << "\n";
338 
339  //exclude region built in jets
340  if ( doJetsExclusionCheck_ ) {
341  double delta_R_min = 1000.;
342  for ( CaloJetCollection::const_iterator jet = caloJetsHandle->begin (); jet != caloJetsHandle->end(); jet++ ) {
343  if ( jet->pt() < jetsPtMin_ ) continue;
344 
345  double deta = center.eta() - jet->eta();
346  double dphi = fabs( center.phi() - jet->phi() );
347  if ( dphi > TMath::Pi() ) dphi = 2*TMath::Pi() - dphi;
348 
349  double delta_R = sqrt(deta*deta + dphi*dphi);
350  if ( delta_R < delta_R_min ) delta_R_min = delta_R;
351 
352  }//end loop on jets
353 
354  if ( delta_R_min < deltaRExclusionSize_ ) {
355  LogDebug("CosmicRegionalSeedGenerator") << "Region built too close from a jet";
356  continue;
357  }
358  }// end if doJetsExclusionCheck
359 
360  //definition of the region
361  CosmicTrackingRegion *etaphiRegion = new CosmicTrackingRegion((-1)*regionMom,
362  center,
363  ptMin_,
364  rVertex_,
365  zVertex_,
366  deltaEta_,
367  deltaPhi_,
368  regionPSet,
369  measurementTracker);
370 
371 
372  //return the result
373  result.push_back(etaphiRegion);
374 
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();
381 
382  }//end loop on muons
383 
384  }//end if SeedOnCosmicMuon
385 
386 
387  //________________________________________
388  //
389  //Seeding on L2 muons (MC && Datas)
390  //________________________________________
391 
392  if(regionBase_=="seedOnL2Muon") {
393 
394  LogDebug("CosmicRegionalSeedGenerator") << "Seeding on L2 muons";
395 
396  //get collections
397  //+++++++++++++++
398 
399  //get the muon collection
401  event.getByToken(recoL2MuonsToken_,L2MuonsHandle);
402 
403  if (!L2MuonsHandle.isValid())
404  {
405  edm::LogError("CollectionNotFound") << "Error::No L2 muons collection (" << recoL2MuonsCollection_ <<") in the event - Please verify the name of the L2 muon collection";
406  return result;
407  }
408 
409  LogDebug("CosmicRegionalSeedGenerator") << "L2 muons collection size = " << L2MuonsHandle->size();
410 
411  //get the propagator
412  edm::ESHandle<Propagator> thePropagator;
413  es.get<TrackingComponentsRecord>().get(thePropagatorName_, thePropagator); // thePropagatorName = "AnalyticalPropagator"
414 
415  //get tracker geometry
416  edm::ESHandle<TrackerGeometry> theTrackerGeometry;
417  es.get<TrackerDigiGeometryRecord>().get(theTrackerGeometry);
418  DetId outerid;
419 
420 
421  //definition of the region
422  //+++++++++++++++++++++++++
423 
424  int nmuons = 0;
425  for (reco::RecoChargedCandidateCollection::const_iterator L2Muon = L2MuonsHandle->begin(); L2Muon != L2MuonsHandle->end(); ++L2Muon) {
426  reco::TrackRef tkL2Muon = L2Muon->get<reco::TrackRef>();
427 
428  //bit 25 as a coverage -1.4 < eta < 1.4
429  if ( abs( tkL2Muon->eta() ) > 1.5 ) continue;
430 
431  nmuons++;
432 
433  //initial position, momentum, charge
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();
437 
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;
448 
449 
450  //seeding only in the bottom
451  if ( tkL2Muon->outerPosition().y() > 0 )
452  {
453  LogDebug("CosmicRegionalSeedGenerator") << "L2 muon in the TOP --- Region not created";
454  return result;
455  }
456 
457  GlobalTrajectoryParameters glb_parameters(initialRegionPosition,
458  initialRegionMomentum,
459  charge,
460  thePropagator->magneticField());
461  FreeTrajectoryState fts(glb_parameters);
462  StateOnTrackerBound onBounds(thePropagator.product());
463  TrajectoryStateOnSurface outer = onBounds(fts);
464 
465  if (!outer.isValid())
466  {
467  //edm::LogError("FailedPropagation") << "Trajectory state on surface not valid" ;
468  LogDebug("CosmicRegionalSeedGenerator") << "Trajectory state on surface not valid" ;
469  continue;
470  }
471 
472 
473  //final position & momentum
474  GlobalPoint regionPosition = outer.globalPosition();
475  GlobalVector regionMom = outer.globalMomentum();
476 
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();
483 
484 
485  //step back
486  double stepBack = 1;
487  GlobalPoint center = regionPosition + stepBack * regionMom.unit();
488  GlobalVector v = stepBack * regionMom.unit();
489  LogDebug("CosmicRegionalSeedGenerator") << "Step back vector = " << v << "\n";
490 
491 
492  //definition of the region
493  CosmicTrackingRegion *etaphiRegion = new CosmicTrackingRegion((-1)*regionMom,
494  center,
495  ptMin_,
496  rVertex_,
497  zVertex_,
498  deltaEta_,
499  deltaPhi_,
500  regionPSet,
501  measurementTracker);
502 
503  result.push_back(etaphiRegion);
504 
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();
511 
512 
513  }//end loop on muons
514 
515  }//end if SeedOnL2Muon
516 
517  return result;
518 
519 }
#define LogDebug(id)
edm::EDGetTokenT< reco::TrackCollection > recoTrackMuonsToken_
const double Pi
edm::EDGetTokenT< reco::CaloJetCollection > recoCaloJetsToken_
T perp() const
Definition: PV3DBase.h:72
T mag() const
The vector magnitude. Equivalent to sqrt(vec.mag2())
Geom::Phi< T > phi() const
Definition: PV3DBase.h:69
GlobalVector const & direction() const
the direction around which region is constructed
T sqrt(T t)
Definition: SSEVec.h:48
T z() const
Definition: PV3DBase.h:64
tuple result
Definition: query.py:137
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
T const * get() const
Returns C++ pointer to the item.
Definition: Ref.h:244
edm::EDGetTokenT< reco::MuonCollection > recoMuonsToken_
double delta_R(double eta1, double phi1, double eta2, double phi2)
Definition: AnglesUtil.h:116
bool isValid() const
Definition: HandleBase.h:75
edm::EDGetTokenT< MeasurementTrackerEvent > measurementTrackerEventToken_
Vector3DBase unit() const
Definition: Vector3DBase.h:57
Definition: DetId.h:18
T const * product() const
Definition: Handle.h:81
const T & get() const
Definition: EventSetup.h:55
T const * product() const
Definition: ESHandle.h:86
T eta() const
Definition: PV3DBase.h:76
bool isUninitialized() const
Definition: EDGetToken.h:71
edm::EDGetTokenT< reco::RecoChargedCandidateCollection > recoL2MuonsToken_

Member Data Documentation

edm::ParameterSet CosmicRegionalSeedGenerator::conf_
private

Definition at line 60 of file CosmicRegionalSeedGenerator.h.

Referenced by CosmicRegionalSeedGenerator().

float CosmicRegionalSeedGenerator::deltaEta_
private

Definition at line 66 of file CosmicRegionalSeedGenerator.h.

Referenced by CosmicRegionalSeedGenerator(), and regions().

float CosmicRegionalSeedGenerator::deltaPhi_
private

Definition at line 67 of file CosmicRegionalSeedGenerator.h.

Referenced by CosmicRegionalSeedGenerator(), and regions().

double CosmicRegionalSeedGenerator::deltaRExclusionSize_
private

Definition at line 83 of file CosmicRegionalSeedGenerator.h.

Referenced by CosmicRegionalSeedGenerator(), and regions().

bool CosmicRegionalSeedGenerator::doJetsExclusionCheck_
private

Definition at line 82 of file CosmicRegionalSeedGenerator.h.

Referenced by CosmicRegionalSeedGenerator(), and regions().

double CosmicRegionalSeedGenerator::jetsPtMin_
private

Definition at line 84 of file CosmicRegionalSeedGenerator.h.

Referenced by CosmicRegionalSeedGenerator(), and regions().

edm::EDGetTokenT<MeasurementTrackerEvent> CosmicRegionalSeedGenerator::measurementTrackerEventToken_
private

Definition at line 79 of file CosmicRegionalSeedGenerator.h.

Referenced by CosmicRegionalSeedGenerator(), and regions().

float CosmicRegionalSeedGenerator::ptMin_
private

Definition at line 63 of file CosmicRegionalSeedGenerator.h.

Referenced by CosmicRegionalSeedGenerator(), and regions().

edm::InputTag CosmicRegionalSeedGenerator::recoCaloJetsCollection_
private

Definition at line 85 of file CosmicRegionalSeedGenerator.h.

Referenced by CosmicRegionalSeedGenerator().

edm::EDGetTokenT<reco::CaloJetCollection> CosmicRegionalSeedGenerator::recoCaloJetsToken_
private

Definition at line 75 of file CosmicRegionalSeedGenerator.h.

Referenced by CosmicRegionalSeedGenerator(), and regions().

edm::InputTag CosmicRegionalSeedGenerator::recoL2MuonsCollection_
private

Definition at line 74 of file CosmicRegionalSeedGenerator.h.

Referenced by CosmicRegionalSeedGenerator(), and regions().

edm::EDGetTokenT<reco::RecoChargedCandidateCollection> CosmicRegionalSeedGenerator::recoL2MuonsToken_
private

Definition at line 78 of file CosmicRegionalSeedGenerator.h.

Referenced by CosmicRegionalSeedGenerator(), and regions().

edm::InputTag CosmicRegionalSeedGenerator::recoMuonsCollection_
private

Definition at line 72 of file CosmicRegionalSeedGenerator.h.

Referenced by CosmicRegionalSeedGenerator(), and regions().

edm::EDGetTokenT<reco::MuonCollection> CosmicRegionalSeedGenerator::recoMuonsToken_
private

Definition at line 76 of file CosmicRegionalSeedGenerator.h.

Referenced by CosmicRegionalSeedGenerator(), and regions().

edm::InputTag CosmicRegionalSeedGenerator::recoTrackMuonsCollection_
private

Definition at line 73 of file CosmicRegionalSeedGenerator.h.

Referenced by CosmicRegionalSeedGenerator(), and regions().

edm::EDGetTokenT<reco::TrackCollection> CosmicRegionalSeedGenerator::recoTrackMuonsToken_
private

Definition at line 77 of file CosmicRegionalSeedGenerator.h.

Referenced by CosmicRegionalSeedGenerator(), and regions().

std::string CosmicRegionalSeedGenerator::regionBase_
private

Definition at line 70 of file CosmicRegionalSeedGenerator.h.

Referenced by CosmicRegionalSeedGenerator(), and regions().

edm::ParameterSet CosmicRegionalSeedGenerator::regionPSet
private

Definition at line 61 of file CosmicRegionalSeedGenerator.h.

Referenced by CosmicRegionalSeedGenerator(), and regions().

float CosmicRegionalSeedGenerator::rVertex_
private

Definition at line 64 of file CosmicRegionalSeedGenerator.h.

Referenced by CosmicRegionalSeedGenerator(), and regions().

std::string CosmicRegionalSeedGenerator::thePropagatorName_
private

Definition at line 69 of file CosmicRegionalSeedGenerator.h.

Referenced by CosmicRegionalSeedGenerator(), and regions().

float CosmicRegionalSeedGenerator::zVertex_
private

Definition at line 65 of file CosmicRegionalSeedGenerator.h.

Referenced by CosmicRegionalSeedGenerator(), and regions().