GSI Forum
GSI Helmholtzzentrum für Schwerionenforschung

Home » PANDA » PandaRoot » Analysis » (SOLVED)Obtain Raw Info from Calorimeter (old GetMicroCandidate from TCandList class) (Learning Analysis)
(SOLVED)Obtain Raw Info from Calorimeter (old GetMicroCandidate from TCandList class) [message #16321] Tue, 15 April 2014 18:12 Go to next message
Mamen is currently offline  Mamen
Messages: 55
Registered: January 2009
Location: Mainz
continuous participant
From: *kph.uni-mainz.de
Hi, everybody!

Finally after so many years of delay I'm learning how to use PandaRoot.
I got some macro from Dmitry Khaneft and I am trying to reproduce his analysis to start learning a bit the code.
By now I have already encountered some problems. The Class TCandList has been changed to RhoCandList, and some of the methods seem not to be available anymore.
For instance I was trying to get some EMC information:

for (Int_t j=0;j<negative.GetLength();++j){
if(negative[j].GetMicroCandidate().GetEmcIndex()>-1){
// *** Fill momentum vs E/p
hEPvsP-> Fill(negative[j].GetMicroCandidate().GetMomentum().Mag(),negative[j].Get MicroCandidate().GetEmcCalEnergy()/negative[j].GetMicroCandidate().GetMo mentum().Mag());
// *** Fill number of crystals hit in the EMC
hNCrystalsEMC->Fill(negative[j].GetMicroCandidate().GetEmcNumberOfCrystals());
}

the object 'negative' is defined as follows:

RhoCandList negative;

and it refers to the negative tracks.

The method GetMicroCandidate() doesn't exist anymore in the class RhoCandList.
I was trying to find out how to do this using the new RhoCandList, instead of the old TCandList, but I could not manage to find any documentation Sad...
Could somebody help me? Please!

Thanks a lot in advance!
Cheers!
Mamen

[Updated on: Wed, 16 April 2014 10:49]

Report message to a moderator

Re: Obtain Raw Info from Calorimeter (old GetMicroCandidate from TCandList class) [message #16322 is a reply to message #16321] Tue, 15 April 2014 18:17 Go to previous messageGo to next message
StefanoSpataro is currently offline  StefanoSpataro
Messages: 2736
Registered: June 2005
Location: Torino
first-grade participant

From: *ip71.fastwebnet.it
Now it is called GetRecoCandidate.
A nice documentation can be found non only here but also with more details here.
Good luck!
Re: Obtain Raw Info from Calorimeter (old GetMicroCandidate from TCandList class) [message #16323 is a reply to message #16321] Tue, 15 April 2014 18:21 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: *adsl.alicedsl.de
Hi Mamen,


you can access the PndPidCandidate (previously called PndMicroCandidate) with

PndPidCandidate *pidCand = (PndPidCandidate*) negative[j]->GetRecoCandidate();


Best,
Klaus
Re: Obtain Raw Info from Calorimeter (old GetMicroCandidate from TCandList class) [message #16324 is a reply to message #16321] Tue, 15 April 2014 18:42 Go to previous messageGo to next message
Mamen is currently offline  Mamen
Messages: 55
Registered: January 2009
Location: Mainz
continuous participant
From: *kph.uni-mainz.de
Thanks Stefano and Klaus,

GetRecoCandidate somehow works, however, there is still something which is not really working.
Although i can see the method GetEmcIndex() defined in the code here: https://subversion.gsi.de/trac/fairroot/browser/pandaroot/trunk/pnddata/ PidData/PndPidCandidate.h
I get errors when I run the analysis:
Test code:

cout<< "GetEmcIndex() -> "<< negative[j].GetRecoCandidate().GetEmcIndex() <<endl;

Error:

Warning: wrong member access operator '.' ana_complete.C:157:
Warning: wrong member access operator '.' ana_complete.C:157:
Error: Can't call FairRecoCandidate::GetEmcIndex() in current scope ana_complete.C:157:
Possible candidates are...
(in FairRecoCandidate)
(in FairMultiLinkedData)
Error: non class,struct,union object GetRecoCandidate() used with . or -> ana_complete.C:157:
GetEmcIndex() -> (class G__CINT_ENDL)26133456
*** Interpreter error recovered ***

And it breaks... Sad


Other methods, like for example:
negative[j].GetRecoCandidate().GetMomentum().Mag()

work instead:

Code, commenting out the other line:

cout<< "GetMomentum() -> "<< negative[j].GetRecoCandidate().GetMomentum().Mag() <<endl;

some of the outputs inside the loop:

....

GetMomentum() -> 0.883354
GetMomentum() -> 0.976688
GetMomentum() -> 1.15377
evt 500

....

(of course I'm just printing it out on screen as a control sequence Wink )

Somehow it looks to me like some kind of bug(?), or am I still doing something wrong?

Thanks again!
Cheers,

Mamen
Re: Obtain Raw Info from Calorimeter (old GetMicroCandidate from TCandList class) [message #16325 is a reply to message #16324] Tue, 15 April 2014 19:50 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: *adsl.alicedsl.de
Hi Mamen,

as I wrote (and as it is written in the docu Stefano linked to), you have to cast the FairRecoCandidate (= base class) to the PndPidCandidate to access the full functionality. I.e. to access the EMC specific stuff, you need the cast, since the FairRecoCandidate knows about momentum etc, but not about detector specific information.

Therefore it might be more clear to create first a proper pointer to the PndPidCandidate and use it afterwards. You could also try a construction like

cout<< "GetEmcIndex() -> "<< ((PndPidCandidate*)negative[j]->GetRecoCandidate())->GetEmcIndex() <<endl;

but actually, I don't know whether it works, and it looks quite ugly... Wink


Best,
Klaus
Re: Obtain Raw Info from Calorimeter (old GetMicroCandidate from TCandList class) [message #16326 is a reply to message #16325] Tue, 15 April 2014 19:55 Go to previous messageGo to next message
StefanoSpataro is currently offline  StefanoSpataro
Messages: 2736
Registered: June 2005
Location: Torino
first-grade participant

From: *ip71.fastwebnet.it
Just one comment: this only works with full reco. In fast sim you cannot access to PID detectors information such as EMC cal energy, I believe.
Re: Obtain Raw Info from Calorimeter (old GetMicroCandidate from TCandList class) [message #16327 is a reply to message #16326] Tue, 15 April 2014 20:07 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: *adsl.alicedsl.de
Hi,


that's not completely true. Some of the values which are created by e.g. PID detectors are actually filled. Which values are available can be seen in PndFastSim.cxx, line 441 ff.

441	      pidCand->SetMcIndex(iTrack);
442	      pidCand->SetMvdDEDX( ft->detResponse()->MvddEdx() );
443	      //pidCand->SetMvdDEdxErr( ft->detResponse()->MvddEdxErr() );
444	      pidCand->SetSttMeanDEDX( ft->detResponse()->SttdEdx() );
445	      //pidCand->SetSttDEdxErr( ft->detResponse()->SttdEdxErr() );
446	      pidCand->SetTofM2( ft->detResponse()->m2() );
447	      //pidCand->SetTofM2Err( ft->detResponse()->m2Err() );
448	      pidCand->SetDrcThetaC( ft->detResponse()->DrcBarrelThtc() );
449	      pidCand->SetDrcThetaCErr( ft->detResponse()->DrcBarrelThtcErr() );
450	      pidCand->SetDrcNumberOfPhotons(0);
451	      pidCand->SetDiscThetaC( ft->detResponse()->DrcDiscThtc() );
452	      pidCand->SetDiscThetaCErr( ft->detResponse()->DrcDiscThtcErr() );
453	      pidCand->SetDiscNumberOfPhotons(0);
454	      pidCand->SetRichThetaC( ft->detResponse()->RichThtc() );
455	      pidCand->SetRichThetaCErr( ft->detResponse()->RichThtcErr() );
456	      pidCand->SetRichNumberOfPhotons(0);
457	      pidCand->SetEmcCalEnergy(ft->detResponse()->EmcEcal() );
458	      pidCand->SetMuoIron(ft->detResponse()->MuoIron() );


Best,
Klaus
Re: Obtain Raw Info from Calorimeter (old GetMicroCandidate from TCandList class) [message #16328 is a reply to message #16327] Tue, 15 April 2014 20:24 Go to previous messageGo to next message
StefanoSpataro is currently offline  StefanoSpataro
Messages: 2736
Registered: June 2005
Location: Torino
first-grade participant

From: *ip71.fastwebnet.it
Ok but the GetEmcIndex, which gives crashes to Mamen, is not filled Razz
Re: Obtain Raw Info from Calorimeter (old GetMicroCandidate from TCandList class) [message #16333 is a reply to message #16328] Wed, 16 April 2014 10:49 Go to previous message
Mamen is currently offline  Mamen
Messages: 55
Registered: January 2009
Location: Mainz
continuous participant
From: *kph.uni-mainz.de
Thanks a lot to both of you!

I finnaly could access the information I wanted
Very Happy

Cheers!
Mamen
Previous Topic: Vertex and kinematic fitter for full simulation.
Next Topic: option of polarization for Lambda-Lambdabar model
Goto Forum:
  


Current Time: Fri Mar 29 11:39:26 CET 2024

Total time taken to generate the page: 0.00750 seconds