]> git.uio.no Git - u/mrichter/AliRoot.git/blame - MUON/MUONtrigger.C
Independent Trigger and rawcluster reconstruction
[u/mrichter/AliRoot.git] / MUON / MUONtrigger.C
CommitLineData
ba9436c6 1#include "AliRun.h"
2#include "AliRunLoader.h"
3#include "AliLoader.h"
4#include "AliMUON.h"
5#include "AliMUONData.h"
6
7
8AliRun * gAlice;
9
88cb7938 10//get trigger decision and write it in TreeR of MUON.RecPoints.root
a897a37a 11
88cb7938 12void MUONtrigger (char* filename="galice.root",
bf17dbfd 13 Int_t evNumber1=0, Int_t evNumber2=9999)
a897a37a 14{
a9e2aefa 15//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
88cb7938 16// Creating Run Loader and openning file containing Hits
17 AliRunLoader * RunLoader = AliRunLoader::Open(filename,"MUONFolder","UPDATE");
18 if (RunLoader ==0x0) {
19 printf(">>> Error : Error Opening %s file \n",filename);
20 return;
21 }
22
23 // Loading AliRun master
24 RunLoader->UnloadgAlice();
25 RunLoader->LoadgAlice();
26 gAlice = RunLoader->GetAliRun();
27
28 // Loading MUON subsystem
29 AliMUON * MUON = (AliMUON *) gAlice->GetDetector("MUON");
30 AliLoader * MUONLoader = RunLoader->GetLoader("MUONLoader");
e6dd99fc 31 AliMUONData * muondata = MUON->GetMUONData();
32 muondata->SetLoader(MUONLoader);
88cb7938 33
34 Int_t ievent, nevents;
35 nevents = RunLoader->GetNumberOfEvents();
36
37 MUONLoader->LoadDigits("READ");
bf17dbfd 38 MUONLoader->LoadRecPoints("UPDATE");
346357f4 39
40
41
a9e2aefa 42//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
bf17dbfd 43 if (evNumber2>nevents) evNumber2=nevents;
e6dd99fc 44 for (Int_t ievent=evNumber1; ievent<evNumber2; ievent++) { // event loop
88cb7938 45 printf("event %d\n",ievent);
46 RunLoader->GetEvent(ievent);
346357f4 47 // Test if rawcluster has already been done before
48 if (MUONLoader->TreeR() == 0x0)
49 MUONLoader->MakeRecPointsContainer();
50 else {
51 if (muondata->IsTriggerBranchesInTree()){ // Test if rawcluster has already been done before
52 MUONLoader->MakeRecPointsContainer(); // Redoing clusterisation
53 Info("RecPointsContainer","Recreating RecPointsContainer and deleting previous ones");
54 }
bf17dbfd 55 }
e6dd99fc 56 muondata->MakeBranch("GLT");
57 muondata->SetTreeAddress("D,GLT");
bf17dbfd 58 MUON->Trigger(ievent);
59 muondata->ResetDigits();
60 muondata->ResetTrigger();
a897a37a 61 } // event loop
88cb7938 62 MUONLoader->UnloadDigits();
bf17dbfd 63 MUONLoader->UnloadRecPoints();
a897a37a 64}
65
66
67
68
a9e2aefa 69
70
71
72
73
74
75
76
77
78