Included new data member to change patch size in calorimeters trigger (Gustavo)
[u/mrichter/AliRoot.git] / EMCAL / macros / TestEMCALTrigger.C
CommitLineData
8393329e 1
2// Test Macro, shows how to execute the Trigger, and prints the results.
3// Author: Gustavo Conesa
4
5void TestEMCALTrigger(){
6
7 //Loader
8 AliRunLoader* rl=0x0;
9
10 cout<<"TestEMCALTrigger: 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 AliEMCALLoader *emcalLoader = dynamic_cast<AliEMCALLoader*>
21 (rl->GetDetectorLoader("EMCAL"));
22
23 //Get Maximum number of events
24
25 Int_t maxevent = rl->GetNumberOfEvents();
26 cout<<"n events "<<maxevent<<endl;
0b2ec9f7 27// maxevent=5;
8393329e 28 //Load Digits
29 rl->LoadDigits("EMCAL");
8393329e 30
31 //event loop
32 for(Int_t iEvent = 0; iEvent < maxevent ; iEvent++){
33 rl->GetEvent(iEvent);
34 cout<<">>>>>>>>>>> Event >>> "<<iEvent<<endl;
0b2ec9f7 35 AliEMCALTrigger *tr = new AliEMCALTrigger();
36 //Create trigger pointer and set thresholds if you want
37 //Default threshold values need to be fixed
38 // tr->SetL0Threshold(10000);
39 // tr->SetL1JetLowPtThreshold(10000);
40 // tr->SetL1JetMediumPtThreshold(10000);
41 // tr->SetL1JetHighPtThreshold(10000);
42 tr->SetPatchSize(4);//0 means 2x2, 1->4x4, 2->8x8, 3->16x16 ...
8393329e 43 //Select trigger for each event
44 tr->Trigger();//Do the trigger algorithm
0b2ec9f7 45 // cout<<"Patch "<<tr->GetPatchSize()<<endl;
46 // cout<<"Trigger patch "<< tr->GetPatchSize()
47 // <<" 2x2 maximum amplitude sum "<<tr->Get2x2MaxAmplitude()
48 // <<" nxn max amp sum "<<tr->GetnxnMaxAmplitude()<<endl;
8393329e 49 tr->Print("");//Print results.
50
51 }
52}