Access to clusters properties [message #11757] |
Tue, 10 May 2011 08:56 |
Ronald Kunne
Messages: 32 Registered: October 2009
|
continuous participant |
From: *in2p3.fr
|
|
Good morning!
I have two questions on access to clusters properties.
The PandaRoot version I use currently is 11787, dated 5/5/11.
Thanks in advance,
Ronald Kunne
1) What is the simplest way to access the contents of the individual crystals, that make up a cluster?
My goal is to distinguish between clusters consisting of one or two gammas, i.e. pizeros.
I would like to do something like this:
TString inPidTPCFile = "pid_tpccombi.root";
TFile *inFile = TFile::Open(inPidTPCFile,"READ");
TTree *lhe=(TTree *) inFile->Get("cbmsim") ;
...
TClonesArray* cluster_array=new TClonesArray("PndEmcCluster");
lhe->SetBranchAddress("EmcCluster",&cluster_array);
...
// loop over events
NTevents=lhe->GetEntriesFast();
for (Int_t j=0; j< NTevents ; j++){
lhe->GetEntry(j); // kinematics
// loop over clusters
Int_t nclusters= cluster_array->GetEntriesFast();
for (Int_t nc = 0; nc < nclusters; nc++) {
PndEmcCluster *cl = (PndEmcCluster *)cluster_array->At(nc);
// access to energy and moments of cluster
Double_t Energy = cl->energy();
Double_t Z20 = cl->Z20();
Double_t Z53 = cl->Z53();
Double_t LatMom = cl->LatMom();
// (hypothetical) loop over crystals in this cluster
Int_t ncrystals= crystal_array->GetEntriesFast();
for (Int_t nx = 0; nx < ncrystals; nx++) {
...etc...
}
}
}
2) The above method gives me access to the moments Z20, Z53 and LatMom.
How do I get access to *all* the moments available in
/emc/EmcData/PndEmcXClMoments.h ?
|
|
|
|
Re: Access to clusters properties [message #11767 is a reply to message #11759] |
Tue, 10 May 2011 13:05 |
Ronald Kunne
Messages: 32 Registered: October 2009
|
continuous participant |
From: *in2p3.fr
|
|
Hi Dima,
Thanks for the info. I looked through your collection of macros and found an easy solution there. I got 1) to work as I described above with the following for the "hypothetical loop":
Int_t ndigi= digi_array->GetEntriesFast();
Double_t digiEsum=0;
for (Int_t i=0; i<ndigi; i++) {
PndEmcDigi *digi=(PndEmcDigi*)digi_array->At(i);
Double_t digi_energy=digi->GetEnergy();
digiEsum+=digi_energy;
}
After the loop the sum over the digi energies is equal to the cluster energy as it should. I found this method in your /macro/emc/dedicated/digi_analys.C
2) does work indeed for
PndEmcClusterEnergySums esum(*cl, digi_array);
(which is the example in your reco_analys.C).
But when using instead
PndEmcXClMoments mom(*cl, digi_array);
I get the error message: "gGeoManager does not exist" with root ending without a crash.
But with access to the digis I can calculate my own moments anyway.
Greetings,
Ronald Kunne
|
|
|