]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - STEER/AliTriggerDetector.cxx
Initialization of some data members (Alberto)
[u/mrichter/AliRoot.git] / STEER / AliTriggerDetector.cxx
index 3f02d7d414459ade7fe50cd04c02b79f6c159d00..27049cf892726a008d8efc348c1ba9544a683216 100644 (file)
@@ -25,6 +25,7 @@
 //                                                                           //
 ///////////////////////////////////////////////////////////////////////////////
 
+#include <Riostream.h>
 #include <TNamed.h>
 #include <TString.h>
 #include <TObjArray.h>
@@ -104,9 +105,7 @@ void AliTriggerDetector::Trigger()
 void AliTriggerDetector::SetInput( TString& name )
 {
    // Set Input by name
-   AliTriggerInput* in = ((AliTriggerInput*)fInputs.FindObject( name.Data() ));
-   in->Set();
-   fMask |= in->GetValue();
+   SetInput( name.Data() );
 }
 
 //_____________________________________________________________________________
@@ -114,8 +113,11 @@ void AliTriggerDetector::SetInput( const char * name )
 {
    // Set Input by name
    AliTriggerInput* in = ((AliTriggerInput*)fInputs.FindObject( name ));
-   in->Set();
-   fMask |= in->GetValue();
+   if( in ) {
+      in->Set();
+      fMask |= in->GetValue();
+   } else
+      AliError( Form( "There is not input named %s", name ) );
 }
 
 //_____________________________________________________________________________
@@ -133,3 +135,15 @@ void AliTriggerDetector::SetInput( Int_t mask )
    }
 }
 
+//_____________________________________________________________________________
+void AliTriggerDetector::Print( const Option_t* opt ) const
+{
+   // Print
+   cout << "Trigger Detector : " << GetName() << endl;
+   cout << "  Trigger Class Mask: 0x" << hex << GetMask() << dec << endl;
+   Int_t nInputs = fInputs.GetEntriesFast();
+   for( Int_t j=0; j<nInputs; j++ ) {
+      AliTriggerInput* in = (AliTriggerInput*)fInputs.At( j );
+      in->Print( opt );
+   }
+}