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, edm::ConsumesCollector &&iC)
 
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::EDGetTokenT
< reco::CaloJetCollection
theJetCollectionToken
 
bool thePrintTimeReport
 
std::string thePropagatorName
 
MuonServiceProxytheService
 the event setup proxy, it takes care the services update More...
 
double theThreshold
 

Detailed Description

Definition at line 34 of file JetExtractor.h.

Constructor & Destructor Documentation

muonisolation::JetExtractor::JetExtractor ( )
inline

Definition at line 38 of file JetExtractor.h.

38 {};
JetExtractor::JetExtractor ( const edm::ParameterSet par,
edm::ConsumesCollector &&  iC 
)

Definition at line 34 of file JetExtractor.cc.

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

34  :
36  thePropagatorName(par.getParameter<std::string>("PropagatorName")),
37  theThreshold(par.getParameter<double>("Threshold")),
38  theDR_Veto(par.getParameter<double>("DR_Veto")),
39  theDR_Max(par.getParameter<double>("DR_Max")),
40  theExcludeMuonVeto(par.getParameter<bool>("ExcludeMuonVeto")),
41  theService(0),
42  theAssociator(0),
43  thePrintTimeReport(par.getUntrackedParameter<bool>("PrintTimeReport"))
44 {
45  ParameterSet serviceParameters = par.getParameter<ParameterSet>("ServiceParameters");
46  theService = new MuonServiceProxy(serviceParameters);
47 
48  // theAssociatorParameters = new TrackAssociatorParameters(par.getParameter<edm::ParameterSet>("TrackAssociatorParameters"), iC_);
50  theAssociatorParameters->loadParameters(par.getParameter<edm::ParameterSet>("TrackAssociatorParameters"), iC);
52 }
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
void loadParameters(const edm::ParameterSet &, edm::ConsumesCollector &)
tuple TrackAssociatorParameters
Definition: example_cfg.py:32
edm::EDGetTokenT< reco::CaloJetCollection > theJetCollectionToken
Definition: JetExtractor.h:48
MuonServiceProxy * theService
the event setup proxy, it takes care the services update
Definition: JetExtractor.h:61
TrackAssociatorParameters * theAssociatorParameters
Definition: JetExtractor.h:63
TrackDetectorAssociator * theAssociator
Definition: JetExtractor.h:64
std::vector< CaloJet > CaloJetCollection
collection of CaloJet objects
JetExtractor::~JetExtractor ( )
virtual

Definition at line 54 of file JetExtractor.cc.

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

54  {
57  if (theService) delete theService;
58  if (theAssociator) delete theAssociator;
59 }
static TimingReport * current()
Definition: TimingReport.cc:21
MuonServiceProxy * theService
the event setup proxy, it takes care the services update
Definition: JetExtractor.h:61
TrackAssociatorParameters * theAssociatorParameters
Definition: JetExtractor.h:63
TrackDetectorAssociator * theAssociator
Definition: JetExtractor.h:64
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 69 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, theJetCollectionToken, thePropagatorName, theService, theThreshold, and TrackDetMatchInfo::trkGlobPosAtHcal.

70 {
71 
72  theService->update(eventSetup);
74 
75  typedef IsoDeposit::Veto Veto;
76  IsoDeposit::Direction muonDir(muon.eta(), muon.phi());
77 
78  IsoDeposit depJet(muonDir);
79 
81  eventSetup.get<IdealMagneticFieldRecord>().get(bField);
82 
83 
84  reco::TransientTrack tMuon(muon, &*bField);
85  FreeTrajectoryState iFTS = tMuon.initialFreeState();
87 
88  reco::isodeposit::Direction vetoDirection(mInfo.trkGlobPosAtHcal.eta(), mInfo.trkGlobPosAtHcal.phi());
89  depJet.setVeto(Veto(vetoDirection, theDR_Veto));
90 
91 
93  event.getByToken(theJetCollectionToken, caloJetsH);
94 
95  //use calo towers
96  CaloJetCollection::const_iterator jetCI = caloJetsH->begin();
97  for (; jetCI != caloJetsH->end(); ++jetCI){
98  double deltar0 = reco::deltaR(muon,*jetCI);
99  if (deltar0>theDR_Max) continue;
100  if (jetCI->et() < theThreshold ) continue;
101 
102  //should I make a separate config option for this?
103  std::vector<CaloTowerPtr> jetConstituents = jetCI->getCaloConstituents();
104 
105  std::vector<DetId>::const_iterator crossedCI = mInfo.crossedTowerIds.begin();
106  std::vector<CaloTowerPtr>::const_iterator jetTowCI = jetConstituents.begin();
107 
108  double sumEtExcluded = 0;
109  for (;jetTowCI != jetConstituents.end(); ++ jetTowCI){
110  bool isExcluded = false;
111  double deltaRLoc = reco::deltaR(vetoDirection, *jetCI);
112  if (deltaRLoc < theDR_Veto){
113  isExcluded = true;
114  }
115  for(; ! isExcluded && crossedCI != mInfo.crossedTowerIds.end(); ++crossedCI){
116  if (crossedCI->rawId() == (*jetTowCI)->id().rawId()){
117  isExcluded = true;
118  }
119  }
120  if (isExcluded) sumEtExcluded += (*jetTowCI)->et();
121  }
122  if (theExcludeMuonVeto){
123  if (jetCI->et() - sumEtExcluded < theThreshold ) continue;
124  }
125 
126  double depositEt = jetCI->et();
127  if (theExcludeMuonVeto) depositEt = depositEt - sumEtExcluded;
128 
129  reco::isodeposit::Direction jetDir(jetCI->eta(), jetCI->phi());
130  depJet.addDeposit(jetDir, depositEt);
131 
132  }
133 
134  std::vector<const CaloTower*>::const_iterator crossedCI = mInfo.crossedTowers.begin();
135  double muSumEt = 0;
136  for (; crossedCI != mInfo.crossedTowers.end(); ++crossedCI){
137  muSumEt += (*crossedCI)->et();
138  }
139  depJet.addCandEnergy(muSumEt);
140 
141  return depJet;
142 
143 }
std::vector< const CaloTower * > crossedTowers
std::vector< DetId > crossedTowerIds
double deltaR(const T1 &t1, const T2 &t2)
Definition: deltaR.h:48
math::XYZPoint trkGlobPosAtHcal
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
edm::EDGetTokenT< reco::CaloJetCollection > theJetCollectionToken
Definition: JetExtractor.h:48
MuonServiceProxy * theService
the event setup proxy, it takes care the services update
Definition: JetExtractor.h:61
TrackDetMatchInfo associate(const edm::Event &, const edm::EventSetup &, const FreeTrajectoryState &, const AssociatorParameters &)
TrackAssociatorParameters * theAssociatorParameters
Definition: JetExtractor.h:63
TrackDetectorAssociator * theAssociator
Definition: JetExtractor.h:64
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 61 of file JetExtractor.cc.

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

Member Data Documentation

TrackDetectorAssociator* muonisolation::JetExtractor::theAssociator
private

Definition at line 64 of file JetExtractor.h.

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

TrackAssociatorParameters* muonisolation::JetExtractor::theAssociatorParameters
private

Definition at line 63 of file JetExtractor.h.

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

double muonisolation::JetExtractor::theDR_Max
private

Definition at line 55 of file JetExtractor.h.

Referenced by deposit().

double muonisolation::JetExtractor::theDR_Veto
private

Definition at line 54 of file JetExtractor.h.

Referenced by deposit().

bool muonisolation::JetExtractor::theExcludeMuonVeto
private

Definition at line 58 of file JetExtractor.h.

Referenced by deposit().

edm::EDGetTokenT<reco::CaloJetCollection> muonisolation::JetExtractor::theJetCollectionToken
private

Definition at line 48 of file JetExtractor.h.

Referenced by deposit().

bool muonisolation::JetExtractor::thePrintTimeReport
private

Definition at line 66 of file JetExtractor.h.

Referenced by ~JetExtractor().

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

Definition at line 50 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 61 of file JetExtractor.h.

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

double muonisolation::JetExtractor::theThreshold
private

Definition at line 53 of file JetExtractor.h.

Referenced by deposit().