CMS 3D CMS Logo

Public Member Functions | Private Attributes

DualByL2TSG Class Reference

#include <DualByL2TSG.h>

Inheritance diagram for DualByL2TSG:
SeparatingTSG CompositeTSG TrackerSeedGenerator

List of all members.

Public Member Functions

 DualByL2TSG (const edm::ParameterSet &pset)
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.

Private Attributes

edm::Handle
< reco::TrackCollection
l3muonH
std::string theCategory
edm::InputTag theL3CollectionLabelA

Detailed Description

Description: SeparatingTSG (TrackerSeedGenerator) which makes a check to see if a previous seed lead to a L3 track

Author:
Jean-Roch vlimant, Adam Everett

Definition at line 17 of file DualByL2TSG.h.


Constructor & Destructor Documentation

DualByL2TSG::DualByL2TSG ( const edm::ParameterSet pset)

Definition at line 12 of file DualByL2TSG.cc.

References edm::ParameterSet::getParameter(), CompositeTSG::nTSGs(), theCategory, and theL3CollectionLabelA.

                                                    : SeparatingTSG(pset){  theCategory ="DualByL2TSG";
  theL3CollectionLabelA = pset.getParameter<edm::InputTag>("L3TkCollectionA");
  if (nTSGs()!=2)
    {edm::LogError(theCategory)<<"not two seed generators provided";}
}

Member Function Documentation

unsigned int DualByL2TSG::selectTSG ( const TrackCand muonTrackCand,
const TrackingRegion region 
) [virtual]

decide the TSG depending on the existence of a L3 track seeded from the L2. Return value is 0 or 1.

Implements SeparatingTSG.

Definition at line 18 of file DualByL2TSG.cc.

References edm::HandleBase::failedToGet(), edm::Event::getByLabel(), TrackerSeedGenerator::getEvent(), i, l3muonH, LogDebug, findQualityFiles::maxI, theCategory, and theL3CollectionLabelA.

{
  LogDebug(theCategory)<<"|eta|=|"<<muonTrackCand.second->eta()<<"|";

  bool re_do_this_L2 = true;
  //LogDebug("TrackerSeedGenerator")<<theEvent;
  //getEvent();
  
  //retrieve L3 track collection
  edm::Handle<reco::TrackCollection> l3muonH;
  getEvent()->getByLabel(theL3CollectionLabelA ,l3muonH);
  if(l3muonH.failedToGet()) return 0;
  
  unsigned int maxI = l3muonH->size();
  
  LogDebug(theCategory) << "TheCollectionA size " << maxI;

  // Loop through all tracks, if the track was seeded from this L2, then skip
  for (unsigned int i=0;i!=maxI;++i){
    reco::TrackRef tk(l3muonH,i);
    edm::Ref<L3MuonTrajectorySeedCollection> l3seedRef = tk->seedRef().castTo<edm::Ref<L3MuonTrajectorySeedCollection> >();
    reco::TrackRef staTrack = l3seedRef->l2Track();

    if(staTrack == (muonTrackCand.second) ) re_do_this_L2 = false;
    //LogDebug(theCategory) << "The DualByL2TSG selectTSG loop " << re_do_this_L2 << " staCand " << muonTrackCand.second->eta() << " " << muonTrackCand.second->pt() << " alreadyMadeRefToL3 " << staTrack->eta() << " " << staTrack->pt();
  }
  
  LogDebug(theCategory) << "The DualByL2TSG to use " << re_do_this_L2 ;

  return re_do_this_L2 ? 1 : 0;
}

Member Data Documentation

Definition at line 27 of file DualByL2TSG.h.

Referenced by selectTSG().

std::string DualByL2TSG::theCategory [private]

Reimplemented from SeparatingTSG.

Definition at line 25 of file DualByL2TSG.h.

Referenced by DualByL2TSG(), and selectTSG().

Definition at line 26 of file DualByL2TSG.h.

Referenced by DualByL2TSG(), and selectTSG().