CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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 }
17 
18 unsigned int DualByL2TSG::selectTSG(const TrackCand & muonTrackCand, const TrackingRegion& region)
19 {
20  LogDebug(theCategory)<<"|eta|=|"<<muonTrackCand.second->eta()<<"|";
21 
22  bool re_do_this_L2 = true;
23  //LogDebug("TrackerSeedGenerator")<<theEvent;
24  //getEvent();
25 
26  //retrieve L3 track collection
29  if(l3muonH.failedToGet()) return 0;
30 
31  unsigned int maxI = l3muonH->size();
32 
33  LogDebug(theCategory) << "TheCollectionA size " << maxI;
34 
35  // Loop through all tracks, if the track was seeded from this L2, then skip
36  for (unsigned int i=0;i!=maxI;++i){
37  reco::TrackRef tk(l3muonH,i);
39  reco::TrackRef staTrack = l3seedRef->l2Track();
40 
41  if(staTrack == (muonTrackCand.second) ) re_do_this_L2 = false;
42  //LogDebug(theCategory) << "The DualByL2TSG selectTSG loop " << re_do_this_L2 << " staCand " << muonTrackCand.second->eta() << " " << muonTrackCand.second->pt() << " alreadyMadeRefToL3 " << staTrack->eta() << " " << staTrack->pt();
43  }
44 
45  LogDebug(theCategory) << "The DualByL2TSG to use " << re_do_this_L2 ;
46 
47  return re_do_this_L2 ? 1 : 0;
48 }
#define LogDebug(id)
DualByL2TSG(const edm::ParameterSet &pset)
Definition: DualByL2TSG.cc:12
T getParameter(std::string const &) const
int i
Definition: DBlmapReader.cc:9
std::pair< const Trajectory *, reco::TrackRef > TrackCand
edm::Handle< reco::TrackCollection > l3muonH
Definition: DualByL2TSG.h:27
const edm::Event * getEvent() const
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:356
bool failedToGet() const
Definition: HandleBase.h:80
std::string theCategory
Definition: DualByL2TSG.h:25
unsigned int nTSGs()
Definition: CompositeTSG.h:38
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:18
edm::InputTag theL3CollectionLabelA
Definition: DualByL2TSG.h:26