Re: CbmRootManager [message #5500 is a reply to message #5495] |
Tue, 27 November 2007 16:54   |
asanchez
Messages: 350 Registered: March 2006
|
first-grade participant |
From: *gsi.de
|
|
What is your input file?
you should have something like that inside of
the Init method -----
like
InitStatus PndTofHitProducerIdeal::Init()
{
// Get input array
fPointarray = (TClonesArray*) ioman->GetObject("TofPoint");
//TofPoint is the branchname you want to read from
//input file
if ( ! fPointArray )
{
std::cout << "-W- PndTofHitProducerIdeal::Init: "
<< "No TofPoint array!" << std::endl;
return kERROR;
}
and then, you define where you want to save the output
//Create and register output array
fHitArray = new TClonesArray("PndTofHit");
ioman->Register("TofHit", "Tof", fHitArray, kTRUE);
return kSUCCESS;
}
In Exec to get fPointarray information,
// Loop over TofPoints
Int_t nPoints = fPointArray->GetEntriesFast();
for (Int_t iPoint = 0; iPoint < nPoints; iPoint++)
{
point = (PndTofPoint*) fPointArray->At(iPoint);
// Create new hit
new ((*fHitArray)[iPoint]) PndTofHit(trackID, detID,
point->GetDetName(),time, t1, position,dpos,iPoint, point->GetEnergyLoss(),1);
}
i hope it can help you
cheers
alicia.
|
|
|