Modifications needed by the HBT analysis (P.Skowronski)
[u/mrichter/AliRoot.git] / MUON / MUONtrigger.C
CommitLineData
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
26AliRun * gAlice;
27
88cb7938 28//get trigger decision and write it in TreeR of MUON.RecPoints.root
a897a37a 29
88cb7938 30void 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
41 // Loading AliRun master
42 RunLoader->UnloadgAlice();
43 RunLoader->LoadgAlice();
44 gAlice = RunLoader->GetAliRun();
45
46 // Loading MUON subsystem
47 AliMUON * MUON = (AliMUON *) gAlice->GetDetector("MUON");
48 AliLoader * MUONLoader = RunLoader->GetLoader("MUONLoader");
e6dd99fc 49 AliMUONData * muondata = MUON->GetMUONData();
50 muondata->SetLoader(MUONLoader);
88cb7938 51
52 Int_t ievent, nevents;
53 nevents = RunLoader->GetNumberOfEvents();
54
55 MUONLoader->LoadDigits("READ");
bf17dbfd 56 MUONLoader->LoadRecPoints("UPDATE");
346357f4 57
58
59
a9e2aefa 60//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
bf17dbfd 61 if (evNumber2>nevents) evNumber2=nevents;
e6dd99fc 62 for (Int_t ievent=evNumber1; ievent<evNumber2; ievent++) { // event loop
88cb7938 63 printf("event %d\n",ievent);
64 RunLoader->GetEvent(ievent);
346357f4 65 // Test if rawcluster has already been done before
66 if (MUONLoader->TreeR() == 0x0)
67 MUONLoader->MakeRecPointsContainer();
68 else {
69 if (muondata->IsTriggerBranchesInTree()){ // Test if rawcluster has already been done before
50837721 70 if (ievent==evNumber1) MUONLoader->UnloadRecPoints();
346357f4 71 MUONLoader->MakeRecPointsContainer(); // Redoing clusterisation
72 Info("RecPointsContainer","Recreating RecPointsContainer and deleting previous ones");
73 }
bf17dbfd 74 }
e6dd99fc 75 muondata->MakeBranch("GLT");
76 muondata->SetTreeAddress("D,GLT");
bf17dbfd 77 MUON->Trigger(ievent);
78 muondata->ResetDigits();
79 muondata->ResetTrigger();
a897a37a 80 } // event loop
88cb7938 81 MUONLoader->UnloadDigits();
bf17dbfd 82 MUONLoader->UnloadRecPoints();
a897a37a 83}
84
85
86
87
a9e2aefa 88
89
90
91
92
93
94
95
96
97