42 ptCut_(cfg.getParameter<double>(
"PtCut")),
43 etaCut_(cfg.getParameter<double>(
"EtaCut")),
44 massZMin_(cfg.getParameter<double>(
"MassZMin")),
45 massZMax_(cfg.getParameter<double>(
"MassZMax")),
58 if (!muonCollection.
isValid()) {
59 LogTrace(
"") <<
">>> Muon collection does not exist !!!";
66 LogTrace(
"") <<
">>> ISO Muon collection does not exist !!!";
74 if (!trackerCollection.
isValid()) {
75 LogTrace(
"") <<
">>> Tracker collection does not exist !!!";
81 LogTrace(
"") <<
">>> ISO Tracker collection does not exist !!!";
86 unsigned int npairs = 0;
87 bool globalCombinationFound =
false;
88 for (
unsigned int i=0;
i<muonCollection->size();
i++) {
90 LogTrace(
"") <<
"> Processing muon number " <<
i <<
"...";
92 LogTrace(
"") <<
"\t... pt= " << pt <<
" GeV";
94 double eta = mu->eta();
96 if (fabs(eta)>
etaCut_)
continue;
97 bool iso = (*isoMap)[
mu];
98 LogTrace(
"") <<
"\t... isolated? " << iso;
101 for (
unsigned int j=
i+1; j<muonCollection->size(); j++) {
103 LogTrace(
"") <<
"> Processing second muon number " << j <<
"...";
104 double pt2 = mu2->pt();
105 LogTrace(
"") <<
"\t... pt2= " << pt2 <<
" GeV";
107 double eta2 = mu2->eta();
108 LogTrace(
"") <<
"\t... eta2= " << eta2;
109 if (fabs(eta2)>
etaCut_)
continue;
110 bool iso2 = (*isoMap)[mu2];
111 LogTrace(
"") <<
"\t... isolated2? " << iso2;
114 double z_en = mu->p() + mu2->p();
115 double z_px = mu->px() + mu2->px();
116 double z_py = mu->py() + mu2->py();
117 double z_pz = mu->pz() + mu2->pz();
118 double massZ = z_en*z_en - z_px*z_px - z_py*z_py - z_pz*z_pz;
119 massZ = (massZ>0) ?
sqrt(massZ) : 0;
120 LogTrace(
"") <<
"\t... Z_en, Z_px, Z_py, Z_pz= " << z_en <<
", " << z_px <<
", " << z_py <<
", " << z_pz <<
" GeV";
121 LogTrace(
"") <<
"\t... (GM-GM) Invariant reconstructed mass= " << massZ <<
" GeV";
124 globalCombinationFound =
true;
130 for (
unsigned int j=0; j<trackerCollection->size(); j++) {
132 LogTrace(
"") <<
"> Processing track number " << j <<
"...";
133 double pt2 = mu2->pt();
134 LogTrace(
"") <<
"\t... pt3= " << pt2 <<
" GeV";
136 double eta2 = mu2->eta();
137 LogTrace(
"") <<
"\t... eta3= " << eta2;
138 if (fabs(eta2)>
etaCut_)
continue;
139 int nhits2 = mu2->numberOfValidHits();
140 LogTrace(
"") <<
"\t... nhits3= " << nhits2;
142 bool iso2 = (*isoTrackerMap)[mu2];
143 LogTrace(
"") <<
"\t... isolated3? " << iso2;
146 double z_en = mu->p() + mu2->p();
147 double z_px = mu->px() + mu2->px();
148 double z_py = mu->py() + mu2->py();
149 double z_pz = mu->pz() + mu2->pz();
150 double massZ = z_en*z_en - z_px*z_px - z_py*z_py - z_pz*z_pz;
151 massZ = (massZ>0) ?
sqrt(massZ) : 0;
152 LogTrace(
"") <<
"\t... Z_en, Z_px, Z_py, Z_pz= " << z_en <<
", " << z_px <<
", " << z_py <<
", " << z_pz <<
" GeV";
153 LogTrace(
"") <<
"\t... (GM-TK) Invariant reconstructed mass= " << massZ <<
" GeV";
160 LogTrace(
"") <<
"> Number of Z pairs found= " << npairs;
162 LogTrace(
"") <<
">>>> Event REJECTED";
165 LogTrace(
"") <<
">>>> Event SELECTED!!!";
bool getByToken(EDGetToken token, Handle< PROD > &result) const
#define DEFINE_FWK_MODULE(type)
edm::EDGetTokenT< reco::TrackCollection > muonToken_
std::vector< Track > TrackCollection
collection of Tracks
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
virtual bool filter(edm::Event &, const edm::EventSetup &) override
edm::EDGetTokenT< reco::TrackCollection > trackerToken_
edm::EDGetTokenT< edm::ValueMap< bool > > isoToken_
ZToMuMuSelector(const edm::ParameterSet &)
edm::EDGetTokenT< edm::ValueMap< bool > > isoTrackerToken_
EDGetTokenT< ProductType > mayConsume(edm::InputTag const &tag)