#include <RecoMuon/MuonIsolation/plugins/JetExtractor.h>
Public Member Functions | |
virtual reco::IsoDeposit | deposit (const edm::Event &ev, const edm::EventSetup &evSetup, const reco::Track &track) const |
make single IsoDeposit based on track as input purely virtual: have to implement in concrete implementations | |
virtual void | fillVetos (const edm::Event &ev, const edm::EventSetup &evSetup, const reco::TrackCollection &tracks) |
fill vetoes: to exclude deposits at IsoDeposit creation stage check concrete extractors if it's no-op ! | |
JetExtractor (const edm::ParameterSet &par) | |
JetExtractor () | |
virtual | ~JetExtractor () |
Private Attributes | |
TrackDetectorAssociator * | theAssociator |
TrackAssociatorParameters * | theAssociatorParameters |
double | theDR_Max |
double | theDR_Veto |
bool | theExcludeMuonVeto |
edm::InputTag | theJetCollectionLabel |
bool | thePrintTimeReport |
Propagator * | thePropagator |
std::string | thePropagatorName |
double | theThreshold |
Definition at line 36 of file JetExtractor.h.
muonisolation::JetExtractor::JetExtractor | ( | ) | [inline] |
JetExtractor::JetExtractor | ( | const edm::ParameterSet & | par | ) |
Definition at line 34 of file JetExtractor.cc.
References edm::ParameterSet::getParameter(), theAssociator, theAssociatorParameters, and default_cfi::TrackAssociatorParameters.
00034 : 00035 theJetCollectionLabel(par.getParameter<edm::InputTag>("JetCollectionLabel")), 00036 thePropagatorName(par.getParameter<std::string>("PropagatorName")), 00037 theThreshold(par.getParameter<double>("Threshold")), 00038 theDR_Veto(par.getParameter<double>("DR_Veto")), 00039 theDR_Max(par.getParameter<double>("DR_Max")), 00040 theExcludeMuonVeto(par.getParameter<bool>("ExcludeMuonVeto")), 00041 theAssociator(0), 00042 thePropagator(0), 00043 thePrintTimeReport(par.getUntrackedParameter<bool>("PrintTimeReport")) 00044 { 00045 theAssociatorParameters = new TrackAssociatorParameters(par.getParameter<edm::ParameterSet>("TrackAssociatorParameters")); 00046 theAssociator = new TrackDetectorAssociator(); 00047 }
JetExtractor::~JetExtractor | ( | ) | [virtual] |
Definition at line 49 of file JetExtractor.cc.
References GenMuonPlsPt100GeV_cfg::cout, TimingReport::current(), TimingReport::dump(), theAssociator, theAssociatorParameters, thePrintTimeReport, and thePropagator.
00049 { 00050 if (thePrintTimeReport) TimingReport::current()->dump(std::cout); 00051 if (theAssociatorParameters) delete theAssociatorParameters; 00052 if (theAssociator) delete theAssociator; 00053 if (thePropagator) delete thePropagator; 00054 }
IsoDeposit JetExtractor::deposit | ( | const edm::Event & | ev, | |
const edm::EventSetup & | evSetup, | |||
const reco::Track & | track | |||
) | const [virtual] |
make single IsoDeposit based on track as input purely virtual: have to implement in concrete implementations
Implements reco::isodeposit::IsoDepositExtractor.
Definition at line 64 of file JetExtractor.cc.
References TrackDetectorAssociator::associate(), TrackDetMatchInfo::crossedTowerIds, TrackDetMatchInfo::crossedTowers, reco::deltaR(), reco::TrackBase::eta(), edm::EventSetup::get(), reco::TransientTrack::initialFreeState(), reco::TrackBase::phi(), TrackDetectorAssociator::setPropagator(), theAssociator, theAssociatorParameters, theDR_Max, theDR_Veto, theExcludeMuonVeto, theJetCollectionLabel, thePropagator, thePropagatorName, theThreshold, and TrackDetMatchInfo::trkGlobPosAtHcal.
00065 { 00066 if (thePropagator == 0){ 00067 ESHandle<Propagator> prop; 00068 eventSetup.get<TrackingComponentsRecord>().get(thePropagatorName, prop); 00069 thePropagator = prop->clone(); 00070 theAssociator->setPropagator(thePropagator); 00071 } 00072 00073 typedef IsoDeposit::Veto Veto; 00074 IsoDeposit::Direction muonDir(muon.eta(), muon.phi()); 00075 00076 IsoDeposit depJet(muonDir); 00077 00078 edm::ESHandle<MagneticField> bField; 00079 eventSetup.get<IdealMagneticFieldRecord>().get(bField); 00080 00081 00082 reco::TransientTrack tMuon(muon, &*bField); 00083 FreeTrajectoryState iFTS = tMuon.initialFreeState(); 00084 TrackDetMatchInfo mInfo = theAssociator->associate(event, eventSetup, iFTS, *theAssociatorParameters); 00085 00086 reco::isodeposit::Direction vetoDirection(mInfo.trkGlobPosAtHcal.eta(), mInfo.trkGlobPosAtHcal.phi()); 00087 depJet.setVeto(Veto(vetoDirection, theDR_Veto)); 00088 00089 00090 edm::Handle<CaloJetCollection> caloJetsH; 00091 event.getByLabel(theJetCollectionLabel, caloJetsH); 00092 00093 //use calo towers 00094 CaloJetCollection::const_iterator jetCI = caloJetsH->begin(); 00095 for (; jetCI != caloJetsH->end(); ++jetCI){ 00096 double deltar0 = reco::deltaR(muon,*jetCI); 00097 if (deltar0>theDR_Max) continue; 00098 if (jetCI->et() < theThreshold ) continue; 00099 00100 //should I make a separate config option for this? 00101 std::vector<CaloTowerPtr> jetConstituents = jetCI->getCaloConstituents(); 00102 00103 std::vector<DetId>::const_iterator crossedCI = mInfo.crossedTowerIds.begin(); 00104 std::vector<CaloTowerPtr>::const_iterator jetTowCI = jetConstituents.begin(); 00105 00106 double sumEtExcluded = 0; 00107 for (;jetTowCI != jetConstituents.end(); ++ jetTowCI){ 00108 bool isExcluded = false; 00109 double deltaRLoc = reco::deltaR(vetoDirection, *jetCI); 00110 if (deltaRLoc < theDR_Veto){ 00111 isExcluded = true; 00112 } 00113 for(; ! isExcluded && crossedCI != mInfo.crossedTowerIds.end(); ++crossedCI){ 00114 if (crossedCI->rawId() == (*jetTowCI)->id().rawId()){ 00115 isExcluded = true; 00116 } 00117 } 00118 if (isExcluded) sumEtExcluded += (*jetTowCI)->et(); 00119 } 00120 if (theExcludeMuonVeto){ 00121 if (jetCI->et() - sumEtExcluded < theThreshold ) continue; 00122 } 00123 00124 double depositEt = jetCI->et(); 00125 if (theExcludeMuonVeto) depositEt = depositEt - sumEtExcluded; 00126 00127 reco::isodeposit::Direction jetDir(jetCI->eta(), jetCI->phi()); 00128 depJet.addDeposit(jetDir, depositEt); 00129 00130 } 00131 00132 std::vector<const CaloTower*>::const_iterator crossedCI = mInfo.crossedTowers.begin(); 00133 double muSumEt = 0; 00134 for (; crossedCI != mInfo.crossedTowers.end(); ++crossedCI){ 00135 muSumEt += (*crossedCI)->et(); 00136 } 00137 depJet.addCandEnergy(muSumEt); 00138 00139 return depJet; 00140 00141 }
void JetExtractor::fillVetos | ( | const edm::Event & | ev, | |
const edm::EventSetup & | evSetup, | |||
const reco::TrackCollection & | tracks | |||
) | [virtual] |
fill vetoes: to exclude deposits at IsoDeposit creation stage check concrete extractors if it's no-op !
Implements reco::isodeposit::IsoDepositExtractor.
Definition at line 56 of file JetExtractor.cc.
00057 { 00058 // LogWarning("JetExtractor") 00059 // <<"fillVetos does nothing now: IsoDeposit provides enough functionality\n" 00060 // <<"to remove a deposit at/around given (eta, phi)"; 00061 00062 }
Definition at line 63 of file JetExtractor.h.
Referenced by deposit(), JetExtractor(), and ~JetExtractor().
Definition at line 62 of file JetExtractor.h.
Referenced by deposit(), JetExtractor(), and ~JetExtractor().
double muonisolation::JetExtractor::theDR_Max [private] |
double muonisolation::JetExtractor::theDR_Veto [private] |
Propagator* muonisolation::JetExtractor::thePropagator [mutable, private] |
std::string muonisolation::JetExtractor::thePropagatorName [private] |
double muonisolation::JetExtractor::theThreshold [private] |