CMS 3D CMS Logo

CaloRecoTauDiscriminationByLeadingTrackPtCut.cc

Go to the documentation of this file.
00001 #include "RecoTauTag/RecoTau/interface/CaloRecoTauDiscriminationByLeadingTrackPtCut.h"
00002 void CaloRecoTauDiscriminationByLeadingTrackPtCut::produce(Event& iEvent,const EventSetup& iEventSetup){
00003   Handle<CaloTauCollection> theCaloTauCollection;
00004   iEvent.getByLabel(CaloTauProducer_,theCaloTauCollection);
00005  
00006  double theleadTrackPtCutDiscriminator = 0.;
00007  auto_ptr<CaloTauDiscriminator> theCaloTauDiscriminatorByLeadingTrackPtCut(new CaloTauDiscriminator(CaloTauRefProd(theCaloTauCollection)));
00008 
00009  //loop over the CaloTau candidates
00010  for(size_t iCaloTau=0;iCaloTau<theCaloTauCollection->size();++iCaloTau) {
00011    CaloTauRef theCaloTauRef(theCaloTauCollection,iCaloTau);
00012    CaloTau theCaloTau=*theCaloTauRef;
00013    
00014    // fill the AssociationVector object
00015    if (!theCaloTau.leadTrack()) 
00016      {
00017        theleadTrackPtCutDiscriminator=0.;
00018      }else if(theCaloTau.leadTrack()->pt() > minPtLeadTrack_) theleadTrackPtCutDiscriminator=1.;
00019 
00020    theCaloTauDiscriminatorByLeadingTrackPtCut->setValue(iCaloTau,theleadTrackPtCutDiscriminator);
00021  }
00022  
00023  iEvent.put(theCaloTauDiscriminatorByLeadingTrackPtCut);
00024 
00025 }
00026    

Generated on Tue Jun 9 17:45:01 2009 for CMSSW by  doxygen 1.5.4