]>
Commit | Line | Data |
---|---|---|
50837721 | 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 | /* $Id$ */ | |
17 | ||
d8d3b5b8 | 18 | #if !defined(__CINT__) || defined(__MAKECINT__) |
ba9436c6 | 19 | #include "AliRun.h" |
20 | #include "AliRunLoader.h" | |
21 | #include "AliLoader.h" | |
22 | #include "AliMUON.h" | |
23 | #include "AliMUONData.h" | |
d8d3b5b8 | 24 | #endif |
ba9436c6 | 25 | |
26 | AliRun * gAlice; | |
27 | ||
88cb7938 | 28 | //get trigger decision and write it in TreeR of MUON.RecPoints.root |
a897a37a | 29 | |
88cb7938 | 30 | void MUONtrigger (char* filename="galice.root", |
bf17dbfd | 31 | Int_t evNumber1=0, Int_t evNumber2=9999) |
a897a37a | 32 | { |
a9e2aefa | 33 | //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
88cb7938 | 34 | // Creating Run Loader and openning file containing Hits |
35 | AliRunLoader * RunLoader = AliRunLoader::Open(filename,"MUONFolder","UPDATE"); | |
36 | if (RunLoader ==0x0) { | |
37 | printf(">>> Error : Error Opening %s file \n",filename); | |
38 | return; | |
39 | } | |
40 | ||
c6cd5030 | 41 | // Loading AliRun master |
88cb7938 | 42 | RunLoader->UnloadgAlice(); |
43 | RunLoader->LoadgAlice(); | |
44 | gAlice = RunLoader->GetAliRun(); | |
45 | ||
c6cd5030 | 46 | // Loading MUON subsystem |
88cb7938 | 47 | AliMUON * MUON = (AliMUON *) gAlice->GetDetector("MUON"); |
48 | AliLoader * MUONLoader = RunLoader->GetLoader("MUONLoader"); | |
e6dd99fc | 49 | AliMUONData * muondata = MUON->GetMUONData(); |
88cb7938 | 50 | |
51 | Int_t ievent, nevents; | |
52 | nevents = RunLoader->GetNumberOfEvents(); | |
53 | ||
54 | MUONLoader->LoadDigits("READ"); | |
bf17dbfd | 55 | MUONLoader->LoadRecPoints("UPDATE"); |
346357f4 | 56 | |
c6cd5030 | 57 | // Testing if trigger has already been done |
58 | RunLoader->GetEvent(0); | |
59 | if (MUONLoader->TreeR()) { | |
60 | if (muondata->IsTriggerBranchesInTree()) { | |
61 | MUONLoader->UnloadRecPoints(); | |
62 | MUONLoader->LoadRecPoints("RECREATE"); | |
63 | printf("Recreating RecPoints files\n"); | |
64 | } | |
65 | } | |
66 | ||
67 | // Loop over events | |
bf17dbfd | 68 | if (evNumber2>nevents) evNumber2=nevents; |
c6cd5030 | 69 | for (Int_t ievent=evNumber1; ievent<evNumber2; ievent++) { // event loop |
70 | printf("event %d\n",ievent); | |
71 | RunLoader->GetEvent(ievent); | |
72 | if (MUONLoader->TreeR() == 0x0) MUONLoader->MakeRecPointsContainer(); | |
73 | ||
74 | muondata->MakeBranch("GLT"); | |
75 | muondata->SetTreeAddress("D,GLT"); | |
76 | MUON->Trigger(ievent); | |
77 | muondata->ResetDigits(); | |
78 | muondata->ResetTrigger(); | |
79 | } | |
80 | MUONLoader->UnloadDigits(); | |
81 | MUONLoader->UnloadRecPoints(); | |
a897a37a | 82 | } |
83 | ||
84 | ||
85 | ||
86 | ||
a9e2aefa | 87 | |
88 | ||
89 | ||
90 | ||
91 | ||
92 | ||
93 | ||
94 | ||
95 | ||
96 |