25 using namespace isodeposit;
38 double ptThreshold_, etEcalThreshold_, etHcalThreshold_ ,dRVetoTrk_, dRTrk_, dREcal_ , dRHcal_;
41 vector<double>
isolation(
const T &
t,
double ptThreshold,
double etEcalThreshold,
double etHcalThreshold ,
double dRVetoTrk,
double dRTrk,
double dREcal ,
double dRHcal,
double alpha,
double beta);
45 vector<double>
ZMuMuMuonUserData::isolation(
const T &
t,
double ptThreshold,
double etEcalThreshold,
double etHcalThreshold ,
double dRVetoTrk,
double dRTrk,
double dREcal ,
double dRHcal,
double alpha,
double beta) {
55 vetosTrk.push_back(
new ConeVeto( dir, dRVetoTrk ));
59 vetosEcal.push_back(
new ConeVeto( dir, 0.));
63 vetosHcal.push_back(
new ConeVeto( dir, 0. ));
66 double isovalueTrk = (trkIso->
sumWithin(dRTrk,vetosTrk));
67 double isovalueEcal = (ecalIso->
sumWithin(dREcal,vetosEcal));
68 double isovalueHcal = (hcalIso->
sumWithin(dRHcal,vetosHcal));
70 iso.push_back(isovalueTrk);
72 iso.push_back(isovalueEcal);
74 iso.push_back(isovalueHcal);
81 double combIso = alpha*( ((1+
beta)/2*isovalueEcal) + ((1-
beta)/2*isovalueHcal) ) + ((1-alpha)*isovalueTrk);
82 iso.push_back(combIso);
85 double relIso = combIso /= t.pt();
86 iso.push_back(relIso);
92 srcToken_(consumes<vector<pat::
Muon> > ( cfg.getParameter<
InputTag>(
"src" ) ) ),
93 beamSpotToken_(consumes<
BeamSpot> (cfg.getParameter<
InputTag>(
"beamSpot" ) ) ),
95 alpha_(cfg.getParameter<double>(
"alpha") ),
96 beta_(cfg.getParameter<double>(
"beta") ),
97 ptThreshold_(cfg.getParameter<double >(
"ptThreshold") ),
98 etEcalThreshold_(cfg.getParameter<double >(
"etEcalThreshold") ),
99 etHcalThreshold_(cfg.getParameter<double >(
"etHcalThreshold") ),
100 dRVetoTrk_(cfg.getParameter<double >(
"dRVetoTrk") ),
101 dRTrk_(cfg.getParameter<double >(
"dRTrk") ),
102 dREcal_(cfg.getParameter<double >(
"dREcal") ),
103 dRHcal_(cfg.getParameter<double >(
"dRHcal") ),
104 hltPath_(cfg.getParameter<std::
string >(
"hltPath") ){
105 produces<std::vector<pat::Muon> >();
118 auto_ptr<vector<pat::Muon> > muonColl(
new vector<pat::Muon> (*muons) );
119 for (
unsigned int i = 0;
i< muonColl->size();++
i){
138 float zDaudxyFromBS = -1;
139 float zDaudzFromBS = -1;
140 float zDaudxyFromPV = -1;
141 float zDaudzFromPV = -1;
146 float zDauTrkChi2 = -1;
147 float zDauSaChi2 = -1;
148 float zDauNofMuonHits = -1;
149 float zDauSaNofMuonHits = -1;
150 float zDauNofStripHits = -1;
151 float zDauTrkNofStripHits = -1;
152 float zDauNofPixelHits = -1;
153 float zDauTrkNofPixelHits = -1;
159 zDaudxyFromBS = muGlbRef->dxy(beamSpotHandle->position());
160 zDaudzFromBS = muGlbRef->dz(beamSpotHandle->position());
161 zDaudxyFromPV = muGlbRef->dxy(primaryVertices->begin()->position() );
162 zDaudzFromPV = muGlbRef->dz(primaryVertices->begin()->position() );
163 zDauChi2 = muGlbRef->normalizedChi2();
164 zDauTrkChi2 = muTrkRef->normalizedChi2();
165 zDauSaChi2 = muSaRef->normalizedChi2();
166 zDauNofMuonHits = muGlbRef->hitPattern().numberOfValidMuonHits();
167 zDauSaNofMuonHits = muSaRef->hitPattern().numberOfValidMuonHits();
168 zDauNofStripHits = muGlbRef->hitPattern().numberOfValidStripHits();
169 zDauTrkNofStripHits = muTrkRef->hitPattern().numberOfValidStripHits();
170 zDauNofPixelHits = muGlbRef->hitPattern().numberOfValidPixelHits();
171 zDauTrkNofPixelHits = muTrkRef->hitPattern().numberOfValidPixelHits();
174 zDaudxyFromBS = muSaRef->dxy(beamSpotHandle->position());
175 zDaudzFromBS = muSaRef->dz(beamSpotHandle->position());
176 zDaudxyFromPV = muSaRef->dxy(primaryVertices->begin()->position() );
177 zDaudzFromPV = muSaRef->dz(primaryVertices->begin()->position() );
178 zDauSaChi2 = muSaRef->normalizedChi2();
179 zDauSaNofMuonHits = muSaRef->hitPattern().numberOfValidMuonHits();
183 zDaudxyFromBS = muTrkRef->dxy(beamSpotHandle->position());
184 zDaudzFromBS = muTrkRef->dz(beamSpotHandle->position());
185 zDaudxyFromPV = muTrkRef->dxy(primaryVertices->begin()->position() );
186 zDaudzFromPV = muTrkRef->dz(primaryVertices->begin()->position() );
187 zDauTrkChi2 = muTrkRef->normalizedChi2();
188 zDauTrkNofStripHits = muTrkRef->hitPattern().numberOfValidStripHits();
189 zDauTrkNofPixelHits = muTrkRef->hitPattern().numberOfValidPixelHits();
195 int dimTrig = muHLTMatches.size();
211 m.
addUserFloat(
"zDau_SaNofMuonHits" , zDauSaNofMuonHits );
212 m.
addUserFloat(
"zDau_NofStripHits" , zDauNofStripHits );
213 m.
addUserFloat(
"zDau_TrkNofStripHits" , zDauTrkNofStripHits );
214 m.
addUserFloat(
"zDau_NofPixelHits" , zDauNofPixelHits );
215 m.
addUserFloat(
"zDau_TrkNofPixelHits" , zDauTrkNofPixelHits );
216 m.
addUserFloat(
"zDau_NofMuChambers" , zDauNofMuChambers );
217 m.
addUserFloat(
"zDau_NofMuMatches" , zDauNofMuMatches );
EDGetTokenT< VertexCollection > primaryVerticesToken_
reco::TrackRef innerTrack() const
reference to Track reconstructed in the tracker only (reimplemented from reco::Muon) ...
vector< double > isolation(const T &t, double ptThreshold, double etEcalThreshold, double etHcalThreshold, double dRVetoTrk, double dRTrk, double dREcal, double dRHcal, double alpha, double beta)
void setIsolation(IsolationKeys key, float value)
bool getByToken(EDGetToken token, Handle< PROD > &result) const
#define DEFINE_FWK_MODULE(type)
bool isTrackerMuon() const
bool isGlobalMuon() const
std::vector< Vertex > VertexCollection
collection of Vertex objects
std::vector< TriggerObjectStandAlone > TriggerObjectStandAloneCollection
Collection of TriggerObjectStandAlone.
bool isStandAloneMuon() const
reco::TrackRef outerTrack() const
reference to Track reconstructed in the muon detector only (reimplemented from reco::Muon) ...
double sumWithin(double coneSize, const AbsVetos &vetos=AbsVetos(), bool skipDepositVeto=false) const
EDGetTokenT< vector< pat::Muon > > srcToken_
bool isNonnull() const
Checks for non-null.
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
void addUserFloat(const std::string &label, float data)
Set user-defined float.
EDGetTokenT< BeamSpot > beamSpotToken_
const TriggerObjectStandAloneCollection triggerObjectMatchesByPath(const std::string &namePath, const bool pathLastFilterAccepted=false, const bool pathL3FilterAccepted=true) const
reco::TrackRef globalTrack() const
reference to Track reconstructed in both tracked and muon detector (reimplemented from reco::Muon) ...
int numberOfMatches(ArbitrationType type=SegmentAndTrackArbitration) const
get number of chambers with matched segments
MuonEnergy calEnergy() const
get energy deposition information
int numberOfChambers() const
ZMuMuMuonUserData(const edm::ParameterSet &)
isodeposit::AbsVetos AbsVetos
Analysis-level muon class.
void produce(edm::Event &, const edm::EventSetup &) override