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 **************************************************************************/
18 //////////////////////////////////////////////////////////////////
19 // Class for fast reconstruction of recpoints //
22 //////////////////////////////////////////////////////////////////
28 #include <AliRunLoader.h>
29 #include <AliLoader.h>
30 #include <AliRunDigitizer.h>
32 #include "AliITSFDigitizer.h"
33 #include "AliITSgeom.h"
34 #include "AliITSsimulationFastPoints.h"
36 ClassImp(AliITSFDigitizer)
38 //______________________________________________________________________
39 AliITSFDigitizer::AliITSFDigitizer() : AliDigitizer(),
43 // Default constructor.
46 //______________________________________________________________________
47 AliITSFDigitizer::AliITSFDigitizer(AliRunDigitizer *mngr) : AliDigitizer(mngr),
51 // Standard constructor.
54 //______________________________________________________________________
55 AliITSFDigitizer::AliITSFDigitizer(const AliITSFDigitizer &rec):AliDigitizer(rec),
61 //______________________________________________________________________
62 AliITSFDigitizer& AliITSFDigitizer::operator=(const AliITSFDigitizer& /*source*/){
64 // Assignment operator. This is a function which is not allowed to be
66 Error("operator=","Assignment operator not allowed\n");
70 //______________________________________________________________________
71 AliITSFDigitizer::~AliITSFDigitizer(){
73 // Default destructor.
75 fITS = 0; // don't delete fITS. Done else where.
77 //______________________________________________________________________
78 Bool_t AliITSFDigitizer::Init(){
81 // loads ITS and ITSgeom.
91 Warning("Init","gAlice not found");
94 fITS = (AliITS *)(gAlice->GetDetector("ITS"));
96 Warning("Init","ITS not found");
99 if(!fITS->GetITSgeom()){
100 Warning("Init","ITS geometry not found");
103 return fInit = kTRUE;
105 ////////////////////////////////////////////////////////////////////////
106 void AliITSFDigitizer::Exec(Option_t* opt){
108 // Main digitization function.
110 // Option_t * opt "deb" ... more verbose output
113 AliITSsimulationFastPoints *sim = new AliITSsimulationFastPoints();
114 AliRunLoader* outrl = AliRunLoader::GetRunLoader(
115 fManager->GetOutputFolderName());
117 Error("Exec","Can not find Run Loader in output folder.");
120 AliLoader* outgime = outrl->GetLoader("ITSLoader");
122 Error("Exec","Can not get TOF Loader from Output Run Loader.");
125 if(strstr(opt,"deb")){
126 Info("Exec","sim=%p, outrl=%p, outgime=%p",sim,outrl,outgime);
128 TTree* outputTreeR = outgime->TreeR();
129 if (outputTreeR == 0x0){
130 outgime->MakeTree("R");
131 outputTreeR = outgime->TreeR();
134 TClonesArray* recPoints = new TClonesArray("AliITSRecPoint",1000);
135 TBranch* branch = outputTreeR->GetBranch("ITSRecPointsF");
136 if(branch) branch->SetAddress(recPoints);
137 else outputTreeR->Branch("ITSRecPointsF",&recPoints);
139 fITS->InitModules(-1,nModules);
141 // load hits into modules
142 for (Int_t iFile = 0; iFile < fManager->GetNinputs(); iFile++){
143 AliRunLoader* rl = AliRunLoader::GetRunLoader(
144 fManager->GetInputFolderName(iFile));
146 Error("Exec","Can not find Run Loader in input %d folder.",iFile);
150 AliLoader* gime = rl->GetLoader("ITSLoader");
152 Error("Exec","Can not get TOF Loader from Input %d Run Loader.",
158 fITS->FillModules(gime->TreeH(),fManager->GetMask(iFile));
162 // transform hits to fast rec points
164 AliITSgeom *geom = fITS->GetITSgeom();
165 for(Int_t moduleIndex = 0; moduleIndex<geom->GetIndexMax(); moduleIndex++){
166 sim->CreateFastRecPoints(moduleIndex,recPoints);
170 outrl->WriteRecPoints("OVERWRITE");
171 // outputTreeR->AutoSave();
173 ////////////////////////////////////////////////////////////////////////