Update master to aliroot
[u/mrichter/AliRoot.git] / PHOS / macros / TestPHOSTrigger.C
CommitLineData
0b2ec9f7 1
2// Test Macro, shows how to execute the Trigger, and prints the results.
3// Author: Gustavo Conesa
4
5void TestPHOSTrigger(){
6
7 //Loader
8 AliRunLoader* rl=0x0;
9
10// cout<<"TestPHOSTrigger: Creating Run Loader ..."<<endl;
11// rl = AliRunLoader::Open("galice.root",
12// AliConfig::GetDefaultEventFolderName(),
13// "read");
14// if (rl == 0x0)
15// {
16// gAlice->Fatal("Config.C","Can not instatiate the Run Loader");
17// return;
18// }
19
20// AliPHOSLoader *emcalLoader = dynamic_cast<AliPHOSLoader*>
21// (rl->GetDetectorLoader("PHOS"));
22
23// //Load Digits
24// rl->LoadDigits("PHOS");
25
26 AliPHOSGetter * gime = AliPHOSGetter::Instance("./galice.root");
27 //Get Maximum number of events
28 Int_t maxevent = gime->MaxEvent();
29 //Int_t maxevent = rl->GetNumberOfEvents();
30 cout<<"n events "<<maxevent<<endl;
31// maxevent=5;
32
33
34 //event loop
35 for(Int_t iEvent = 0; iEvent < maxevent ; iEvent++){
36 // rl->GetEvent(iEvent);
37 gime->Event(iEvent,"D"); //Only Digits
38 cout<<">>>>>>>>>>> Event >>> "<<iEvent<<endl;
39 AliPHOSTrigger *tr = new AliPHOSTrigger();
40 //Create trigger pointer and set thresholds if you want
41 //Default threshold values need to be fixed
42 // tr->SetL0Threshold(10000);
43 // tr->SetL1JetLowPtThreshold(10000);
44 // tr->SetL1JetHighPtThreshold(10000);
45 tr->SetPatchSize(1);//0 means 2x2, 1->4x4, 2->8x8, 3->16x16 ...
46 //Select trigger for each event
47 tr->Trigger();//Do the trigger algorithm
48 //cout<<"Patch "<<tr->GetPatchSize()<<endl;
49 cout<<"Trigger patch "<< tr->GetPatchSize()
50 <<" 2x2 maximum amplitude sum "<<tr->Get2x2MaxAmplitude()
51 <<" nxn max amp sum "<<tr->GetnxnMaxAmplitude()<<endl;
52 //tr->Print("");//Print results.
53
54 }
55}