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 #include <Riostream.h>
22 #include <TSeqCollection.h>
24 #include <TClonesArray.h>
26 #include "AliHeader.h"
30 #include "AliITSsDigitize.h"
31 #include "AliITSgeom.h"
33 /////////////////////////////////////////////////////////
37 /////////////////////////////////////////////////////////
38 ClassImp(AliITSsDigitize)
39 //______________________________________________________________________
40 AliITSsDigitize::AliITSsDigitize():
46 // Default constructor.
52 // A zero-ed constructed AliITSsDigitize class.
54 fDet[0] = fDet[1] = fDet[2] = kTRUE;
56 //______________________________________________________________________
57 AliITSsDigitize::AliITSsDigitize(const char* filename):
63 // Standard constructor.
65 // const char* filename filename containing the digits to be
66 // reconstructed. If filename = 0 (nil)
67 // then no file is opened but a file is
68 // assumed to already be opened. This
69 // already opened file will be used.
73 // A standardly constructed AliITSsDigitize class.
80 fRunLoader = AliRunLoader::Open(filename);
81 fRunLoader->LoadgAlice();
82 fRunLoader->LoadHeader();
87 //______________________________________________________________________
88 AliITSsDigitize::~AliITSsDigitize(){
89 // Default constructor.
95 // A destroyed AliITSsDigitize class.
97 if(fRunLoader) delete fRunLoader;
101 //______________________________________________________________________
102 Bool_t AliITSsDigitize::Init(){
109 // kTRUE if no errors initilizing this class occurse else kFALSE
112 fITS = (AliITS*) gAlice->GetDetector("ITS");
114 cout << "ITS not found aborting. fITS=" << fITS << endl;
118 if(!(fITS->GetITSgeom())){
119 cout << "ITSgeom not found aborting."<< endl;
122 } // end if !GetITSgeom()
123 // Now ready to init.
125 fDet[0] = fDet[1] = fDet[2] = kTRUE;
127 fEnt = AliRunLoader::Instance()->GetNumberOfEvents();
129 AliLoader* loader = fRunLoader->GetLoader("ITSLoader");
131 if(!loader->TreeS()){
132 cout << "Having to create the SDigits Tree." << endl;
133 loader->MakeTree("S");
134 } // end if !gAlice->TreeS()
136 fITS->MakeBranch("S");
137 fITS->SetTreeAddress();
139 fRunLoader->GetEvent(fEnt0);
144 //______________________________________________________________________
145 Bool_t AliITSsDigitize::InitSDig() const {
146 // Sets up SDigitization part of AliITSDetType..
157 //______________________________________________________________________
158 void AliITSsDigitize::Exec(const Option_t *opt){
159 // Main SDigitization function.
161 // Option_t * opt list of subdetector to digitize. =0 all.
167 Bool_t condition =kFALSE;
169 if(strstr(opt,"All")||strstr(opt,"ALL")||strstr(opt,"ITS"))condition =kTRUE;
175 fDet[0] = fDet[1] = fDet[2] = kTRUE;
178 fDet[0] = fDet[1] = fDet[2] = kFALSE;
179 if(strstr(opt,"SPD")) fDet[kSPD] = kTRUE;
180 if(strstr(opt,"SDD")) fDet[kSDD] = kTRUE;
181 if(strstr(opt,"SSD")) fDet[kSSD] = kTRUE;
182 if(fDet[kSPD] && fDet[kSDD] && fDet[kSSD]) lopt = "All";
184 } // end if strstr(opt,...)
187 cout << "Initilization Failed, Can't run Exec." << endl;
191 fITS->HitsToSDigits(fRunLoader->GetHeader()->GetEvent(),0,-1," ",lopt," ");