GSI Forum
GSI Helmholtzzentrum für Schwerionenforschung

Home » PANDA » PandaRoot » Bugs, Fixes, Releases » Fix in lhetrack
Fix in lhetrack [message #6339] Thu, 10 April 2008 10:57 Go to next message
StefanoSpataro is currently offline  StefanoSpataro
Messages: 2736
Registered: June 2005
Location: Torino
first-grade participant

From: *physik.uni-giessen.de
Dear all,
I have found a problem in lhetrack code that gave me a crash while processing many events. In particular, the function PndTpcLheTrackCuts::Circle3pnts(...) which estimates from the first and the last point of the track candidate the centre and the radius of the circle crossing those two points and the origin (0,0).

You can see below the old version in PndTpcLheTrackCuts.cxx

Toggle Spoiler


As you can see, the function is not protected agains division by zero (so when x[1]-x[0]==0 or x[2]-x[1]==0). Moreover, the case m_a==m_b (the three points lay on a straight line) does not give results.

I have corrected it in the repository in the following way:

Toggle Spoiler


If the three points lay on a straight line, the circle centre is set at (10000,10000) just to put a high number, probably the code will kill those tracks or be able to recover them.
If there is the division by zero, I have simply exchanged x->y y->x (in this system there is no division by zero anymore), calculated the centre coordinates and re-transformated them into the original system.

I hope I have not messed up things, however now I do not have the crash anymore (or at least there).

Comments and checks are welcome.
Update of lhetrack [message #6357 is a reply to message #6339] Thu, 10 April 2008 19:25 Go to previous messageGo to next message
StefanoSpataro is currently offline  StefanoSpataro
Messages: 2736
Registered: June 2005
Location: Torino
first-grade participant

From: *physik.uni-giessen.de
Dear all,
since version 2466 lhetrack package has several "important" updates.

1) First of all, a small bug that produced analysis crashes was solved (see entry before).

2) Now it is possible to include MVD in the fitting by a task option, without recompiling (as done before)

3) It is possible to run the code with pure MC points, with MCPoints smeared by fixing the spatial resolution, with reconstructed hits (so TpcCluster and MVDHits).

The construction is very easy. You have just to add in your analysis macro:

// -----   LHETRACK  ---------------------------------
PndTpcLheHitsMaker* trackMS = new PndTpcLheHitsMaker("Tracking routine");
trackMS->SetTpcMode(2, -1);  // 0 OFF, 1 TpcPoint, 2 TpcCluster // TpcPoint smearing [cm], if negative no smearing
trackMS->SetMvdMode(2, -1);  // 0 OFF, 1 MVDPoint, 2 MVDHit     // MVDPoint smearing [cm], if negative no smearing
fRun->AddTask(trackMS);
PndTpcLheTrackFinder* trackFinder    = new PndTpcLheTrackFinder();
fRun->AddTask(trackFinder);

PndTpcLheTrackFitter* trackFitter    = new PndTpcLheTrackFitter("fitting");
fRun->AddTask(trackFitter);



With the SetXXXMode(Int_t mode, Float_t res) function for TPC and MVD you can switch OFF your detector (mode==0), or decide to use just Points (mode==1), Points smeared according to a space resolution value res (for TPC sigma_Z = 2*res), or reconstructed hits (mode==2).

Under macro/lhetrack you can run the reconstruction chain:

run_sim_tpcmvd.C will produce MC points
run_track_tpcmvd.C will run digitization+reconstruction for TPC and MVD, and will use the reco points for the fitting
plot_pT.C will plot the results of the fitting.


Known (and unsolved) problems (at the moment)

1) If lhetrack runs in a 2nd step macro, it is crashing. The problem seems to stay in the sigma for MVD hits. The functions MVDHits::GetDx() y and z called by lhetrack code require the geometry which is not in the file, so the macro crashes. Adding the sim file as fRun->AddFriend() does not help. For these reasons everything should run in the same macro, at the moment.

2) It seems that if one turns on the RiemannFit task, the macro goes well. But when launching the plot_pT.C macro to show results, this crashes. It is like it is not able to access properly to the tree. This should be investigated.

3) While for the MCPoints is easy to get the MCTrack index, for reco hits this is not possible. In this case the TrackID is set to -1.

4) lhetrack has some tools to fill track candidated from the MC and from the fit, by using TpcPoints TCA. Now lhetrack works even with other kind of data objects such as MVDPoints and reco hits. So this part should be adjusted. For MC it will be quite simple, but for reco... that's another story.



Some feedback is welcome, of course.
Re: Update of lhetrack [message #6381 is a reply to message #6357] Fri, 11 April 2008 16:18 Go to previous messageGo to next message
StefanoSpataro is currently offline  StefanoSpataro
Messages: 2736
Registered: June 2005
Location: Torino
first-grade participant

From: *physik.uni-giessen.de
The (v2481) release can handle even EMC clusters and bumps.

At the moment the track fitter is also using those points, so adding the EMC the resolution becomes worse.

In the next future EMC hits will not be used by the TrackFitter, but just for correlation. But not with the actual release.
Pid with lhetrack [message #6511 is a reply to message #6381] Thu, 17 April 2008 19:39 Go to previous messageGo to next message
StefanoSpataro is currently offline  StefanoSpataro
Messages: 2736
Registered: June 2005
Location: Torino
first-grade participant

From: *dip.t-dialin.net
Today some new code was committed into svn.

Now pid candidates are created and a rough information on dE/dx in MVD detector is there.
The macro were also updated.

Tomorrow the plots will come, even because I have found something very strange...
Re: Pid with lhetrack [message #6516 is a reply to message #6511] Fri, 18 April 2008 10:50 Go to previous messageGo to next message
asanchez is currently offline  asanchez
Messages: 350
Registered: March 2006
first-grade participant
From: *kph.uni-mainz.de
Hi Stephano what is the lowest limit
for the momenta with lhetrack?

best regrads
ALicia.
Re: Pid with lhetrack [message #6519 is a reply to message #6516] Fri, 18 April 2008 11:27 Go to previous messageGo to next message
StefanoSpataro is currently offline  StefanoSpataro
Messages: 2736
Registered: June 2005
Location: Torino
first-grade participant

From: *physik.uni-giessen.de
Hello,
I attach the plot for MVD dE/dx versus momentum, where:

MVD dE/dx is the total energy deposited in MVD strip/pixel (MvdHits, no MC) divided by the number of MVD strips/pixels fired -> no correction for thickness or angle of the track inside the sensor

momentum is the reconstructed momentum using reco hits, so TpcCluster and MvdHit, calculated by lhetrack.

Here the plot for GEANT3

index.php?t=getfile&id=4387&private=0

and for GEANT4

index.php?t=getfile&id=4388&private=0

The plots were generated with Box generator, uniform in p [0,1 GeV/c], theta [20°,120°] and phi [0°,360°]. I have generated separately protons, kaons pions and electrons.

You can see that he momentum reconstruction seems to stop below 100-150 MeV/c, but it depends also on the particle type.

Second, you can see that in "kaon" events there is a structure in the pion region, most probably connected to kaon decays.

Third, electrons have different energy loss in G3 and G4!!!
Here you are the direct comparison:

index.php?t=getfile&id=4389&private=0

In Geant3 electrons are losing more than twice the energy lost in Geant4. In Geant4 we have a MIPS point similar to the one of the pions, while in G3 it seems that we could use MVD to discriminate between pions and electrons Smile

However, I remember you the dE/dx plot for STT done with geant3 (that I have also showed at CHEP), and even there the electrons stayed much higher than pions.




But from dE/dx plots on tpc of the data particle booklet (page 269), it seems G3 is closer to reality...

So... another problem of G4?


[Updated on: Fri, 18 April 2008 11:27]

Report message to a moderator

Re: Pid with lhetrack [message #6520 is a reply to message #6519] Fri, 18 April 2008 11:39 Go to previous messageGo to next message
Sebastian Neubert is currently offline  Sebastian Neubert
Messages: 282
Registered: March 2006
Location: Munich
first-grade participant

From: *e18.physik.tu-muenchen.de
Hi Stefano!

We have reported on problems with the Energy Loss for G3 vs. G4 soem time ago. I am not surprised that it also shows in the MVD. I would be glad if we could find out what is going on!

However as I wrote last week also G3 has to be mistrusted. At least for Gas detectors the setup which is currently in svn is screwing up.

What is also worrying me in your plots is, that there seem to be two classes of kaons... at least when you look at the region around p=200Mev.
index.php?t=getfile&id=4391&private=0


Cheers! Sebastian.


Sebastian Neubert
Technische Universität München
Department Physik E18
sneubert@e18.physik.tu-muenchen.de
tel: +49-8928912592
Re: Pid with lhetrack [message #6522 is a reply to message #6520] Fri, 18 April 2008 11:52 Go to previous messageGo to next message
StefanoSpataro is currently offline  StefanoSpataro
Messages: 2736
Registered: June 2005
Location: Torino
first-grade participant

From: *physik.uni-giessen.de
Hi Sebastian,
I remember your considerations, but I have supposed they were connected to the bad behaviour of the g4 "stepLimiter" option (as found by Dima) that now is switched off. But it does not seems the case, there is still something strange.
About trusting on g3 or g4... I am not too much sure on what should be the correct response. Are you able to produce the same plots for tpc, just to cross check? In theory the plot in the data particle booklet should be our reference, and in that case electrons stay higher than pions (so in this case g3 should be more realistic).

About the second structure, as I wrote before,
kaons can decay into pions, and these are placed in the region you evidence. This is the reason "I think" of the second structure. "Kaon" means "event where I have created one primary kaon", not "the particle is a kaon".
I am not applying PID because I am not using MC info at all, so at the moment I cannot tell you exactly what they are, but I think my suspect should be true.


Opinions are welcome..
Re: Pid with lhetrack [message #6523 is a reply to message #6522] Fri, 18 April 2008 12:12 Go to previous messageGo to next message
Viola Michael is currently offline  Viola Michael
Messages: 5
Registered: August 2007
occasional visitor
From: *e18.physik.tu-muenchen.de
hi!
Concerning the kaons in the pion region, i have seen this some time ago in the tpc-dedx. When i checked, it were kaons decaying to pions, as expected.
Best regards,
Viola
Re: Pid with lhetrack [message #6524 is a reply to message #6523] Fri, 18 April 2008 12:20 Go to previous messageGo to next message
Sebastian Neubert is currently offline  Sebastian Neubert
Messages: 282
Registered: March 2006
Location: Munich
first-grade participant

From: *e18.physik.tu-muenchen.de
Hi Stefano!

Sorry, I over looked your comment on the decaying kaons. Embarassed

I guess we can produce that. I just do not know if I will find time today.

I agree that the G3 results looks more like what is in the PDG. Also with G4 I remember getting the electrons higher than pions in the simulations I did for the TPR.

Cheers! Sebastian.


Sebastian Neubert
Technische Universität München
Department Physik E18
sneubert@e18.physik.tu-muenchen.de
tel: +49-8928912592
Re: Pid with lhetrack [message #6575 is a reply to message #6524] Tue, 22 April 2008 20:25 Go to previous messageGo to next message
StefanoSpataro is currently offline  StefanoSpataro
Messages: 2736
Registered: June 2005
Location: Torino
first-grade participant

From: *physik.uni-giessen.de
For those who are interested, the discussion about G3/G4 comparison continues here!
http://forum.gsi.de/index.php?t=tree&th=1889
Re: Update of lhetrack [message #6685 is a reply to message #6357] Wed, 07 May 2008 14:03 Go to previous messageGo to next message
asanchez is currently offline  asanchez
Messages: 350
Registered: March 2006
first-grade participant
From: *gsi.de
Dear all, i have done some modifications in tof
so that the tof detector can be added to lhetrack without problems(it doesn't crashes)

One can operate either with TofPoint or with TofHit.
Of course if one uses the TofPoint the result aftre tracking and fit
is nicer(see picture below) than by using the TofHit information.

To create the hit, i have made some approximation to calculate the
time at each edge of the scintillation bar(as it was measured by a tdc), so basically hit provides the position coordinates of the center of the bar in the xy plane, and the z coordinate is determined by using the time difference (photon arrival time)measured by tdc.

Of course the position resolution will be much worse than
mvd or tpc.

Here you are two pictures in which tofPoint and TofHit was considered respectively.

So i don't know if it is a good idea to add the tof information
to the tracking.

I think that for pid with tof, geane should be used to match the track with tof hits and get the corresponding tof, and then try to calculate the total length.
best regrads
Re: Update of lhetrack [message #6802 is a reply to message #6685] Thu, 29 May 2008 19:51 Go to previous messageGo to next message
StefanoSpataro is currently offline  StefanoSpataro
Messages: 2736
Registered: June 2005
Location: Torino
first-grade participant

From: *physik.uni-giessen.de
Dear all,
the Dip Fit code was changed in lhetrack, in order to solve problems with the fit of "reco" hits.

Now lambda is calculated by a fit in the Z vs R plane, and gives reasonable results.

In addition, the functions PndTpcLheTrack:: ExtrapolateToZ and ExtrapolateToR were added, for the correlation to other detectors.


Re: Update of lhetrack [message #6853 is a reply to message #6802] Fri, 06 June 2008 18:03 Go to previous messageGo to next message
StefanoSpataro is currently offline  StefanoSpataro
Messages: 2736
Registered: June 2005
Location: Torino
first-grade participant

From: *physik.uni-giessen.de
Dear all,
in svn you can find the latest version of lhetrack code.

By using the geometrical extrapolation, a correlation with TOF and EMC detectors is now provided: the object PndLhePidTrack contains together the informations from TPC, MVD, EMC and TOF.

The following plot shows the tof vs momentum distribution for protons (the top one), kaons (intermediate), pions, muons, and electrons (the lower bands almost horizontal):

index.php?t=getfile&id=4526&private=0

and here you are the E/P (energy loss in EMC divided by momentum) versus momentum plot for electrons (the horizontal line at 1), protons (the band which is going up), pions and muons (the band which is going down) and kaons (mixed with the pions, but a higher momenta)

index.php?t=getfile&id=4527&private=0

The bump at E/B~0.8 should be due to secondary pions generated by the decay of a primary kaon.

No MonteCarlo information was used for the previous plots, everything comes from full simulation and full reconstruction.

Still the extrapolation should be improved, and the path lenght to the tof detector has to be calculated.
  • Attachment: TofTof.gif
    (Size: 17.75KB, Downloaded 821 times)
  • Attachment: EmcEloss.gif
    (Size: 19.04KB, Downloaded 796 times)
Re: Update of lhetrack [message #7145 is a reply to message #6853] Fri, 01 August 2008 18:30 Go to previous messageGo to next message
StefanoSpataro is currently offline  StefanoSpataro
Messages: 2736
Registered: June 2005
Location: Torino
first-grade participant

From: *physik.uni-giessen.de
Hello,
the Dirc Hit information was added to the PndLhePidTrack (cherenkov angle).
The correlation was moved from the only z difference to also delta_phi.
In the correlation it seems many tracks do not show PID informations (by DPM tests), so maybe there is still some bug in the extrapolation or in something else.
This will be checked in the next weeks.
Dirc+TOF [message #7178 is a reply to message #7145] Wed, 06 August 2008 12:02 Go to previous messageGo to next message
StefanoSpataro is currently offline  StefanoSpataro
Messages: 2736
Registered: June 2005
Location: Torino
first-grade participant

From: *physik.uni-giessen.de
Here you are the plot of Theta Cherenkov vs reconstructed momentum, using the lhetrack tracking+correlation, 1000 events with DPM at 4 GeV/c:

index.php?t=getfile&id=4667&private=0

It looks quite good, the theta_Cherenkov is smeared inside the DrcHitProducerIdeal (thanks to Annalisa). The two shapes are due to pions and protons... it seems in DPM there are no kaons!

Meanwhile I have also put the correct track lenght to the TOF detector, in order to calculate beta:

index.php?t=getfile&id=4668&private=0

Even this plot looks quite nice.
Re: Dirc+TOF [message #7179 is a reply to message #7178] Wed, 06 August 2008 13:16 Go to previous messageGo to next message
asanchez is currently offline  asanchez
Messages: 350
Registered: March 2006
first-grade participant
From: *gsi.de
Hi Stephano, i see you are using the Phi value you get by extrapolating to the tof radius for calculating the path length
in the XY plane. Be careful because in this way you are assuming that all particles are primaries, (coming from the vertex).

Is it not better to take the difference between the phi value in tof and the first hit of the track?

If you do that you will consider also the particles
which are secondaries(decay products).

best regards
Alicia.
Re: Dirc+TOF [message #7180 is a reply to message #7179] Wed, 06 August 2008 13:52 Go to previous messageGo to next message
StefanoSpataro is currently offline  StefanoSpataro
Messages: 2736
Registered: June 2005
Location: Torino
first-grade participant

From: *physik.uni-giessen.de
I have not understood so well.

My particles are coming from (0, 0, Z0), so in theory even secondaries are handled.

Or have I misunderstood something?

Re: Dirc+TOF [message #7181 is a reply to message #7180] Wed, 06 August 2008 14:09 Go to previous messageGo to next message
asanchez is currently offline  asanchez
Messages: 350
Registered: March 2006
first-grade participant
From: *gsi.de
ok.
Re: Dirc+TOF [message #7182 is a reply to message #7180] Wed, 06 August 2008 14:42 Go to previous messageGo to next message
asanchez is currently offline  asanchez
Messages: 350
Registered: March 2006
first-grade participant
From: *gsi.de
hi again,
i thought the z0, was the z coordinante at (x0,y0)

where x0,y0 are the coordinates of the center of the circle described by the particle in its movement.

So my point was, that primaries are statrting at 0,0,0, where the extrapolation to tof radius to determine the phi is correct.
But if the particle is not starting at 0,0,0 the extrapolation to tof radius is not valid anymore at least you take also into a count the Phi value for the first hit in the track.

What do you think?

Alicia.
Re: Dirc+TOF [message #7184 is a reply to message #7182] Wed, 06 August 2008 18:45 Go to previous messageGo to next message
StefanoSpataro is currently offline  StefanoSpataro
Messages: 2736
Registered: June 2005
Location: Torino
first-grade participant

From: *physik.uni-giessen.de
Exactly z0 corresponds to the point (x0, y0, z0), where:

x0 = d0*cos(phi0)
y0 = d0*sin(phi0).

phi0 = phi of the circle centre
d0 = charge * Sqrt(xc*xc + yc*yc) - radius

(xc, yc is the centre of the circle)


I still do not see how this means that the particle is coming from 0,0,0. I don't know if this is correct, but this is the definition in the original Oleg's code.


STT in lhetrack [message #7186 is a reply to message #6339] Thu, 07 August 2008 17:17 Go to previous messageGo to next message
StefanoSpataro is currently offline  StefanoSpataro
Messages: 2736
Registered: June 2005
Location: Torino
first-grade participant

From: *physik.uni-giessen.de
Now the STT detector is inside lhetrack.

At the moment it starts from the SttHelixHit (the PCA of the helix prefit to the sense wire inside the straw), and it does fitting with MVD, adding the PID information of all the other detectors as done before for the TPC code.

The macros in macros/lhetrack were also splitted, separated for tpc and stt.


Re: STT in lhetrack [message #7351 is a reply to message #7186] Tue, 23 September 2008 16:53 Go to previous messageGo to next message
StefanoSpataro is currently offline  StefanoSpataro
Messages: 2736
Registered: June 2005
Location: Torino
first-grade participant

From: 140.181.9*
Now the dE/dx information (troncated mean) is available in LheTrack:

index.php?t=getfile&id=4759&private=0

Thanks to Lia.
Kalman in lhetrack [message #7359 is a reply to message #6339] Fri, 26 September 2008 16:50 Go to previous messageGo to next message
StefanoSpataro is currently offline  StefanoSpataro
Messages: 2736
Registered: June 2005
Location: Torino
first-grade participant

From: *physik.uni-giessen.de
Dear all,
now a Kalman Filter is also provided with lhetrack code, so for TPC+MVD and STT+MVD.

Let me show the difference between lhetrack fit for muons at 1GeV and genfit refit.

TPC+MVD:

index.php?t=getfile&id=4764&private=0

STT+MVD:

index.php?t=getfile&id=4765&private=0

...
...
in practice there are no strong differences.

You can find some macros on how to run it, after the standard sim/digi/recom in tutorials/lhetrack:

* run_kalman_tpc.C
* run_kalman_stt.C
* plot_kalman_tpc.C
* plot_kalman_stt.C


At the moment, in the code you can see that three iterations are performed and even smoothing:

Toggle Spoiler


You can switch ON/OFF or play with these parameters.

Probably fixes will be needed, but at least it seems to work.


Ferrara tutorial bug [message #7398 is a reply to message #7359] Thu, 09 October 2008 17:06 Go to previous messageGo to next message
StefanoSpataro is currently offline  StefanoSpataro
Messages: 2736
Registered: June 2005
Location: Torino
first-grade participant

From: *physik.uni-giessen.de
Dear all,
in Ferrara somebody had problems with the lhetrack tutorial, in particular all those who had a gcc version >= 4.2.

In the last version of lhetrack the bug was removed, so now the code should work properly will all the gcc versions.
Bug fix in geane [message #7465 is a reply to message #7398] Fri, 24 October 2008 09:44 Go to previous message
StefanoSpataro is currently offline  StefanoSpataro
Messages: 2736
Registered: June 2005
Location: Torino
first-grade participant

From: *physik.uni-giessen.de
Dear all,
several small bugs connected to geane propagation, field and charge, were fixed in lhetrack and tutorials/lhetrack directory (the distributions are a bit better, but there is still some sistematic shift in correlation residuals). If you want to use geane propagation or genfit, please update these directories.

Moreover, I have deleted the directory macro/lhetrack, I have decided to keep only one place for lhetrack macros (tutorials/lhetrack).
Previous Topic: EmcCluster: Map version 0 does not exist
Next Topic: Update in Dart.sh
Goto Forum:
  


Current Time: Tue Dec 03 04:18:52 CET 2024

Total time taken to generate the page: 0.00992 seconds