45 void endJob()
override;
57 double isocut_, etacut_, ptcut_,
ptSTAcut_, minZmass_, maxZmass_;
58 TH1D * h_zMuMu_mass_, * h_zMuSingleTrack_mass_, * h_zMuSingleStandAlone_mass_,* h_zMuSingleStandAloneOverlap_mass_,
59 * h_zMuMuMatched_mass_,
61 * h_zMuSingleStandAloneMatched_mass_,
62 * h_zMuSingleStandAloneOverlapMatched_mass_;
74 zMuStandAloneMapToken_( mayConsume<
CandMatchMap >( pset.getParameter<
InputTag>(
"zMuStandAloneMap" ) ) ),
75 isocut_( pset.getParameter<double>(
"isocut" ) ),
76 etacut_( pset.getParameter<double>(
"etacut" ) ),
77 ptcut_( pset.getParameter<double>(
"ptcut" ) ),
78 ptSTAcut_( pset.getParameter<double>(
"ptSTAcut" ) ),
80 minZmass_( pset.getParameter<double>(
"minZmass" )),
81 maxZmass_( pset.getParameter<double>(
"maxZmass" )) {
104 unsigned int nZMuMu = zMuMu->
size();
105 unsigned int nZTrackMu = zMuTrack->
size();
106 unsigned int nZStandAloneMu = zMuStandAlone->
size();
107 static const double zMass = 91.1876;
119 if( nZTrackMu > 0 ) {
124 if( nZStandAloneMu > 0 ) {
130 ProductID muIsoId = muIso->keyProduct().id();
133 ProductID trackIsoId = trackIso->keyProduct().id();
137 ProductID standAloneIsoId = standAloneIso->keyProduct().id();
140 double mass = 1000000.;
141 for(
unsigned int i = 0;
i < nZMuMu;
i++ ) {
147 const double iso1 = muIso->value( lep1.
key() );
148 const double iso2 = muIso->value( lep2.key() );
150 double m = zmmCand.
mass();
154 if ( fabs( mass - zMass ) > fabs( m - zMass ) ) {
160 if( m0 != zMuMuMap->
end()) {
168 if (nZMuMu ==0 && nZTrackMu>0) {
169 for(
unsigned int j = 0; j < nZTrackMu; j++ ) {
170 const Candidate & ztmCand = (*zMuTrack)[ j ];
181 iso1 = muIso->value( lep1.
key() );
182 else if ( id1 == trackIsoId )
183 iso1 = trackIso->value( lep1.
key() );
186 iso2 = muIso->value( lep2.key() );
187 else if ( id2 == trackIsoId )
188 iso2 = trackIso->value( lep2.key() );
190 double mt = ztmCand.
mass();
196 if( m0 != zMuTrackMap->
end()) {
204 if (nZMuMu ==0 && nZStandAloneMu>0) {
206 for(
unsigned int j = 0; j < nZStandAloneMu; j++ ) {
207 const Candidate & zsmCand = (*zMuStandAlone)[ j ];
218 iso1 = muIso->value( lep1.
key() );
219 else if ( id1 == standAloneIsoId )
220 iso1 = standAloneIso->value( lep1.
key() );
223 iso2 = muIso->value( lep2.key() );
224 else if ( id2 == standAloneIsoId )
225 iso2 = standAloneIso->value( lep2.key() );
227 double ms = zsmCand.
mass();
233 if( m0 != zMuStandAloneMap->
end()) {
237 bool noOverlap =
true;
238 for(
unsigned int j = 0; j < zMuTrack->
size(); j++ ) {
239 const Candidate & ztmCand = (*zMuTrack)[ j ];
251 iso1 = muIso->value( lep1.
key() );
252 else if ( id1 == trackIsoId )
253 iso1 = trackIso->value( lep1.
key() );
256 iso2 = muIso->value( lep2.key() );
257 else if ( id2 == trackIsoId )
258 iso2 = trackIso->value( lep2.key() );
260 double mt = ztmCand.
mass();
265 if (
overlap_( ztmCand, zsmCand ) ) {
274 if( m1 != zMuTrackMap->
end() && m2 != zMuStandAloneMap->
end() ) {
296 cout<<
"-- N SingleTrackMu = "<<Nztm<<endl;
297 cout<<
"-----N SinglStandAloneMu = "<<Nzsm<<endl;
298 cout<<
"-----N SingleStandAloneOverlapMu = "<<Nzsnom<<endl;
299 cout<<
"------- N MuMu = "<<Nzmm<<endl;
301 cout<<
"-- N SingleTrackMuMatched = "<<NztmMatch<<endl;
302 cout<<
"-----N SinglStandAloneMuMatched = "<<NzsmMatch<<endl;
303 cout<<
"-----N SingleStandAloneOverlapMuMatched = "<<NzsnomMatch<<endl;
304 cout<<
"------- N MuMu Matched = "<<NzmmMatch<<endl;
EDGetTokenT< IsolationCollection > standAloneIsoToken_
const_iterator end() const
last iterator over the map (read only)
virtual const Candidate * daughter(size_type i) const =0
return daughter at a given position, i = 0, ... numberOfDaughters() - 1 (read only mode) ...
const_iterator find(const key_type &k) const
find element with specified reference key
def setup(process, global_tag, zero_tesla=False)
T * make(const Args &...args) const
make new ROOT object
void analyze(const edm::Event &event, const edm::EventSetup &setup) override
EDGetTokenT< IsolationCollection > muIsoToken_
key_type key() const
Accessor for product key.
EDGetTokenT< CandidateCollection > zMuStandAloneToken_
ZMuMuAnalyzer(const edm::ParameterSet &pset)
edm::AssociationVector< reco::CandidateRefProd, std::vector< double > > IsolationCollection
example_stream void analyze(const edm::Event &, const edm::EventSetup &) override
ProductID id() const
Accessor for product ID.
#define DEFINE_FWK_MODULE(type)
TH1D * h_zMuSingleStandAloneOverlap_mass_
EDGetTokenT< CandMatchMap > zMuStandAloneMapToken_
EDGetTokenT< CandMatchMap > zMuTrackMapToken_
TH1D * h_zMuSingleTrack_mass_
virtual const CandidateBaseRef & masterClone() const =0
EDGetTokenT< CandidateCollection > zMuTrackToken_
TH1D * h_zMuMuMatched_mass_
virtual double mass() const =0
mass
TH1D * h_zMuSingleStandAlone_mass_
EDGetTokenT< IsolationCollection > trackIsoToken_
TH1D * h_zMuSingleStandAloneOverlapMatched_mass_
EDGetTokenT< CandMatchMap > zMuMuMapToken_
TH1D * h_zMuSingleTrackMatched_mass_
lep1
print 'MRbb(1b)',event.mr_bb
TH1D * h_zMuSingleStandAloneMatched_mass_
EDGetTokenT< CandidateCollection > zMuMuToken_