Bring PIPEupgrade naming conventions in acc. with ITSU expectations
[u/mrichter/AliRoot.git] / STEER / ReadTrigger.C
CommitLineData
f6545345 1ReadTrigger( TString inFile = "galice.root" )
2{
3 // Dynamically link some shared libs
4 if( gClassTable->GetID( "AliRun" ) < 0 ) {
5 gROOT->ProcessLine( ".x $(ALICE_ROOT)/macros/loadlibs.C" );
6 } else if( gAlice ) {
33c3c91a 7 delete AliRunLoader::Instance();
f6545345 8 delete gAlice;
9 gAlice=0;
10 }
11
12 AliRunLoader* rl = AliRunLoader::Open( inFile.Data() );
13 if( rl == 0x0 ) {
14 cerr << "ReadTrigger.C : Can not open session RunLoader=NULL"
15 << endl;
16 return 3;
17 }
18
19 // Read and Print Trigger
20
21 rl->LoadTrigger();
22 AliCentralTrigger *aCTP = rl->GetTrigger();
23 aCTP->Print();
24
25 // Loop over event and print trigger info
26 Int_t nevent = rl->GetNumberOfEvents();
27 for( Int_t i=0; i<nevent; i++ ) {
28 rl->GetEvent( i );
29 cout << endl << "Event " << i
30 << " Global Trigger Class Mask: 0x" << hex << aCTP->GetClassMask() << endl;
31
32 // Read trigger inputs from detector. Example. ITS
33 AliLoader * loader = rl->GetDetectorLoader( "ITS" );
34 if( loader ) {
35 AliDataLoader * dataLoader = loader->GetDigitsDataLoader();
36 if( !dataLoader->IsFileOpen() )
37 dataLoader->OpenFile( "READ" );
38 AliTriggerDetector* trgdet = (AliTriggerDetector*)dataLoader->GetDirectory()->Get( "Trigger" );
39 if( trgdet ) {
40 trgdet->Print();
41 } else {
42 cerr << "There is not trigger object for " << loader->GetName() << endl;
43 }
44 }
45 }
880d6abe 46}