33 using namespace isodeposit;
40 virtual void endJob()
override;
52 TH1F *
IsoZ,* IsoW,* IsoOther ;
53 TH1F *
TkrPt,* EcalEt,* HcalEt ;
56 TH1F *
Z_eta,* W_eta,* Other_eta;
58 TH1F *
Z_pt,* W_pt,* Other_pt;
61 enum MuTag { muFromZ, muFromW, muFromOther };
65 void histo(TH1F* hist,
const char* cx,
const char* cy)
const;
75 int sizem = p->numberOfMothers();
85 int pdgId1 = moth1->
pdgId();
95 int pdgId2 = moth2->
pdgId();
100 if(
abs(pdgId2)==24)
return muFromW;
108 for(IsoDeposit::const_iterator it= isodep->
begin(); it!= isodep->
end(); ++it){
109 if(it->dR()<dR_max) {
110 double theta= 2*(TMath::ATan(TMath::Exp(-(it->eta() ) ) ) );
112 hist->Fill(it->value()/TMath::Sin(theta));
118 hist->GetXaxis()->SetTitle(cx);
119 hist->GetYaxis()->SetTitle(cy);
120 hist->GetXaxis()->SetTitleOffset(1);
121 hist->GetYaxis()->SetTitleOffset(1.2);
122 hist->GetXaxis()->SetTitleSize(0.04);
123 hist->GetYaxis()->SetTitleSize(0.04);
124 hist->GetXaxis()->SetLabelSize(0.03);
125 hist->GetYaxis()->SetLabelSize(0.03);
130 dRVeto(pset.getUntrackedParameter<double>(
"veto")),
131 dRTrk(pset.getUntrackedParameter<double>(
"deltaRTrk")),
132 dREcal(pset.getUntrackedParameter<double>(
"deltaREcal")),
133 dRHcal(pset.getUntrackedParameter<double>(
"deltaRHcal")),
134 ptThreshold(pset.getUntrackedParameter<double>(
"ptThreshold")),
135 etEcalThreshold(pset.getUntrackedParameter<double>(
"etEcalThreshold")),
136 etHcalThreshold(pset.getUntrackedParameter<double>(
"etHcalThreshold")),
137 alpha(pset.getUntrackedParameter<double>(
"alpha")),
138 beta(pset.getUntrackedParameter<double>(
"beta")),
139 pt(pset.getUntrackedParameter<double>(
"pt")),
140 eta(pset.getUntrackedParameter<double>(
"eta")),
141 iso_cut(pset.getUntrackedParameter<double>(
"isoCut")) {
143 std::ostringstream str1,str2,str3,str4,str5,str6,str7,str8,str9,str10,n_tracks;
144 str1 <<
"muons from Z with p_{t} > " <<
ptThreshold <<
" GeV/c"<<
" and #Delta R < "<<
dRTrk;
145 str2 <<
"muons from W with p_{t} > " <<
ptThreshold <<
" GeV/c"<<
" and #Delta R < "<<
dRTrk;
146 str3 <<
"muons from Others with p_{t} > " <<
ptThreshold <<
" GeV/c"<<
" and #Delta R < "<<
dRTrk;
147 str4 <<
"muons from Z with p_{t} > " <<
ptThreshold <<
" GeV/c"<<
" and #Delta R < "<<dRTrk<<
" (alpha = "<<
alpha<<
" , "<<
"beta = "<<
beta<<
" )";
148 str5 <<
"muons from W with p_{t} > " <<
ptThreshold <<
" GeV/c"<<
" and #Delta R < "<<dRTrk<<
" (alpha = "<<
alpha<<
" , "<<
"beta = "<<beta<<
" )";
149 str6 <<
"muons from Other with p_{t} > " <<
ptThreshold <<
" GeV/c"<<
" and #Delta R < "<<dRTrk<<
" (alpha = "<<
alpha<<
" , "<<
"beta = "<<beta<<
" )";
150 n_tracks <<
"Number of tracks for muon with p_{t} > " <<
ptThreshold <<
" and #Delta R < "<<dRTrk<<
" GeV/c";
151 str7<<
"Isolation Vs p_{t} with p_{t} > " <<
ptThreshold <<
" GeV/c"<<
" and #Delta R < "<<dRTrk<<
"(Tracker)";
152 str8<<
"Isolation Vs p_{t} with p_{t} > " <<
ptThreshold <<
" GeV/c"<<
" and #Delta R < "<<dRTrk<<
"(Ecal)";
153 str9<<
"Isolation Vs p_{t} with p_{t} > " <<
ptThreshold <<
" GeV/c"<<
" and #Delta R < "<<dRTrk<<
"(Hcal)";
154 str10<<
"Isolation Vs p_{t} with p_{t} > " <<
ptThreshold <<
" GeV/c"<<
" and #Delta R < "<<dRTrk<<
" (alpha = "<<
alpha<<
" , "<<
"beta = "<<beta<<
" )";
155 h_IsoZ_tk = fs->
make<TH1F>(
"ZIso_Tk",str1.str().c_str(),100,0.,20.);
156 h_IsoW_tk = fs->
make<TH1F>(
"WIso_Tk",str2.str().c_str(),100,0.,20.);
158 h_IsoZ_ecal = fs->
make<TH1F>(
"ZIso_ecal",str1.str().c_str(),100,0.,20.);
159 h_IsoW_ecal = fs->
make<TH1F>(
"WIso_ecal",str2.str().c_str(),100,0.,20.);
161 h_IsoZ_hcal = fs->
make<TH1F>(
"ZIso_hcal",str1.str().c_str(),100,0.,20.);
162 h_IsoW_hcal = fs->
make<TH1F>(
"WIso_hcal",str2.str().c_str(),100,0.,20.);
164 IsoZ = fs->
make<TH1F>(
"ZIso",str4.str().c_str(),100,0.,20.);
165 IsoW = fs->
make<TH1F>(
"WIso",str5.str().c_str(),100,0.,20.);
166 IsoOther = fs->
make<TH1F>(
"otherIso",str6.str().c_str(),100,0.,20.);
169 Z_eta = fs->
make<TH1F>(
"Z_eta",
"#eta distribution for muons coming from Z",40,-
eta,
eta);
170 W_eta = fs->
make<TH1F>(
"W_eta",
"#eta distribution for muons coming from W",40,-
eta,
eta);
171 Other_eta = fs->
make<TH1F>(
"Other_eta",
"#eta distribution for muons coming from other",40,-
eta,
eta);
176 Z_pt = fs->
make<TH1F>(
"Z_pt",
"p_{T} distribution for muons coming from Z",40,
pt,150.);
177 W_pt = fs->
make<TH1F>(
"W_pt",
"p_{T} distribution for muons coming from W",40,
pt,150.);
178 Other_pt = fs->
make<TH1F>(
"Other_pt",
"p_{T} distribution for muons coming from other",40,
pt,150.);
179 Z_pt_postSelection = fs->
make<TH1F>(
"Z_pt_postSelection",
"p_{T} distribution for muons coming from Z after iso selection",40,
pt,150.);
180 W_pt_postSelection = fs->
make<TH1F>(
"W_pt_postSelection",
"p_{t} distribution for muons coming from W after iso selection",40,
pt,150.);
181 Other_pt_postSelection = fs->
make<TH1F>(
"Other_pt_postSelection",
"p_{t} distribution for muons coming from other after iso selection",40,
pt,150.);
184 TkrPt = fs->
make<TH1F>(
"TkrPt",
"IsoDeposit p distribution in the Tracker",100,0.,10.);
185 EcalEt = fs->
make<TH1F>(
"EcalEt",
"IsoDeposit E distribution in the Ecal",100,0.,5.);
186 HcalEt = fs->
make<TH1F>(
"HcalEt",
"IsoDeposit E distribution in the Hcal",100,0.,5.);
188 EcalEtZ = fs->
make<TH1F>(
"VetoEcalEt",
" #Sigma E_{T} deposited in veto cone in the Ecal",100,0.,10.);
189 HcalEtZ = fs->
make<TH1F>(
"VetoHcalEt",
" #Sigma E_{T} deposited in veto cone in the Hcal",100,0.,10.);
196 for(
unsigned int i=0;
i < dimuons->
size(); ++
i ) {
225 vetos_mu_ecal.push_back(
new ConeVeto( muDir, 0. ));
229 vetos_tk_ecal.push_back(
new ConeVeto( tkDir, 0. ));
233 vetos_mu_hcal.push_back(
new ConeVeto( muDir, 0. ));
237 vetos_tk_hcal.push_back(
new ConeVeto( tkDir, 0. ));
253 double iso_value=
TMath::Max(iso_value0,iso_value1);
259 IsoZ->Fill(iso_value);
286 IsoW->Fill(iso_value);
virtual double pt() const final
transverse momentum
double candEnergy() const
Get energy or pT attached to cand trajectory.
TH1F * Z_eta_postSelection
virtual double eta() const final
momentum pseudorapidity
def analyze(function, filename, filter=None)
#define DEFINE_FWK_MODULE(type)
EDGetTokenT< CandidateView > srcToken
virtual const Candidate * daughter(size_type i) const =0
return daughter at a given position, i = 0, ... numberOfDaughters() - 1 (read only mode) ...
Geom::Theta< T > theta() const
def setup(process, global_tag, zero_tesla=False)
virtual const Candidate * mother(size_type i=0) const =0
return pointer to mother
T * make(const Args &...args) const
make new ROOT object
const IsoDeposit * isoDeposit(IsolationKeys key) const
Returns the IsoDeposit associated with some key, or a null pointer if it is not available.
virtual void endJob() override
const IsoDeposit * isoDeposit(IsolationKeys key) const
Returns the IsoDeposit associated with some key, or a null pointer if it is not available.
double sumWithin(double coneSize, const AbsVetos &vetos=AbsVetos(), bool skipDepositVeto=false) const
TH1F * W_pt_postSelection
TH1F * Z_pt_postSelection
virtual double phi() const final
momentum azimuthal angle
Analysis-level Generic Particle class (e.g. for hadron or muon not fully reconstructed) ...
virtual int pdgId() const =0
PDG identifier.
Abs< T >::type abs(const T &t)
TH1F * Other_pt_postSelection
ZMuMuIsolationAnalyzer(const edm::ParameterSet &pset)
void Deposits(const pat::IsoDeposit *isodep, double dR_max, TH1F *hist)
bool isNull() const
Checks for null.
const_iterator begin() const
virtual const CandidateBaseRef & masterClone() const =0
TH1F * Other_eta_postSelection
TH1F * W_eta_postSelection
std::vector< AbsVeto * > AbsVetos
MuTag muTag(const T &mu) const
isodeposit::AbsVetos AbsVetos
const_iterator end() const
void histo(TH1F *hist, const char *cx, const char *cy) const
Analysis-level muon class.
virtual void analyze(const edm::Event &event, const edm::EventSetup &setup) override