- Welding section on absorber side (LHCVC2C_001)
[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"
52c9bc11 24#include "AliMUONTriggerDecision.h"
d8d3b5b8 25#endif
ba9436c6 26
27AliRun * gAlice;
28
88cb7938 29//get trigger decision and write it in TreeR of MUON.RecPoints.root
a897a37a 30
88cb7938 31void MUONtrigger (char* filename="galice.root",
bf17dbfd 32 Int_t evNumber1=0, Int_t evNumber2=9999)
a897a37a 33{
a9e2aefa 34//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
88cb7938 35// Creating Run Loader and openning file containing Hits
52c9bc11 36 AliRunLoader * RunLoader = AliRunLoader::Open(filename,"MUONLoader","UPDATE");
88cb7938 37 if (RunLoader ==0x0) {
38 printf(">>> Error : Error Opening %s file \n",filename);
39 return;
40 }
41
52c9bc11 42 // Loading AliRun master
43 if (RunLoader->GetAliRun() == 0x0) RunLoader->LoadgAlice();
88cb7938 44
52c9bc11 45 // Loading MUON subsystem
88cb7938 46 AliLoader * MUONLoader = RunLoader->GetLoader("MUONLoader");
47
48 Int_t ievent, nevents;
49 nevents = RunLoader->GetNumberOfEvents();
50
52c9bc11 51 AliMUONTriggerDecision* TrigDec = new AliMUONTriggerDecision(MUONLoader);
52 AliMUONData* muondata = TrigDec->GetMUONData();
53
88cb7938 54 MUONLoader->LoadDigits("READ");
bf17dbfd 55 MUONLoader->LoadRecPoints("UPDATE");
346357f4 56
52c9bc11 57 // Testing if trigger has already been done
c6cd5030 58 RunLoader->GetEvent(0);
59 if (MUONLoader->TreeR()) {
52c9bc11 60 if (muondata->IsTriggerBranchesInTree()) {
61 MUONLoader->UnloadRecPoints();
62 MUONLoader->LoadRecPoints("RECREATE");
63 printf("Recreating RecPoints files\n");
64 }
c6cd5030 65 }
52c9bc11 66
67//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
bf17dbfd 68 if (evNumber2>nevents) evNumber2=nevents;
52c9bc11 69 for (ievent = evNumber1; ievent < evNumber2; ievent++) { // event loop
70
71 printf("event %d\n",ievent);
72 RunLoader->GetEvent(ievent);
73 // Test if rawcluster has already been done before
74 if (MUONLoader->TreeR() == 0x0)
75 MUONLoader->MakeRecPointsContainer();
76 else {
77 if (muondata->IsTriggerBranchesInTree()){
78 // Test if rawcluster has already been done before
79 if (ievent == evNumber1) MUONLoader->UnloadRecPoints();
80 MUONLoader->MakeRecPointsContainer(); // Redoing clusterisation
81 Info("RecPointsContainer",
82 "Recreating RecPointsContainer and deleting previous ones");
83 }
84 }
85 muondata->MakeBranch("GLT");
86 muondata->SetTreeAddress("D,GLT");
87
88 TrigDec->Digits2Trigger();
89
90 muondata->Fill("GLT"); //Filling Global Local Trigger
91 MUONLoader->WriteRecPoints("OVERWRITE");
92 muondata->ResetDigits();
93 muondata->ResetTrigger();
94
95 } // event loop
96
97 MUONLoader->UnloadDigits();
98 MUONLoader->UnloadRecPoints();
a897a37a 99}
100
101
102
103
a9e2aefa 104
105
106
107
108
109
110
111
112
113