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