what is the value that Particle_Mother1 return?

Asked by Huanian Zhang

Hello,

Right now I am trying to identity B_jet from Higgs. So first I need to choose B_jets, then to check whether the B_jet comes from Higgs or not. Here is my code:

   std::vector<double> B_Jet_PT;
   std::vector<double> B_Jet_Eta;
   std::vector<double> B_Jet_Phi;
   std::vector<double> B_Jet_Mass;

   for(int i = 0; i < Particle_size; i++){

      if (abs(Particle_PID[i]) == 5) {

         //std::cout << Particle_PT[i] << std::endl;
         B_Jet_PT.push_back(Particle_PT[i]);
         B_Jet_Eta.push_back(Particle_Eta[i]);
         B_Jet_Phi.push_back(Particle_Phi[i]);
         B_Jet_Mass.push_back(Particle_M[i]);
      }
   }

         std::vector<double> B_Higgs_PT;
         std::vector<double> B_Higgs_Eta;
         std::vector<double> B_Higgs_Phi;
         std::vector<double> B_Higgs_Mass;

         for(int i = 0; i < B_Jet_PT.size(); i++){

            int a = Particle_Mother1[i];
            std::cout << a << std::endl;
            std::cout << Particle_PID[a] << std::endl;

         if (Particle_PID[a] == 25) {

               B_Higgs_PT.push_back(B_Jet_PT.at(i));
               B_Higgs_Eta.push_back(B_Jet_Eta.at(i));
               B_Higgs_Phi.push_back(B_Jet_Phi.at(i));
               B_Higgs_Mass.push_back(B_Jet_Mass.at(i));
               PT_Bjet->Fill(B_Jet_PT.at(i));

            }
         }

But there are some wired things. First the value of a is 0 0 2 3, I do not know what exactly that means. Then the value of Particle_PID[a] is 21 21 21 1000023, it is not Higgs. Could you tell me HOW I can modify the code. Thank you very much. Have a nice night.

Question information

Language:
English Edit question
Status:
Solved
For:
MadGraph5_aMC@NLO Edit question
Assignee:
No assignee Edit question
Solved by:
Huanian Zhang
Solved:
Last query:
Last reply:
Revision history for this message
Olivier Mattelaer (olivier-mattelaer) said :
#1

Convert this to a question since this is clearly not a bug of MG5.

Revision history for this message
Olivier Mattelaer (olivier-mattelaer) said :
#2

Hi,

Do you read lhe events or some events after shower?

Is this some code base on MadAnalysis?
Could you put here some of the lhe events based on it? (if this is at parton level)

Cheers,

Olivier

Revision history for this message
Olivier Mattelaer (olivier-mattelaer) said :
#3

Also I don't see any definition of Particle_Mother1

So like this:

  int a = Particle_Mother1[i];

 I would say that you don't get the mother of the b particles but the mother of some other particles in the process.

Cheers,

Olivier

Revision history for this message
Huanian Zhang (fantasyzhn) said :
#4

Hi Olivier,

Thank you very much. Yes, this code is based on MadAnalysis. This is the macro from the unweighted_events.root at parton level.

Below is one event from lhe file. And I do not quite understand what do the second, third, forth, fifth, sixth column mean.

20 0 0.6355000E-09 0.7350089E+03 0.7957747E-01 0.9766779E-01
       21 -1 0 0 505 504 0.00000000000E+00 0.00000000000E+00 0.42848324338E+03 0.42848324338E+03 0.00000000000E+00 0. 1.
       21 -1 0 0 502 505 0.00000000000E+00 0.00000000000E+00 -0.12732712545E+04 0.12732712545E+04 0.00000000000E+00 0. 1.
  1000006 2 1 2 502 0 0.26825611217E+03 -0.41879091860E+03 -0.32685903922E+03 0.80259463319E+03 0.53849246837E+03 0. 0.
  1000023 2 3 3 0 0 0.83039026473E+02 -0.16001431471E+03 -0.12598339954E+03 0.38763786328E+03 0.31920406523E+03 0. 0.
       25 2 4 4 0 0 0.15765920913E+03 -0.72204249686E+02 -0.78290638559E+02 0.22765811792E+03 0.12501565771E+03 0. 0.
        6 2 3 3 502 0 0.18521708570E+03 -0.25877660389E+03 -0.20087563968E+03 0.41495676991E+03 0.17483534746E+03 0. 0.
       24 2 6 6 0 0 0.46623384218E+02 -0.36387575988E+02 -0.41954949408E+02 0.10845280241E+03 0.80647361572E+02 0. 0.
 -1000006 2 1 2 0 504 -0.26825611217E+03 0.41879091860E+03 -0.51792897187E+03 0.89915986466E+03 0.54119392744E+03 0. 0.
       -6 2 8 8 0 504 -0.37266788502E+03 0.21957325956E+03 -0.43921722525E+03 0.64065421030E+03 0.17444849492E+03 0. 0.
      -24 2 9 9 0 0 -0.25870730727E+03 0.18243446518E+03 -0.39403587906E+03 0.51246895433E+03 0.84547916888E+02 0. 0.
  1000022 1 4 4 0 0 -0.74620182653E+02 -0.87810065020E+02 -0.47692760985E+02 0.15997974536E+03 0.10020050049E+03 0. 1.
        5 1 5 5 501 0 0.71329003756E+02 -0.99535014313E+02 -0.52938058699E+02 0.13349639090E+03 0.48787779808E+01 0. -1.
       -5 1 5 5 0 501 0.86330205370E+02 0.27330764627E+02 -0.25352579860E+02 0.94161727015E+02 0.48787779808E+01 0. -1.
        5 1 6 6 502 0 0.13859370148E+03 -0.22238902791E+03 -0.15892069027E+03 0.30650396750E+03 0.48787779808E+01 0. -1.
        4 1 7 7 503 0 -0.66793302396E+01 -0.45073612186E+02 -0.14167233583E+02 0.47717444141E+02 0.00000000000E+00 0. -1.
       -3 1 7 7 0 503 0.53302714458E+02 0.86860361973E+01 -0.27787715825E+02 0.60735358270E+02 0.00000000000E+00 0. 1.
  1000022 1 8 8 0 0 0.10441177285E+03 0.19921765904E+03 -0.78711746619E+02 0.25850565436E+03 0.10020050049E+03 0. -1.
       -5 1 9 9 0 504 -0.11396057775E+03 0.37138794374E+02 -0.45181346191E+02 0.12818525596E+03 0.48787779808E+01 0. 1.
       13 1 10 10 0 0 -0.88959360721E+02 0.29690535382E+02 -0.16017856846E+03 0.18561376443E+03 0.00000000000E+00 0. -1.
      -14 1 10 10 0 0 -0.16974794655E+03 0.15274392980E+03 -0.23385731060E+03 0.32685518990E+03 0.00000000000E+00 0. 1.

Revision history for this message
Huanian Zhang (fantasyzhn) said :
#5

the Particle_Mother1 is one array from the head file. Here is how it defines:

   Int_t Particle_Mother1[kMaxParticle];

I am not use unweighted_events.lhe, but use unweighted_events.root.

Revision history for this message
Olivier Mattelaer (olivier-mattelaer) said :
#6

Hi,

For the meaning of the various column, I would advise you to read the paper describing the lhe format.

But I confirm my analysis that
Particle_Mother1 is a vector with size : the number of the particles in the events
then you do:
for(int i = 0; i < B_Jet_PT.size(); i++){
}
therefore i, you have as value [0, nb_jet in your events]
then you do

a = Particle_Mother1[i];
But i is not the correct index in this case, you should have something like (I'm not a C++ expert so please forget me for the approximate syntax)

  std::vector<double> B_Jet_index;

   for(int i = 0; i < Particle_size; i++){
      if (abs(Particle_PID[i]) == 5) {

         //std::cout << Particle_PT[i] << std::endl;
         B_Jet_index.push_back(i);
}
}

and later:
for(int i = 0; i < B_Jet_PT.size(); i++){
b_index = B_jet_index[i]
a = Particle_Mother1[b_index];
}

Cheers,

Olivier

Revision history for this message
Huanian Zhang (fantasyzhn) said :
#7

Thank you very much, Olivier. It worked very well.