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_
 
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 48 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(), jetsPtMin_, 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");
53 
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:10
std::vector< Muon > MuonCollection
collection of Muon objects
Definition: MuonFwd.h:9
edm::EDGetTokenT< reco::MuonCollection > recoMuonsToken_
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 54 of file CosmicRegionalSeedGenerator.h.

54 {};

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(), DeDxDiscriminatorTools::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::HandleBase::isValid(), metsig::jet, jetsPtMin_, LogDebug, mag(), SurfaceOrientation::outer, PV3DBase< T, PVType, FrameType >::perp(), PV3DBase< T, PVType, FrameType >::phi(), Pi, 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 
66  //________________________________________
67  //
68  //Seeding on Sta muon (MC && Datas)
69  //________________________________________
70 
71 
72  if(regionBase_=="seedOnStaMuon"||regionBase_=="") {
73 
74  LogDebug("CosmicRegionalSeedGenerator") << "Seeding on stand alone muons ";
75 
76  //get collections
77  //+++++++++++++++
78 
79  //get the muon collection
81  event.getByToken(recoMuonsToken_,muonsHandle);
82  if (!muonsHandle.isValid())
83  {
84  edm::LogError("CollectionNotFound") << "Error::No reco muons collection (" << recoMuonsCollection_ << ") in the event - Please verify the name of the muon collection";
85  return result;
86  }
87 
88  LogDebug("CosmicRegionalSeedGenerator") << "Muons collection size = " << muonsHandle->size();
89 
90  //get the jet collection
91  edm::Handle<CaloJetCollection> caloJetsHandle;
92  event.getByToken(recoCaloJetsToken_,caloJetsHandle);
93 
94  //get the propagator
95  edm::ESHandle<Propagator> thePropagator;
96  es.get<TrackingComponentsRecord>().get(thePropagatorName_, thePropagator); // thePropagatorName = "AnalyticalPropagator"
97 
98  //get tracker geometry
99  edm::ESHandle<TrackerGeometry> theTrackerGeometry;
100  es.get<TrackerDigiGeometryRecord>().get(theTrackerGeometry);
101  //const TrackerGeometry& theTracker(*theTrackerGeometry);
102  DetId outerid;
103 
104 
105  //definition of the region
106  //+++++++++++++++++++++++++
107 
108  int nmuons = 0;
109  for (reco::MuonCollection::const_iterator staMuon = muonsHandle->begin(); staMuon != muonsHandle->end(); ++staMuon) {
110 
111  //select sta muons
112  if (!staMuon->isStandAloneMuon()) {
113  LogDebug("CosmicRegionalSeedGenerator") << "This muon is not a stand alone muon";
114  continue;
115  }
116 
117  //bit 25 as a coverage -1.4 < eta < 1.4
118  if ( abs( staMuon->standAloneMuon()->eta() ) > 1.5 ) continue;
119 
120  //debug
121  nmuons++;
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();
127 
128  //initial position, momentum, charge
129 
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();
133 
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;
140 
141  //propagation on the last layers of TOB
142  if ( staMuon->standAloneMuon()->outerPosition().y()>0 ) initialRegionMomentum *=-1;
143  GlobalTrajectoryParameters glb_parameters(initialRegionPosition,
144  initialRegionMomentum,
145  charge,
146  thePropagator->magneticField());
147  FreeTrajectoryState fts(glb_parameters);
148  StateOnTrackerBound onBounds(thePropagator.product());
149  TrajectoryStateOnSurface outer = onBounds(fts);
150 
151  if (!outer.isValid())
152  {
153  //edm::LogError("FailedPropagation") << "Trajectory state on surface not valid" ;
154  LogDebug("CosmicRegionalSeedGenerator") << "Trajectory state on surface not valid" ;
155  continue;
156  }
157 
158 
159  //final position & momentum
160  GlobalPoint regionPosition = outer.globalPosition();
161  GlobalVector regionMom = outer.globalMomentum();
162 
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();
169 
170 
171  //step back
172  double stepBack = 1;
173  GlobalPoint center = regionPosition + stepBack * regionMom.unit();
174  GlobalVector v = stepBack * regionMom.unit();
175  LogDebug("CosmicRegionalSeedGenerator") << "Step back vector = " << v << "\n";
176 
177  //exclude region built in jets
178  if ( doJetsExclusionCheck_ ) {
179  double delta_R_min = 1000.;
180  for ( CaloJetCollection::const_iterator jet = caloJetsHandle->begin (); jet != caloJetsHandle->end(); jet++ ) {
181  if ( jet->pt() < jetsPtMin_ ) continue;
182 
183  double deta = center.eta() - jet->eta();
184  double dphi = fabs( center.phi() - jet->phi() );
185  if ( dphi > TMath::Pi() ) dphi = 2*TMath::Pi() - dphi;
186 
187  double delta_R = sqrt(deta*deta + dphi*dphi);
188  if ( delta_R < delta_R_min ) delta_R_min = delta_R;
189 
190  }//end loop on jets
191 
192  if ( delta_R_min < deltaRExclusionSize_ ) {
193  LogDebug("CosmicRegionalSeedGenerator") << "Region built too close from a jet";
194  continue;
195  }
196  }//end if doJetsExclusionCheck
197 
198 
199  //definition of the region
200  CosmicTrackingRegion *etaphiRegion = new CosmicTrackingRegion((-1)*regionMom,
201  center,
202  ptMin_,
203  rVertex_,
204  zVertex_,
205  deltaEta_,
206  deltaPhi_,
207  regionPSet
208  );
209 
210 
211 
212  //return the result
213  result.push_back(etaphiRegion);
214 
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();
221 
222 
223  }//end loop on muons
224 
225  }//end if SeedOnStaMuon
226 
227 
228 
229 
230 
231  //________________________________________
232  //
233  //Seeding on cosmic muons (MC && Datas)
234  //________________________________________
235 
236 
237  if(regionBase_=="seedOnCosmicMuon") {
238 
239  LogDebug("CosmicRegionalSeedGenerator") << "Seeding on cosmic muons tracks";
240 
241  //get collections
242  //+++++++++++++++
243 
244  //get the muon collection
245  edm::Handle<reco::TrackCollection> cosmicMuonsHandle;
246  event.getByToken(recoTrackMuonsToken_,cosmicMuonsHandle);
247  if (!cosmicMuonsHandle.isValid())
248  {
249  edm::LogError("CollectionNotFound") << "Error::No cosmic muons collection (" << recoTrackMuonsCollection_ << ") in the event - Please verify the name of the muon reco track collection";
250  return result;
251  }
252 
253  LogDebug("CosmicRegionalSeedGenerator") << "Cosmic muons tracks collection size = " << cosmicMuonsHandle->size();
254 
255  //get the jet collection
256  edm::Handle<CaloJetCollection> caloJetsHandle;
257  event.getByToken(recoCaloJetsToken_,caloJetsHandle);
258 
259  //get the propagator
260  edm::ESHandle<Propagator> thePropagator;
261  es.get<TrackingComponentsRecord>().get(thePropagatorName_, thePropagator); // thePropagatorName = "AnalyticalPropagator"
262 
263  //get tracker geometry
264  edm::ESHandle<TrackerGeometry> theTrackerGeometry;
265  es.get<TrackerDigiGeometryRecord>().get(theTrackerGeometry);
266  DetId outerid;
267 
268 
269  //definition of the region
270  //+++++++++++++++++++++++++
271 
272  int nmuons = 0;
273  for (reco::TrackCollection::const_iterator cosmicMuon = cosmicMuonsHandle->begin(); cosmicMuon != cosmicMuonsHandle->end(); ++cosmicMuon) {
274 
275  //bit 25 as a coverage -1.4 < eta < 1.4
276  if ( abs( cosmicMuon->eta() ) > 1.5 ) continue;
277 
278  nmuons++;
279 
280  //initial position, momentum, charge
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();
284 
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;
295 
296  //propagation on the last layers of TOB
297  if ( cosmicMuon->outerPosition().y()>0 && cosmicMuon->momentum().y()<0 ) initialRegionMomentum *=-1;
298  GlobalTrajectoryParameters glb_parameters(initialRegionPosition,
299  initialRegionMomentum,
300  charge,
301  thePropagator->magneticField());
302  FreeTrajectoryState fts(glb_parameters);
303  StateOnTrackerBound onBounds(thePropagator.product());
304  TrajectoryStateOnSurface outer = onBounds(fts);
305 
306  if (!outer.isValid())
307  {
308  //edm::LogError("FailedPropagation") << "Trajectory state on surface not valid" ;
309  LogDebug("CosmicRegionalSeedGenerator") << "Trajectory state on surface not valid" ;
310  continue;
311  }
312 
313 
314  //final position & momentum
315  GlobalPoint regionPosition = outer.globalPosition();
316  GlobalVector regionMom = outer.globalMomentum();
317 
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();
324 
325 
326  //step back
327  double stepBack = 1;
328  GlobalPoint center = regionPosition + stepBack * regionMom.unit();
329  GlobalVector v = stepBack * regionMom.unit();
330  LogDebug("CosmicRegionalSeedGenerator") << "Step back vector = " << v << "\n";
331 
332  //exclude region built in jets
333  if ( doJetsExclusionCheck_ ) {
334  double delta_R_min = 1000.;
335  for ( CaloJetCollection::const_iterator jet = caloJetsHandle->begin (); jet != caloJetsHandle->end(); jet++ ) {
336  if ( jet->pt() < jetsPtMin_ ) continue;
337 
338  double deta = center.eta() - jet->eta();
339  double dphi = fabs( center.phi() - jet->phi() );
340  if ( dphi > TMath::Pi() ) dphi = 2*TMath::Pi() - dphi;
341 
342  double delta_R = sqrt(deta*deta + dphi*dphi);
343  if ( delta_R < delta_R_min ) delta_R_min = delta_R;
344 
345  }//end loop on jets
346 
347  if ( delta_R_min < deltaRExclusionSize_ ) {
348  LogDebug("CosmicRegionalSeedGenerator") << "Region built too close from a jet";
349  continue;
350  }
351  }// end if doJetsExclusionCheck
352 
353  //definition of the region
354  CosmicTrackingRegion *etaphiRegion = new CosmicTrackingRegion((-1)*regionMom,
355  center,
356  ptMin_,
357  rVertex_,
358  zVertex_,
359  deltaEta_,
360  deltaPhi_,
361  regionPSet
362  );
363 
364 
365  //return the result
366  result.push_back(etaphiRegion);
367 
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();
374 
375  }//end loop on muons
376 
377  }//end if SeedOnCosmicMuon
378 
379 
380  //________________________________________
381  //
382  //Seeding on L2 muons (MC && Datas)
383  //________________________________________
384 
385  if(regionBase_=="seedOnL2Muon") {
386 
387  LogDebug("CosmicRegionalSeedGenerator") << "Seeding on L2 muons";
388 
389  //get collections
390  //+++++++++++++++
391 
392  //get the muon collection
394  event.getByToken(recoL2MuonsToken_,L2MuonsHandle);
395 
396  if (!L2MuonsHandle.isValid())
397  {
398  edm::LogError("CollectionNotFound") << "Error::No L2 muons collection (" << recoL2MuonsCollection_ <<") in the event - Please verify the name of the L2 muon collection";
399  return result;
400  }
401 
402  LogDebug("CosmicRegionalSeedGenerator") << "L2 muons collection size = " << L2MuonsHandle->size();
403 
404  //get the propagator
405  edm::ESHandle<Propagator> thePropagator;
406  es.get<TrackingComponentsRecord>().get(thePropagatorName_, thePropagator); // thePropagatorName = "AnalyticalPropagator"
407 
408  //get tracker geometry
409  edm::ESHandle<TrackerGeometry> theTrackerGeometry;
410  es.get<TrackerDigiGeometryRecord>().get(theTrackerGeometry);
411  DetId outerid;
412 
413 
414  //definition of the region
415  //+++++++++++++++++++++++++
416 
417  int nmuons = 0;
418  for (reco::RecoChargedCandidateCollection::const_iterator L2Muon = L2MuonsHandle->begin(); L2Muon != L2MuonsHandle->end(); ++L2Muon) {
419  reco::TrackRef tkL2Muon = L2Muon->get<reco::TrackRef>();
420 
421  //bit 25 as a coverage -1.4 < eta < 1.4
422  if ( abs( tkL2Muon->eta() ) > 1.5 ) continue;
423 
424  nmuons++;
425 
426  //initial position, momentum, charge
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();
430 
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;
441 
442 
443  //seeding only in the bottom
444  if ( tkL2Muon->outerPosition().y() > 0 )
445  {
446  LogDebug("CosmicRegionalSeedGenerator") << "L2 muon in the TOP --- Region not created";
447  return result;
448  }
449 
450  GlobalTrajectoryParameters glb_parameters(initialRegionPosition,
451  initialRegionMomentum,
452  charge,
453  thePropagator->magneticField());
454  FreeTrajectoryState fts(glb_parameters);
455  StateOnTrackerBound onBounds(thePropagator.product());
456  TrajectoryStateOnSurface outer = onBounds(fts);
457 
458  if (!outer.isValid())
459  {
460  //edm::LogError("FailedPropagation") << "Trajectory state on surface not valid" ;
461  LogDebug("CosmicRegionalSeedGenerator") << "Trajectory state on surface not valid" ;
462  continue;
463  }
464 
465 
466  //final position & momentum
467  GlobalPoint regionPosition = outer.globalPosition();
468  GlobalVector regionMom = outer.globalMomentum();
469 
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();
476 
477 
478  //step back
479  double stepBack = 1;
480  GlobalPoint center = regionPosition + stepBack * regionMom.unit();
481  GlobalVector v = stepBack * regionMom.unit();
482  LogDebug("CosmicRegionalSeedGenerator") << "Step back vector = " << v << "\n";
483 
484 
485  //definition of the region
486  CosmicTrackingRegion *etaphiRegion = new CosmicTrackingRegion((-1)*regionMom,
487  center,
488  ptMin_,
489  rVertex_,
490  zVertex_,
491  deltaEta_,
492  deltaPhi_,
493  regionPSet
494  );
495 
496  result.push_back(etaphiRegion);
497 
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();
504 
505 
506  }//end loop on muons
507 
508  }//end if SeedOnL2Muon
509 
510  return result;
511 
512 }
#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
double charge(const std::vector< uint8_t > &Ampls)
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
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:76
Vector3DBase unit() const
Definition: Vector3DBase.h:57
Definition: DetId.h:18
const T & get() const
Definition: EventSetup.h:55
T const * product() const
Definition: ESHandle.h:62
T eta() const
Definition: PV3DBase.h:76
T const * get() const
Returns C++ pointer to the item.
Definition: Ref.h:242
edm::EDGetTokenT< reco::RecoChargedCandidateCollection > recoL2MuonsToken_

Member Data Documentation

edm::ParameterSet CosmicRegionalSeedGenerator::conf_
private

Definition at line 59 of file CosmicRegionalSeedGenerator.h.

Referenced by CosmicRegionalSeedGenerator().

float CosmicRegionalSeedGenerator::deltaEta_
private

Definition at line 65 of file CosmicRegionalSeedGenerator.h.

Referenced by CosmicRegionalSeedGenerator(), and regions().

float CosmicRegionalSeedGenerator::deltaPhi_
private

Definition at line 66 of file CosmicRegionalSeedGenerator.h.

Referenced by CosmicRegionalSeedGenerator(), and regions().

double CosmicRegionalSeedGenerator::deltaRExclusionSize_
private

Definition at line 81 of file CosmicRegionalSeedGenerator.h.

Referenced by CosmicRegionalSeedGenerator(), and regions().

bool CosmicRegionalSeedGenerator::doJetsExclusionCheck_
private

Definition at line 80 of file CosmicRegionalSeedGenerator.h.

Referenced by CosmicRegionalSeedGenerator(), and regions().

double CosmicRegionalSeedGenerator::jetsPtMin_
private

Definition at line 82 of file CosmicRegionalSeedGenerator.h.

Referenced by CosmicRegionalSeedGenerator(), and regions().

float CosmicRegionalSeedGenerator::ptMin_
private

Definition at line 62 of file CosmicRegionalSeedGenerator.h.

Referenced by CosmicRegionalSeedGenerator(), and regions().

edm::InputTag CosmicRegionalSeedGenerator::recoCaloJetsCollection_
private

Definition at line 83 of file CosmicRegionalSeedGenerator.h.

Referenced by CosmicRegionalSeedGenerator().

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

Definition at line 74 of file CosmicRegionalSeedGenerator.h.

Referenced by CosmicRegionalSeedGenerator(), and regions().

edm::InputTag CosmicRegionalSeedGenerator::recoL2MuonsCollection_
private

Definition at line 73 of file CosmicRegionalSeedGenerator.h.

Referenced by CosmicRegionalSeedGenerator(), and regions().

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

Definition at line 77 of file CosmicRegionalSeedGenerator.h.

Referenced by CosmicRegionalSeedGenerator(), and regions().

edm::InputTag CosmicRegionalSeedGenerator::recoMuonsCollection_
private

Definition at line 71 of file CosmicRegionalSeedGenerator.h.

Referenced by CosmicRegionalSeedGenerator(), and regions().

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

Definition at line 75 of file CosmicRegionalSeedGenerator.h.

Referenced by CosmicRegionalSeedGenerator(), and regions().

edm::InputTag CosmicRegionalSeedGenerator::recoTrackMuonsCollection_
private

Definition at line 72 of file CosmicRegionalSeedGenerator.h.

Referenced by CosmicRegionalSeedGenerator(), and regions().

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

Definition at line 76 of file CosmicRegionalSeedGenerator.h.

Referenced by CosmicRegionalSeedGenerator(), and regions().

std::string CosmicRegionalSeedGenerator::regionBase_
private

Definition at line 69 of file CosmicRegionalSeedGenerator.h.

Referenced by CosmicRegionalSeedGenerator(), and regions().

edm::ParameterSet CosmicRegionalSeedGenerator::regionPSet
private

Definition at line 60 of file CosmicRegionalSeedGenerator.h.

Referenced by CosmicRegionalSeedGenerator(), and regions().

float CosmicRegionalSeedGenerator::rVertex_
private

Definition at line 63 of file CosmicRegionalSeedGenerator.h.

Referenced by CosmicRegionalSeedGenerator(), and regions().

std::string CosmicRegionalSeedGenerator::thePropagatorName_
private

Definition at line 68 of file CosmicRegionalSeedGenerator.h.

Referenced by CosmicRegionalSeedGenerator(), and regions().

float CosmicRegionalSeedGenerator::zVertex_
private

Definition at line 64 of file CosmicRegionalSeedGenerator.h.

Referenced by CosmicRegionalSeedGenerator(), and regions().