00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015 inline void MyParticleJet::init(const TLorentzVector & p,
00016 const int & rec_flag,
00017 const int & index,
00018 const double & tag_weight,
00019 const int & truthflavour,
00020 const bool & truthjet_flag,
00021 const int & nb_tracks,
00022 const std::vector <double> tracks_charge,
00023 const std::vector<TLorentzVector> tracks_tlv,
00024 const std::vector<int> tracks_vertex_index) {
00025
00026 m_tlv = p;
00027 m_rec_flag = rec_flag;
00028 m_index = index;
00029 m_b_tag_weight = tag_weight;
00030 m_truthflavour = truthflavour;
00031 m_matchingflag = 0;
00032 m_nb_tracks = nb_tracks;
00033
00034 for (unsigned int i=0;i<tracks_charge.size();i++) {
00035 m_tracks_charge.push_back(tracks_charge[i]);
00036 m_tracks_tlv.push_back(tracks_tlv[i]);
00037 m_tracks_vertex_index.push_back(tracks_vertex_index[i]);
00038 }
00039
00040 if(truthjet_flag){
00041 m_type = "truthparticle_jet";
00042 }
00043 else{
00044 m_type = "particle_jet";
00045 }
00046
00047 m_charge = 0;
00048 m_pdgId = 0;
00049
00050 return;
00051
00052 }
00053
00054
00055
00056
00057
00058
00059
00060 inline int MyParticleJet::reconstruction_flag(void) const {
00061
00062 return m_rec_flag;
00063
00064 }
00065
00066
00067
00068
00069
00070
00071
00072 inline double MyParticleJet::b_tag_weight(void) const {
00073
00074 return m_b_tag_weight;
00075
00076 }
00077
00078
00079
00080
00081
00082
00083
00084 inline int MyParticleJet::truth_flavour(void) const{
00085
00086 return m_truthflavour;
00087
00088 }
00089
00090
00091
00092
00093
00094
00095 inline void MyParticleJet::set_reconstruction_flag(const int & flag) {
00096
00097 m_rec_flag = flag;
00098 return;
00099
00100 }
00101
00102
00103
00104
00105
00106
00107
00108 inline void MyParticleJet::set_b_tag_weight(const double & weight) {
00109
00110 m_b_tag_weight = weight;
00111 return;
00112
00113 }
00114
00115
00116
00117
00118
00119
00120
00121 inline void MyParticleJet::PrintParticle(std::string option) {
00122
00123 return;
00124 }
00125
00126
00127
00128
00129
00130
00131
00132 inline int MyParticleJet::nb_tracks(void) const {
00133
00134 return m_nb_tracks;
00135
00136 }
00137
00138
00139
00140
00141
00142
00143
00144 inline double MyParticleJet::tracks_charge(int itrack) const {
00145
00146 if ( itrack>-1 && itrack<m_nb_tracks ){
00147 return m_tracks_charge[itrack];
00148 }else{
00149 std::cerr<< " tracks_charge - WARNING: track not belonging to Jet\n";
00150 return -999;
00151 }
00152 }
00153
00154
00155
00156
00157
00158
00159
00160
00161 inline TLorentzVector MyParticleJet::tracks_tlv(int itrack) const {
00162
00163 TLorentzVector tmptlv;
00164 if ( itrack>-1 && itrack<m_nb_tracks ){
00165 return m_tracks_tlv[itrack];
00166 }else{
00167 std::cerr<< " tracks_tlv - WARNING: track not belonging to Jet\n";
00168 return tmptlv;
00169 }
00170
00171 }
00172
00173
00174
00175
00176
00177
00178
00179 inline int MyParticleJet::tracks_vertex_index(int itrack) const {
00180
00181 if ( itrack>-1 && itrack<m_nb_tracks ){
00182 return m_tracks_vertex_index[itrack];
00183 }else{
00184 std::cerr<< " tracks_E - WARNING: track not belonging to Jet\n";
00185 return -999;
00186 }
00187
00188 }
00189
00190
00191
00192
00193
00194
00195
00196 inline double MyParticleJet::tracks_ptratio(int vertex_index) const {
00197
00198 double ptsum_vertex = 0.;
00199 double ptsum_all = 0.;
00200
00201 for (int k=0; k<m_nb_tracks; k++) {
00202
00203 ptsum_all += m_tracks_tlv[k].Pt();
00204
00205 if(m_tracks_vertex_index[k]<0){
00206 continue;
00207 }
00208
00209 if(vertex_index<0){
00210 continue;
00211 }
00212
00213 if(m_tracks_vertex_index[k] == vertex_index){
00214 ptsum_vertex += m_tracks_tlv[k].Pt();
00215 }
00216 }
00217
00218
00219 double ptratio = 1.;
00220
00221 if(ptsum_all>0.){
00222 ptratio = ptsum_vertex/ptsum_all;
00223 }
00224
00225 return ptratio;
00226 }
00227
00228
00229
00230
00231
00232
00233
00234 inline double MyParticleJet::tracks_cmsptratio(int vertex_index) const {
00235
00236 double ptsum_vertex = 0.;
00237
00238
00239 for (int k=0; k<m_nb_tracks; k++) {
00240
00241
00242
00243 if(m_tracks_vertex_index[k]<0){
00244 continue;
00245 }
00246
00247 if(vertex_index<0){
00248 continue;
00249 }
00250
00251 if(m_tracks_vertex_index[k] == vertex_index){
00252 ptsum_vertex += m_tracks_tlv[k].Pt();
00253 }
00254 }
00255
00256
00257 double cmsptratio = 1.;
00258
00259 if(this->tlv().Pt()>0.){
00260 cmsptratio = ptsum_vertex/this->tlv().Pt();
00261 }
00262
00263 return cmsptratio;
00264 }
00265
00266
00267
00268
00269
00270
00271
00272
00273
00274 inline double MyParticleJet::pt_pucorr(int vertex_index) const {
00275
00276 double pt = this->tlv().Pt();
00277 double ptratio = this->tracks_ptratio(vertex_index);
00278
00279 double pt_corr = pt*ptratio;
00280
00281 return pt_corr;
00282 }