* provided "as is" without express or implied warranty. *
**************************************************************************/
-/*
-$Log$
-Revision 1.1.2.1 2002/07/24 09:27:50 alibrary
-Updating on VirtualMC
-
-Revision 1.1 2002/06/10 17:32:17 nilsen
-New Fastpoint merger added.
-
-*/
+/* $Id$ */
#include <stdlib.h>
-#include <iostream.h>
+#include <Riostream.h>
#include <TObjArray.h>
#include <TClonesArray.h>
#include <TTree.h>
#include <TFile.h>
#include <AliRun.h>
+#include <AliRunLoader.h>
+#include <AliLoader.h>
#include <AliRunDigitizer.h>
#include "AliITSFDigitizer.h"
// Option_t * opt "deb" ... more verbose output
//
- AliITSsimulationFastPoints *sim = new AliITSsimulationFastPoints();
-
- TTree *outputTreeR = fManager->GetTreeR();
- TClonesArray *recPoints = fITS->RecPoints();
+ AliITSsimulationFastPoints *sim = new AliITSsimulationFastPoints();
+ AliRunLoader* outrl = AliRunLoader::GetRunLoader(
+ fManager->GetOutputFolderName());
+ if (outrl == 0x0){
+ Error("Exec","Can not find Run Loader in output folder.");
+ return;
+ }
+ AliLoader* outgime = outrl->GetLoader("ITSLoader");
+ if (outgime == 0x0){
+ Error("Exec","Can not get TOF Loader from Output Run Loader.");
+ return;
+ }
+ if(strstr(opt,"deb")){
+ Info("Exec","sim=%p, outrl=%p, outgime=%p",sim,outrl,outgime);
+ }
+ TTree* outputTreeR = outgime->TreeR();
+ if (outputTreeR == 0x0){
+ outgime->MakeTree("R");
+ outputTreeR = outgime->TreeR();
+ }
+ TClonesArray *recPoints = fITS->RecPoints();
// TBranch *branch =
- fITS->MakeBranchInTree(outputTreeR,"ITSRecPointsF",
- &recPoints,4000,0);
+ fITS->MakeBranchInTree(outputTreeR,"ITSRecPointsF",&recPoints,4000,0);
- Int_t nModules;
- fITS->InitModules(-1,nModules);
+ Int_t nModules;
+ fITS->InitModules(-1,nModules);
// load hits into modules
+ for (Int_t iFile = 0; iFile < fManager->GetNinputs(); iFile++){
+ AliRunLoader* rl = AliRunLoader::GetRunLoader(
+ fManager->GetInputFolderName(iFile));
+ if (rl == 0x0){
+ Error("Exec","Can not find Run Loader in input %d folder.",iFile);
+ return;
+ }
- for (Int_t iFile = 0; iFile < fManager->GetNinputs(); iFile++) {
- fITS->FillModules(fManager->GetInputTreeH(iFile),
- fManager->GetMask(iFile));
- }
+ AliLoader* gime = rl->GetLoader("ITSLoader");
+ if (gime == 0x0){
+ Error("Exec","Can not get TOF Loader from Input %d Run Loader.",
+ iFile);
+ return;
+ }
+
+ gime->LoadHits();
+ fITS->FillModules(gime->TreeH(),fManager->GetMask(iFile));
+ gime->UnloadHits();
+ }
// transform hits to fast rec points
- AliITSgeom *geom = fITS->GetITSgeom();
- for(Int_t moduleIndex = 0; moduleIndex < geom->GetIndexMax(); moduleIndex++){
- sim->CreateFastRecPoints(moduleIndex);
-// branch->Fill();
- outputTreeR->Fill();
- fITS->ResetRecPoints();
- }
- outputTreeR->AutoSave();
-
+ AliITSgeom *geom = fITS->GetITSgeom();
+ for(Int_t moduleIndex = 0; moduleIndex<geom->GetIndexMax(); moduleIndex++){
+ sim->CreateFastRecPoints(moduleIndex);
+// branch->Fill();
+ outputTreeR->Fill();
+ fITS->ResetRecPoints();
+ }
+ outrl->WriteRecPoints("OVERWRITE");
+// outputTreeR->AutoSave();
}
////////////////////////////////////////////////////////////////////////