Home » PANDA » PandaRoot » Analysis » Using Rho without MC info
Using Rho without MC info [message #18401] |
Wed, 05 August 2015 16:33 |
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 #18407 is a reply to message #18406] |
Fri, 07 August 2015 16:33 |
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
|
|
|
|
Re: Using Rho without MC info [message #18506 is a reply to message #18401] |
Wed, 16 September 2015 16:37 |
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
Index: PndAnalysis.cxx
===================================================================
--- PndAnalysis.cxx (revision 28526)
+++ PndAnalysis.cxx (working copy)
@@ -143,13 +143,13 @@
if ( ! fMcTracks && fVerbose ) {
std::cout << "-W- PndAnalysis::Init(): No \"MCTrack\" array found. No MC info available." << std::endl;
- }
+ } else {
+ fBuildMcCands = true;
+ fMcCands = new TClonesArray ( "RhoCandidate" );
+ // next line commented by KG, 07/2012
+ fRootManager->Register ( "PndMcTracks","PndMcTracksFolder", fMcCands, kFALSE );
+ }
- fMcCands =new TClonesArray ( "RhoCandidate" );
-
- // next line commented by KG, 07/2012
- fRootManager->Register ( "PndMcTracks","PndMcTracksFolder", fMcCands, kFALSE );
- fBuildMcCands = true;
}
fChainEntries = ( fRootManager->GetInChain() )->GetEntries();
@@ -440,18 +440,17 @@
{
int i;
// Make Monte-carlo truth candidates by the reconstructed particles up to the initial state (if available)
- if ( !fMcCands ){
- Warning("PndAnalysis::BuildMcCands","No array to store candidates...");
- return;
- }
if ( !fBuildMcCands ) {
if(fVerbose) Info("PndAnalysis::BuildMcCands","No mc to build...");
return;
}
+ if ( !fMcCands ){
+ Warning("PndAnalysis::BuildMcCands","No array to store candidates...");
+ return;
+ }
if ( fMcCands->GetEntriesFast() != 0 ) {
fMcCands->Delete();
}
-
if ( fMcTracks == 0 ) {
Error ( "BuildMcCands","MC track Array does not exist." );
return;
|
|
|
Re: Using Rho without MC info [message #18519 is a reply to message #18506] |
Fri, 18 September 2015 13:10 |
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
|
|
|
Goto Forum:
Current Time: Fri Nov 29 01:00:14 CET 2024
Total time taken to generate the page: 0.02029 seconds
|