40 muonTag_(cfg.getParameter<edm::
InputTag> (
"MuonTag")),
41 isoTag_(cfg.getParameter<edm::
InputTag> (
"IsolationTag")),
42 ptCut_(cfg.getParameter<double>(
"PtCut")),
43 etaCut_(cfg.getParameter<double>(
"EtaCut")),
44 massZMin_(cfg.getParameter<double>(
"MassZMin")),
45 massZMax_(cfg.getParameter<double>(
"MassZMax")),
47 onlyGlobalMuons_(cfg.getParameter<bool>(
"OnlyGlobalMuons")),
48 trackerTag_(cfg.getUntrackedParameter<edm::
InputTag> (
"TrackerTag",edm::
InputTag(
"ctfWithMaterialTracks"))),
49 isoTrackerTag_(cfg.getUntrackedParameter<edm::
InputTag> (
"TrackerIsolationTag",edm::
InputTag(
"zMuMuTrackerIsolations"))),
50 minTrackerHits_(cfg.getUntrackedParameter<int>(
"MinTrackerHits",7))
63 if (!muonCollection.
isValid()) {
64 LogTrace(
"") <<
">>> Muon collection does not exist !!!";
71 LogTrace(
"") <<
">>> ISO Muon collection does not exist !!!";
79 if (!trackerCollection.
isValid()) {
80 LogTrace(
"") <<
">>> Tracker collection does not exist !!!";
86 LogTrace(
"") <<
">>> ISO Tracker collection does not exist !!!";
91 unsigned int npairs = 0;
92 bool globalCombinationFound =
false;
93 for (
unsigned int i=0;
i<muonCollection->size();
i++) {
95 LogTrace(
"") <<
"> Processing muon number " <<
i <<
"...";
97 LogTrace(
"") <<
"\t... pt= " << pt <<
" GeV";
99 double eta = mu->eta();
101 if (fabs(eta)>
etaCut_)
continue;
102 bool iso = (*isoMap)[
mu];
103 LogTrace(
"") <<
"\t... isolated? " << iso;
106 for (
unsigned int j=
i+1;
j<muonCollection->size();
j++) {
108 LogTrace(
"") <<
"> Processing second muon number " <<
j <<
"...";
109 double pt2 = mu2->pt();
110 LogTrace(
"") <<
"\t... pt2= " << pt2 <<
" GeV";
112 double eta2 = mu2->eta();
113 LogTrace(
"") <<
"\t... eta2= " << eta2;
114 if (fabs(eta2)>
etaCut_)
continue;
115 bool iso2 = (*isoMap)[mu2];
116 LogTrace(
"") <<
"\t... isolated2? " << iso2;
119 double z_en = mu->p() + mu2->p();
120 double z_px = mu->px() + mu2->px();
121 double z_py = mu->py() + mu2->py();
122 double z_pz = mu->pz() + mu2->pz();
123 double massZ = z_en*z_en - z_px*z_px - z_py*z_py - z_pz*z_pz;
124 massZ = (massZ>0) ?
sqrt(massZ) : 0;
125 LogTrace(
"") <<
"\t... Z_en, Z_px, Z_py, Z_pz= " << z_en <<
", " << z_px <<
", " << z_py <<
", " << z_pz <<
" GeV";
126 LogTrace(
"") <<
"\t... (GM-GM) Invariant reconstructed mass= " << massZ <<
" GeV";
129 globalCombinationFound =
true;
135 for (
unsigned int j=0;
j<trackerCollection->size();
j++) {
137 LogTrace(
"") <<
"> Processing track number " <<
j <<
"...";
138 double pt2 = mu2->pt();
139 LogTrace(
"") <<
"\t... pt3= " << pt2 <<
" GeV";
141 double eta2 = mu2->eta();
142 LogTrace(
"") <<
"\t... eta3= " << eta2;
143 if (fabs(eta2)>
etaCut_)
continue;
144 int nhits2 = mu2->numberOfValidHits();
145 LogTrace(
"") <<
"\t... nhits3= " << nhits2;
147 bool iso2 = (*isoTrackerMap)[mu2];
148 LogTrace(
"") <<
"\t... isolated3? " << iso2;
151 double z_en = mu->p() + mu2->p();
152 double z_px = mu->px() + mu2->px();
153 double z_py = mu->py() + mu2->py();
154 double z_pz = mu->pz() + mu2->pz();
155 double massZ = z_en*z_en - z_px*z_px - z_py*z_py - z_pz*z_pz;
156 massZ = (massZ>0) ?
sqrt(massZ) : 0;
157 LogTrace(
"") <<
"\t... Z_en, Z_px, Z_py, Z_pz= " << z_en <<
", " << z_px <<
", " << z_py <<
", " << z_pz <<
" GeV";
158 LogTrace(
"") <<
"\t... (GM-TK) Invariant reconstructed mass= " << massZ <<
" GeV";
165 LogTrace(
"") <<
"> Number of Z pairs found= " << npairs;
167 LogTrace(
"") <<
">>>> Event REJECTED";
170 LogTrace(
"") <<
">>>> Event SELECTED!!!";
#define DEFINE_FWK_MODULE(type)
virtual bool filter(edm::Event &, const edm::EventSetup &) override
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
edm::InputTag trackerTag_
ZToMuMuSelector(const edm::ParameterSet &)
edm::InputTag isoTrackerTag_