]> git.uio.no Git - u/mrichter/AliRoot.git/blob - ITS/AliITSFDigitizer.cxx
Removing obsolete macros
[u/mrichter/AliRoot.git] / ITS / AliITSFDigitizer.cxx
1 /**************************************************************************
2  * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
3  *                                                                        *
4  * Author: The ALICE Off-line Project.                                    *
5  * Contributors are mentioned in the code where appropriate.              *
6  *                                                                        *
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  **************************************************************************/
15  
16 /*
17 $Log$
18 Revision 1.2  2002/10/14 14:57:00  hristov
19 Merging the VirtualMC branch to the main development branch (HEAD)
20
21 Revision 1.1.2.1  2002/07/24 09:27:50  alibrary
22 Updating on VirtualMC
23
24 Revision 1.1  2002/06/10 17:32:17  nilsen
25 New Fastpoint merger added.
26
27 */
28
29 #include <stdlib.h>
30 #include <Riostream.h>
31 #include <TObjArray.h>
32 #include <TClonesArray.h>
33 #include <TTree.h>
34 #include <TBranch.h>
35 #include <TFile.h>
36
37 #include <AliRun.h>
38 #include <AliRunDigitizer.h>
39
40 #include "AliITSFDigitizer.h"
41 // #include "AliITSpList.h"
42 #include "AliITSmodule.h"
43 #include "AliITSgeom.h"
44 #include "AliITSsimulationFastPoints.h"
45
46 ClassImp(AliITSFDigitizer)
47
48 //______________________________________________________________________
49 AliITSFDigitizer::AliITSFDigitizer() : AliDigitizer(){
50 //
51 // Default constructor.
52 //
53     fITS      = 0;
54     fInit     = kFALSE;
55 }
56 //______________________________________________________________________
57 AliITSFDigitizer::AliITSFDigitizer(AliRunDigitizer *mngr) : AliDigitizer(mngr){
58 //
59 // Standard constructor.
60 //
61     fITS      = 0;
62     fInit     = kFALSE;
63 }
64 //______________________________________________________________________
65 AliITSFDigitizer::~AliITSFDigitizer(){
66 //
67 // Default destructor. 
68 //
69     fITS = 0; // don't delete fITS. Done else where.
70 }
71 //______________________________________________________________________
72 Bool_t AliITSFDigitizer::Init(){
73 //
74 // Initialization. 
75 // loads ITS and ITSgeom.
76 // Inputs:
77 //      none.
78 // Outputs:
79 //      none.
80
81   
82   fInit = kFALSE;
83   if(!gAlice) {
84     fITS      = 0;
85     Warning("Init","gAlice not found");
86     return fInit;
87   }
88   fITS = (AliITS *)(gAlice->GetDetector("ITS"));
89   if(!fITS){
90     Warning("Init","ITS not found");
91     return fInit;
92   } 
93   if(!fITS->GetITSgeom()){
94     Warning("Init","ITS geometry not found");
95     return fInit;
96   }
97   return fInit = kTRUE;
98 }
99 ////////////////////////////////////////////////////////////////////////
100 void AliITSFDigitizer::Exec(Option_t* opt){
101 //
102 // Main digitization function. 
103 // Inputs:
104 //      Option_t * opt  "deb" ... more verbose output 
105 //
106
107   AliITSsimulationFastPoints *sim = new AliITSsimulationFastPoints();
108
109   TTree *outputTreeR = fManager->GetTreeR();
110   TClonesArray *recPoints = fITS->RecPoints();
111 //  TBranch *branch =
112       fITS->MakeBranchInTree(outputTreeR,"ITSRecPointsF",
113                                            &recPoints,4000,0);
114   
115   Int_t nModules;
116   fITS->InitModules(-1,nModules);
117
118 // load hits into modules
119
120   for (Int_t iFile = 0; iFile < fManager->GetNinputs(); iFile++) {
121     fITS->FillModules(fManager->GetInputTreeH(iFile),
122                       fManager->GetMask(iFile));
123   }
124   
125 // transform hits to fast rec points
126
127   AliITSgeom *geom = fITS->GetITSgeom();
128   for(Int_t moduleIndex = 0; moduleIndex < geom->GetIndexMax(); moduleIndex++){
129     sim->CreateFastRecPoints(moduleIndex);
130 //    branch->Fill();
131     outputTreeR->Fill();
132     fITS->ResetRecPoints();
133   }
134   outputTreeR->AutoSave();
135
136 }
137 ////////////////////////////////////////////////////////////////////////