11 #include "CLHEP/Units/defs.h"
12 #include "CLHEP/Units/PhysicalConstants.h"
21 hepmcCollection_(iPSet.getParameter<edm::
InputTag>(
"hepmcCollection")),
22 tauEtCut(iPSet.getParameter<double>(
"tauEtCutForRtau"))
65 TauRtauW =
dbe->
book1D(
"TauRtauW",
"W->Tau p(leading track)/E(visible tau)", 50 ,0,1);
106 HepMC::GenEvent *myGenEvent =
new HepMC::GenEvent(*(evt->GetEvent()));
111 for(HepMC::GenEvent::particle_const_iterator iter = myGenEvent->particles_begin(); iter != myGenEvent->particles_end(); ++iter) {
112 if((*iter)->status()==3) {
113 if(
abs((*iter)->pdg_id())==15){
119 rtau(*iter,mother,decaychannel);
132 if ( tau->production_vertex() ) {
133 HepMC::GenVertex::particle_iterator mother;
134 for (mother = tau->production_vertex()->particles_begin(
HepMC::parents);
135 mother!= tau->production_vertex()->particles_end(
HepMC::parents); ++mother ) {
136 mother_pid = (*mother)->pdg_id();
142 if(
abs(mother_pid) == 24) label =
W;
143 if(
abs(mother_pid) == 23) label =
Z;
144 if(
abs(mother_pid) == 22) label =
gamma;
145 if(
abs(mother_pid) == 25) label =
HSM;
146 if(
abs(mother_pid) == 35) label =
H0;
147 if(
abs(mother_pid) == 36) label =
A0;
148 if(
abs(mother_pid) == 37) label =
Hpm;
158 if ( tau->end_vertex() ) {
159 HepMC::GenVertex::particle_iterator des;
160 for(des = tau->end_vertex()->particles_begin(HepMC::descendants);
161 des!= tau->end_vertex()->particles_end(HepMC::descendants);++des ) {
162 int pid = (*des)->pdg_id();
164 if((*des)->status() != 1)
continue;
167 int charge = (int) pd->charge();
168 if(charge == 0)
continue;
182 if(tau->status() == 1) channel =
stable;
189 if ( tau->end_vertex() ) {
190 HepMC::GenVertex::particle_iterator des;
191 for(des = tau->end_vertex()->particles_begin(HepMC::descendants);
192 des!= tau->end_vertex()->particles_end(HepMC::descendants);++des ) {
195 int pid = (*des)->pdg_id();
202 if(
abs(pid) == 11) eCount++;
203 if(
abs(pid) == 13) muCount++;
204 if(
abs(pid) == 111) pi0Count++;
205 if(
abs(pid) == 211) piCount++;
210 if(piCount == 1 && pi0Count == 0) channel =
pi;
211 if(piCount == 1 && pi0Count == 1) channel =
pi1pi0;
212 if(piCount == 1 && pi0Count > 1) channel =
pinpi0;
214 if(piCount == 3 && pi0Count == 0) channel =
tripi;
215 if(piCount == 3 && pi0Count > 0) channel =
tripinpi0;
218 if(muCount == 1) channel =
muon;
226 if(decay !=
pi1pi0)
return;
228 if(tau->momentum().perp() <
tauEtCut)
return;
234 if(visibleTauE != 0) rTau = ltrack/visibleTauE;
242 if(decay !=
pi)
return;
244 TLorentzVector momP4 =
motherP4(tau);
247 pionP4.Boost(-1*momP4.BoostVector());
249 double energy = pionP4.E()/(momP4.M()/2);
261 TLorentzVector
p4(0,0,0,0);
263 if ( tau->end_vertex() ) {
264 HepMC::GenVertex::particle_iterator des;
265 for(des = tau->end_vertex()->particles_begin(HepMC::descendants);
266 des!= tau->end_vertex()->particles_end(HepMC::descendants);++des ) {
267 int pid = (*des)->pdg_id();
271 if(
abs(pid) != 211)
continue;
273 if((*des)->momentum().rho() > p4.P()) {
274 p4 = TLorentzVector((*des)->momentum().px(),
275 (*des)->momentum().py(),
276 (*des)->momentum().pz(),
277 (*des)->momentum().e());
287 TLorentzVector
p4(0,0,0,0);
289 if ( tau->production_vertex() ) {
290 HepMC::GenVertex::particle_iterator mother;
291 for (mother = tau->production_vertex()->particles_begin(
HepMC::parents);
292 mother!= tau->production_vertex()->particles_end(
HepMC::parents); ++mother ) {
295 p4 = TLorentzVector((*mother)->momentum().px(),
296 (*mother)->momentum().py(),
297 (*mother)->momentum().pz(),
298 (*mother)->momentum().e());
306 TLorentzVector
p4(tau->momentum().px(),
307 tau->momentum().py(),
308 tau->momentum().pz(),
309 tau->momentum().e());
311 if ( tau->end_vertex() ) {
312 HepMC::GenVertex::particle_iterator des;
313 for(des = tau->end_vertex()->particles_begin(HepMC::descendants);
314 des!= tau->end_vertex()->particles_end(HepMC::descendants);++des ) {
315 int pid = (*des)->pdg_id();
319 if(
abs(pid) == 12 ||
abs(pid) == 14 ||
abs(pid) == 16) {
320 p4 -= TLorentzVector((*des)->momentum().px(),
321 (*des)->momentum().py(),
322 (*des)->momentum().pz(),
323 (*des)->momentum().e());
333 if ( tau->end_vertex() ) {
334 bool photonFromTau =
false;
335 HepMC::GenVertex::particle_iterator des;
336 for(des = tau->end_vertex()->particles_begin(HepMC::descendants);
337 des!= tau->end_vertex()->particles_end(HepMC::descendants);++des ) {
338 int pid = (*des)->pdg_id();
341 photonFromTau =
true;
void setBinContent(int binx, double content)
set content of bin (1-D)
MonitorElement * book1D(const char *name, const char *title, int nchX, double lowX, double highX)
Book 1D histogram.
MonitorElement * TauRtauW
TauValidation(const edm::ParameterSet &)
MonitorElement * TauMothers
void setBinLabel(int bin, const std::string &label, int axis=1)
set bin label for x, y or z axis (axis=1, 2, 3 respectively)
int tauMother(const HepMC::GenParticle *)
virtual void analyze(const edm::Event &, const edm::EventSetup &)
MonitorElement * TauSpinEffectsW
void getData(T &iHolder) const
MonitorElement * TauProngs
int tauDecayChannel(const HepMC::GenParticle *)
void spinEffects(const HepMC::GenParticle *, int, int)
void rtau(const HepMC::GenParticle *, int, int)
double photonFromTauPtSum
MonitorElement * TauDecayChannels
edm::InputTag hepmcCollection_
MonitorElement * TauSpinEffectsHpm
HepPDT::ParticleData ParticleData
double visibleTauEnergy(const HepMC::GenParticle *)
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
TLorentzVector leadingPionP4(const HepMC::GenParticle *)
void photons(const HepMC::GenParticle *)
TLorentzVector motherP4(const HepMC::GenParticle *)
virtual void endRun(const edm::Run &, const edm::EventSetup &)
edm::ESHandle< HepPDT::ParticleDataTable > fPDGTable
PDT table.
double leadingPionMomentum(const HepMC::GenParticle *)
DQMStore * dbe
ME's "container".
virtual void beginRun(const edm::Run &, const edm::EventSetup &)
int tauProngs(const HepMC::GenParticle *)
void setAxisTitle(const std::string &title, int axis=1)
set x-, y- or z-axis title (axis=1, 2, 3 respectively)
MonitorElement * TauRtauHpm
void setCurrentFolder(const std::string &fullpath)
MonitorElement * TauPhotons