GSI Forum
GSI Helmholtzzentrum für Schwerionenforschung

Home » PANDA » PandaRoot » Analysis » [CLOSED] Wrong particle in FillList
Re: Wrong particle in FillList [message #15227 is a reply to message #15224] Fri, 16 August 2013 15:03 Go to previous messageGo to next message
MartinJGaluska is currently offline  MartinJGaluska
Messages: 203
Registered: March 2010
Location: Germany
first-grade participant
From: *physik.uni-giessen.de
Thank you, Klaus! So the only thing which should be avoided (for now) is the
theAnalysis->FillList(kp, "KaonLoosePlus");

(I mean using MC truth as PID)
or was it tested to work properly now, too?

[Updated on: Fri, 16 August 2013 15:06]

Report message to a moderator

Re: Wrong particle in FillList [message #15228 is a reply to message #15227] Fri, 16 August 2013 15:20 Go to previous messageGo to next message
Klaus Götzen is currently offline  Klaus Götzen
Messages: 293
Registered: June 2006
Location: GSI
first-grade participant
From: *gsi.de
Hi,


concerning the true PID (I guess you mean PidAlgoIdealCharged) I didn't test it myself. Usually I test whether the macros in tutorials/rho run properly and the output looks reasonable.

But since in the example also true PID is used for some histos, leading to reasonable results, it should work in principle. What I did there is to select true PID depending on the McTruthMatch.

int PndTutAnaTask::SelectTruePid(PndAnalysis *ana, RhoCandList &l) {
	int removed = 0;
	for (int ii=l.GetLength()-1;ii>=0;--ii) {
		if ( !(ana->McTruthMatch(l[ii])) ) {
			l.Remove(l[ii]);
			removed++;
		}
	}
	return removed;
}


Best,
Klaus
Re: Wrong particle in FillList [message #15229 is a reply to message #15228] Fri, 16 August 2013 15:22 Go to previous messageGo to next message
StefanoSpataro is currently offline  StefanoSpataro
Messages: 2736
Registered: June 2005
Location: Torino
first-grade participant

From: 2.235.190*
Hi Klaus,
let me remind you that the "remove" function is dangerous, and that it is better to add into a new TCandList Razz
Re: Wrong particle in FillList [message #15230 is a reply to message #15229] Fri, 16 August 2013 15:38 Go to previous messageGo to next message
Klaus Götzen is currently offline  Klaus Götzen
Messages: 293
Registered: June 2006
Location: GSI
first-grade participant
From: *gsi.de
I love that kinda risky life... Wink

But I think removing staring from the end of the list should be save.
Re: Wrong particle in FillList [message #15231 is a reply to message #15044] Fri, 16 August 2013 22:40 Go to previous messageGo to next message
Simon Reiter is currently offline  Simon Reiter
Messages: 44
Registered: May 2013
continuous participant
From: *dip0.t-ipconnect.de
Oh no,

now I'm more confused than before. The GetMcTruth() seems to be too difficult for me. I simulated 2000 events and used the following code:
PndAnalysis* theAnalysis = new PndAnalysis("SttMvdGemGenTrack","FtsIdealGenTrack");
theAnalysis->FillList(piplus, "PionLoosePlus",pidalgos);
theAnalysis->FillList(mcpiplus, "PionLoosePlus");
for (Int_t ipiplus=0;ipiplus<piplus.GetLength();++ipiplus){
   if(piplus[ipiplus]->GetMcTruth()) {
      if(!theAnalysis->McTruthMatch(piplus[ipiplus]))
                        //(1) pointer set, but no McTruthMatch
   } else
                        //(2) pointer not even set
}
for (Int_t ipiplus=0;ipiplus<mcpiplus.GetLength();++ipiplus){
   if(mcpiplus[ipiplus]->GetMcTruth()) {
      if(!theAnalysis->McTruthMatch(mcpiplus[ipiplus]))
                        //(3) pointer set, but no McTruthMatch
   } else
                        //(4) pointer not even set
}

On every marker, I implemented a counter, to check, what is working in which way. But the result was again confusing.
    | has not even a truth pointer | has a truth pointer but McTruthMatch failed | number of particles
------------------------------------------------------------------------------------------------------
PID |             15               |                      2809                   |         9031
MC  |             28               |                       847                   |         9558               // in this case: MC=PidAlgoIdealCharged

I understand, that with a pid algorithm the McTruthMatch failed so often. I mean, the actual pid is crap (or "not the best one" Razz ). As I understood right, the pointer is set after track reconstruction, and just the particles are identified wrong. Even that some of them didn't have a pointer makes sense to me. But why are in the PidAlgoIdealCharged-list so many candidates without a pointed and, that's what I was really wondering about, didn't pass the McTruthMatch!?

This time, I'm using trunk, rev 21245!!!

Additionally: What are the criteria for setting the truth pointer? And shall I change theAnalysis->FillList(mcpiplus, "PionLoosePlus") to something like
theAnalysis->FillList(mcpiplus, "PionAllPlus");
for(int i=0;mcpiplus.GetLength(),i++) {
   if(theAnalysis->McTruthMatch(mcpiplus[i]))
      mcpiplustrue.Add(mcpiplus[i]); // mcpiplustrue as a new RhoCandList
}


Thanks in advance
Simon
Re: Wrong particle in FillList [message #15232 is a reply to message #15231] Sat, 17 August 2013 16:36 Go to previous messageGo to next message
StefanoSpataro is currently offline  StefanoSpataro
Messages: 2736
Registered: June 2005
Location: Torino
first-grade participant

From: 2.235.190*
There are four ways for the MC association:

a) GetRecoCandidate()->GetMcIndex()
b) GetMcTruth()
c) PidIdealCharged algorithm
d) McTruthMatch


Why don't you start from the first one a), as suggested several messages ago, which will work for sure? (at least it is the standard)
You can try also b), which should work also. If the truth pointer is not associated, it means that most probably the track is made of noise hits (i.e.mvd oixels), then there is no MC association.

c) and d) could have still problems, but if you use one to check the other we cannot understand a lot.

Re: Wrong particle in FillList [message #15234 is a reply to message #15232] Mon, 19 August 2013 13:35 Go to previous messageGo to next message
MartinJGaluska is currently offline  MartinJGaluska
Messages: 203
Registered: March 2010
Location: Germany
first-grade participant
From: *physik.uni-giessen.de
Stefano Spataro wrote on Sat, 17 August 2013 16:36

There are four ways for the MC association:

a) GetRecoCandidate()->GetMcIndex()
b) GetMcTruth()
c) PidIdealCharged algorithm
d) McTruthMatch


Why don't you start from the first one a), as suggested several messages ago, which will work for sure? (at least it is the standard)
You can try also b), which should work also. If the truth pointer is not associated, it means that most probably the track is made of noise hits (i.e.mvd oixels), then there is no MC association.

c) and d) could have still problems, but if you use one to check the other we cannot understand a lot.




Simon and I have just discussed this issue and we will write a macro checking possible problems in trunk. We believe that filling four lists (one for each way of accessing the mc truth information) of a given particle type -- let's say pions -- for some simulation would be the best way. Each list will be cross-checked with each of the other methods. We expect to be able to give you an update by the end of the week.
Re: Wrong particle in FillList [message #15237 is a reply to message #15234] Mon, 19 August 2013 15:35 Go to previous message
StefanoSpataro is currently offline  StefanoSpataro
Messages: 2736
Registered: June 2005
Location: Torino
first-grade participant

From: 2.235.190*
As said in the SeeVogh, I close this topic.
Please report current problems in new forum threads.
Previous Topic: MVD Particle Identification in analyses
Next Topic: [WONTFIX] Tutorial macro - trunk
Goto Forum:
  


Current Time: Thu Apr 25 08:20:19 CEST 2024

Total time taken to generate the page: 0.00785 seconds