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