Adding new variable to normal mode.

Asked by Juhi Dutta

Hi,

I have a query regarding adding new variables in the normal mode besides the given ones (MET,PT,etc).

In order to do so I added my reqd. observable definition in the file "observable_list.py" in the following folder :
madanalysis5/madanalysis/observable/observable_list.py

Further,I enlisted it in the file "observable_type.py" in the folder: madanalysis5/madanalysis/enumeration/observable_type.py.
(this I think enlists all the variables with all its properties)

Since I wanted to construct the effective mass variable I followed the structure of the MET definition given and just changed the mathematical definition to 'PHYSICS->Transverse->EventMET(event.rec())+PHYSICS->Transverse->EventTET(event.rec())',
and necessary units to be displayed on histograms.My output file does show the new variable histogram .But I am not sure if any other change is to be made in any other part of the madanalysis code besides the two I made? Or am I wrong in modifying in the above mentioned way in the normal mode?

Kindly help me in this regard.

Thanks & Regards,

Juhi

Question information

Language:
English Edit question
Status:
Solved
For:
MadAnalysis 5 Edit question
Assignee:
No assignee Edit question
Solved by:
Benjamin Fuks
Solved:
Last query:
Last reply:
Revision history for this message
Benjamin Fuks (fuks) said :
#1

Dear Juhi,

What you did is totally fine.

Regards,

Benjamin

Revision history for this message
Juhi Dutta (dutta-juhi91) said :
#2

Hi,

Thank you for the reply!

But there are some things which donot tally in the properties of the observable in the madanalysis5/madanalysis/observable/observable_list.py and madanalysis5/madanalysis/enumeration/observable_type.py files.

For eg.In the observation_list.py we have for MET :
MET = ObservableBase( name = 'MET',
                      args = [],
                      combination = CombinationType.DEFAULT,
                      plot_auto = False,
                      plot_nbins = 100,
                      plot_xmin = 0.,
                      plot_xmax = 1000.,
                      plot_unitX = 'GeV',
                      code_parton = 'PHYSICS->Transverse->EventMET(event.mc())',
                      code_hadron = 'PHYSICS->Transverse->EventMET(event.mc())',
                      code_reco = 'PHYSICS->Transverse->EventMET(event.rec())',
                      cut_event = True,
                      cut_candidate = True,
                      tex = '#slash{E}_{T}'
                    )
whereas in observation_type.py

 'MET' : [False ,'PHYSICS->Transverse->EventMET(event.mc())','PHYSICS->Transverse->EventMET(event.mc())', 'PHYSICS->Transverse->EventMET(event.rec())','GeV',100,0.,1000.,True,False],\

are the entries in the second case in correspondence with the definition in the observable_list.py ? in that case some entries like the last one must be true instead of false.

Such a similar thing is also present for the PT,PX ,.. definitions :
PT = ObservableBase( name = 'PT',
                     args = [ArgumentType.COMBINATION],
                     combination = CombinationType.SUMVECTOR,
                     plot_auto = False,
                     plot_nbins = 100,
                     plot_xmin = 0.,
                     plot_xmax = 1000.,
                     plot_unitX = 'GeV/c',
                     code_parton = 'pt()',
                     code_hadron = 'pt()',
                     code_reco = 'pt()',
                     cut_event = True,
                     cut_candidate = True,
                     tex = 'p_{T}'
                  )

and 'PT' : [True,'pt()','pt()','pt()','GeV/c',100,0.,1000.,True,True],\

where the first entry is True whereas it should have been False if we follow the definition block of the block.

I tried varying these around,even the names of axes etc. without any change in the output.
I did not understand why.

It would be very helpful if you give some insight into this.

Regards,

Juhi

Revision history for this message
Benjamin Fuks (fuks) said :
#3

Dear Juhi,

In ObservableType, you really need to copy what has been done for the MET variable. The first entry (0) indicates whether the observable is a particle property. It is not related at all to what has been put in the other file. For the rest, there is a one-to-one correspondance
 1,2,3 -> the methods used to compute the observable
  4 -> units
  5-> nbins
  6-> xmin
  7->xmax
  8-> is cutable
 9-> can get a prefix in the obseravble name

Does it help?

Cheers,

Benjamin

Revision history for this message
Juhi Dutta (dutta-juhi91) said :
#4

Hi,

Thank you for the reply!

Yes things are clearer now. Except for point 9 -> prefix in observable name.

The MET and PT definitions have opposite entries in 9 suggesting prefix in PT but not in MET names. Does it refer to the tex name provided in definition or has to do with functions like DPHI where PHI is already a function and D prefix-es it but is a new function?

Regards,

Juhi

Revision history for this message
Best Benjamin Fuks (fuks) said :
#5

Hi Juhi,

This means you can calculate sPT(p1 p2) where pa and p2 are two particles. This will compute the scalar sum of the PT pf the two particles. You have other prefixes like 'v', 'ds', etc… See the manual. For global event observables, those prefix are irrelevant since they cannot be associated to specific particles -> set to false.

In DPHI, D is not a prefix (D is part of the function name). sDPHI opr dDPHI would be the associated prefixed quantities.

Cheers,

Benjamin

> The MET and PT definitions have opposite entries in 9 suggesting prefix
> in PT but not in MET names. Does it refer to the tex name provided in
> definition or has to do with functions like DPHI where PHI is already a
> function and D prefix-es it but is a new function?
>
> Regards,
>
> Juhi
>
> --
> You received this question notification because you are an answer
> contact for MadAnalysis 5.

Revision history for this message
Juhi Dutta (dutta-juhi91) said :
#6

Thanks Benjamin Fuks, that solved my question.