#include <RecoMuon/L3MuonIsolationProducer/src/L3MuonIsolationProducer.h>
Public Member Functions | |
virtual void | beginJob (const edm::EventSetup &iSetup) |
initialisation | |
L3MuonIsolationProducer (const edm::ParameterSet &) | |
constructor with config | |
virtual void | produce (edm::Event &, const edm::EventSetup &) |
Produce isolation maps. | |
virtual | ~L3MuonIsolationProducer () |
destructor | |
Private Attributes | |
double | optOutputIsoDeposits |
bool | theApplyCutsORmaxNTracks |
apply or not the maxN cut on top of the sumPt (or nominall eff) < cuts | |
edm::ParameterSet | theConfig |
muonisolation::Cuts | theCuts |
reco::isodeposit::IsoDepositExtractor * | theExtractor |
int | theMaxNTracks |
max number of tracks to allow in the sum count <= maxN | |
edm::InputTag | theMuonCollectionLabel |
double | theTrackPt_Min |
pt cut to consider track in sumPt after extracting iso deposit better split this off into a filter |
Definition at line 18 of file L3MuonIsolationProducer.h.
L3MuonIsolationProducer::L3MuonIsolationProducer | ( | const edm::ParameterSet & | par | ) |
constructor with config
Definition at line 36 of file L3MuonIsolationProducer.cc.
References LogDebug, and optOutputIsoDeposits.
00036 : 00037 theConfig(par), 00038 theMuonCollectionLabel(par.getParameter<InputTag>("inputMuonCollection")), 00039 optOutputIsoDeposits(par.getParameter<bool>("OutputMuIsoDeposits")), 00040 theExtractor(0), 00041 theTrackPt_Min(-1) 00042 { 00043 LogDebug("RecoMuon|L3MuonIsolationProducer")<<" L3MuonIsolationProducer CTOR"; 00044 00045 if (optOutputIsoDeposits) produces<reco::IsoDepositMap>(); 00046 produces<edm::ValueMap<bool> >(); 00047 }
L3MuonIsolationProducer::~L3MuonIsolationProducer | ( | ) | [virtual] |
destructor
Definition at line 50 of file L3MuonIsolationProducer.cc.
References LogDebug, and theExtractor.
00050 { 00051 LogDebug("RecoMuon|L3MuonIsolationProducer")<<" L3MuonIsolationProducer DTOR"; 00052 if (theExtractor) delete theExtractor; 00053 }
void L3MuonIsolationProducer::beginJob | ( | const edm::EventSetup & | iSetup | ) | [virtual] |
initialisation
get min pt for the track to go into sumPt
test cutsName only. The depositType is informational only (has not been used so far) [VK]
Reimplemented from edm::EDProducer.
Definition at line 55 of file L3MuonIsolationProducer.cc.
References DBSPlugin::get(), edm::ParameterSet::getParameter(), edm::ParameterSet::getUntrackedParameter(), LogTrace, muonisolation::Cuts::print(), theApplyCutsORmaxNTracks, theConfig, theCuts, theExtractor, theMaxNTracks, and theTrackPt_Min.
00056 { 00057 00058 // 00059 // Extractor 00060 // 00061 edm::ParameterSet extractorPSet = theConfig.getParameter<edm::ParameterSet>("ExtractorPSet"); 00063 theTrackPt_Min = theConfig.getParameter<double>("TrackPt_Min"); 00064 std::string extractorName = extractorPSet.getParameter<std::string>("ComponentName"); 00065 theExtractor = IsoDepositExtractorFactory::get()->create( extractorName, extractorPSet); 00066 std::string depositType = extractorPSet.getUntrackedParameter<std::string>("DepositLabel"); 00067 00068 // 00069 // Cuts 00070 // 00071 edm::ParameterSet cutsPSet = theConfig.getParameter<edm::ParameterSet>("CutsPSet"); 00072 std::string cutsName = cutsPSet.getParameter<std::string>("ComponentName"); 00073 if (cutsName == "SimpleCuts") { 00074 theCuts = Cuts(cutsPSet); 00075 } 00076 else if ( 00077 // (cutsName== "L3NominalEfficiencyCuts_PXLS" && depositType=="PXLS") 00078 // || (cutsName== "L3NominalEfficiencyCuts_TRKS" && depositType=="TRKS") 00080 (cutsName== "L3NominalEfficiencyCuts_PXLS" ) 00081 || (cutsName== "L3NominalEfficiencyCuts_TRKS") ) { 00082 theCuts = L3NominalEfficiencyConfigurator(cutsPSet).cuts(); 00083 } 00084 else { 00085 LogError("L3MuonIsolationProducer::beginJob") 00086 <<"cutsName: "<<cutsPSet<<" is not recognized:" 00087 <<" theCuts not set!"; 00088 } 00089 LogTrace("")<< theCuts.print(); 00090 00091 // (kludge) additional cut on the number of tracks 00092 theMaxNTracks = cutsPSet.getParameter<int>("maxNTracks"); 00093 theApplyCutsORmaxNTracks = cutsPSet.getParameter<bool>("applyCutsORmaxNTracks"); 00094 }
void L3MuonIsolationProducer::produce | ( | edm::Event & | event, | |
const edm::EventSetup & | eventSetup | |||
) | [virtual] |
Produce isolation maps.
Implements edm::EDProducer.
Definition at line 96 of file L3MuonIsolationProducer.cc.
References muonisolation::Cuts::CutSpec::conesize, count, EgammaValidation_Zee_cff::cut, reco::isodeposit::IsoDepositExtractor::deposit(), reco::IsoDeposit::depositAndCountWithin(), reco::TrackBase::eta(), edm::helper::Filler< Map >::fill(), i, edm::helper::Filler< Map >::insert(), LogDebug, LogTrace, muons_cfi::muons, optOutputIsoDeposits, reco::IsoDeposit::print(), HLT_VtxMuL3::result, theApplyCutsORmaxNTracks, theCuts, theExtractor, theMaxNTracks, theMuonCollectionLabel, theTrackPt_Min, muonisolation::Cuts::CutSpec::threshold, value, and reco::IsoDeposit::veto().
00096 { 00097 std::string metname = "RecoMuon|L3MuonIsolationProducer"; 00098 00099 LogDebug(metname)<<" L3 Muon Isolation producing..." 00100 <<" BEGINING OF EVENT " <<"================================"; 00101 00102 // Take the SA container 00103 LogTrace(metname)<<" Taking the muons: "<<theMuonCollectionLabel; 00104 Handle<TrackCollection> muons; 00105 event.getByLabel(theMuonCollectionLabel,muons); 00106 00107 std::auto_ptr<reco::IsoDepositMap> depMap( new reco::IsoDepositMap()); 00108 std::auto_ptr<edm::ValueMap<bool> > isoMap( new edm::ValueMap<bool> ()); 00109 00110 00111 // 00112 // get Vetos and deposits 00113 // 00114 uint nMuons = muons->size(); 00115 00116 IsoDeposit::Vetos vetos(nMuons); 00117 00118 std::vector<IsoDeposit> deps(nMuons); 00119 std::vector<bool> isos(nMuons, false); 00120 00121 for (unsigned int i=0; i<nMuons; i++) { 00122 TrackRef mu(muons,i); 00123 deps[i] = theExtractor->deposit(event, eventSetup, *mu); 00124 vetos[i] = deps[i].veto(); 00125 } 00126 00127 // 00128 // add here additional vetos 00129 // 00130 //..... 00131 00132 // 00133 // actual cut step 00134 // 00135 for(uint iMu=0; iMu < nMuons; ++iMu){ 00136 const reco::Track* mu = &(*muons)[iMu]; 00137 00138 const IsoDeposit & deposit = deps[iMu]; 00139 LogTrace(metname)<< deposit.print(); 00140 00141 const Cuts::CutSpec & cut = theCuts( mu->eta()); 00142 std::pair<double, int> sumAndCount = deposit.depositAndCountWithin(cut.conesize, vetos, theTrackPt_Min); 00143 00144 double value = sumAndCount.first; 00145 int count = sumAndCount.second; 00146 00147 bool result = (value < cut.threshold); 00148 if (theApplyCutsORmaxNTracks ) result |= count <= theMaxNTracks; 00149 LogTrace(metname)<<"deposit in cone: "<<value<<"with count "<<count<<" is isolated: "<<result; 00150 00151 isos[iMu] = result; 00152 } 00153 00154 // 00155 // store 00156 // 00157 if (optOutputIsoDeposits){ 00158 reco::IsoDepositMap::Filler depFiller(*depMap); 00159 depFiller.insert(muons, deps.begin(), deps.end()); 00160 depFiller.fill(); 00161 event.put(depMap); 00162 } 00163 edm::ValueMap<bool> ::Filler isoFiller(*isoMap); 00164 isoFiller.insert(muons, isos.begin(), isos.end()); 00165 isoFiller.fill(); 00166 event.put(isoMap); 00167 00168 LogTrace(metname) <<" END OF EVENT " <<"================================"; 00169 }
double L3MuonIsolationProducer::optOutputIsoDeposits [private] |
Definition at line 45 of file L3MuonIsolationProducer.h.
Referenced by L3MuonIsolationProducer(), and produce().
apply or not the maxN cut on top of the sumPt (or nominall eff) < cuts
Definition at line 59 of file L3MuonIsolationProducer.h.
Referenced by beginJob(), and produce().
Definition at line 48 of file L3MuonIsolationProducer.h.
Referenced by beginJob(), produce(), and ~L3MuonIsolationProducer().
int L3MuonIsolationProducer::theMaxNTracks [private] |
max number of tracks to allow in the sum count <= maxN
Definition at line 56 of file L3MuonIsolationProducer.h.
Referenced by beginJob(), and produce().
double L3MuonIsolationProducer::theTrackPt_Min [private] |
pt cut to consider track in sumPt after extracting iso deposit better split this off into a filter
Definition at line 52 of file L3MuonIsolationProducer.h.
Referenced by beginJob(), and produce().