1 /**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
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 **************************************************************************/
18 #if !defined(__CINT__) || defined(__MAKECINT__)
20 #include "AliRunLoader.h"
21 #include "AliLoader.h"
23 #include "AliMUONData.h"
28 //get trigger decision and write it in TreeR of MUON.RecPoints.root
30 void MUONtrigger (char* filename="galice.root",
31 Int_t evNumber1=0, Int_t evNumber2=9999)
33 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
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);
41 // Loading AliRun master
42 RunLoader->UnloadgAlice();
43 RunLoader->LoadgAlice();
44 gAlice = RunLoader->GetAliRun();
46 // Loading MUON subsystem
47 AliMUON * MUON = (AliMUON *) gAlice->GetDetector("MUON");
48 AliLoader * MUONLoader = RunLoader->GetLoader("MUONLoader");
49 AliMUONData * muondata = MUON->GetMUONData();
51 Int_t ievent, nevents;
52 nevents = RunLoader->GetNumberOfEvents();
54 MUONLoader->LoadDigits("READ");
55 MUONLoader->LoadRecPoints("UPDATE");
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");
68 if (evNumber2>nevents) evNumber2=nevents;
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();
74 muondata->MakeBranch("GLT");
75 muondata->SetTreeAddress("D,GLT");
76 MUON->Trigger(ievent);
77 muondata->ResetDigits();
78 muondata->ResetTrigger();
80 MUONLoader->UnloadDigits();
81 MUONLoader->UnloadRecPoints();