CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
L2MuonIsolationProducer.cc
Go to the documentation of this file.
1 
6 // Framework
13 
16 
21 
25 
26 #include <string>
27 
28 using namespace edm;
29 using namespace std;
30 using namespace reco;
31 using namespace muonisolation;
32 
35  theSACollectionLabel(par.getParameter<edm::InputTag>("StandAloneCollectionLabel")),
36  theExtractor(0),
37  theDepositIsolator(0)
38 {
39  LogDebug("Muon|RecoMuon|L2MuonIsolationProducer")<<" L2MuonIsolationProducer constructor called";
40 
41 
42  //
43  // Extractor
44  //
45  edm::ParameterSet extractorPSet = par.getParameter<edm::ParameterSet>("ExtractorPSet");
46  std::string extractorName = extractorPSet.getParameter<std::string>("ComponentName");
47  theExtractor = IsoDepositExtractorFactory::get()->create( extractorName, extractorPSet);
48 
49 
50  edm::ParameterSet isolatorPSet = par.getParameter<edm::ParameterSet>("IsolatorPSet");
51  optOutputDecision = !isolatorPSet.empty();
52  if (optOutputDecision){
53  std::string type = isolatorPSet.getParameter<std::string>("ComponentName");
54  theDepositIsolator = MuonIsolatorFactory::get()->create(type,isolatorPSet);
55  }
56  if (optOutputDecision) produces<edm::ValueMap<bool> >();
57  produces<reco::IsoDepositMap>();
58 }
59 
62  LogDebug("Muon|RecoMuon|L2MuonIsolationProducer")<<" L2MuonIsolationProducer destructor called";
63  if (theExtractor) delete theExtractor;
64 }
65 
68 
69 }
70 
73  std::string metname = "Muon|RecoMuon|L2MuonIsolationProducer";
74 
75  LogDebug(metname)<<" L2 Muon Isolation producing...";
76 
77  // Take the SA container
78  LogDebug(metname)<<" Taking the StandAlone muons: "<<theSACollectionLabel;
80  event.getByLabel(theSACollectionLabel,tracks);
81 
82  // Find deposits and load into event
83  LogDebug(metname)<<" Get energy around";
84  std::auto_ptr<reco::IsoDepositMap> depMap( new reco::IsoDepositMap());
85  std::auto_ptr<edm::ValueMap<bool> > isoMap( new edm::ValueMap<bool> ());
86 
87  theExtractor->fillVetos(event,eventSetup,*tracks);
88 
89  unsigned int nTracks = tracks->size();
90  std::vector<IsoDeposit> deps(nTracks);
91  std::vector<bool> isos(nTracks, false);
92 
93  for (unsigned int i=0; i<nTracks; i++) {
94  TrackRef tk(tracks,i);
95 
96  deps[i] = theExtractor->deposit(event, eventSetup, *tk);
97 
98  if (optOutputDecision){
100  isos[i] = theDepositIsolator->result( isoContainer, *tk ).valBool;
101  }
102  }
103 
104 
105 
107  reco::IsoDepositMap::Filler depFiller(*depMap);
108  depFiller.insert(tracks, deps.begin(), deps.end());
109  depFiller.fill();
110  event.put(depMap);
111 
112  if (optOutputDecision){
113  edm::ValueMap<bool> ::Filler isoFiller(*isoMap);
114  isoFiller.insert(tracks, isos.begin(), isos.end());
115  isoFiller.fill();
116  event.put(isoMap);
117  }
118 
119  LogDebug(metname) <<" Event loaded"
120  <<"================================";
121 }
#define LogDebug(id)
type
Definition: HCALResponse.h:22
T getParameter(std::string const &) const
bool empty() const
Definition: ParameterSet.h:213
reco::isodeposit::IsoDepositExtractor * theExtractor
int i
Definition: DBlmapReader.cc:9
const std::string metname
void insert(const H &h, I begin, I end)
Definition: ValueMap.h:53
virtual void fillVetos(const edm::Event &ev, const edm::EventSetup &evSetup, const reco::TrackCollection &tracks)=0
virtual Result result(DepositContainer deposits) const =0
Compute and return the isolation variable.
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
virtual ~L2MuonIsolationProducer()
destructor
std::vector< DepositAndVetos > DepositContainer
tuple tracks
Definition: testEve_cfg.py:39
virtual void produce(edm::Event &, const edm::EventSetup &)
Produce isolation maps.
virtual void beginJob()
setup the job
muonisolation::MuIsoBaseIsolator * theDepositIsolator
L2MuonIsolationProducer(const edm::ParameterSet &)
constructor with config
virtual reco::IsoDeposit deposit(const edm::Event &ev, const edm::EventSetup &evSetup, const reco::Track &track) const =0
T get(const Candidate &c)
Definition: component.h:56
const double par[8 *NPar][4]