GSI Forum
GSI Helmholtzzentrum für Schwerionenforschung

Home » PANDA » PandaRoot » EMC » Access to clusters properties (bis)
Access to clusters properties (bis) [message #12626] Tue, 06 September 2011 12:27 Go to next message
Ronald Kunne is currently offline  Ronald Kunne
Messages: 32
Registered: October 2009
continuous participant
From: *in2p3.fr
How do I get access to Zernicke moments different from Z20, Z53 and LatMom ?

The "obvious" way to do it, using code copied from PndEmcMakeCluster.cxx, seemed to be to add to my macro:

lhe->AddFriend("cbmsim", "digi_emc.root");
TClonesArray* digi_array=new TClonesArray("PndEmcDigi");
lhe->SetBranchAddress("EmcDigi",&digi_array);

...

for (Int_t i=0; i<cluster_array->GetEntriesFast(); i++)
  {
    PndEmcCluster *cl=(PndEmcCluster*)cluster_array->At(i);
    PndEmcXClMoments *xClMoments = new PndEmcXClMoments(*cl, digi_array);
    Double_t Z42=xClMoments->AbsZernikeMoment(4, 2, 15);
    ...
  }


This works perfectly well for accessing for instance
PndEmcClusterEnergySums esum(*cl, digi_array);

But the call to PndEmcXClMoments leads to the error:
gGeoManager does not exist

Thanks in advance for your help.

Ronald Kunne
Re: Access to clusters properties (bis) [message #12627 is a reply to message #12626] Tue, 06 September 2011 12:43 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*
Probably you need something like:


	TString parFile = "simparams.root"; 
	FairRuntimeDb* rtdb = fRun->GetRuntimeDb();
	FairParRootFileIo* parInput1 = new FairParRootFileIo();
	parInput1->open(parFile.Data());
	rtdb->setFirstInput(parInput1);



in your macro.
Re: Access to clusters properties (bis) [message #12628 is a reply to message #12627] Tue, 06 September 2011 13:18 Go to previous messageGo to next message
Ronald Kunne is currently offline  Ronald Kunne
Messages: 32
Registered: October 2009
continuous participant
From: *in2p3.fr
Well, I do have something similar already in the macro which looks like your code, using "params_tpccombi.root" instead of "simparams.root". So there must be more to it.
  TString sysFile = gSystem->Getenv("VMCWORKDIR");
  TString allDigiFile = sysFile+"/macro/params/all.par";
  TString parFile = Directory+"params_tpccombi.root"; 

  FairRunAna *fRun= new FairRunAna();
  FairRuntimeDb* rtdb = fRun->GetRuntimeDb();
  FairParRootFileIo* parInput1 = new FairParRootFileIo();
  parInput1->open(parFile.Data());
  rtdb->setFirstInput(parInput1);

  FairParAsciiFileIo* parIo1 = new FairParAsciiFileIo();
  parIo1->open(allDigiFile.Data(),"in");

  PndGeoHandling* geoH = PndGeoHandling::Instance();
Re: Access to clusters properties (bis) [message #12629 is a reply to message #12628] Tue, 06 September 2011 13:25 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*
Do you have also:

PndEmcMapper::Init(6);


?
Re: Access to clusters properties (bis) [message #12630 is a reply to message #12629] Tue, 06 September 2011 13:46 Go to previous messageGo to next message
Ronald Kunne is currently offline  Ronald Kunne
Messages: 32
Registered: October 2009
continuous participant
From: *in2p3.fr
Yes. But actually having it in or not doesn't change anything.

There seems to be a fundamental difference between the class

PndEmcXClMoments xClMoments(*cl, digi_array);

and others in the same directory, like

PndEmcClusterEnergySums esum(*cl, digi_array);


Re: Access to clusters properties (bis) [message #12631 is a reply to message #12630] Tue, 06 September 2011 13:56 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*
I surrender,
probably Dima can answer you.
Re: Access to clusters properties (bis) [message #12632 is a reply to message #12626] Tue, 06 September 2011 16:44 Go to previous messageGo to next message
Dima Melnychuk is currently offline  Dima Melnychuk
Messages: 213
Registered: April 2004
Location: National Centre for Nucle...
first-grade participant
From: 140.181.10*
Hi Ronald,

It works if you add :

	TFile* file = new TFile("simparams.root");
	file->Get("FairBaseParSet"); 



The whole macro is attached for calculation AbsZernikeMoment(4, 2, 15).

Dima
Re: Access to clusters properties (bis) [message #12633 is a reply to message #12632] Tue, 06 September 2011 17:11 Go to previous message
Ronald Kunne is currently offline  Ronald Kunne
Messages: 32
Registered: October 2009
continuous participant
From: *in2p3.fr
Yes!! This "magic recipe" seems to work.

With the only difference that "simparams.root" is called "params_tpccombi.root" in the reconstruction sequence I use. Which is the one from: trunk/macro/pid

Thanks very much, Dima!

Friendly greetings,
Ronald Kunne
Previous Topic: New FwEndCap geometry implemented
Next Topic: update EMC geometry
Goto Forum:
  


Current Time: Tue Dec 10 19:14:23 CET 2024

Total time taken to generate the page: 0.00721 seconds