CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Attributes
muonisolation::JetExtractor Class Reference

#include <JetExtractor.h>

Inheritance diagram for muonisolation::JetExtractor:
reco::isodeposit::IsoDepositExtractor

Public Member Functions

virtual reco::IsoDeposit deposit (const edm::Event &ev, const edm::EventSetup &evSetup, const reco::Track &track) const
 
virtual void fillVetos (const edm::Event &ev, const edm::EventSetup &evSetup, const reco::TrackCollection &tracks)
 
 JetExtractor ()
 
 JetExtractor (const edm::ParameterSet &par)
 
virtual ~JetExtractor ()
 
- Public Member Functions inherited from reco::isodeposit::IsoDepositExtractor
virtual reco::IsoDeposit deposit (const edm::Event &ev, const edm::EventSetup &evSetup, const reco::TrackBaseRef &track) const
 make single IsoDeposit based on trackRef as input More...
 
virtual reco::IsoDeposit deposit (const edm::Event &ev, const edm::EventSetup &evSetup, const reco::Candidate &track) const
 
virtual reco::IsoDeposit deposit (const edm::Event &ev, const edm::EventSetup &evSetup, const reco::CandidateBaseRef &track) const
 make single IsoDeposit based on a CandidateBaseRef as input More...
 
virtual std::vector
< reco::IsoDeposit
deposits (const edm::Event &ev, const edm::EventSetup &evSetup, const reco::Track &track) const
 
virtual std::vector
< reco::IsoDeposit
deposits (const edm::Event &ev, const edm::EventSetup &evSetup, const reco::TrackBaseRef &track) const
 
virtual std::vector
< reco::IsoDeposit
deposits (const edm::Event &ev, const edm::EventSetup &evSetup, const reco::Candidate &track) const
 
virtual std::vector
< reco::IsoDeposit
deposits (const edm::Event &ev, const edm::EventSetup &evSetup, const reco::CandidateBaseRef &track) const
 
virtual ~IsoDepositExtractor ()
 Destructor. More...
 

Private Attributes

TrackDetectorAssociatortheAssociator
 
TrackAssociatorParameterstheAssociatorParameters
 
double theDR_Max
 
double theDR_Veto
 
bool theExcludeMuonVeto
 
edm::InputTag theJetCollectionLabel
 
bool thePrintTimeReport
 
std::string thePropagatorName
 
MuonServiceProxytheService
 the event setup proxy, it takes care the services update More...
 
double theThreshold
 

Detailed Description

Definition at line 36 of file JetExtractor.h.

Constructor & Destructor Documentation

muonisolation::JetExtractor::JetExtractor ( )
inline

Definition at line 40 of file JetExtractor.h.

40 {};
JetExtractor::JetExtractor ( const edm::ParameterSet par)

Definition at line 37 of file JetExtractor.cc.

References edm::ParameterSet::getParameter(), MuonServiceProxy_cff::MuonServiceProxy, theAssociator, theAssociatorParameters, theService, and example_cfg::TrackAssociatorParameters.

37  :
38  theJetCollectionLabel(par.getParameter<edm::InputTag>("JetCollectionLabel")),
39  thePropagatorName(par.getParameter<std::string>("PropagatorName")),
40  theThreshold(par.getParameter<double>("Threshold")),
41  theDR_Veto(par.getParameter<double>("DR_Veto")),
42  theDR_Max(par.getParameter<double>("DR_Max")),
43  theExcludeMuonVeto(par.getParameter<bool>("ExcludeMuonVeto")),
44  theService(0),
45  theAssociator(0),
46  thePrintTimeReport(par.getUntrackedParameter<bool>("PrintTimeReport"))
47 {
48  ParameterSet serviceParameters = par.getParameter<ParameterSet>("ServiceParameters");
49  theService = new MuonServiceProxy(serviceParameters);
50 
53 }
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
edm::InputTag theJetCollectionLabel
Definition: JetExtractor.h:50
tuple TrackAssociatorParameters
Definition: example_cfg.py:32
MuonServiceProxy * theService
the event setup proxy, it takes care the services update
Definition: JetExtractor.h:63
TrackAssociatorParameters * theAssociatorParameters
Definition: JetExtractor.h:65
TrackDetectorAssociator * theAssociator
Definition: JetExtractor.h:66
JetExtractor::~JetExtractor ( )
virtual

Definition at line 55 of file JetExtractor.cc.

References gather_cfg::cout, TimingReport::current(), TimingReport::dump(), theAssociator, theAssociatorParameters, thePrintTimeReport, and theService.

55  {
58  if (theService) delete theService;
59  if (theAssociator) delete theAssociator;
60 }
static TimingReport * current()
Definition: TimingReport.cc:21
MuonServiceProxy * theService
the event setup proxy, it takes care the services update
Definition: JetExtractor.h:63
TrackAssociatorParameters * theAssociatorParameters
Definition: JetExtractor.h:65
TrackDetectorAssociator * theAssociator
Definition: JetExtractor.h:66
tuple cout
Definition: gather_cfg.py:121
void dump(std::ostream &co, bool active=false)
Definition: TimingReport.cc:50

Member Function Documentation

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 70 of file JetExtractor.cc.

References TrackDetectorAssociator::associate(), ecalTB2006H4_GenSimDigiReco_cfg::bField, 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, thePropagatorName, theService, theThreshold, and TrackDetMatchInfo::trkGlobPosAtHcal.

71 {
72 
73  theService->update(eventSetup);
75 
76  typedef IsoDeposit::Veto Veto;
77  IsoDeposit::Direction muonDir(muon.eta(), muon.phi());
78 
79  IsoDeposit depJet(muonDir);
80 
82  eventSetup.get<IdealMagneticFieldRecord>().get(bField);
83 
84 
85  reco::TransientTrack tMuon(muon, &*bField);
86  FreeTrajectoryState iFTS = tMuon.initialFreeState();
88 
89  reco::isodeposit::Direction vetoDirection(mInfo.trkGlobPosAtHcal.eta(), mInfo.trkGlobPosAtHcal.phi());
90  depJet.setVeto(Veto(vetoDirection, theDR_Veto));
91 
92 
94  event.getByLabel(theJetCollectionLabel, caloJetsH);
95 
96  //use calo towers
97  CaloJetCollection::const_iterator jetCI = caloJetsH->begin();
98  for (; jetCI != caloJetsH->end(); ++jetCI){
99  double deltar0 = reco::deltaR(muon,*jetCI);
100  if (deltar0>theDR_Max) continue;
101  if (jetCI->et() < theThreshold ) continue;
102 
103  //should I make a separate config option for this?
104  std::vector<CaloTowerPtr> jetConstituents = jetCI->getCaloConstituents();
105 
106  std::vector<DetId>::const_iterator crossedCI = mInfo.crossedTowerIds.begin();
107  std::vector<CaloTowerPtr>::const_iterator jetTowCI = jetConstituents.begin();
108 
109  double sumEtExcluded = 0;
110  for (;jetTowCI != jetConstituents.end(); ++ jetTowCI){
111  bool isExcluded = false;
112  double deltaRLoc = reco::deltaR(vetoDirection, *jetCI);
113  if (deltaRLoc < theDR_Veto){
114  isExcluded = true;
115  }
116  for(; ! isExcluded && crossedCI != mInfo.crossedTowerIds.end(); ++crossedCI){
117  if (crossedCI->rawId() == (*jetTowCI)->id().rawId()){
118  isExcluded = true;
119  }
120  }
121  if (isExcluded) sumEtExcluded += (*jetTowCI)->et();
122  }
123  if (theExcludeMuonVeto){
124  if (jetCI->et() - sumEtExcluded < theThreshold ) continue;
125  }
126 
127  double depositEt = jetCI->et();
128  if (theExcludeMuonVeto) depositEt = depositEt - sumEtExcluded;
129 
130  reco::isodeposit::Direction jetDir(jetCI->eta(), jetCI->phi());
131  depJet.addDeposit(jetDir, depositEt);
132 
133  }
134 
135  std::vector<const CaloTower*>::const_iterator crossedCI = mInfo.crossedTowers.begin();
136  double muSumEt = 0;
137  for (; crossedCI != mInfo.crossedTowers.end(); ++crossedCI){
138  muSumEt += (*crossedCI)->et();
139  }
140  depJet.addCandEnergy(muSumEt);
141 
142  return depJet;
143 
144 }
edm::InputTag theJetCollectionLabel
Definition: JetExtractor.h:50
std::vector< const CaloTower * > crossedTowers
std::vector< DetId > crossedTowerIds
math::XYZPoint trkGlobPosAtHcal
double deltaR(double eta1, double phi1, double eta2, double phi2)
Definition: deltaR.h:19
void setPropagator(const Propagator *)
use a user configured propagator
How EventSelector::AcceptEvent() decides whether to accept an event for output otherwise it is excluding the probing of A single or multiple positive and the trigger will pass if any such matching triggers are PASS or EXCEPTION[A criterion thatmatches no triggers at all is detected and causes a throw.] A single negative with an expectation of appropriate bit checking in the decision and the trigger will pass if any such matching triggers are FAIL or EXCEPTION A wildcarded negative criterion that matches more than one trigger in the trigger but the state exists so we define the behavior If all triggers are the negative crieriion will lead to accepting the event(this again matches the behavior of"!*"before the partial wildcard feature was incorporated).The per-event"cost"of each negative criterion with multiple relevant triggers is about the same as!*was in the past
MuonServiceProxy * theService
the event setup proxy, it takes care the services update
Definition: JetExtractor.h:63
TrackDetMatchInfo associate(const edm::Event &, const edm::EventSetup &, const FreeTrajectoryState &, const AssociatorParameters &)
TrackAssociatorParameters * theAssociatorParameters
Definition: JetExtractor.h:65
TrackDetectorAssociator * theAssociator
Definition: JetExtractor.h:66
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 62 of file JetExtractor.cc.

63 {
64 // LogWarning("JetExtractor")
65 // <<"fillVetos does nothing now: IsoDeposit provides enough functionality\n"
66 // <<"to remove a deposit at/around given (eta, phi)";
67 
68 }

Member Data Documentation

TrackDetectorAssociator* muonisolation::JetExtractor::theAssociator
private

Definition at line 66 of file JetExtractor.h.

Referenced by deposit(), JetExtractor(), and ~JetExtractor().

TrackAssociatorParameters* muonisolation::JetExtractor::theAssociatorParameters
private

Definition at line 65 of file JetExtractor.h.

Referenced by deposit(), JetExtractor(), and ~JetExtractor().

double muonisolation::JetExtractor::theDR_Max
private

Definition at line 57 of file JetExtractor.h.

Referenced by deposit().

double muonisolation::JetExtractor::theDR_Veto
private

Definition at line 56 of file JetExtractor.h.

Referenced by deposit().

bool muonisolation::JetExtractor::theExcludeMuonVeto
private

Definition at line 60 of file JetExtractor.h.

Referenced by deposit().

edm::InputTag muonisolation::JetExtractor::theJetCollectionLabel
private

Definition at line 50 of file JetExtractor.h.

Referenced by deposit().

bool muonisolation::JetExtractor::thePrintTimeReport
private

Definition at line 68 of file JetExtractor.h.

Referenced by ~JetExtractor().

std::string muonisolation::JetExtractor::thePropagatorName
private

Definition at line 52 of file JetExtractor.h.

Referenced by deposit().

MuonServiceProxy* muonisolation::JetExtractor::theService
private

the event setup proxy, it takes care the services update

Definition at line 63 of file JetExtractor.h.

Referenced by deposit(), JetExtractor(), and ~JetExtractor().

double muonisolation::JetExtractor::theThreshold
private

Definition at line 55 of file JetExtractor.h.

Referenced by deposit().