24 using namespace isodeposit;
36 double ptThreshold_, etEcalThreshold_, etHcalThreshold_ ,dRVetoTrk_, dRTrk_, dREcal_ , dRHcal_;
39 vector<double>
isolation(
const T &
t,
double ptThreshold,
double etEcalThreshold,
double etHcalThreshold ,
double dRVetoTrk,
double dRTrk,
double dREcal ,
double dRHcal,
double alpha,
double beta);
44 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) {
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);
71 iso.push_back(isovalueEcal);
72 iso.push_back(isovalueHcal);
75 double combIso = alpha*( ((1+
beta)/2*isovalueEcal) + ((1-
beta)/2*isovalueHcal) ) + ((1-alpha)*isovalueTrk);
77 iso.push_back(combIso);
78 double relIso = combIso /= t.pt();
79 iso.push_back(relIso);
84 srcToken_(consumes<vector<pat::GenericParticle> > ( cfg.getParameter<
InputTag>(
"src" ) ) ),
85 beamSpotToken_(consumes<
BeamSpot> (cfg.getParameter<
InputTag>(
"beamSpot" ) ) ),
87 ptThreshold_(cfg.getParameter<double >(
"ptThreshold") ),
88 etEcalThreshold_(cfg.getParameter<double >(
"etEcalThreshold") ),
89 etHcalThreshold_(cfg.getParameter<double >(
"etHcalThreshold") ),
90 dRVetoTrk_(cfg.getParameter<double >(
"dRVetoTrk") ),
91 dRTrk_(cfg.getParameter<double >(
"dRTrk") ),
92 dREcal_(cfg.getParameter<double >(
"dREcal") ),
93 dRHcal_(cfg.getParameter<double >(
"dRHcal") ),
94 alpha_(cfg.getParameter<double>(
"alpha") ),
95 beta_(cfg.getParameter<double>(
"beta") ){
96 produces<std::vector<pat::GenericParticle> >();
109 auto_ptr<vector<pat::GenericParticle> > tkColl(
new vector<pat::GenericParticle> (*tracks) );
110 for (
unsigned int i = 0;
i< tkColl->size();++
i){
126 float zDaudxyFromBS = -1 ;
127 float zDaudzFromBS = -1;
128 float zDaudxyFromPV = -1;
129 float zDaudzFromPV = -1;
130 float zDauNofMuChambers = -1;
131 float zDauNofMuMatches = -1;
133 float zDauTrkChi2 = -1;
134 float zDauSaChi2 = -1;
135 float zDauNofMuonHits =- 1;
136 float zDauNofStripHits = -1;
137 float zDauNofPixelHits = -1;
138 float zDauMuEnergyEm = -1;
139 float zDauMuEnergyHad = -1;
143 zDaudxyFromBS = muTrkRef->dxy(beamSpotHandle->position());
144 zDaudzFromBS = muTrkRef->dz(beamSpotHandle->position());
145 zDaudxyFromPV = muTrkRef->dxy(primaryVertices->begin()->position() );
146 zDaudzFromPV = muTrkRef->dz(primaryVertices->begin()->position() );
147 zDauChi2 = muTrkRef->normalizedChi2();
148 zDauTrkChi2 = muTrkRef->normalizedChi2();
149 zDauNofStripHits = muTrkRef->hitPattern().numberOfValidStripHits();
150 zDauNofPixelHits = muTrkRef->hitPattern().numberOfValidPixelHits();
157 tk.
addUserFloat(
"zDau_TrkNofStripHits" , zDauNofStripHits );
158 tk.
addUserFloat(
"zDau_TrkNofPixelHits" , zDauNofPixelHits );
159 tk.
addUserFloat(
"zDau_NofMuChambers", zDauNofMuChambers);
void setIsolation(IsolationKeys key, float value)
bool getByToken(EDGetToken token, Handle< PROD > &result) const
ZMuMuTrackUserData(const edm::ParameterSet &)
#define DEFINE_FWK_MODULE(type)
void produce(edm::Event &, const edm::EventSetup &) override
std::vector< Vertex > VertexCollection
collection of Vertex objects
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)
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
EDGetTokenT< vector< pat::GenericParticle > > srcToken_
EDGetTokenT< VertexCollection > primaryVerticesToken_
EDGetTokenT< BeamSpot > beamSpotToken_
isodeposit::AbsVetos AbsVetos