GSI Forum
GSI Helmholtzzentrum für Schwerionenforschung

Home » PANDA » PandaRoot » Analysis » Using Rho without MC info
icon5.gif  Using Rho without MC info [message #18401] Wed, 05 August 2015 16:33 Go to next message
Marcel Tiemens is currently offline  Marcel Tiemens
Messages: 47
Registered: January 2014
continuous participant
From: *kvi-cart.rug.nl
Hello Rho experts,

In order to evaluate my clustering algorithm in the PandaRoot framework, I would like to analyse the reconstructed clusters with Rho. Basically, I want to reconstruct the parent particle(s). However, after running a macro (which is based on ana_complete.C in /macro/run/, but could very well be flawed as I am no Rho expert), I get the following error (a lot):

Error in <BuildMcCands>: MC track Array does not exist.

My interpretation of this is that it looks for MC truth information, which is not there because the current implementation of the timebased simulation for the EMC is not yet compatible with MC backprogation (Tobias is working on this I understood). The absence of this information is not such a big problem at this stage, however. To circumvent this issue, I would like Rho to just take the EmcClusters from the reco macro and basically treat these as photon candidates and then continue the analysis under this assumption. The question is, I don't really know how. I guess it should be relatively easy, but can anyone tell me?

Also, just to check, to reconstruct a neutral pion, I would need to run something like
pion.Combine(gamma,gamma);

, correct? Where "pion" and "gamma" are RhoCandLists. This part, concerning neutral particles, is not covered in the Rho tutorial, which is why I'm asking.

Thanks a lot in advance!
Re: Using Rho without MC info [message #18403 is a reply to message #18401] Wed, 05 August 2015 17:20 Go to previous messageGo to next message
StefanoSpataro is currently offline  StefanoSpataro
Messages: 2736
Registered: June 2005
Location: Torino
first-grade participant

From: *21-87-r.retail.telecomitalia.it
Hi,
would it be maybe better to change the PndPidCorrelator so that for neutrals it takes the proper MC info from the timebased simulation code and FairLinks, and not the standard GetMcIndex?
At present the interface to the analysis should be changed to use the FairLinks, but it still uses the old index structure.
Re: Using Rho without MC info [message #18404 is a reply to message #18401] Thu, 06 August 2015 07:57 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 Marcel,


I'm not completely sure whether I understand your problem. One thing is MC truth information, another is combining RhoCandLists, and I don't see a big connection between them. Combining neutrals exactly works like combining charged particles, so it should work like you wrote in case you have proper RhoCandLists.

If you'd like to build your own candidates (from e.g. your clusters), so that you can combine them via RhoCandList::Combine(), you can take a look how candidates are created from FairRecoCands in PndAnalysis::ReadRecoCandidates(). You would have to create FairRecoCands from your clusters beforehand. Important is to give each RhoCandidate a uid (unique id) in case you need overlap control, since the bitmarkers are set according to it. For pi0 -> gamma gamma it shouldn't play a role though.


Best,
Klaus
Re: Using Rho without MC info [message #18405 is a reply to message #18404] Thu, 06 August 2015 11:10 Go to previous messageGo to next message
Marcel Tiemens is currently offline  Marcel Tiemens
Messages: 47
Registered: January 2014
continuous participant
From: *kvi-cart.rug.nl
The analysis macro gives a lot of warnings and errors that it can't find certain branches. For most of them, this isn't surprising, since I'm only running with the EMC; no other subdetectors are present. This one bugs me however:

[INFO ] Branch: PidNeutralCand not found in Tree
[INFO ] Branch: PidNeutralCand not found in Tree
-I- PndAnalysis::ReadTCA(): No PidNeutralCand array found.

Or can the PID macro not construct a list of neutral candidates using the EMC information only? If it needs information from other subdetectors, that could be related to why it doesn't work, seeing as these aren't there.

And I don't know how much of a problem it is that this occurs:
Error in <BuildMcCands>: MC track Array does not exist.

I'm running the full simulation by the way.

Re: Using Rho without MC info [message #18406 is a reply to message #18405] Thu, 06 August 2015 20:28 Go to previous messageGo to next message
StefanoSpataro is currently offline  StefanoSpataro
Messages: 2736
Registered: June 2005
Location: Torino
first-grade participant

From: *234-95-r.retail.telecomitalia.it
Hi,
if you check PndPidCorrelator::ConstructNeutralCandidate(), that is the function which is contructing the NeutralCand starting from the emc bumps (or clusters). You should modify it to have the analysis working with neutrals and the new code.
Re: Using Rho without MC info [message #18407 is a reply to message #18406] Fri, 07 August 2015 16:33 Go to previous messageGo to next message
Marcel Tiemens is currently offline  Marcel Tiemens
Messages: 47
Registered: January 2014
continuous participant
From: *kvi-cart.rug.nl
Thank you for that suggestion. A small update... I sort of managed to get it to work by disabling the "return kERROR" statement, so that the PidCorrelator doesn't stop when it doesn't find a track array, and commenting out the part in ConstructNeutralCandidate() that tries to match tracks. If I'm honest, I don't what kind of tracks it would need. Surely, for neutrals you don't need a complete track; the starting point (=interaction vertex) and end point (=EMC cluster position) should uniquely identify the track, right? Especially in this case it doesn't matter, since there is nothing in between. Perhaps it would be possible to use a Kalman filter or something to interpolate the "track", but I am no expert. The default clustering algorithm does something with the tracks, using
FairMultiLinkedData hitLinks = theDigi->GetLinksWithType(FairRootManager::Instance()->GetBranchId("EmcHit"));
    for (Int_t j = 0; j < hitLinks.GetNLinks(); j++) {
        PndEmcHit* hit = (PndEmcHit*)fHitArray->At(hitLinks.GetLink(j).GetIndex());
  	if(hit) cluster->AddTracksEnteringExiting(hit->GetTrackEntering(), hit->GetTrackExiting());
	else std::cout << "-E in PndEmcMakeCluster::Exec FairLink " << hitLinks.GetLink(i) << "to EmcHit delivers null" << std::endl;
    }

However, as Philipp explained in his email (you were included there, Stefano), this part is not compatible with the new timebased simulation for the EMC.


Anyway, the analysis macro crashes after leaving my computer unresponsive for some 15 minutes with the message:
[INFO ] The number of entries in the tree is 1000
[INFO ] FairRootManager::ReadEvent(1): The tree has 1000 entries
evt 2
evt 3
evt 4
evt 5
evt 6
evt 7
evt 8
evt 9
evt 10
terminate called after throwing an instance of 'std::bad_alloc'
what(): std::bad_alloc

It is of course very possible that I am at fault here; I'm only just learning this Rho stuff. I have both pi0's and eta's, which both decay to photons, but it should be possible to distinguish the two? Or do I need to do something special for that? Perhaps it is better if I share the file I use for the analysis, so you can take a look and tell me if I'm doing something stupid... Or if is has to do with the tracks part. ... Okay, maybe it wasn't that small of an update Wink
Re: Using Rho without MC info [message #18503 is a reply to message #18407] Wed, 16 September 2015 15:11 Go to previous messageGo to next message
Marcel Tiemens is currently offline  Marcel Tiemens
Messages: 47
Registered: January 2014
continuous participant
From: *kvi-cart.rug.nl
Did anyone have a chance to take a look at this?
Re: Using Rho without MC info [message #18506 is a reply to message #18401] Wed, 16 September 2015 16:37 Go to previous messageGo to next message
Ralf Kliemt is currently offline  Ralf Kliemt
Messages: 507
Registered: May 2007
Location: GSI, Darmstadt
first-grade participant

From: *gsi.de
Hi Marcel,

As far as the Analysis & Rho side is concerned, try the patch in the spoiler below. Basically now it tries to create MC Cands even if we have no MC Track array. This results in a message for each event. With the patch that message won't appear.

As the pi0 combinations go:
RhoCandList gammas, pi0s;
while (theAnalysis->GetEvent() && i++<nevts){
  theAnalysis->FillList(gammas, "Neutral");
  pi0s.Combine(gammas,gammas);
  ...
}


Cheers!
Ralf

Toggle Spoiler
Re: Using Rho without MC info [message #18519 is a reply to message #18506] Fri, 18 September 2015 13:10 Go to previous message
Marcel Tiemens is currently offline  Marcel Tiemens
Messages: 47
Registered: January 2014
continuous participant
From: *kvi-cart.rug.nl
Hi Ralf,

Thanks for your suggestion. I tried it out, and indeed there are no more error messages. However, when using your patch in conjunction with the hack I proposed earlier (in PndPidCorrelator::ConstructNeutralCandidate() ), the macro doesn't finish properly... It finishes without giving any errors, but also doesn't print the lines "Macro finished successfully." etc, which the according to the macro clearly should happen. The resulting root file also doesn't contain a tree. Running it without the hack I mentioned earlier causes the crash in my previous message:

terminate called after throwing an instance of 'std::bad_alloc'
what(): std::bad_alloc
Previous Topic: entries at unphysical mass after vertex fit
Next Topic: Panda target and vertex cuts
Goto Forum:
  


Current Time: Fri Nov 29 01:00:14 CET 2024

Total time taken to generate the page: 0.02029 seconds