24 using namespace isodeposit;
34 double ptThreshold_, etEcalThreshold_, etHcalThreshold_ ,dRVetoTrk_, dRTrk_, dREcal_ , dRHcal_;
37 vector<double>
isolation(
const T &
t,
double ptThreshold,
double etEcalThreshold,
double etHcalThreshold ,
double dRVetoTrk,
double dRTrk,
double dREcal ,
double dRHcal,
double alpha,
double beta);
42 vector<double>
ZMuMuTrackUserData::isolation(
const T &
t,
double ptThreshold,
double etEcalThreshold,
double etHcalThreshold ,
double dRVetoTrk,
double dRTrk,
double dREcal ,
double dRHcal,
double alpha,
double beta) {
53 vetosTrk.push_back(
new ConeVeto( dir, dRVetoTrk ));
57 vetosEcal.push_back(
new ConeVeto( dir, 0.));
61 vetosHcal.push_back(
new ConeVeto( dir, 0. ));
64 double isovalueTrk = (trkIso->
sumWithin(dRTrk,vetosTrk));
65 double isovalueEcal = (ecalIso->
sumWithin(dREcal,vetosEcal));
66 double isovalueHcal = (hcalIso->
sumWithin(dRHcal,vetosHcal));
68 iso.push_back(isovalueTrk);
69 iso.push_back(isovalueEcal);
70 iso.push_back(isovalueHcal);
73 double combIso = alpha*( ((1+
beta)/2*isovalueEcal) + ((1-
beta)/2*isovalueHcal) ) + ((1-alpha)*isovalueTrk);
75 iso.push_back(combIso);
76 double relIso = combIso /= t.pt();
77 iso.push_back(relIso);
82 src_( cfg.getParameter<
InputTag>(
"src" ) ),
83 beamSpot_(cfg.getParameter<
InputTag>(
"beamSpot" ) ),
84 primaryVertices_(cfg.getParameter<
InputTag>(
"primaryVertices" ) ),
85 ptThreshold_(cfg.getParameter<double >(
"ptThreshold") ),
86 etEcalThreshold_(cfg.getParameter<double >(
"etEcalThreshold") ),
87 etHcalThreshold_(cfg.getParameter<double >(
"etHcalThreshold") ),
88 dRVetoTrk_(cfg.getParameter<double >(
"dRVetoTrk") ),
89 dRTrk_(cfg.getParameter<double >(
"dRTrk") ),
90 dREcal_(cfg.getParameter<double >(
"dREcal") ),
91 dRHcal_(cfg.getParameter<double >(
"dRHcal") ),
92 alpha_(cfg.getParameter<double>(
"alpha") ),
93 beta_(cfg.getParameter<double>(
"beta") ){
94 produces<std::vector<pat::GenericParticle> >();
108 auto_ptr<vector<pat::GenericParticle> > tkColl(
new vector<pat::GenericParticle> (*tracks) );
109 for (
unsigned int i = 0;
i< tkColl->size();++
i){
125 float zDaudxyFromBS = -1 ;
126 float zDaudzFromBS = -1;
127 float zDaudxyFromPV = -1;
128 float zDaudzFromPV = -1;
129 float zDauNofMuChambers = -1;
130 float zDauNofMuMatches = -1;
132 float zDauTrkChi2 = -1;
133 float zDauSaChi2 = -1;
134 float zDauNofMuonHits =- 1;
135 float zDauNofStripHits = -1;
136 float zDauNofPixelHits = -1;
137 float zDauMuEnergyEm = -1;
138 float zDauMuEnergyHad = -1;
142 zDaudxyFromBS = muTrkRef->dxy(beamSpotHandle->position());
143 zDaudzFromBS = muTrkRef->dz(beamSpotHandle->position());
144 zDaudxyFromPV = muTrkRef->dxy(primaryVertices->begin()->position() );
145 zDaudzFromPV = muTrkRef->dz(primaryVertices->begin()->position() );
146 zDauChi2 = muTrkRef->normalizedChi2();
147 zDauTrkChi2 = muTrkRef->normalizedChi2();
148 zDauNofStripHits = muTrkRef->hitPattern().numberOfValidStripHits();
149 zDauNofPixelHits = muTrkRef->hitPattern().numberOfValidPixelHits();
156 tk.
addUserFloat(
"zDau_TrkNofStripHits" , zDauNofStripHits );
157 tk.
addUserFloat(
"zDau_TrkNofPixelHits" , zDauNofPixelHits );
158 tk.
addUserFloat(
"zDau_NofMuChambers", zDauNofMuChambers);
void setIsolation(IsolationKeys key, float value)
ZMuMuTrackUserData(const edm::ParameterSet &)
#define DEFINE_FWK_MODULE(type)
void produce(edm::Event &, const edm::EventSetup &) override
double sumWithin(double coneSize, const AbsVetos &vetos=AbsVetos(), bool skipDepositVeto=false) const
bool isNonnull() const
Checks for non-null.
Analysis-level Generic Particle class (e.g. for hadron or muon not fully reconstructed) ...
vector< double > isolation(const T &t, double ptThreshold, double etEcalThreshold, double etHcalThreshold, double dRVetoTrk, double dRTrk, double dREcal, double dRHcal, double alpha, double beta)
InputTag primaryVertices_
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
void addUserFloat(const std::string &label, float data)
Set user-defined float.
virtual reco::TrackRef track() const
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
isodeposit::AbsVetos AbsVetos