CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
TauValidation.cc
Go to the documentation of this file.
1 /*class TauValidation
2  *
3  * Class to fill dqm monitor elements from existing EDM file
4  *
5  */
7 #include "CLHEP/Units/defs.h"
8 #include "CLHEP/Units/PhysicalConstants.h"
14 #include <iostream>
15 using namespace edm;
16 
18  wmanager_(iPSet,consumesCollector())
19  ,genparticleCollection_(iPSet.getParameter<edm::InputTag>("genparticleCollection"))
20  ,hepmcCollection_(iPSet.getParameter<edm::InputTag>("hepmcCollection"))
21  ,NMODEID(TauDecay::NMODEID-1)// fortran to C++ index
22  ,zsbins(20)
23  ,zsmin(-0.5)
24  ,zsmax(0.5)
25 {
26  hepmcCollectionToken_=consumes<HepMCProduct>(hepmcCollection_);
27  genparticleCollectionToken_=consumes<reco::GenParticleCollection>(genparticleCollection_);
28 }
29 
31 
33  c.getData( fPDGTable );
34 }
35 
38  i.setCurrentFolder("Generator/Tau");
39 
40  // Number of analyzed events
41  nTaus = i.book1D("nTaus", "n analyzed Taus", 1, 0., 1.);
42  nPrimeTaus = i.book1D("nPrimeTaus", "n analyzed prime Taus", 1, 0., 1.);
43 
44  //Kinematics
45  TauPt = i.book1D("TauPt","Tau pT", 100 ,0,100);
46  TauEta = i.book1D("TauEta","Tau eta", 100 ,-2.5,2.5);
47  TauPhi = i.book1D("TauPhi","Tau phi", 100 ,-3.14,3.14);
48  TauProngs = i.book1D("TauProngs","Tau n prongs", 7 ,0,7);
49  TauDecayChannels = i.book1D("TauDecayChannels","Tau decay channels", 13 ,0,13);
53  TauDecayChannels->setBinLabel(1+pi,"#pi^{#pm}");
54  TauDecayChannels->setBinLabel(1+rho,"#rho^{#pm}");
55  TauDecayChannels->setBinLabel(1+a1,"a_{1}^{#pm}");
56  TauDecayChannels->setBinLabel(1+pi1pi0,"#pi^{#pm}#pi^{0}");
57  TauDecayChannels->setBinLabel(1+pinpi0,"#pi^{#pm}n#pi^{0}");
58  TauDecayChannels->setBinLabel(1+tripi,"3#pi^{#pm}");
59  TauDecayChannels->setBinLabel(1+tripinpi0,"3#pi^{#pm}n#pi^{0}");
62  TauDecayChannels->setBinLabel(1+stable,"Stable");
63 
64  TauMothers = i.book1D("TauMothers","Tau mother particles", 10 ,0,10);
65 
67  TauMothers->setBinLabel(1+B,"B Decays");
68  TauMothers->setBinLabel(1+D,"D Decays");
69  TauMothers->setBinLabel(1+gamma,"#gamma");
70  TauMothers->setBinLabel(1+Z,"Z");
71  TauMothers->setBinLabel(1+W,"W");
72  TauMothers->setBinLabel(1+HSM,"H_{SM}/h^{0}");
73  TauMothers->setBinLabel(1+H0,"H^{0}");
74  TauMothers->setBinLabel(1+A0,"A^{0}");
75  TauMothers->setBinLabel(1+Hpm,"H^{#pm}");
76 
77  DecayLength = i.book1D("DecayLength","#tau Decay Length", 100 ,-20,20); DecayLength->setAxisTitle("L_{#tau} (cm)");
78  LifeTime = i.book1D("LifeTime","#tau LifeTime ", 500 ,0,10000E-15); LifeTime->setAxisTitle("#tau_{#tau} (s)");
79 
80  TauSpinEffectsW_X = i.book1D("TauSpinEffectsWX","X for pion", 50 ,0,1); TauSpinEffectsW_X->setAxisTitle("X");
81  TauSpinEffectsHpm_X = i.book1D("TauSpinEffectsHpmX","X for pion", 50 ,0,1); TauSpinEffectsHpm_X->setAxisTitle("X");
82 
83  TauSpinEffectsW_eX = i.book1D("TauSpinEffectsWeX","X for e", 50 ,0,1); TauSpinEffectsW_eX->setAxisTitle("X");
84  TauSpinEffectsHpm_eX = i.book1D("TauSpinEffectsHpmeX","X for e", 50 ,0,1); TauSpinEffectsHpm_eX->setAxisTitle("X");
85 
86  TauSpinEffectsW_muX = i.book1D("TauSpinEffectsWmuX","X for mu", 50 ,0,1); TauSpinEffectsW_muX->setAxisTitle("X");
87  TauSpinEffectsHpm_muX = i.book1D("TauSpinEffectsHpmmuX","X for mue", 50 ,0,1); TauSpinEffectsHpm_muX->setAxisTitle("X");
88 
89  TauSpinEffectsW_UpsilonRho = i.book1D("TauSpinEffectsWUpsilonRho","#Upsilon for #rho", 50 ,-1,1); TauSpinEffectsW_UpsilonRho->setAxisTitle("#Upsilon");
90  TauSpinEffectsHpm_UpsilonRho = i.book1D("TauSpinEffectsHpmUpsilonRho","#Upsilon for #rho", 50 ,-1,1); TauSpinEffectsHpm_UpsilonRho->setAxisTitle("#Upsilon");
91 
92  TauSpinEffectsW_UpsilonA1 = i.book1D("TauSpinEffectsWUpsilonA1","#Upsilon for a1", 50 ,-1,1); TauSpinEffectsW_UpsilonA1->setAxisTitle("#Upsilon");
93  TauSpinEffectsHpm_UpsilonA1 = i.book1D("TauSpinEffectsHpmUpsilonA1","#Upsilon for a1", 50 ,-1,1); TauSpinEffectsHpm_UpsilonA1->setAxisTitle("#Upsilon");
94 
95  TauSpinEffectsH_pipiAcoplanarity = i.book1D("TauSpinEffectsH_pipiAcoplanarity","H Acoplanarity for #pi^{-}#pi^{+}", 50 ,0,2*TMath::Pi()); TauSpinEffectsH_pipiAcoplanarity->setAxisTitle("Acoplanarity");
96 
97  TauSpinEffectsH_pipiAcollinearity = i.book1D("TauSpinEffectsH_pipiAcollinearity","H Acollinearity for #pi^{-}#pi^{+}", 50 ,0,TMath::Pi()); TauSpinEffectsH_pipiAcollinearity->setAxisTitle("Acollinearity");
98  TauSpinEffectsH_pipiAcollinearityzoom = i.book1D("TauSpinEffectsH_pipiAcollinearityzoom","H Acollinearity for #pi^{-}#pi^{+}", 50 ,3,TMath::Pi()); TauSpinEffectsH_pipiAcollinearityzoom->setAxisTitle("Acollinearity");
99 
100  TauSpinEffectsZ_MVis = i.book1D("TauSpinEffectsZMVis","Mass of pi+ pi-", 25 ,0,1.1); TauSpinEffectsZ_MVis->setAxisTitle("M_{#pi^{+}#pi^{-}}");
101  TauSpinEffectsH_MVis = i.book1D("TauSpinEffectsHMVis","Mass of pi+ pi-", 25 ,0,1.1); TauSpinEffectsZ_MVis->setAxisTitle("M_{#pi^{+}#pi^{-}}");
102 
103  TauSpinEffectsZ_Zs = i.book1D("TauSpinEffectsZZs","Z_{s}", zsbins ,zsmin,zsmax); TauSpinEffectsZ_Zs->setAxisTitle("Z_{s}");
104  TauSpinEffectsH_Zs = i.book1D("TauSpinEffectsHZs","Z_{s}", zsbins ,zsmin,zsmax); TauSpinEffectsZ_Zs->setAxisTitle("Z_{s}");
105 
106  TauSpinEffectsZ_X= i.book1D("TauSpinEffectsZX","X for pion of #tau^{-}", 25 ,0,1.0); TauSpinEffectsZ_X->setAxisTitle("X");
107  TauSpinEffectsZ_X50to75= i.book1D("TauSpinEffectsZX50to75","X for pion of #tau^{-} (50GeV-75GeV)", 10 ,0,1.0); TauSpinEffectsZ_X->setAxisTitle("X");
108  TauSpinEffectsZ_X75to88= i.book1D("TauSpinEffectsZX75to88","X for pion of #tau^{-} (75GeV-88GeV)", 10 ,0,1.0); TauSpinEffectsZ_X->setAxisTitle("X");
109  TauSpinEffectsZ_X88to100= i.book1D("TauSpinEffectsZX88to100","X for pion of #tau^{-} (88GeV-100GeV)", 10 ,0,1.0); TauSpinEffectsZ_X->setAxisTitle("X");
110  TauSpinEffectsZ_X100to120= i.book1D("TauSpinEffectsZX100to120","X for pion of #tau^{-} (100GeV-120GeV)", 10 ,0,1.0); TauSpinEffectsZ_X->setAxisTitle("X");
111  TauSpinEffectsZ_X120UP= i.book1D("TauSpinEffectsZX120UP","X for pion of #tau^{-} (>120GeV)", 10 ,0,1.0); TauSpinEffectsZ_X->setAxisTitle("X");
112 
113 
114  TauSpinEffectsH_X= i.book1D("TauSpinEffectsH_X","X for pion of #tau^{-}", 25 ,0,1.0); TauSpinEffectsH_X->setAxisTitle("X");
115 
116  TauSpinEffectsZ_Xf = i.book1D("TauSpinEffectsZXf","X for pion of forward emitted #tau^{-}", 25 ,0,1.0); TauSpinEffectsZ_Xf->setAxisTitle("X_{f}");
117  TauSpinEffectsH_Xf = i.book1D("TauSpinEffectsHXf","X for pion of forward emitted #tau^{-}", 25 ,0,1.0); TauSpinEffectsZ_Xf->setAxisTitle("X_{f}");
118 
119  TauSpinEffectsZ_Xb = i.book1D("TauSpinEffectsZXb","X for pion of backward emitted #tau^{-}", 25 ,0,1.0); TauSpinEffectsZ_Xb->setAxisTitle("X_{b}");
120  TauSpinEffectsH_Xb = i.book1D("TauSpinEffectsHXb","X for pion of backward emitted #tau^{-}", 25 ,0,1.0); TauSpinEffectsZ_Xb->setAxisTitle("X_{b}");
121 
122  TauSpinEffectsZ_eX = i.book1D("TauSpinEffectsZeX","X for e", 50 ,0,1); TauSpinEffectsZ_eX->setAxisTitle("X");
123  TauSpinEffectsH_eX = i.book1D("TauSpinEffectsHeX","X for e", 50 ,0,1); TauSpinEffectsH_eX->setAxisTitle("X");
124 
125  TauSpinEffectsZ_muX = i.book1D("TauSpinEffectsZmuX","X for mu", 50 ,0,1); TauSpinEffectsZ_muX->setAxisTitle("X");
126  TauSpinEffectsH_muX = i.book1D("TauSpinEffectsHmuX","X for mu", 50 ,0,1); TauSpinEffectsH_muX->setAxisTitle("X");
127 
128  TauSpinEffectsH_rhorhoAcoplanarityminus = i.book1D("TauSpinEffectsH_rhorhoAcoplanarityminus","#phi^{*-} (acoplanarity) for Higgs #rightarrow #rho-#rho (y_{1}*y_{2}<0)", 32 ,0,2*TMath::Pi()); TauSpinEffectsH_rhorhoAcoplanarityminus->setAxisTitle("#phi^{*-} (Acoplanarity)");
129  TauSpinEffectsH_rhorhoAcoplanarityplus = i.book1D("TauSpinEffectsH_rhorhoAcoplanarityplus","#phi^{*+} (acoplanarity) for Higgs #rightarrow #rho-#rho (y_{1}*y_{2}>0)", 32 ,0,2*TMath::Pi()); TauSpinEffectsH_rhorhoAcoplanarityplus->setAxisTitle("#phi^{*+} (Acoplanarity)");
130 
131  TauFSRPhotonsN=i.book1D("TauFSRPhotonsN","FSR Photons radiating from/with tau (Gauge Boson)", 5 ,-0.5,4.5);
132  TauFSRPhotonsN->setAxisTitle("N FSR Photons radiating from/with tau");
133  TauFSRPhotonsPt=i.book1D("TauFSRPhotonsPt","Pt of FSR Photons radiating from/with tau (Gauge Boson)", 100 ,0,100);
134  TauFSRPhotonsPt->setAxisTitle("P_{t} of FSR Photons radiating from/with tau [per tau]");
135  TauFSRPhotonsPtSum=i.book1D("TauFSRPhotonsPtSum","Pt of FSR Photons radiating from/with tau (Gauge Boson)", 100 ,0,100);
136  TauFSRPhotonsPtSum->setAxisTitle("P_{t} of FSR Photons radiating from/with tau [per tau]");
137 
138  TauBremPhotonsN=i.book1D("TauBremPhotonsN","Brem. Photons radiating in tau decay", 5 ,-0.5,4.5);
139  TauBremPhotonsN->setAxisTitle("N FSR Photons radiating from/with tau");
140  TauBremPhotonsPt=i.book1D("TauBremPhotonsPt","Sum Brem Pt ", 100 ,0,100);
141  TauFSRPhotonsPt->setAxisTitle("P_{t} of Brem. Photons radiating in tau decay");
142  TauBremPhotonsPtSum =i.book1D("TauBremPhotonsPtSum","Sum of Brem Pt ", 100 ,0,100);
143  TauFSRPhotonsPtSum->setAxisTitle("Sum P_{t} of Brem. Photons radiating in tau decay");
144 
145  MODEID =i.book1D("JAKID","JAK ID",NMODEID+1,-0.5,NMODEID+0.5);
146  for(unsigned int j=0; j<NMODEID+1;j++){
147  MODEInvMass.push_back(std::vector<MonitorElement *>());
148  TString tmp="JAKID";
149  tmp+=j;
150  MODEInvMass.at(j).push_back(i.book1D("M"+tmp,"M_{"+tmp+"} (GeV)", 80 ,0,2.0));
155  MODEInvMass.at(j).push_back(i.book1D("M13"+tmp,"M_{13,"+tmp+"} (GeV)", 80 ,0,2.0));
156  MODEInvMass.at(j).push_back(i.book1D("M23"+tmp,"M_{23,"+tmp+"} (GeV)", 80 ,0,2.0));
157  MODEInvMass.at(j).push_back(i.book1D("M12"+tmp,"M_{12,"+tmp+"} (GeV)", 80 ,0,2.0));
158  }
159  }
160  return;
161 }
162 
163 
167  iEvent.getByToken(genparticleCollectionToken_, genParticles );
168 
169  double weight = wmanager_.weight(iEvent);
171  // find taus
172  for (reco::GenParticleCollection::const_iterator iter = genParticles->begin(); iter != genParticles->end(); ++iter) {
173  if(abs(iter->pdgId())==PdtPdgMini::Z0 || abs(iter->pdgId())==PdtPdgMini::Higgs0){
174  spinEffectsZH(&(*iter),weight);
175  }
176  if(abs(iter->pdgId())==15){
177  if(isLastTauinChain(&(*iter))){
178  nTaus->Fill(0.5,weight);
179  int mother = tauMother(&(*iter),weight);
180  if(mother>-1){ // exclude B, D and other non-signal decay modes
181  nPrimeTaus->Fill(0.5,weight);
182  TauPt->Fill(iter->pt(),weight);
183  TauEta->Fill(iter->eta(),weight);
184  TauPhi->Fill(iter->phi(),weight);
185  photons(&(*iter),weight);
187  // Adding MODEID and Mass information
189  unsigned int jak_id, TauBitMask;
190  if(TD.AnalyzeTau(&(*iter),jak_id,TauBitMask,false,false)){
191  MODEID->Fill(jak_id,weight);
192  TauProngs->Fill(TD.nProng(TauBitMask),weight);
193  tauDecayChannel(&(*iter),jak_id,TauBitMask,weight);
194  if(jak_id<=NMODEID){
195  int tcharge=iter->pdgId()/abs(iter->pdgId());
196  std::vector<const reco::GenParticle*> part=TD.Get_TauDecayProducts();
197  spinEffectsWHpm(&(*iter),mother,jak_id,part,weight);
198  TLorentzVector LVQ(0,0,0,0);
199  TLorentzVector LVS12(0,0,0,0);
200  TLorentzVector LVS13(0,0,0,0);
201  TLorentzVector LVS23(0,0,0,0);
202  bool haspart1=false;
203  TVector3 PV,SV;
204  bool hasDL(false);
205  for(unsigned int i=0;i<part.size();i++){
206  if(abs(part.at(i)->pdgId())!=PdtPdgMini::nu_tau && TD.isTauFinalStateParticle(part.at(i)->pdgId()) && !hasDL){
207  hasDL=true;
208  TLorentzVector tlv(iter->px(),iter->py(),iter->pz(),iter->energy());
209  PV=TVector3(iter->vx(),iter->vy(),iter->vz());
210  SV=TVector3(part.at(i)->vx(),part.at(i)->vy(),part.at(i)->vz());
211  TVector3 DL=SV-PV;
212  DecayLength->Fill(DL.Dot(tlv.Vect())/tlv.P(),weight);
213  double c(2.99792458E8),Ltau(DL.Mag()/100)/*cm->m*/,beta(iter->p()/iter->mass());
214  LifeTime->Fill( Ltau/(c*beta),weight);
215  }
216 
217  if(TD.isTauFinalStateParticle(part.at(i)->pdgId()) && abs(part.at(i)->pdgId())!=PdtPdgMini::nu_e &&
218  abs(part.at(i)->pdgId())!=PdtPdgMini::nu_mu && abs(part.at(i)->pdgId())!=PdtPdgMini::nu_tau ){
219  TLorentzVector LV(part.at(i)->px(),part.at(i)->py(),part.at(i)->pz(),part.at(i)->energy());
220  LVQ+=LV;
221  if(jak_id==TauDecay::MODE_3PI || jak_id==TauDecay::MODE_PI2PI0 ||
222  jak_id==TauDecay::MODE_KPIK ||
223  jak_id==TauDecay::MODE_KPIPI
224  ){
225  if((tcharge==part.at(i)->pdgId()/abs(part.at(i)->pdgId()) && TD.nProng(TauBitMask)==3) || ((jak_id==TauDecay::MODE_3PI || jak_id==TauDecay::MODE_PI2PI0) && TD.nProng(TauBitMask)==1 && abs(part.at(i)->pdgId())==PdtPdgMini::pi_plus) ){
226  LVS13+=LV;
227  LVS23+=LV;
228  }
229  else{
230  LVS12+=LV;
231  if(!haspart1 && ((jak_id==TauDecay::MODE_3PI || jak_id==TauDecay::MODE_PI2PI0) || ((jak_id!=TauDecay::MODE_3PI || jak_id==TauDecay::MODE_PI2PI0) && abs(part.at(i)->pdgId())==PdtPdgMini::K_plus) )){
232  LVS13+=LV;
233  haspart1=true;
234  }
235  else{
236  LVS23+=LV;
237  }
238  }
239  }
240  }
241  }
242  part.clear();
243  MODEInvMass.at(jak_id).at(0)->Fill(LVQ.M(),weight);
244  if(jak_id==TauDecay::MODE_3PI || jak_id==TauDecay::MODE_PI2PI0 ||
245  jak_id==TauDecay::MODE_KPIK ||
246  jak_id==TauDecay::MODE_KPIPI
247  ){
248  MODEInvMass.at(jak_id).at(1)->Fill(LVS13.M(),weight);
249  MODEInvMass.at(jak_id).at(2)->Fill(LVS23.M(),weight);
250  MODEInvMass.at(jak_id).at(3)->Fill(LVS12.M(),weight);
251  }
252  }
253  }
254  else{
255  MODEID->Fill(jak_id,weight);
256  }
257  }
258  }
259  }
260  }
261 }//analyze
262 
264  for (unsigned int i=0;i<tau->numberOfMothers();i++) {
265  const reco::GenParticle *mother=static_cast<const reco::GenParticle*>(tau->mother(i));
266  if(mother->pdgId() == tau->pdgId()) return GetMother(mother);
267  return mother;
268  }
269  return tau;
270 }
271 
272 const std::vector<const reco::GenParticle*> TauValidation::GetMothers(const reco::GenParticle* boson){
273  std::vector<const reco::GenParticle*> mothers;
274  for (unsigned int i=0;i<boson->numberOfMothers();i++) {
275  const reco::GenParticle *mother=static_cast<const reco::GenParticle*>(boson->mother(i));
276  if(mother->pdgId() == boson->pdgId()) return GetMothers(mother);
277  mothers.push_back(mother);
278  }
279  return mothers;
280 }
281 
283  return TauValidation::GetMother(tau)->pdgId();
284 }
285 
287  for(unsigned int i = 0; i <tau->numberOfDaughters(); i++){
288  if(tau->daughter(i)->pdgId() == tau->pdgId()) return false;
289  }
290  return true;
291 }
292 
293 void TauValidation::findTauList(const reco::GenParticle* tau,std::vector<const reco::GenParticle*> &TauList){
294  TauList.insert(TauList.begin(),tau);
295  for(unsigned int i=0;i<tau->numberOfMothers();i++) {
296  const reco::GenParticle *mother=static_cast<const reco::GenParticle*>(tau->mother(i));
297  if(mother->pdgId() == tau->pdgId()){
298  findTauList(mother,TauList);
299  }
300  }
301 }
302 
303 void TauValidation::findFSRandBrem(const reco::GenParticle* p, bool doBrem, std::vector<const reco::GenParticle*> &ListofFSR,
304  std::vector<const reco::GenParticle*> &ListofBrem){
305  // note this code split the FSR and Brem based one if the tau decays into a tau+photon or not with the Fortran Tauola Interface, this is not 100% correct because photos puts the tau with the regular tau decay products.
306  if(abs(p->pdgId())==15){
307  if(isLastTauinChain(p)){ doBrem=true;}
308  else{ doBrem=false;}
309  }
310  int photo_ID=22;
311  for(unsigned int i = 0; i <p->numberOfDaughters(); i++){
312  const reco::GenParticle *dau=static_cast<const reco::GenParticle*>(p->daughter(i));
313  if(abs((dau)->pdgId()) == abs(photo_ID) && !doBrem){ListofFSR.push_back(dau);}
314  if(abs((dau)->pdgId()) == abs(photo_ID) && doBrem){ListofBrem.push_back(dau);}
315  if(abs((dau)->pdgId()) != 111 && abs((dau)->pdgId()) != 221){ // remove pi0 and eta decays
316  findFSRandBrem(dau,doBrem,ListofFSR,ListofBrem);
317  }
318  }
319 }
320 
321 void TauValidation::FindPhotosFSR(const reco::GenParticle* p,std::vector<const reco::GenParticle*> &ListofFSR,double &BosonScale){
322  BosonScale=0.0;
323  const reco::GenParticle* m=GetMother(p);
324  int mother_pid=m->pdgId();
325  if(m->pdgId()!=p->pdgId()){
326  for(unsigned int i=0; i <m->numberOfDaughters(); i++){
327  const reco::GenParticle *dau=static_cast<const reco::GenParticle*>(m->daughter(i));
328  if(abs(dau->pdgId()) == 22) {
329  ListofFSR.push_back(dau);
330  }
331  }
332  }
333  if(abs(mother_pid) == 24) BosonScale=1.0; // W
334  if(abs(mother_pid) == 23) BosonScale=2.0; // Z;
335  if(abs(mother_pid) == 22) BosonScale=2.0; // gamma;
336  if(abs(mother_pid) == 25) BosonScale=2.0; // HSM;
337  if(abs(mother_pid) == 35) BosonScale=2.0; // H0;
338  if(abs(mother_pid) == 36) BosonScale=2.0; // A0;
339  if(abs(mother_pid) == 37) BosonScale=1.0; //Hpm;
340 }
341 
343  if(abs(tau->pdgId()) != 15 ) return -3;
344  int mother_pid = findMother(tau);
345  if(mother_pid == -2) return -2;
346  int label = other;
347  if(abs(mother_pid) == 24) label = W;
348  if(abs(mother_pid) == 23) label = Z;
349  if(abs(mother_pid) == 22) label = gamma;
350  if(abs(mother_pid) == 25) label = HSM;
351  if(abs(mother_pid) == 35) label = H0;
352  if(abs(mother_pid) == 36) label = A0;
353  if(abs(mother_pid) == 37) label = Hpm;
354  int mother_shortpid=(abs(mother_pid)%10000);
355  if(mother_shortpid>500 && mother_shortpid<600 )label = B;
356  if(mother_shortpid>400 && mother_shortpid<500)label = D;
357  TauMothers->Fill(label,weight);
358  if(label==B || label == D || label == other) return -1;
359  return mother_pid;
360 }
361 
362 int TauValidation::tauDecayChannel(const reco::GenParticle* tau,int jak_id, unsigned int TauBitMask, double weight){
363  int channel = undetermined;
364  if(tau->status() == 1) channel = stable;
365  int allCount = 0,
366  eCount = 0,
367  muCount = 0,
368  pi0Count = 0,
369  piCount = 0,
370  rhoCount = 0,
371  a1Count = 0,
372  KCount = 0,
373  KstarCount = 0;
374 
375  countParticles(tau,allCount,eCount,muCount,pi0Count,piCount,rhoCount,a1Count,KCount,KstarCount);
376 
377  // resonances
378  if(KCount >= 1) channel = K;
379  if(KstarCount >= 1) channel = Kstar;
380  if(a1Count >= 1) channel = a1;
381  if(rhoCount >= 1) channel = rho;
382  if(channel!=undetermined && weight!=0.0) TauDecayChannels->Fill(channel,weight);
383 
384  // final state products
385  if(piCount == 1 && pi0Count == 0) channel = pi;
386  if(piCount == 1 && pi0Count == 1) channel = pi1pi0;
387  if(piCount == 1 && pi0Count > 1) channel = pinpi0;
388  if(piCount == 3 && pi0Count == 0) channel = tripi;
389  if(piCount == 3 && pi0Count > 0) channel = tripinpi0;
390  if(eCount == 1) channel = electron;
391  if(muCount == 1) channel = muon;
392  if(weight!=0.0) TauDecayChannels->Fill(channel,weight);
393  return channel;
394 }
395 
396 void TauValidation::countParticles(const reco::GenParticle* p,int &allCount, int &eCount, int &muCount,
397  int &pi0Count,int &piCount,int &rhoCount,int &a1Count,int &KCount,int &KstarCount){
398  for(unsigned int i=0; i<p->numberOfDaughters(); i++){
399  const reco::GenParticle *dau=static_cast<const reco::GenParticle*>(p->daughter(i));
400  int pid = dau->pdgId();
401  allCount++;
402  if(abs(pid) == 11) eCount++;
403  if(abs(pid) == 13) muCount++;
404  if(abs(pid) == 111) pi0Count++;
405  if(abs(pid) == 211) piCount++;
406  if(abs(pid) == 213) rhoCount++;
407  if(abs(pid) == 20213) a1Count++;
408  if(abs(pid) == 321) KCount++;
409  if(abs(pid) == 323) KstarCount++;
410  countParticles(dau,allCount,eCount,muCount,pi0Count,piCount,rhoCount,a1Count,KCount,KstarCount);
411  }
412 }
413 
414 
415 
416 void TauValidation::spinEffectsWHpm(const reco::GenParticle* tau,int mother, int decay, std::vector<const reco::GenParticle*> &part,double weight){
417  if(decay == TauDecay::MODE_PION || decay == TauDecay::MODE_MUON || decay == TauDecay::MODE_ELECTRON){ // polarization only for 1-prong hadronic taus with no neutral pions
418  TLorentzVector momP4 = motherP4(tau);
419  TLorentzVector pionP4 = leadingPionP4(tau);
420  pionP4.Boost(-1*momP4.BoostVector());
421  double energy = pionP4.E()/(momP4.M()/2);
422  if(decay == TauDecay::MODE_PION){
423  if(abs(mother) == 24) TauSpinEffectsW_X->Fill(energy,weight);
424  if(abs(mother) == 37) TauSpinEffectsHpm_X->Fill(energy,weight);
425  }
426  if(decay == TauDecay::MODE_MUON){
427  if(abs(mother) == 24) TauSpinEffectsW_muX->Fill(energy,weight);
428  if(abs(mother) == 37) TauSpinEffectsHpm_muX->Fill(energy,weight);
429  }
430  if(decay == TauDecay::MODE_ELECTRON){
431  if(abs(mother) == 24) TauSpinEffectsW_eX->Fill(energy,weight);
432  if(abs(mother) == 37) TauSpinEffectsHpm_eX->Fill(energy,weight);
433  }
434  }
435  else if(decay==TauDecay::MODE_PIPI0){
436  TLorentzVector rho(0,0,0,0),pi(0,0,0,0);
437  for(unsigned int i=0;i<part.size();i++){
438  TLorentzVector LV(part.at(i)->px(),part.at(i)->py(),part.at(i)->pz(),part.at(i)->energy());
439  if(abs(part.at(i)->pdgId())==PdtPdgMini::pi_plus){pi+=LV; rho+=LV;}
440  if(abs(part.at(i)->pdgId())==PdtPdgMini::pi0){rho+=LV;}
441  }
442  if(abs(mother) == 24) TauSpinEffectsW_UpsilonRho->Fill(2*pi.P()/rho.P()-1,weight);
443  if(abs(mother) == 37) TauSpinEffectsHpm_UpsilonRho->Fill(2*pi.P()/rho.P()-1,weight);
444  }
445  else if(decay==TauDecay::MODE_3PI || decay==TauDecay::MODE_PI2PI0){ // only for pi2pi0 for now
446  TLorentzVector a1(0,0,0,0),pi_p(0,0,0,0),pi_m(0,0,0,0);
447  int nplus(0),nminus(0);
448  for(unsigned int i=0;i<part.size();i++){
449  TLorentzVector LV(part.at(i)->px(),part.at(i)->py(),part.at(i)->pz(),part.at(i)->energy());
450  if(part.at(i)->pdgId()==PdtPdgMini::pi_plus){ pi_p+=LV; a1+=LV; nplus++;}
451  if(part.at(i)->pdgId()==PdtPdgMini::pi_minus){pi_m+=LV; a1+=LV; nminus++;}
452  }
453  double gamma=0;
454  if(nplus+nminus==3 && nplus==1) gamma=2*pi_p.P()/a1.P()-1;
455  if(nplus+nminus==3 && nminus==1) gamma=2*pi_m.P()/a1.P()-1;
456  else{
457  pi_p+=pi_m; gamma=2*pi_p.P()/a1.P()-1;
458  }
459  if(abs(mother) == 24) TauSpinEffectsW_UpsilonA1->Fill(gamma,weight);
460  if(abs(mother) == 37) TauSpinEffectsHpm_UpsilonA1->Fill(gamma,weight);
461  }
462 }
463 
465  int ntau(0);
466  for(unsigned int i = 0; i <boson->numberOfDaughters(); i++){
467  const reco::GenParticle *dau=static_cast<const reco::GenParticle*>(boson->daughter(i));
468  if(ntau==1 && dau->pdgId() == 15)return;
469  if(boson->pdgId()!= 15 && abs(dau->pdgId()) == 15)ntau++;
470  }
471  if(ntau!=2) return;
472  if(abs(boson->pdgId())==PdtPdgMini::Z0 || abs(boson->pdgId())==PdtPdgMini::Higgs0){
473  TLorentzVector tautau(0,0,0,0);
474  TLorentzVector pipi(0,0,0,0);
475  TLorentzVector taum(0,0,0,0);
476  TLorentzVector taup(0,0,0,0);
477  TLorentzVector rho_plus,rho_minus,pi_rhominus,pi0_rhominus,pi_rhoplus,pi0_rhoplus,pi_plus,pi_minus;
478  bool hasrho_minus(false),hasrho_plus(false),haspi_minus(false),haspi_plus(false);
479  int nSinglePionDecays(0),nSingleMuonDecays(0),nSingleElectronDecays(0);
480  double x1(0),x2(0);
481  TLorentzVector Zboson(boson->px(),boson->py(),boson->pz(),boson->energy());
482  for(unsigned int i = 0; i <boson->numberOfDaughters(); i++){
483  const reco::GenParticle *dau=static_cast<const reco::GenParticle*>(boson->daughter(i));
484  int pid = dau->pdgId();
485  if(abs(findMother(dau)) != 15 && abs(pid) == 15){
487  unsigned int jak_id, TauBitMask;
488  if(TD.AnalyzeTau(dau,jak_id,TauBitMask,false,false)){
489  std::vector<const reco::GenParticle*> part=TD.Get_TauDecayProducts();
490  if(jak_id==TauDecay::MODE_PION || jak_id==TauDecay::MODE_MUON || jak_id==TauDecay::MODE_ELECTRON){
491  if(jak_id==TauDecay::MODE_PION) nSinglePionDecays++;
492  if(jak_id==TauDecay::MODE_MUON) nSingleMuonDecays++;
493  if(jak_id==TauDecay::MODE_ELECTRON) nSingleElectronDecays++;
494  TLorentzVector LVtau(dau->px(),dau->py(),dau->pz(),dau->energy());
495  tautau += LVtau;
496  TLorentzVector LVpi=leadingPionP4(dau);
497  pipi+=LVpi;
498  const HepPDT::ParticleData* pd = fPDGTable->particle(dau->pdgId ());
499  int charge = (int) pd->charge();
500  LVtau.Boost(-1*Zboson.BoostVector());
501  LVpi.Boost(-1*Zboson.BoostVector());
502 
503 
504 
505  if(jak_id==TauDecay::MODE_MUON){
506  if(abs(boson->pdgId())==PdtPdgMini::Z0) TauSpinEffectsZ_muX->Fill(LVpi.P()/LVtau.E(),weight);
507  if(abs(boson->pdgId())==PdtPdgMini::Higgs0) TauSpinEffectsH_muX->Fill(LVpi.P()/LVtau.E(),weight);
508 
509  }
510  if(jak_id==TauDecay::MODE_ELECTRON){
511  if(abs(boson->pdgId())==PdtPdgMini::Z0) TauSpinEffectsZ_eX->Fill(LVpi.P()/LVtau.E(),weight);
512  if(abs(boson->pdgId())==PdtPdgMini::Higgs0) TauSpinEffectsH_eX->Fill(LVpi.P()/LVtau.E(),weight);
513  }
514 
515 
516  if(jak_id==TauDecay::MODE_PION){
517  if(abs(boson->pdgId())==PdtPdgMini::Z0){
518  TauSpinEffectsZ_X->Fill(LVpi.P()/LVtau.E(),weight);
519  if(50.0<Zboson.M() && Zboson.M()<75.0) TauSpinEffectsZ_X50to75->Fill(LVpi.P()/LVtau.E(),weight);
520  if(75.0<Zboson.M() && Zboson.M()<88.0) TauSpinEffectsZ_X75to88->Fill(LVpi.P()/LVtau.E(),weight);
521  if(88.0<Zboson.M() && Zboson.M()<100.0) TauSpinEffectsZ_X88to100->Fill(LVpi.P()/LVtau.E(),weight);
522  if(100.0<Zboson.M() && Zboson.M()<120.0) TauSpinEffectsZ_X100to120->Fill(LVpi.P()/LVtau.E(),weight);
523  if(120.0<Zboson.M()) TauSpinEffectsZ_X120UP->Fill(LVpi.P()/LVtau.E(),weight);
524  }
525  if(abs(boson->pdgId())==PdtPdgMini::Higgs0) TauSpinEffectsH_X->Fill(LVpi.P()/LVtau.E(),weight);
526  }
527  if(charge<0){x1=LVpi.P()/LVtau.E(); taum=LVtau;}
528  else{ x2=LVpi.P()/LVtau.E();}
529  }
530  TLorentzVector LVtau(dau->px(),dau->py(),dau->pz(),dau->energy());
531  if(pid == 15)taum=LVtau;
532  if(pid ==-15)taup=LVtau;
533  if(jak_id==TauDecay::MODE_PIPI0){
534  for(unsigned int i=0; i<part.size();i++){
535  int pid_d = part.at(i)->pdgId();
536  if(abs(pid_d)==211 || abs(pid_d)==111){
537  TLorentzVector LV(part.at(i)->px(),part.at(i)->py(),part.at(i)->pz(),part.at(i)->energy());
538  if(pid==15){
539  hasrho_minus=true;
540  if(pid_d==-211 ){ pi_rhominus=LV;}
541  if(abs(pid_d)==111 ){ pi0_rhominus=LV;}
542  }
543  if(pid==-15){
544  hasrho_plus=true;
545  if(pid_d==211 ){pi_rhoplus=LV;}
546  if(abs(pid_d)==111 ){pi0_rhoplus=LV;}
547  }
548  }
549  }
550  }
551  if(jak_id==TauDecay::MODE_PION){
552  for(unsigned int i=0; i<part.size();i++){
553  int pid_d = part.at(i)->pdgId();
554  if(abs(pid_d)==211 ){
555  TLorentzVector LV(part.at(i)->px(),part.at(i)->py(),part.at(i)->pz(),part.at(i)->energy());
556  if(pid==15){
557  haspi_minus=true;
558  if(pid_d==-211 ){ pi_minus=LV;}
559  }
560  if(pid==-15){
561  haspi_plus=true;
562  if(pid_d==211 ){pi_plus=LV;}
563  }
564  }
565  }
566  }
567  }
568  }
569  }
570  if(hasrho_minus && hasrho_plus){
571  //compute rhorho
572  rho_minus=pi_rhominus;
573  rho_minus+=pi0_rhominus;
574  rho_plus=pi_rhoplus;
575  rho_plus+=pi0_rhoplus;
576  TLorentzVector rhorho=rho_minus;rhorho+=rho_plus;
577 
578  // boost to rhorho cm
579  TLorentzVector pi_rhoplusb=pi_rhoplus; pi_rhoplusb.Boost(-1*rhorho.BoostVector());
580  TLorentzVector pi0_rhoplusb=pi0_rhoplus; pi0_rhoplusb.Boost(-1*rhorho.BoostVector());
581  TLorentzVector pi_rhominusb=pi_rhominus; pi_rhominusb.Boost(-1*rhorho.BoostVector());
582  TLorentzVector pi0_rhominusb=pi0_rhominus; pi0_rhominusb.Boost(-1*rhorho.BoostVector());
583 
584  // compute n+/-
585  TVector3 n_plus=pi_rhoplusb.Vect().Cross(pi0_rhoplusb.Vect());
586  TVector3 n_minus=pi_rhominusb.Vect().Cross(pi0_rhominusb.Vect());
587 
588  // compute the acoplanarity
589  double Acoplanarity=acos(n_plus.Dot(n_minus)/(n_plus.Mag()*n_minus.Mag()));
590  if(pi_rhominusb.Vect().Dot(n_plus)>0){Acoplanarity*=-1;Acoplanarity+=2*TMath::Pi();}
591 
592  // now boost to tau frame
593  pi_rhoplus.Boost(-1*taup.BoostVector());
594  pi0_rhoplus.Boost(-1*taup.BoostVector());
595  pi_rhominus.Boost(-1*taum.BoostVector());
596  pi0_rhominus.Boost(-1*taum.BoostVector());
597 
598  // compute y1 and y2
599  double y1=(pi_rhoplus.E()-pi0_rhoplus.E())/(pi_rhoplus.E()+pi0_rhoplus.E());
600  double y2=(pi_rhominus.E()-pi0_rhominus.E())/(pi_rhominus.E()+pi0_rhominus.E());
601 
602  // fill histograms
603  if(abs(boson->pdgId())==PdtPdgMini::Higgs0 && y1*y2<0) TauSpinEffectsH_rhorhoAcoplanarityminus->Fill(Acoplanarity,weight);
604  if(abs(boson->pdgId())==PdtPdgMini::Higgs0 && y1*y2>0) TauSpinEffectsH_rhorhoAcoplanarityplus->Fill(Acoplanarity,weight);
605  }
606  if(haspi_minus && haspi_plus){
607  TLorentzVector tauporig=taup;
608  TLorentzVector taumorig=taum;
609 
610  // now boost to Higgs frame
611  pi_plus.Boost(-1*Zboson.BoostVector());
612  pi_minus.Boost(-1*Zboson.BoostVector());
613 
614  taup.Boost(-1*Zboson.BoostVector());
615  taum.Boost(-1*Zboson.BoostVector());
616 
617  if(abs(boson->pdgId())==PdtPdgMini::Higgs0){
618  TauSpinEffectsH_pipiAcollinearity->Fill(acos(pi_plus.Vect().Dot(pi_minus.Vect())/(pi_plus.P()*pi_minus.P())));
619  TauSpinEffectsH_pipiAcollinearityzoom->Fill(acos(pi_plus.Vect().Dot(pi_minus.Vect())/(pi_plus.P()*pi_minus.P())));
620  }
621 
622  double proj_m=taum.Vect().Dot(pi_minus.Vect())/(taum.P()*taum.P());
623  double proj_p=taup.Vect().Dot(pi_plus.Vect())/(taup.P()*taup.P());
624  TVector3 Tau_m=taum.Vect();
625  TVector3 Tau_p=taup.Vect();
626  Tau_m*=proj_m;
627  Tau_p*=proj_p;
628  TVector3 Pit_m=pi_minus.Vect()-Tau_m;
629  TVector3 Pit_p=pi_plus.Vect()-Tau_p;
630 
631  double Acoplanarity=acos(Pit_m.Dot(Pit_p)/(Pit_p.Mag()*Pit_m.Mag()));
632  TVector3 n=Pit_p.Cross(Pit_m);
633  if(n.Dot(Tau_m)/Tau_m.Mag()>0){Acoplanarity*=-1; Acoplanarity+=2*TMath::Pi();}
634  // fill histograms
635  if(abs(boson->pdgId())==PdtPdgMini::Higgs0) TauSpinEffectsH_pipiAcoplanarity->Fill(Acoplanarity,weight);
636  taup=tauporig;
637  taum=taumorig;
638  }
639  if(nSinglePionDecays == 2 && tautau.M()!= 0) {
640  for(int i=0;i<zsbins;i++){
641  double zslow=((double)i)*(zsmax-zsmin)/((double)zsbins)+zsmin;
642  double zsup=((double)i+1)*(zsmax-zsmin)/((double)zsbins)+zsmin;
643  double aup=Zstoa(zsup), alow=Zstoa(zslow);
644  if(x2-x1>alow && x2-x1<aup){
645  double zs=(zsup+zslow)/2;
646  if(abs(boson->pdgId())==PdtPdgMini::Z0) TauSpinEffectsZ_Zs->Fill(zs,weight);
647  if(abs(boson->pdgId())==PdtPdgMini::Higgs0) TauSpinEffectsH_Zs->Fill(zs,weight);
648  break;
649  }
650  }
651  if(abs(boson->pdgId())==PdtPdgMini::Z0) TauSpinEffectsZ_MVis->Fill(pipi.M()/tautau.M(),weight);
652  if(abs(boson->pdgId())==PdtPdgMini::Higgs0) TauSpinEffectsH_MVis->Fill(pipi.M()/tautau.M(),weight);
653 
654  if(x1!=0){
655  const std::vector<const reco::GenParticle*> m=GetMothers(boson);
656  int q(0),qbar(0);
657  TLorentzVector Z(0,0,0,0);
658  for(unsigned int i=0;i<m.size();i++){
659  if(m.at(i)->pdgId()==PdtPdgMini::d || m.at(i)->pdgId()==PdtPdgMini::u ){q++;}
660  if(m.at(i)->pdgId()==PdtPdgMini::anti_d || m.at(i)->pdgId()==PdtPdgMini::anti_u ){qbar++;}
661  }
662  if(q==1 && qbar==1){// assume q has largest E (valence vs see quarks)
663  if(taum.Vect().Dot(Zboson.Vect())/(Zboson.P()*taum.P())>0){
664  if(abs(boson->pdgId())==PdtPdgMini::Z0) TauSpinEffectsZ_Xf->Fill(x1,weight);
665  if(abs(boson->pdgId())==PdtPdgMini::Higgs0) TauSpinEffectsH_Xf->Fill(x1,weight);
666  }
667  else{
668  if(abs(boson->pdgId())==PdtPdgMini::Z0) TauSpinEffectsZ_Xb->Fill(x1,weight);
669  if(abs(boson->pdgId())==PdtPdgMini::Higgs0) TauSpinEffectsH_Xb->Fill(x1,weight);
670  }
671  }
672  }
673  }
674  }
675 }
676 
677 double TauValidation::Zstoa(double zs){
678  double a=1-sqrt(fabs(1.0-2*fabs(zs)));
679  if(zs<0){
680  a*=-1.0;
681  }
682  return a;
683 }
684 
685 
687  return leadingPionP4(tau).P();
688 }
689 
691  TLorentzVector p4(0,0,0,0);
692  for(unsigned int i = 0; i <tau->numberOfDaughters(); i++){
693  const reco::GenParticle *dau=static_cast<const reco::GenParticle*>(tau->daughter(i));
694  int pid = dau->pdgId();
695  if(abs(pid) == 15) return leadingPionP4(dau);
696  if(!(abs(pid)==211 || abs(pid)==13 || abs(pid)==11)) continue;
697  if(dau->p() > p4.P()) p4 = TLorentzVector(dau->px(),dau->py(),dau->pz(),dau->energy());
698  }
699  return p4;
700 }
701 
703  const reco::GenParticle* m=GetMother(tau);
704  return TLorentzVector(m->px(),m->py(),m->pz(),m->energy());
705 }
706 
708  TLorentzVector p4(tau->px(),tau->py(),tau->pz(),tau->energy());
709  for(unsigned int i = 0; i <tau->numberOfDaughters(); i++){
710  const reco::GenParticle *dau=static_cast<const reco::GenParticle*>(tau->daughter(i));
711  int pid = dau->pdgId();
712  if(abs(pid) == 15) return visibleTauEnergy(dau);
713  if(abs(pid) == 12 || abs(pid) == 14 || abs(pid) == 16) {
714  p4-=TLorentzVector(dau->px(),dau->py(),dau->pz(),dau->energy());
715  }
716  }
717  return p4.E();
718 }
719 
721  // Find First tau in chain
722  std::vector<const reco::GenParticle*> TauList;
723  findTauList(tau,TauList);
724 
725  // Get List of Gauge Boson to tau(s) FSR and Brem
726  bool passedW=false;
727  std::vector<const reco::GenParticle*> ListofFSR; ListofFSR.clear();
728  std::vector<const reco::GenParticle*> ListofBrem; ListofBrem.clear();
729  std::vector<const reco::GenParticle*> FSR_photos; FSR_photos.clear();
730  double BosonScale(1);
731  if(TauList.size()>0){
732  TauValidation::findFSRandBrem(TauList.at(0),passedW,ListofFSR,ListofBrem);
733  TauValidation::FindPhotosFSR(TauList.at(0),FSR_photos,BosonScale);
734 
735  // Add the Tau Brem. information
736  TauBremPhotonsN->Fill(ListofBrem.size(),weight);
737  double photonPtSum=0;
738  for(unsigned int i=0;i<ListofBrem.size();i++){
739  photonPtSum+=ListofBrem.at(i)->pt();
740  TauBremPhotonsPt->Fill(ListofBrem.at(i)->pt(),weight);
741  }
742  TauBremPhotonsPtSum->Fill(photonPtSum,weight);
743 
744  // Now add the Gauge Boson FSR information
745  if(BosonScale!=0){
746  TauFSRPhotonsN->Fill(ListofFSR.size(),weight);
747  photonPtSum=0;
748  for(unsigned int i=0;i<ListofFSR.size();i++){
749  photonPtSum+=ListofFSR.at(i)->pt();
750  TauFSRPhotonsPt->Fill(ListofFSR.at(i)->pt(),weight);
751  }
752  double FSR_photosSum(0);
753  for(unsigned int i=0;i<FSR_photos.size();i++){
754  FSR_photosSum+=FSR_photos.at(i)->pt();
755  TauFSRPhotonsPt->Fill(FSR_photos.at(i)->pt()/BosonScale,weight*BosonScale);
756  }
757  TauFSRPhotonsPtSum->Fill(photonPtSum+FSR_photosSum/BosonScale,weight);
758  }
759  }
760 }
761 
MonitorElement * TauFSRPhotonsN
Definition: TauValidation.h:95
const double beta
const double Pi
int i
Definition: DBlmapReader.cc:9
virtual int pdgId() const
PDG identifier.
virtual double p() const
magnitude of momentum vector
int findMother(const reco::GenParticle *)
virtual ~TauValidation()
MonitorElement * TauSpinEffectsH_rhorhoAcoplanarityplus
Definition: TauValidation.h:95
MonitorElement * TauPhi
Definition: TauValidation.h:95
MonitorElement * TauSpinEffectsW_X
Definition: TauValidation.h:95
MonitorElement * TauSpinEffectsHpm_UpsilonA1
Definition: TauValidation.h:95
MonitorElement * MODEID
MonitorElement * TauSpinEffectsZ_Xb
Definition: TauValidation.h:95
MonitorElement * nTaus
Definition: TauValidation.h:94
WeightManager wmanager_
Definition: TauValidation.h:64
MonitorElement * DecayLength
Definition: TauValidation.h:95
std::vector< std::vector< MonitorElement * > > MODEInvMass
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:446
virtual int status() const
status word
TauValidation(const edm::ParameterSet &)
MonitorElement * TauPt
Definition: TauValidation.h:95
MonitorElement * TauSpinEffectsH_MVis
Definition: TauValidation.h:95
MonitorElement * TauMothers
Definition: TauValidation.h:95
MonitorElement * TauSpinEffectsHpm_eX
Definition: TauValidation.h:95
MonitorElement * TauSpinEffectsZ_X100to120
Definition: TauValidation.h:95
void FindPhotosFSR(const reco::GenParticle *p, std::vector< const reco::GenParticle * > &ListofFSR, double &BosonScale)
MonitorElement * TauSpinEffectsW_muX
Definition: TauValidation.h:95
MonitorElement * TauBremPhotonsN
Definition: TauValidation.h:95
void spinEffectsWHpm(const reco::GenParticle *, int, int, std::vector< const reco::GenParticle * > &part, double weight)
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)
MonitorElement * TauSpinEffectsZ_Xf
Definition: TauValidation.h:95
bool isLastTauinChain(const reco::GenParticle *tau)
edm::EDGetTokenT< edm::HepMCProduct > hepmcCollectionToken_
MonitorElement * TauBremPhotonsPtSum
Definition: TauValidation.h:95
MonitorElement * TauSpinEffectsH_pipiAcoplanarity
Definition: TauValidation.h:95
MonitorElement * TauSpinEffectsHpm_UpsilonRho
Definition: TauValidation.h:95
double leadingPionMomentum(const reco::GenParticle *, double weight)
void getData(T &iHolder) const
Definition: EventSetup.h:78
MonitorElement * TauSpinEffectsZ_eX
Definition: TauValidation.h:95
void Fill(long long x)
MonitorElement * TauProngs
Definition: TauValidation.h:95
TLorentzVector motherP4(const reco::GenParticle *)
bool isTauFinalStateParticle(int pdgid)
Definition: TauDecay.cc:36
virtual void dqmBeginRun(const edm::Run &r, const edm::EventSetup &c) override
MonitorElement * TauSpinEffectsH_pipiAcollinearityzoom
Definition: TauValidation.h:95
math::XYZTLorentzVectorD LV
void photons(const reco::GenParticle *, double weight)
virtual double energy() const
energy
int iEvent
Definition: GenABIO.cc:230
MonitorElement * TauSpinEffectsW_UpsilonRho
Definition: TauValidation.h:95
const reco::GenParticle * GetMother(const reco::GenParticle *tau)
MonitorElement * TauSpinEffectsZ_X88to100
Definition: TauValidation.h:95
MonitorElement * TauSpinEffectsH_rhorhoAcoplanarityminus
Definition: TauValidation.h:95
virtual void analyze(edm::Event const &, edm::EventSetup const &) override
virtual size_t numberOfMothers() const
number of mothers
MonitorElement * TauSpinEffectsZ_X50to75
Definition: TauValidation.h:95
T sqrt(T t)
Definition: SSEVec.h:48
double p4[4]
Definition: TauolaWrapper.h:92
virtual size_t numberOfDaughters() const
number of daughters
virtual const Candidate * daughter(size_type) const
return daughter at a given position, i = 0, ... numberOfDaughters() - 1 (read only mode) ...
MonitorElement * TauSpinEffectsH_Xf
Definition: TauValidation.h:95
MonitorElement * book1D(Args &&...args)
Definition: DQMStore.h:115
MonitorElement * TauFSRPhotonsPt
Definition: TauValidation.h:95
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
int j
Definition: DBlmapReader.cc:9
MonitorElement * TauSpinEffectsZ_muX
Definition: TauValidation.h:95
MonitorElement * TauDecayChannels
Definition: TauValidation.h:95
edm::InputTag hepmcCollection_
Definition: TauValidation.h:89
MonitorElement * TauSpinEffectsH_Zs
Definition: TauValidation.h:95
unsigned int NMODEID
MonitorElement * TauFSRPhotonsPtSum
Definition: TauValidation.h:95
HepPDT::ParticleData ParticleData
int tauMother(const reco::GenParticle *, double weight)
virtual void bookHistograms(DQMStore::IBooker &i, edm::Run const &, edm::EventSetup const &) override
std::vector< const reco::GenParticle * > Get_TauDecayProducts()
const std::vector< const reco::GenParticle * > GetMothers(const reco::GenParticle *boson)
MonitorElement * TauSpinEffectsZ_MVis
Definition: TauValidation.h:95
virtual int pdgId() const =0
PDG identifier.
MonitorElement * TauSpinEffectsZ_X75to88
Definition: TauValidation.h:95
double visibleTauEnergy(const reco::GenParticle *)
static std::string DecayMode(unsigned int &MODE_ID)
Definition: TauDecay.cc:258
int tauDecayChannel(const reco::GenParticle *tau, int jak_id, unsigned int TauBitMask, double weight)
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:274
MonitorElement * TauSpinEffectsH_pipiAcollinearity
Definition: TauValidation.h:95
virtual double px() const
x coordinate of momentum vector
part
Definition: HCALResponse.h:20
tuple pid
Definition: sysUtil.py:22
MonitorElement * TauSpinEffectsZ_X
Definition: TauValidation.h:95
edm::ESHandle< HepPDT::ParticleDataTable > fPDGTable
PDT table.
Definition: TauValidation.h:92
virtual double pz() const
z coordinate of momentum vector
MonitorElement * TauSpinEffectsH_eX
Definition: TauValidation.h:95
MonitorElement * TauSpinEffectsW_eX
Definition: TauValidation.h:95
std::vector< std::vector< double > > tmp
Definition: MVATrainer.cc:100
edm::EDGetTokenT< reco::GenParticleCollection > genparticleCollectionToken_
double Zstoa(double zs)
void findTauList(const reco::GenParticle *tau, std::vector< const reco::GenParticle * > &TauList)
void findFSRandBrem(const reco::GenParticle *p, bool doBrem, std::vector< const reco::GenParticle * > &ListofFSR, std::vector< const reco::GenParticle * > &ListofBrem)
MonitorElement * LifeTime
Definition: TauValidation.h:95
MonitorElement * TauSpinEffectsH_muX
Definition: TauValidation.h:95
MonitorElement * TauSpinEffectsW_UpsilonA1
Definition: TauValidation.h:95
double a
Definition: hdecay.h:121
void countParticles(const reco::GenParticle *p, int &allCount, int &eCount, int &muCount, int &pi0Count, int &piCount, int &rhoCount, int &a1Count, int &KCount, int &KstarCount)
MonitorElement * TauEta
Definition: TauValidation.h:95
edm::InputTag genparticleCollection_
Definition: TauValidation.h:88
MonitorElement * TauSpinEffectsZ_Zs
Definition: TauValidation.h:95
MonitorElement * TauSpinEffectsHpm_X
Definition: TauValidation.h:95
int weight
Definition: histoStyle.py:50
MonitorElement * TauSpinEffectsHpm_muX
Definition: TauValidation.h:95
double weight(const edm::Event &)
bool AnalyzeTau(const reco::GenParticle *Tau, unsigned int &MODE_ID, unsigned int &TauBitMask, bool dores, bool dopi0)
MonitorElement * TauSpinEffectsZ_X120UP
Definition: TauValidation.h:95
void setAxisTitle(const std::string &title, int axis=1)
set x-, y- or z-axis title (axis=1, 2, 3 respectively)
MonitorElement * TauSpinEffectsH_Xb
Definition: TauValidation.h:95
virtual const Candidate * mother(size_type=0) const
return mother at a given position, i = 0, ... numberOfMothers() - 1 (read only mode) ...
MonitorElement * nPrimeTaus
Definition: TauValidation.h:94
MonitorElement * TauBremPhotonsPt
Definition: TauValidation.h:95
virtual double py() const
y coordinate of momentum vector
void spinEffectsZH(const reco::GenParticle *boson, double weight)
Definition: Run.h:41
unsigned int nProng(unsigned int &TauBitMask)
Definition: TauDecay.cc:218
MonitorElement * TauSpinEffectsH_X
Definition: TauValidation.h:95
TLorentzVector leadingPionP4(const reco::GenParticle *)