]> git.uio.no Git - u/mrichter/AliRoot.git/blob - MUON/MUONHit2SDigit.C
Only with TGeo now (A. Gheata)
[u/mrichter/AliRoot.git] / MUON / MUONHit2SDigit.C
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 #if !defined(__CINT__) || defined(__MAKECINT__)
18 #include <TClonesArray.h>
19
20 #include "AliRun.h"
21 #include "AliMUON.h"
22 #include "AliMUONData.h"
23 #endif
24
25 void MUONHit2SDigit(Int_t iEveMin, Int_t iEveMax, Text_t *FileName = "galice.root")
26 {
27   //
28   cout << "MUONSDigitTest" << endl;
29   cout << "FileName ``" << FileName << "''" << endl;
30   
31   // Creating Run Loader and openning file containing Hits, Digits and RecPoints
32   AliRunLoader * RunLoader = AliRunLoader::Open(FileName,"Event","UPDATE");
33   if (RunLoader ==0x0) {
34     printf(">>> Error : Error Opening %s file \n",FileName);
35     return;
36   }
37   // Loading AliRun master
38   RunLoader->LoadgAlice();
39   gAlice = RunLoader->GetAliRun();
40   AliLoader    * gime; 
41   gime        = RunLoader->GetLoader("MUONLoader");
42  
43   gime->LoadHits("READ");
44   gime->LoadSDigits("RECREATE");
45
46   // Loading MUON subsystem
47   AliMUON* MUON = (AliMUON *) gAlice->GetDetector("MUON");
48
49   Int_t nEvents = RunLoader->GetNumberOfEvents();
50   Int_t nEveMax = TMath::Min(iEveMax,nEvents-1);
51   for (Int_t iEvent = iEveMin; iEvent <= nEveMax; iEvent++){
52     RunLoader->GetEvent(iEvent);
53     MUON->Hits2SDigits();
54   }
55 }