CMS 3D CMS Logo

HLTTauRefProducer Class Reference

#include <DQMOffline/Trigger/interface/HLTTauRefProducer.h>

Inheritance diagram for HLTTauRefProducer:

edm::EDProducer edm::ProducerBase edm::ProductRegistryHelper

List of all members.

Public Member Functions

 HLTTauRefProducer (const edm::ParameterSet &)
virtual void produce (edm::Event &, const edm::EventSetup &)
 ~HLTTauRefProducer ()

Private Types

typedef math::XYZTLorentzVectorD LorentzVector
typedef std::vector
< LorentzVector
LorentzVectorCollection

Private Member Functions

void doCaloTaus (edm::Event &, const edm::EventSetup &)
void doElectrons (edm::Event &, const edm::EventSetup &)
void doElectronsFromZ (edm::Event &, const edm::EventSetup &, std::auto_ptr< LorentzVectorCollection > &)
void doJets (edm::Event &, const edm::EventSetup &)
void doMuons (edm::Event &, const edm::EventSetup &)
void doPFTaus (edm::Event &, const edm::EventSetup &)
double ElectronTrkIsolation (const reco::TrackCollection *, const reco::GsfElectron &)

Private Attributes

edm::InputTag CaloTauDis_
edm::InputTag CaloTaus_
bool doCaloTaus_
bool doElecFromZ_
bool doElectrons_
bool doJets_
bool doMuons_
bool doPFTaus_
edm::InputTag e_ctfTrackCollection_
bool e_doID_
bool e_doTrackIso_
double e_FromZet_
edm::InputTag e_idAssocProd_
double e_isoMaxSumPt_
double e_lipCut_
double e_maxIsoDR_
double e_minIsoDR_
double e_trackMinPt_
double e_zMmax_
double e_zMmin_
edm::InputTag Electrons_
double etaMax
edm::InputTag Jets_
edm::InputTag Muons_
edm::InputTag PFTauDis_
edm::InputTag PFTaus_
double ptMinCaloTau_
double ptMinElectron_
double ptMinJet_
double ptMinMuon_
double ptMinPFTau_


Detailed Description

Definition at line 44 of file HLTTauRefProducer.h.


Member Typedef Documentation

typedef math::XYZTLorentzVectorD HLTTauRefProducer::LorentzVector [private]

Definition at line 53 of file HLTTauRefProducer.h.

typedef std::vector<LorentzVector> HLTTauRefProducer::LorentzVectorCollection [private]

Definition at line 54 of file HLTTauRefProducer.h.


Constructor & Destructor Documentation

HLTTauRefProducer::HLTTauRefProducer ( const edm::ParameterSet iConfig  )  [explicit]

Definition at line 10 of file HLTTauRefProducer.cc.

References CaloTauDis_, CaloTaus_, doCaloTaus_, doElecFromZ_, doElectrons_, doJets_, doMuons_, doPFTaus_, e_ctfTrackCollection_, e_doID_, e_doTrackIso_, e_FromZet_, e_idAssocProd_, e_isoMaxSumPt_, e_lipCut_, e_maxIsoDR_, e_minIsoDR_, e_trackMinPt_, e_zMmax_, e_zMmin_, Electrons_, etaMax, edm::ParameterSet::getUntrackedParameter(), pfTauBenchmarkGeneric_cfi::jets, Jets_, muons_cfi::muons, Muons_, PFTauDis_, PFTaus_, ptMinCaloTau_, ptMinElectron_, ptMinJet_, ptMinMuon_, and ptMinPFTau_.

00011 {
00012 
00013  
00014   //One Parameter Set per Collection
00015 
00016   ParameterSet pfTau = iConfig.getUntrackedParameter<edm::ParameterSet>("PFTaus");
00017   PFTaus_ = pfTau.getUntrackedParameter<InputTag>("PFTauProducer");
00018   PFTauDis_ = pfTau.getUntrackedParameter<InputTag>("PFTauDiscriminator");
00019   doPFTaus_ = pfTau.getUntrackedParameter<bool>("doPFTaus",false);
00020   ptMinPFTau_= pfTau.getUntrackedParameter<double>("ptMin",15.);
00021 
00022   ParameterSet  caloTau = iConfig.getUntrackedParameter<edm::ParameterSet>("CaloTaus");
00023   CaloTaus_ = caloTau.getUntrackedParameter<InputTag>("CaloTauProducer");
00024   CaloTauDis_ = caloTau.getUntrackedParameter<InputTag>("CaloTauDiscriminator");
00025   doCaloTaus_ = caloTau.getUntrackedParameter<bool>("doCaloTaus",false);
00026   ptMinCaloTau_= caloTau.getUntrackedParameter<double>("ptMin",15.);
00027 
00028   ParameterSet  electrons = iConfig.getUntrackedParameter<edm::ParameterSet>("Electrons");
00029   Electrons_ = electrons.getUntrackedParameter<InputTag>("ElectronCollection");
00030   doElectrons_ = electrons.getUntrackedParameter<bool>("doElectrons",false);
00031   e_idAssocProd_ = electrons.getUntrackedParameter<InputTag>("IdCollection");
00032   e_ctfTrackCollection_= electrons.getUntrackedParameter<InputTag>("TrackCollection");
00033   ptMinElectron_= electrons.getUntrackedParameter<double>("ptMin",15.);
00034   e_doID_ = electrons.getUntrackedParameter<bool>("doID",false);
00035   e_doTrackIso_ = electrons.getUntrackedParameter<bool>("doTrackIso",false);
00036   e_trackMinPt_= electrons.getUntrackedParameter<double>("ptMinTrack",1.5);
00037   e_lipCut_= electrons.getUntrackedParameter<double>("lipMinTrack",1.5);
00038   e_minIsoDR_= electrons.getUntrackedParameter<double>("InnerConeDR",0.02);
00039   e_maxIsoDR_= electrons.getUntrackedParameter<double>("OuterConeDR",0.6);
00040   e_isoMaxSumPt_= electrons.getUntrackedParameter<double>("MaxIsoVar",0.02);
00041   doElecFromZ_=electrons.getUntrackedParameter<bool>("doElecFromZ",false);
00042   e_zMmin_= electrons.getUntrackedParameter<double>("MinZwindow",70);
00043   e_zMmax_= electrons.getUntrackedParameter<double>("MaxZwindow",110);
00044   e_FromZet_ = electrons.getUntrackedParameter<double>("ElecEtFromZcut",15);
00045 
00046   ParameterSet  muons = iConfig.getUntrackedParameter<edm::ParameterSet>("Muons");
00047   Muons_ = muons.getUntrackedParameter<InputTag>("MuonCollection");
00048   doMuons_ = muons.getUntrackedParameter<bool>("doMuons",false);
00049   ptMinMuon_= muons.getUntrackedParameter<double>("ptMin",15.);
00050 
00051   ParameterSet  jets = iConfig.getUntrackedParameter<edm::ParameterSet>("Jets");
00052   Jets_ = jets.getUntrackedParameter<InputTag>("JetCollection");
00053   doJets_ = jets.getUntrackedParameter<bool>("doJets");
00054   ptMinJet_= jets.getUntrackedParameter<double>("etMin");
00055 
00056   etaMax = iConfig.getUntrackedParameter<double>("EtaMax",2.5);
00057   
00058 
00059   //recoCollections
00060   produces<LorentzVectorCollection>("PFTaus");
00061   produces<LorentzVectorCollection>("CaloTaus");
00062   produces<LorentzVectorCollection>("Electrons");
00063   produces<LorentzVectorCollection>("ElectronsFromZ");
00064   produces<LorentzVectorCollection>("Muons");
00065   produces<LorentzVectorCollection>("Jets");
00066 
00067 }

HLTTauRefProducer::~HLTTauRefProducer (  ) 

Definition at line 69 of file HLTTauRefProducer.cc.

00069 { }


Member Function Documentation

void HLTTauRefProducer::doCaloTaus ( edm::Event iEvent,
const edm::EventSetup iES 
) [private]

Definition at line 118 of file HLTTauRefProducer.cc.

References CaloTauDis_, CaloTaus_, relval_parameters_module::energy, eta, etaMax, edm::Event::getByLabel(), i, ptMinCaloTau_, and edm::Event::put().

Referenced by produce().

00119 {
00120       auto_ptr<LorentzVectorCollection> product_CaloTaus(new LorentzVectorCollection);
00121       //Retrieve the collection
00122       edm::Handle<CaloTauCollection> calotaus;
00123       if(iEvent.getByLabel(CaloTaus_,calotaus))
00124         {
00125           edm::Handle<CaloTauDiscriminatorByIsolation> calotaudis;
00126           if(iEvent.getByLabel(CaloTauDis_,calotaudis))
00127             for(size_t i = 0 ;i<calotaus->size();++i)
00128               {
00129                 if((*calotaudis)[i].second==1)
00130                   if((*calotaus)[i].pt()>ptMinCaloTau_&&fabs((*calotaus)[i].eta())<etaMax)
00131                     {
00132                       LorentzVector vec((*calotaus)[i].px(),(*calotaus)[i].py(),(*calotaus)[i].pz(),(*calotaus)[i].energy());
00133                       product_CaloTaus->push_back(vec);
00134         
00135                     }
00136               }
00137         
00138 
00139 
00140  iEvent.put(product_CaloTaus,"CaloTaus");
00141         }
00142 
00143      
00144 }

void HLTTauRefProducer::doElectrons ( edm::Event iEvent,
const edm::EventSetup iES 
) [private]

Definition at line 147 of file HLTTauRefProducer.cc.

References doElecFromZ_, doElectronsFromZ(), e_ctfTrackCollection_, e_doID_, e_doTrackIso_, e_idAssocProd_, e_isoMaxSumPt_, Electrons_, ElectronTrkIsolation(), relval_parameters_module::energy, eta, etaMax, edm::Event::getByLabel(), i, edm::Handle< T >::isValid(), edm::InputTag::label(), edm::Handle< T >::product(), ptMinElectron_, and edm::Event::put().

Referenced by produce().

00148 {
00149   auto_ptr<LorentzVectorCollection> product_Electrons(new LorentzVectorCollection);
00150   //Retrieve the collections
00151   edm::Handle<edm::ValueMap<float> > pEleID;
00152   iEvent.getByLabel(e_idAssocProd_,pEleID);
00153   if (!pEleID.isValid()){
00154     edm::LogInfo("")<< "Error! Can't get electronID by label. ";
00155   }
00156   
00157   edm::Handle<reco::TrackCollection> pCtfTracks;
00158   iEvent.getByLabel(e_ctfTrackCollection_, pCtfTracks);
00159   if (!pCtfTracks.isValid()) {
00160     edm::LogInfo("")<< "Error! Can't get " << e_ctfTrackCollection_.label() << " by label. ";
00161     return;
00162   }
00163   const reco::TrackCollection * ctfTracks = pCtfTracks.product();
00164   edm::Handle<GsfElectronCollection> electrons;
00165   if(iEvent.getByLabel(Electrons_,electrons))
00166     for(size_t i=0;i<electrons->size();++i)
00167       {
00168         edm::Ref<reco::GsfElectronCollection> electronRef(electrons,i);
00169         float idDec=0.;
00170         if(e_doID_){
00171           idDec=(*pEleID)[electronRef];
00172         }else idDec=1.;
00173         if((*electrons)[i].pt()>ptMinElectron_&&fabs((*electrons)[i].eta())<etaMax&&idDec)
00174           {
00175             if(e_doTrackIso_){
00176               double isolation_value_ele = ElectronTrkIsolation(ctfTracks,(*electrons)[i]);
00177               if(isolation_value_ele<e_isoMaxSumPt_){
00178                 LorentzVector vec((*electrons)[i].px(),(*electrons)[i].py(),(*electrons)[i].pz(),(*electrons)[i].energy());
00179                 product_Electrons->push_back(vec);
00180               } 
00181             }
00182             else{ 
00183               LorentzVector vec((*electrons)[i].px(),(*electrons)[i].py(),(*electrons)[i].pz(),(*electrons)[i].energy());
00184               product_Electrons->push_back(vec);
00185             }
00186           }
00187       }
00188   
00189   if(doElecFromZ_)
00190     doElectronsFromZ(iEvent,iES,product_Electrons);
00191   
00192   else iEvent.put(product_Electrons,"Electrons");
00193 }

void HLTTauRefProducer::doElectronsFromZ ( edm::Event ,
const edm::EventSetup ,
std::auto_ptr< LorentzVectorCollection > &   
) [private]

Referenced by doElectrons().

void HLTTauRefProducer::doJets ( edm::Event iEvent,
const edm::EventSetup iES 
) [private]

Definition at line 262 of file HLTTauRefProducer.cc.

References relval_parameters_module::energy, eta, etaMax, edm::Event::getByLabel(), i, pfTauBenchmarkGeneric_cfi::jets, Jets_, ptMinJet_, and edm::Event::put().

Referenced by produce().

00263 {
00264       auto_ptr<LorentzVectorCollection> product_Jets(new LorentzVectorCollection);
00265       //Retrieve the collection
00266       edm::Handle<CaloJetCollection> jets;
00267       if(iEvent.getByLabel(Jets_,jets))
00268       for(size_t i = 0 ;i<jets->size();++i)
00269         {
00270              if((*jets)[i].et()>ptMinJet_&&fabs((*jets)[i].eta())<etaMax)
00271               {
00272                 LorentzVector vec((*jets)[i].px(),(*jets)[i].py(),(*jets)[i].pz(),(*jets)[i].energy());
00273                 product_Jets->push_back(vec);
00274               }
00275         }
00276       iEvent.put(product_Jets,"Jets");
00277 }

void HLTTauRefProducer::doMuons ( edm::Event iEvent,
const edm::EventSetup iES 
) [private]

Definition at line 238 of file HLTTauRefProducer.cc.

References relval_parameters_module::energy, eta, etaMax, edm::Event::getByLabel(), i, muons_cfi::muons, Muons_, ptMinMuon_, and edm::Event::put().

Referenced by produce().

00239 {
00240   auto_ptr<LorentzVectorCollection> product_Muons(new LorentzVectorCollection);
00241   //Retrieve the collection
00242   edm::Handle<MuonCollection> muons;
00243       if(iEvent.getByLabel(Muons_,muons))
00244    
00245       for(size_t i = 0 ;i<muons->size();++i)
00246         {
00247          
00248             if((*muons)[i].pt()>ptMinMuon_&&fabs((*muons)[i].eta())<etaMax)
00249               {
00250                 LorentzVector vec((*muons)[i].px(),(*muons)[i].py(),(*muons)[i].pz(),(*muons)[i].energy());
00251                 product_Muons->push_back(vec);
00252               }
00253         }
00254 
00255 
00256       iEvent.put(product_Muons,"Muons");
00257  
00258 }

void HLTTauRefProducer::doPFTaus ( edm::Event iEvent,
const edm::EventSetup iES 
) [private]

Definition at line 87 of file HLTTauRefProducer.cc.

References relval_parameters_module::energy, eta, etaMax, edm::Event::getByLabel(), i, PFTauDis_, PFTaus_, ptMinPFTau_, and edm::Event::put().

Referenced by produce().

00088 {
00089       auto_ptr<LorentzVectorCollection> product_PFTaus(new LorentzVectorCollection);
00090       //Retrieve the collection
00091       edm::Handle<PFTauCollection> pftaus;
00092       if(iEvent.getByLabel(PFTaus_,pftaus))
00093         {
00094           edm::Handle<PFTauDiscriminatorByIsolation> pftaudis;
00095           if(iEvent.getByLabel(PFTauDis_,pftaudis))
00096             for(size_t i = 0 ;i<pftaus->size();++i)
00097               {
00098 
00099                 if((*pftaudis)[i].second==1)
00100                   if((*pftaus)[i].pt()>ptMinPFTau_&&fabs((*pftaus)[i].eta())<etaMax)
00101                     {
00102                       
00103                       LorentzVector vec((*pftaus)[i].px(),(*pftaus)[i].py(),(*pftaus)[i].pz(),(*pftaus)[i].energy());
00104                       product_PFTaus->push_back(vec);
00105         
00106                     }
00107               }
00108       iEvent.put(product_PFTaus,"PFTaus");
00109 
00110         }
00111 
00112 
00113 
00114 
00115 }

double HLTTauRefProducer::ElectronTrkIsolation ( const reco::TrackCollection ctfTracks,
const reco::GsfElectron electron 
) [private]

Definition at line 215 of file HLTTauRefProducer.cc.

References e_lipCut_, e_maxIsoDR_, e_minIsoDR_, e_trackMinPt_, reco::GsfElectron::gsfTrack(), funct::sqrt(), and reco::GsfElectron::trackMomentumAtVtx().

Referenced by doElectrons().

00216 {
00217   reco::TrackCollection::const_iterator tr = ctfTracks->begin();
00218   double sum_of_pt_ele=0;
00219   for(;tr != ctfTracks->end();++tr)
00220     {
00221       double lip = electron.gsfTrack()->dz() - tr->dz();
00222       if(tr->pt() > e_trackMinPt_ && fabs(lip) < e_lipCut_){
00223         double dphi=fabs(tr->phi()-electron.trackMomentumAtVtx().phi());
00224         if(dphi>acos(-1.))dphi=2*acos(-1.)-dphi;
00225         double deta=fabs(tr->eta()-electron.trackMomentumAtVtx().eta());
00226         double dr_ctf_ele = sqrt(deta*deta+dphi*dphi);
00227         if((dr_ctf_ele>e_minIsoDR_) && (dr_ctf_ele<e_maxIsoDR_)){
00228           double cft_pt_2 = (tr->pt())*(tr->pt());
00229           sum_of_pt_ele += cft_pt_2;
00230         }
00231       }
00232     }
00233   double isolation_value_ele = sum_of_pt_ele/(electron.trackMomentumAtVtx().Rho()*electron.trackMomentumAtVtx().Rho());
00234   return isolation_value_ele;
00235 }

void HLTTauRefProducer::produce ( edm::Event iEvent,
const edm::EventSetup iES 
) [virtual]

Implements edm::EDProducer.

Definition at line 71 of file HLTTauRefProducer.cc.

References doCaloTaus(), doCaloTaus_, doElecFromZ_, doElectrons(), doElectrons_, doJets(), doJets_, doMuons(), doMuons_, doPFTaus(), and doPFTaus_.

00072 {
00073   if(doPFTaus_)
00074     doPFTaus(iEvent,iES);
00075   if(doCaloTaus_)
00076     doCaloTaus(iEvent,iES);
00077   if(doElectrons_||doElecFromZ_)
00078     doElectrons(iEvent,iES);
00079   if(doMuons_)
00080     doMuons(iEvent,iES);
00081   if(doJets_)
00082     doJets(iEvent,iES);
00083 
00084 }


Member Data Documentation

edm::InputTag HLTTauRefProducer::CaloTauDis_ [private]

Definition at line 62 of file HLTTauRefProducer.h.

Referenced by doCaloTaus(), and HLTTauRefProducer().

edm::InputTag HLTTauRefProducer::CaloTaus_ [private]

Definition at line 61 of file HLTTauRefProducer.h.

Referenced by doCaloTaus(), and HLTTauRefProducer().

bool HLTTauRefProducer::doCaloTaus_ [private]

Definition at line 63 of file HLTTauRefProducer.h.

Referenced by HLTTauRefProducer(), and produce().

bool HLTTauRefProducer::doElecFromZ_ [private]

Definition at line 78 of file HLTTauRefProducer.h.

Referenced by doElectrons(), HLTTauRefProducer(), and produce().

bool HLTTauRefProducer::doElectrons_ [private]

Definition at line 67 of file HLTTauRefProducer.h.

Referenced by HLTTauRefProducer(), and produce().

bool HLTTauRefProducer::doJets_ [private]

Definition at line 88 of file HLTTauRefProducer.h.

Referenced by HLTTauRefProducer(), and produce().

bool HLTTauRefProducer::doMuons_ [private]

Definition at line 83 of file HLTTauRefProducer.h.

Referenced by HLTTauRefProducer(), and produce().

bool HLTTauRefProducer::doPFTaus_ [private]

Definition at line 58 of file HLTTauRefProducer.h.

Referenced by HLTTauRefProducer(), and produce().

edm::InputTag HLTTauRefProducer::e_ctfTrackCollection_ [private]

Definition at line 69 of file HLTTauRefProducer.h.

Referenced by doElectrons(), and HLTTauRefProducer().

bool HLTTauRefProducer::e_doID_ [private]

Definition at line 71 of file HLTTauRefProducer.h.

Referenced by doElectrons(), and HLTTauRefProducer().

bool HLTTauRefProducer::e_doTrackIso_ [private]

Definition at line 72 of file HLTTauRefProducer.h.

Referenced by doElectrons(), and HLTTauRefProducer().

double HLTTauRefProducer::e_FromZet_ [private]

Definition at line 80 of file HLTTauRefProducer.h.

Referenced by HLTTauRefProducer().

edm::InputTag HLTTauRefProducer::e_idAssocProd_ [private]

Definition at line 68 of file HLTTauRefProducer.h.

Referenced by doElectrons(), and HLTTauRefProducer().

double HLTTauRefProducer::e_isoMaxSumPt_ [private]

Definition at line 77 of file HLTTauRefProducer.h.

Referenced by doElectrons(), and HLTTauRefProducer().

double HLTTauRefProducer::e_lipCut_ [private]

Definition at line 74 of file HLTTauRefProducer.h.

Referenced by ElectronTrkIsolation(), and HLTTauRefProducer().

double HLTTauRefProducer::e_maxIsoDR_ [private]

Definition at line 76 of file HLTTauRefProducer.h.

Referenced by ElectronTrkIsolation(), and HLTTauRefProducer().

double HLTTauRefProducer::e_minIsoDR_ [private]

Definition at line 75 of file HLTTauRefProducer.h.

Referenced by ElectronTrkIsolation(), and HLTTauRefProducer().

double HLTTauRefProducer::e_trackMinPt_ [private]

Definition at line 73 of file HLTTauRefProducer.h.

Referenced by ElectronTrkIsolation(), and HLTTauRefProducer().

double HLTTauRefProducer::e_zMmax_ [private]

Definition at line 79 of file HLTTauRefProducer.h.

Referenced by HLTTauRefProducer().

double HLTTauRefProducer::e_zMmin_ [private]

Definition at line 79 of file HLTTauRefProducer.h.

Referenced by HLTTauRefProducer().

edm::InputTag HLTTauRefProducer::Electrons_ [private]

Definition at line 66 of file HLTTauRefProducer.h.

Referenced by doElectrons(), and HLTTauRefProducer().

double HLTTauRefProducer::etaMax [private]

Definition at line 91 of file HLTTauRefProducer.h.

Referenced by doCaloTaus(), doElectrons(), doJets(), doMuons(), doPFTaus(), and HLTTauRefProducer().

edm::InputTag HLTTauRefProducer::Jets_ [private]

Definition at line 87 of file HLTTauRefProducer.h.

Referenced by doJets(), and HLTTauRefProducer().

edm::InputTag HLTTauRefProducer::Muons_ [private]

Definition at line 82 of file HLTTauRefProducer.h.

Referenced by doMuons(), and HLTTauRefProducer().

edm::InputTag HLTTauRefProducer::PFTauDis_ [private]

Definition at line 57 of file HLTTauRefProducer.h.

Referenced by doPFTaus(), and HLTTauRefProducer().

edm::InputTag HLTTauRefProducer::PFTaus_ [private]

Definition at line 56 of file HLTTauRefProducer.h.

Referenced by doPFTaus(), and HLTTauRefProducer().

double HLTTauRefProducer::ptMinCaloTau_ [private]

Definition at line 64 of file HLTTauRefProducer.h.

Referenced by doCaloTaus(), and HLTTauRefProducer().

double HLTTauRefProducer::ptMinElectron_ [private]

Definition at line 70 of file HLTTauRefProducer.h.

Referenced by doElectrons(), and HLTTauRefProducer().

double HLTTauRefProducer::ptMinJet_ [private]

Definition at line 89 of file HLTTauRefProducer.h.

Referenced by doJets(), and HLTTauRefProducer().

double HLTTauRefProducer::ptMinMuon_ [private]

Definition at line 84 of file HLTTauRefProducer.h.

Referenced by doMuons(), and HLTTauRefProducer().

double HLTTauRefProducer::ptMinPFTau_ [private]

Definition at line 59 of file HLTTauRefProducer.h.

Referenced by doPFTaus(), and HLTTauRefProducer().


The documentation for this class was generated from the following files:
Generated on Tue Jun 9 18:24:44 2009 for CMSSW by  doxygen 1.5.4