1 /**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
7 * Permission to use, copy, modify and distribute this software and its *
8 * documentation strictly for non-commercial purposes is hereby granted *
9 * without fee, provided that the above copyright notice appears in all *
10 * copies and that both the copyright notice and this permission notice *
11 * appear in the supporting documentation. The authors make no claims *
12 * about the suitability of this software for any purpose. It is *
13 * provided "as is" without express or implied warranty. *
14 **************************************************************************/
22 #include <TObjArray.h>
23 #include <TClonesArray.h>
29 #include <AliRunDigitizer.h>
31 #include "AliITSFDigitizer.h"
32 // #include "AliITSpList.h"
33 #include "AliITSmodule.h"
34 #include "AliITSgeom.h"
35 #include "AliITSsimulationFastPoints.h"
37 ClassImp(AliITSFDigitizer)
39 //______________________________________________________________________
40 AliITSFDigitizer::AliITSFDigitizer() : AliDigitizer(){
42 // Default constructor.
47 //______________________________________________________________________
48 AliITSFDigitizer::AliITSFDigitizer(AliRunDigitizer *mngr) : AliDigitizer(mngr){
50 // Standard constructor.
55 //______________________________________________________________________
56 AliITSFDigitizer::~AliITSFDigitizer(){
58 // Default destructor.
60 fITS = 0; // don't delete fITS. Done else where.
62 //______________________________________________________________________
63 Bool_t AliITSFDigitizer::Init(){
66 // loads ITS and ITSgeom.
76 Warning("Init","gAlice not found");
79 fITS = (AliITS *)(gAlice->GetDetector("ITS"));
81 Warning("Init","ITS not found");
84 if(!fITS->GetITSgeom()){
85 Warning("Init","ITS geometry not found");
90 ////////////////////////////////////////////////////////////////////////
91 void AliITSFDigitizer::Exec(Option_t* opt){
93 // Main digitization function.
95 // Option_t * opt "deb" ... more verbose output
98 AliITSsimulationFastPoints *sim = new AliITSsimulationFastPoints();
100 TTree *outputTreeR = fManager->GetTreeR();
101 TClonesArray *recPoints = fITS->RecPoints();
103 fITS->MakeBranchInTree(outputTreeR,"ITSRecPointsF",
107 fITS->InitModules(-1,nModules);
109 // load hits into modules
111 for (Int_t iFile = 0; iFile < fManager->GetNinputs(); iFile++) {
112 fITS->FillModules(fManager->GetInputTreeH(iFile),
113 fManager->GetMask(iFile));
116 // transform hits to fast rec points
118 AliITSgeom *geom = fITS->GetITSgeom();
119 for(Int_t moduleIndex = 0; moduleIndex < geom->GetIndexMax(); moduleIndex++){
120 sim->CreateFastRecPoints(moduleIndex);
123 fITS->ResetRecPoints();
125 outputTreeR->AutoSave();
128 ////////////////////////////////////////////////////////////////////////