/* $Id$ */
///////////////////////////////////////////////////////////////////////////////
-//
+//
// This class for running and define a Trigger Descriptor
-//
+//
// A Trigger Descriptor define a trigger setup for specific runnign
// condition (Pb-Pb, p-p, p-A, Calibration, etc).
// It keep:
// - cluster detector (List of detectors involved)
-// - List of conditions
+// - List of conditions
//
// Descriptors could be create in advance and store in a file.
//
// Example how to create a Trigger Descriptor:
-//
+//
// AliTriggerDescriptor descrip( "TEST", "Test Descriptor" );
//
// // Define a Cluster Detector
// "VO2_M3_ZDC1",
// "Dummy",
// 0x0200 );
-//
+//
// descrip.AddCondition( "VZERO_TEST3_L0 | MUON_Unlike_LPt_L0 | ZDC_TEST3_L0",
// "VO3_M1_ZDC3",
// "Dummy",
//
// // save the descriptor to file
// // (default file name $ALICE_ROOT/data/triggerDescriptor.root)
-// AliTriggerDescriptor::WriteDescriptor( &descrip );
-//
+// descrip.WriteDescriptor(); or descrip.WriteDescriptor( filename );
+//
///////////////////////////////////////////////////////////////////////////////
#include <TString.h>
TNamed( des ), fDetectorCluster( des.fDetectorCluster )
{
// Copy constructor
+ Int_t ncond = des.fConditions.GetEntriesFast();
+ for( Int_t j=0; j<ncond; j++ ) {
+ AddCondition( new AliTriggerCondition( *(AliTriggerCondition*)(des.fConditions.At( j )) ) );
+ }
+}
+
+//______________________________________________________________________________
+AliTriggerDescriptor& AliTriggerDescriptor::operator=(const AliTriggerDescriptor& des)
+{
+ // AliTriggerDescriptor assignment operator.
+
+ if (this != &des) {
+ TNamed::operator=(des);
+ fDetectorCluster = des.fDetectorCluster;
+ fConditions.Delete();
+ Int_t ncond = des.fConditions.GetEntriesFast();
+ for( Int_t j=0; j<ncond; j++ ) {
+ AddCondition( new AliTriggerCondition( *(AliTriggerCondition*)(des.fConditions.At( j )) ) );
+ }
+ }
+ return *this;
}
//_____________________________________________________________________________
TObjArray* AliTriggerDescriptor::GetAvailableDescriptors( const char* filename )
{
// Return an array of descriptor in the file
-
+
TString path;
if( !filename[0] ) {
path += gSystem->Getenv( "ALICE_ROOT" );
}
TObjArray* desArray = new TObjArray();
-
+
TFile file( path.Data(), "READ" );
if( file.IsZombie() ) {
AliErrorGeneral( "AliTriggerDescriptor", Form( "Error opening file (%s)", path.Data() ) );
return NULL;
}
-
+
file.ReadAll();
TKey* key;
Form( "Can't open file (%s)", path.Data() ) );
return;
}
-
+
Bool_t result = (Write( GetName(), TObject::kOverwrite ) != 0);
if( !result )
AliErrorGeneral( "AliTriggerDescriptor",
file.Close();
}
-
-
-
//_____________________________________________________________________________
Bool_t AliTriggerDescriptor::CheckInputsConditions( TString& configfile )
{