CMS 3D CMS Logo

DualByL2TSG.cc
Go to the documentation of this file.
5 
11 
13  theL3CollectionLabelA = pset.getParameter<edm::InputTag>("L3TkCollectionA");
14  if (nTSGs()!=2)
15  {edm::LogError(theCategory)<<"not two seed generators provided";}
16 
18 }
19 
20 unsigned int DualByL2TSG::selectTSG(const TrackCand & muonTrackCand, const TrackingRegion& region)
21 {
22  LogDebug(theCategory)<<"|eta|=|"<<muonTrackCand.second->eta()<<"|";
23 
24  bool re_do_this_L2 = true;
25  //LogDebug("TrackerSeedGenerator")<<theEvent;
26  //getEvent();
27 
28  //retrieve L3 track collection
30  getEvent()->getByToken(l3muonToken ,l3muonH);
31  if(l3muonH.failedToGet()) return 0;
32 
33  unsigned int maxI = l3muonH->size();
34 
35  LogDebug(theCategory) << "TheCollectionA size " << maxI;
36 
37  // Loop through all tracks, if the track was seeded from this L2, then skip
38  for (unsigned int i=0;i!=maxI;++i){
39  reco::TrackRef tk(l3muonH,i);
41  reco::TrackRef staTrack = l3seedRef->l2Track();
42 
43  if(staTrack == (muonTrackCand.second) ) re_do_this_L2 = false;
44  //LogDebug(theCategory) << "The DualByL2TSG selectTSG loop " << re_do_this_L2 << " staCand " << muonTrackCand.second->eta() << " " << muonTrackCand.second->pt() << " alreadyMadeRefToL3 " << staTrack->eta() << " " << staTrack->pt();
45  }
46 
47  LogDebug(theCategory) << "The DualByL2TSG to use " << re_do_this_L2 ;
48 
49  return re_do_this_L2 ? 1 : 0;
50 }
#define LogDebug(id)
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
T getParameter(std::string const &) const
edm::EDGetTokenT< reco::TrackCollection > l3muonToken
Definition: DualByL2TSG.h:30
std::pair< const Trajectory *, reco::TrackRef > TrackCand
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:460
DualByL2TSG(const edm::ParameterSet &pset, edm::ConsumesCollector &iC)
Definition: DualByL2TSG.cc:12
std::vector< Track > TrackCollection
collection of Tracks
Definition: TrackFwd.h:14
edm::Handle< reco::TrackCollection > l3muonH
Definition: DualByL2TSG.h:29
const edm::Event * getEvent() const
bool failedToGet() const
Definition: HandleBase.h:78
std::string theCategory
Definition: DualByL2TSG.h:27
unsigned int nTSGs()
Definition: CompositeTSG.h:40
unsigned int selectTSG(const TrackCand &, const TrackingRegion &)
decide the TSG depending on the existence of a L3 track seeded from the L2. Return value is 0 or 1...
Definition: DualByL2TSG.cc:20
edm::InputTag theL3CollectionLabelA
Definition: DualByL2TSG.h:28