ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/mschen/SusyAnalysis/code/mcParticle.cc
Revision: 1.1
Committed: Mon Mar 28 09:23:54 2011 UTC (14 years, 1 month ago) by mschen
Content type: text/plain
Branch: MAIN
CVS Tags: V2010_data_analysis_effModelInPaper, V2010_data_analysis, HEAD
Log Message:
2010 same sign analysis codeing

File Contents

# User Rev Content
1 mschen 1.1 #include "mcParticle.h"
2     #include <iostream>
3    
4     using std::cout;
5     using std::endl;
6    
7     int defineMuonParentClass(int parentPDG, int status){
8     int parentClass_ = -1;
9     if(status==1) parentClass_= defineParentClass(parentPDG); // pythia level, gen level 0, 1, 2, 3, 4
10     if(status==8) parentClass_ = 5; // decay in flight, (pion or kaon ....)
11     return parentClass_;
12     }
13    
14     int defineParentClass(int parentPDG){
15     // for pythia level leptons, they must have parents .....
16    
17     // check the PDG ID table
18     parentPDG = abs(parentPDG);
19    
20     int parentClass_ = -1;
21    
22     // ==== SUSY and TECHNICOLOR PARTICLES 1000001~3999999
23     // id<80 --> quark, leptons, bosons
24     // 2212 -> p
25     if (parentPDG < 80 || parentPDG==2212 || (parentPDG>=1000001 && parentPDG<3999999))
26     parentClass_ = 0; // prompt
27    
28     if (parentPDG>=80 && parentPDG!=2212 && !(parentPDG>=1000001 && parentPDG<3999999))
29     parentClass_ = 1; // non-prompt
30    
31     if ((parentPDG>=80 && parentPDG<400)
32     || (parentPDG>=1000 && parentPDG<4000 && parentPDG!=2212))
33     parentClass_ = 2; // light flavor decay, uds
34    
35     if ((parentPDG>=400 && parentPDG<500)
36     || (parentPDG>=4000 && parentPDG<5000)
37     || parentPDG==84)
38     parentClass_ = 3; // c decay
39    
40    
41     if ((parentPDG>=500 && parentPDG<600)
42     || (parentPDG>=5000 && parentPDG<6000)
43     || parentPDG==85)
44     parentClass_ = 4; // b decay
45    
46     if (parentClass_==1){
47     // cout << "WARNING: parentClass_==1... still... assigning 2...\t" << "parentPDG: " << parentPDG << endl;
48     parentClass_ = 2;
49     }
50    
51     if (parentClass_<0){
52     // cout << "WARNING: parentClass_<0... still... assigning 0...\t" << "parentPDG: " << parentPDG << endl;
53     parentClass_ = 0;
54     }
55    
56     return parentClass_;
57    
58     }
59     // FIXME print out how many mothers/daugthers it has
60     void mcParticle::printMC(){
61     cout<<"\t mc: id "<<id()
62     <<" status "<<status()
63     <<" charge "<<q()
64     <<" pt "<<pt()
65     <<" eta "<<eta()
66     <<" phi "<<phi()
67     <<" p "<<p()
68     <<" parentPDG "<<getParentPDG()
69     <<" parentIndex "<<getParentIndex()
70     <<endl;
71     }
72     void mcParticle::printMC(ofstream &fout){
73     fout<<"\t mc: id "<<id()
74     <<" status "<<status()
75     <<" charge "<<q()
76     <<" pt "<<pt()
77     <<" eta "<<eta()
78     <<" phi "<<phi()
79     <<" p "<<p()
80     <<" parentPDG "<<getParentPDG()
81     <<" parentIndex "<<getParentIndex()
82     <<endl;
83     }