1 /**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
7 * Permission to use, copy, modify and distribute this software and its *
8 * documentation strictly for non-commercial purposes is hereby granted *
9 * without fee, provided that the above copyright notice appears in all *
10 * copies and that both the copyright notice and this permission notice *
11 * appear in the supporting documentation. The authors make no claims *
12 * about the suitability of this software for any purpose. It is *
13 * provided "as is" without express or implied warranty. *
14 **************************************************************************/
16 ///////////////////////////////////////////////////////////////////////////////
18 // This class which defines defines the Trigger Configuration
20 // Trigger Configuration defines the trigger setup for a particular run
21 // We have default configurations for each running mode (Pb-Pb, p-p, p-A, Calibration, etc).
23 // All the information conained in the CTP configuration file used
24 // online during the data taking
26 // Configurations could be created and stored in local file.
27 // By default the configuration is loaded from the corresponding GRP entry
28 // inside the OCDB. There one can have one and only one configuration per run.
30 // Example how to create a Trigger Configuration:
32 // AliTriggerConfiguration config( "TEST", "Test Configuration" );
34 // // Define a Cluster Detector
35 // config.AddDetectorCluster( "VZERO ZDC MUON" );
37 // // Define the trigger conditions (see AliTriggerCondition.cxx)
38 // config.AddCondition( "VZERO_TEST1_L0 & MUON_SPlus_LPt_L0 & ZDC_TEST2_L0", // condition
39 // "VO1_M1_ZDC2", // short name
40 // "Dummy", // short description
41 // 0x0100 ); // class mask (set one bit)
43 // config.AddCondition( "VZERO_TEST2_L0 & MUON_SMinus_HPt_L0 & ZDC_TEST1_L0",
48 // config.AddCondition( "VZERO_TEST3_L0 | MUON_Unlike_LPt_L0 | ZDC_TEST3_L0",
52 // config.CheckInputsConditions("Config.C");
55 // // save the configuration to file
56 // // (default file name $ALICE_ROOT/data/triggerConfigurations.root)
57 // config.WriteConfiguration(); or config.WriteConfiguration( filename );
59 ///////////////////////////////////////////////////////////////////////////////
60 #include <Riostream.h>
65 #include <TObjString.h>
66 #include <TObjArray.h>
73 #include "AliRunLoader.h"
74 #include "AliModule.h"
76 #include "AliTriggerInput.h"
77 //#include "AliTriggerDetector.h"
78 #include "AliTriggerInteraction.h"
79 #include "AliTriggerBCMask.h"
80 #include "AliTriggerCluster.h"
81 #include "AliTriggerPFProtection.h"
82 #include "AliTriggerDescriptor.h"
83 #include "AliTriggerClass.h"
84 #include "AliTriggerConfiguration.h"
86 ClassImp(AliTriggerConfiguration)
88 const TString AliTriggerConfiguration::fgkConfigurationFileName("/data/triggerConfigurations.root");
90 //_____________________________________________________________________________
91 AliTriggerConfiguration::AliTriggerConfiguration():
103 // Default constructor
106 //_____________________________________________________________________________
107 AliTriggerConfiguration::AliTriggerConfiguration( TString & name, TString & description ):
108 TNamed( name, description ),
122 //_____________________________________________________________________________
123 AliTriggerConfiguration::~AliTriggerConfiguration()
128 fInteractions.SetOwner();
129 fInteractions.Delete();
130 fFunctions.SetOwner();
132 fPFProtections.SetOwner();
133 fPFProtections.Delete();
136 fDescriptors.SetOwner();
137 fDescriptors.Delete();
138 fClusters.SetOwner();
144 //_____________________________________________________________________________
145 Bool_t AliTriggerConfiguration::AddInput( AliTriggerInput* input )
147 // Add a trigger input to
148 // the list of the trigger inputs
149 if (fInputs.GetEntries() < kNMaxInputs) {
150 fInputs.AddLast( input );
154 AliError("CTP can handle up to 50 inputs ! Impossible to add the required input !");
159 //_____________________________________________________________________________
160 AliTriggerInput* AliTriggerConfiguration::AddInput( TString &name, TString &det,
161 UChar_t level, UInt_t signature,
164 // Add a trigger input to
165 // the list of the trigger inputs
166 AliTriggerInput *input = new AliTriggerInput(name,det,level,signature,number);
167 if (!AddInput(input)) {
175 //_____________________________________________________________________________
176 AliTriggerInteraction* AliTriggerConfiguration::AddInteraction(TString &name, TString &logic)
178 // Add a trigger interaction object to
179 // the list of the trigger interactions
180 AliTriggerInteraction *interact = new AliTriggerInteraction(name,logic);
181 if (!AddInteraction(interact)) {
189 //_____________________________________________________________________________
190 Bool_t AliTriggerConfiguration::AddInteraction(AliTriggerInteraction *interact)
192 // Add a trigger interaction object to
193 // the list of the trigger interactions
194 if (fInteractions.GetEntries() < kNMaxInteractions) {
195 if (interact->CheckInputs(fInputs)) {
196 fInteractions.AddLast( interact );
200 AliError("Invalid interaction ! Impossible to add it !");
203 AliError("CTP can handle up to 2 interactions ! Impossible to add the required interaction !");
208 //_____________________________________________________________________________
209 AliTriggerInteraction* AliTriggerConfiguration::AddFunction(TString &name, TString &logic)
211 // Add a trigger function object to
212 // the list of the trigger functions
213 AliTriggerInteraction *func = new AliTriggerInteraction(name,logic);
214 if (!AddFunction(func)) {
222 //_____________________________________________________________________________
223 Bool_t AliTriggerConfiguration::AddFunction(AliTriggerInteraction *func)
225 // Add a trigger function object to
226 // the list of the trigger functions
227 if (fFunctions.GetEntries() < kNMaxFunctions) {
228 if (func->CheckInputs(fInputs)) {
229 fFunctions.AddLast( func );
233 AliError("Invalid logical function ! Impossible to add it !");
236 AliError("CTP can handle up to 2 logical functions ! Impossible to add the required interaction !");
241 //_____________________________________________________________________________
242 Bool_t AliTriggerConfiguration::AddPFProtection( AliTriggerPFProtection* pfp )
244 // Add a trigger past-future protection object to
245 // the list of the trigger past-future protections
246 if (fPFProtections.GetEntries() < kNMaxPFProtections) {
247 if (pfp->CheckInteractions(fInteractions)) {
248 fPFProtections.AddLast( pfp );
252 AliError("Invalid past-future protection ! Impossible to add it !");
255 AliError("CTP can handle up to 4 past-future protections ! Impossible to add the required protection !");
260 //_____________________________________________________________________________
261 AliTriggerBCMask* AliTriggerConfiguration::AddMask( TString &name, TString &mask )
263 // Add a trigger bunch-crossing mask object to
264 // the list of the trigger bunch-crossing masks
265 AliTriggerBCMask *bcmask = new AliTriggerBCMask(name,mask);
266 if (!AddMask(bcmask)) {
274 //_____________________________________________________________________________
275 Bool_t AliTriggerConfiguration::AddMask( AliTriggerBCMask* mask )
277 // Add a trigger bunch-crossing mask object to
278 // the list of the trigger bunch-crossing masks
279 if (fMasks.GetEntries() < kNMaxMasks) {
280 fMasks.AddLast( mask );
284 AliError("CTP can handle up to 4 bunch-crossing masks ! Impossible to add the required mask !");
289 //_____________________________________________________________________________
290 AliTriggerCluster* AliTriggerConfiguration::AddCluster( TString &name, UChar_t index, TString &detectors)
292 // Add a trigger detector readout cluster to
293 // the list of the trigger clusters
294 AliTriggerCluster *clust = new AliTriggerCluster(name,index,detectors);
295 if (!AddCluster(clust)) {
304 //_____________________________________________________________________________
305 Bool_t AliTriggerConfiguration::AddCluster( AliTriggerCluster* cluster )
307 // Add a trigger detector readout cluster to
308 // the list of the trigger clusters
309 if (fClusters.GetEntries() < kNMaxClusters) {
310 TString dets(cluster->GetDetectorsInCluster());
311 if (!(dets.IsNull())) {
312 fClusters.AddLast( cluster );
316 AliError("Empty trigger cluster ! Impossible to add it !");
319 AliError("CTP can handle up to 6 different detector clusters ! Impossible to add the required cluster !");
324 //_____________________________________________________________________________
325 TString AliTriggerConfiguration::GetActiveDetectors() const
327 // Return an string with all active detector
330 TString activeDet = "";
332 Int_t nclus = fClusters.GetEntriesFast();
333 if( !nclus ) return activeDet;
335 for( Int_t j=0; j<nclus; ++j ) {
336 TString detStr = ((AliTriggerCluster*)fClusters.At(j))->GetDetectorsInCluster();
337 TObjArray* det = detStr.Tokenize(" ");
338 Int_t ndet = det->GetEntriesFast();
339 for( Int_t k=0; k<ndet; ++k ) {
340 if( activeDet.Contains( ((TObjString*)det->At(k))->String() ) )continue;
341 activeDet.Append( " " );
342 activeDet.Append( ((TObjString*)det->At(k))->String() );
348 //_____________________________________________________________________________
349 TString AliTriggerConfiguration::GetTriggeringDetectors() const
351 // Return an string with all detectors
352 // used for triggering
356 Int_t ninputs = fInputs.GetEntriesFast();
357 if( !ninputs ) return trDet;
359 for( Int_t j=0; j<ninputs; j++ ) {
360 TString detStr = ((AliTriggerInput*)fInputs.At(j))->GetDetector();
361 if( trDet.Contains( detStr ) ) continue;
363 trDet.Append( detStr );
368 //_____________________________________________________________________________
369 TString AliTriggerConfiguration::GetTriggeringModules() const
371 // Return an string with all detectors (modules in the AliRoot
372 // simulation sense) used for triggering
376 Int_t ninputs = fInputs.GetEntriesFast();
377 if( !ninputs ) return trDet;
379 for( Int_t j=0; j<ninputs; j++ ) {
380 TString detStr = ((AliTriggerInput*)fInputs.At(j))->GetModule();
381 if( trDet.Contains( detStr ) ) continue;
383 trDet.Append( detStr );
388 //_____________________________________________________________________________
389 AliTriggerDescriptor* AliTriggerConfiguration::AddDescriptor( TString &name, TString &cond )
391 // Add a trigger descriptor to
392 // the list of the trigger descriptors
393 AliTriggerDescriptor *desc = new AliTriggerDescriptor(name,cond);
394 if (!AddDescriptor(desc)) {
402 //_____________________________________________________________________________
403 Bool_t AliTriggerConfiguration::AddDescriptor( AliTriggerDescriptor *desc )
405 // Add a trigger descriptor to
406 // the list of the trigger descriptors
407 if (fDescriptors.GetEntries() < kNMaxClasses) {
408 if (desc->CheckInputsAndFunctions(fInputs,fFunctions)) {
409 fDescriptors.AddLast( desc );
413 AliError("Invalid trigger desciptor ! Impossible to add it !");
416 AliError("CTP can handle up to 50 different descriptors ! Impossible to add the required descriptor !");
421 //_____________________________________________________________________________
422 Bool_t AliTriggerConfiguration::AddClass( AliTriggerClass *trclass )
424 // Add a trigger class to
425 // the list of the trigger classes
426 if (fClasses.GetEntries() < kNMaxClasses) {
427 if (trclass->CheckClass(this)) {
428 fClasses.AddLast( trclass );
432 AliError("Invalid trigger class ! Impossible to add it !");
435 AliError("CTP can handle up to 50 different classes ! Impossible to add the required class !");
440 //_____________________________________________________________________________
441 AliTriggerClass *AliTriggerConfiguration::AddClass( TString &name, UChar_t index,
442 AliTriggerDescriptor *desc, AliTriggerCluster *clus,
443 AliTriggerPFProtection *pfp, AliTriggerBCMask *mask,
444 UInt_t prescaler, Bool_t allrare)
446 // Add a trigger class to
447 // the list of the trigger classes
448 if (!fDescriptors.FindObject(desc)) {
449 AliError("Invalid descriptor ! Impossible to add the class !");
452 if (!fClusters.FindObject(clus)) {
453 AliError("Invalid cluster ! Impossible to add the class !");
456 if (!fPFProtections.FindObject(pfp)) {
457 AliError("Invalid past-future protection ! Impossible to add the class !");
460 if (!fMasks.FindObject(mask)) {
461 AliError("Invalid bunch-crossing mask ! Impossible to add the class !");
464 AliTriggerClass* trclass = new AliTriggerClass( name,index,desc,clus,pfp,mask,prescaler,allrare );
465 if (!AddClass(trclass)) {
473 //_____________________________________________________________________________
474 AliTriggerClass *AliTriggerConfiguration::AddClass( TString &name, UChar_t index,
475 TString &desc, TString &clus,
476 TString &pfp, TString &mask,
477 UInt_t prescaler, Bool_t allrare)
479 // Add a new trigger class
480 if (!fDescriptors.FindObject(desc)) {
481 AliError("Invalid descriptor ! Impossible to add the class !");
484 if (!fClusters.FindObject(clus)) {
485 AliError("Invalid cluster ! Impossible to add the class !");
488 if (!fPFProtections.FindObject(pfp)) {
489 AliError("Invalid past-future protection ! Impossible to add the class !");
492 if (!fMasks.FindObject(mask)) {
493 AliError("Invalid bunch-crossing mask ! Impossible to add the class !");
496 AliTriggerClass* trclass = new AliTriggerClass( this, name,index,desc,clus,pfp,mask,prescaler,allrare );
497 if (!AddClass(trclass)) {
505 //_____________________________________________________________________________
506 Bool_t AliTriggerConfiguration::ProcessConfigurationLine(const char* line, Int_t& level)
508 // processes one line of configuration
510 TString strLine(line);
512 if (strLine.BeginsWith("#")) return kTRUE;
513 if (strLine.BeginsWith("PARTITION:")) {
514 strLine.ReplaceAll("PARTITION:","");
515 SetName(strLine.Data());
518 if (strLine.BeginsWith("VERSION:")) {
519 strLine.ReplaceAll("VERSION:","");
520 fVersion = strLine.Atoi();
523 if (strLine.BeginsWith("INPUTS:")) {
527 if (strLine.BeginsWith("INTERACTIONS:")) {
531 if (strLine.BeginsWith("DESCRIPTORS:")) {
535 if (strLine.BeginsWith("CLUSTERS:")) {
539 if (strLine.BeginsWith("PFS:")) {
543 if (strLine.BeginsWith("BCMASKS:")) {
547 if (strLine.BeginsWith("CLASSES:")) {
552 strLine.ReplaceAll("*",'!');
553 TObjArray *tokens = strLine.Tokenize(" \t");
554 Int_t ntokens = tokens->GetEntriesFast();
564 AliError(Form("Invalid trigger input syntax (%s)!",strLine.Data()));
567 AddInput(((TObjString*)tokens->At(0))->String(),
568 ((TObjString*)tokens->At(1))->String(),
569 ((TObjString*)tokens->At(2))->String().Atoi(),
570 ((TObjString*)tokens->At(3))->String().Atoi(),
571 ((TObjString*)tokens->At(4))->String().Atoi());
576 AliError(Form("Invalid trigger interaction syntax (%s)!",strLine.Data()));
579 AddInteraction(((TObjString*)tokens->At(0))->String(),
580 ((TObjString*)tokens->At(1))->String());
583 // Read logical functions and descriptors
585 if ((((TObjString*)tokens->At(0))->String().CompareTo("EMPTY") == 0) ||
586 (((TObjString*)tokens->At(0))->String().CompareTo("DEMPTY") == 0)) {
587 AddDescriptor(((TObjString*)tokens->At(0))->String(),
588 strLine.ReplaceAll(((TObjString*)tokens->At(0))->String(),""));
592 AliError(Form("Invalid trigger descriptor syntax (%s)!",strLine.Data()));
596 if (((TObjString*)tokens->At(0))->String().BeginsWith("l0f")) {
598 AddFunction(((TObjString*)tokens->At(0))->String(),
599 strLine.ReplaceAll(((TObjString*)tokens->At(0))->String(),""));
602 AddDescriptor(((TObjString*)tokens->At(0))->String(),
603 strLine.ReplaceAll(((TObjString*)tokens->At(0))->String(),""));
609 AliError(Form("Invalid trigger cluster syntax (%s)!",strLine.Data()));
613 for(Int_t i = 2; i < ntokens; i++) {
614 strTemp += ((TObjString*)tokens->At(i))->String();
617 AddCluster(((TObjString*)tokens->At(0))->String(),
618 ((TObjString*)tokens->At(1))->String().Atoi(),
624 AliTriggerPFProtection *pfp = NULL;
625 if (((TObjString*)tokens->At(0))->String().CompareTo("NONE") == 0) {
626 pfp = new AliTriggerPFProtection(((TObjString*)tokens->At(0))->String());
630 AliError(Form("Invalid trigger pfs syntax (%s)!",strLine.Data()));
633 pfp = new AliTriggerPFProtection(((TObjString*)tokens->At(0))->String(),
634 ((TObjString*)tokens->At(1))->String(),
635 ((TObjString*)tokens->At(2))->String(),
636 ((TObjString*)tokens->At(3))->String());
637 pfp->SetNa1(((TObjString*)tokens->At(4))->String().Atoi());
638 pfp->SetNa2(((TObjString*)tokens->At(5))->String().Atoi());
639 pfp->SetNb1(((TObjString*)tokens->At(6))->String().Atoi());
640 pfp->SetNb2(((TObjString*)tokens->At(7))->String().Atoi());
641 pfp->SetTa(((TObjString*)tokens->At(8))->String().Atoi());
642 pfp->SetTb(((TObjString*)tokens->At(9))->String().Atoi());
644 AddPFProtection(pfp);
649 AliError(Form("Invalid trigger bcmasks syntax (%s)!",strLine.Data()));
652 if (((TObjString*)tokens->At(0))->String().CompareTo("NONE") == 0)
653 AddMask(new AliTriggerBCMask(((TObjString*)tokens->At(0))->String()));
655 AddMask(((TObjString*)tokens->At(0))->String(),
656 ((TObjString*)tokens->At(1))->String());
662 AliError(Form("Invalid trigger class syntax (%s)!",strLine.Data()));
665 AliTriggerClass *trclass = new AliTriggerClass(this,
666 ((TObjString*)tokens->At(0))->String(),((TObjString*)tokens->At(1))->String().Atoi(),
667 ((TObjString*)tokens->At(2))->String(),((TObjString*)tokens->At(3))->String(),
668 ((TObjString*)tokens->At(4))->String(),((TObjString*)tokens->At(5))->String(),
669 ((TObjString*)tokens->At(6))->String().Atoi(),(Bool_t)(((TObjString*)tokens->At(7))->String().Atoi()));
680 //_____________________________________________________________________________
681 AliTriggerConfiguration* AliTriggerConfiguration::LoadConfiguration(TString & configuration)
683 // Load one pre-created Configurations from database/file that match
684 // with the input string 'configuration'
685 // Ej: "Pb-Pb" or "p-p-DIMUON CALIBRATION-CENTRAL-BARREL"
686 // By default the files are stored in GRP/CTP folder.
687 // The filename is constructed as: GRP/CTP/<configuration>.cfg
689 // Load the selected configuration
691 if (configuration.EndsWith(".cfg") ||
692 configuration.EndsWith(".shuttle")) {
693 filename = configuration;
696 filename = gSystem->Getenv("ALICE_ROOT");
697 filename += "/GRP/CTP/";
698 filename += configuration;
702 if( gSystem->AccessPathName( filename.Data() ) ) {
703 AliErrorClass( Form( "file (%s) not found", filename.Data() ) );
708 ifstream *file = new ifstream ( filename.Data() );
710 AliErrorClass(Form("Error opening file (%s) !",filename.Data()));
716 AliTriggerConfiguration *cfg = new AliTriggerConfiguration();
721 while (strLine.ReadLine(*file)) {
722 if (cfg->ProcessConfigurationLine(strLine, level) == kFALSE)
736 //_____________________________________________________________________________
737 AliTriggerConfiguration* AliTriggerConfiguration::LoadConfigurationFromString(const char* configuration)
739 // Loads configuration given as parameter <configuration>
744 AliTriggerConfiguration *cfg = new AliTriggerConfiguration();
748 TObjArray* tokens = TString(configuration).Tokenize("\n");
749 for (Int_t i=0; i<tokens->GetEntries(); i++)
751 TObjString* str = dynamic_cast<TObjString*>(tokens->At(i));
755 if (cfg->ProcessConfigurationLine(str->String(), level) == kFALSE)
768 //_____________________________________________________________________________
769 TObjArray* AliTriggerConfiguration::GetAvailableConfigurations( const char* filename )
771 // Return an array of configuration in the file
775 path += gSystem->Getenv( "ALICE_ROOT" );
776 path += fgkConfigurationFileName;
781 if( gSystem->AccessPathName( path.Data() ) ) {
782 AliErrorGeneral( "AliTriggerConfiguration", Form( "file (%s) not found", path.Data() ) );
786 TObjArray* desArray = new TObjArray();
788 TFile file( path.Data(), "READ" );
789 if( file.IsZombie() ) {
790 AliErrorGeneral( "AliTriggerConfiguration", Form( "Error opening file (%s)", path.Data() ) );
797 TIter next( file.GetListOfKeys() );
798 while( (key = (TKey*)next()) ) {
799 TObject* obj = key->ReadObj();
800 if( obj->InheritsFrom( "AliTriggerConfiguration" ) ) {
801 desArray->AddLast( obj );
809 //_____________________________________________________________________________
810 void AliTriggerConfiguration::WriteConfiguration( const char* filename )
812 // Write the configuration
815 path += gSystem->Getenv("ALICE_ROOT");
816 path += fgkConfigurationFileName;
821 TFile file( path.Data(), "UPDATE" );
822 if( file.IsZombie() ) {
823 AliErrorGeneral( "AliTriggerConfiguration",
824 Form( "Can't open file (%s)", path.Data() ) );
828 Bool_t result = (Write( GetName(), TObject::kOverwrite ) != 0);
830 AliErrorGeneral( "AliTriggerConfiguration",
831 Form( "Can't write entry to file <%s>!", path.Data() ) );
835 //_____________________________________________________________________________
836 Bool_t AliTriggerConfiguration::CheckConfiguration( TString& configfile )
838 // To be used on the pre-creation of Configurations to check if the
839 // conditions have valid inputs names.
841 // Initiate detectors modules from a Config file
842 // Ask to each active module present in the fDetectorCluster
843 // to create a Trigger detector and retrive the inputs from it
844 // to create a list of inputs.
845 // Each condition in the configuration is then checked agains
846 // the list of inputs
850 AliError( "no gAlice object. Restart aliroot and try again." );
853 if (gAlice->Modules()->GetEntries() > 0) {
854 AliError( "gAlice was already run. Restart aliroot and try again." );
858 AliInfo( Form( "initializing gAlice with config file %s",
859 configfile.Data() ) );
860 StdoutToAliInfo( StderrToAliError(
861 gAlice->Init( configfile.Data() );
864 AliRunLoader* runLoader = gAlice->GetRunLoader();
866 AliError( Form( "gAlice has no run loader object. "
867 "Check your config file: %s", configfile.Data() ) );
871 // get the possible inputs to check the condition
873 TObjArray* detArray = runLoader->GetAliRun()->Detectors();
875 TString detStr = GetTriggeringModules();
877 for( Int_t iDet = 0; iDet < detArray->GetEntriesFast(); iDet++ ) {
878 AliModule* det = (AliModule*) detArray->At(iDet);
879 if( !det || !det->IsActive() ) continue;
880 if( IsSelected( det->GetName(), detStr ) ) {
881 AliInfo( Form( "Creating inputs for %s", det->GetName() ) );
882 AliTriggerDetector* dtrg = det->CreateTriggerDetector();
883 dtrg->CreateInputs(GetInputs());
884 TObjArray* detInp = dtrg->GetInputs();
885 for( Int_t i=0; i<detInp->GetEntriesFast(); i++ ) {
886 AliInfo( Form( "Adding input %s", ((AliTriggerInput*)detInp->At(i))->GetName() ) );
887 inputs.AddLast( detInp->At(i) );
892 // check if the condition is compatible with the triggers inputs
893 Int_t ndesc = fClasses.GetEntriesFast();
894 Bool_t check = kTRUE;
896 for( Int_t j=0; j<ndesc; j++ ) {
897 AliTriggerClass *trclass = (AliTriggerClass*)fClasses.At( j );
898 if( !(trclass->CheckClass( this )) ) check = kFALSE;
900 if (trclass->IsActive(this->GetInputs(),this->GetFunctions())) {
901 AliInfo( Form( "Trigger Class (%s) OK, class mask (0x%Lx)",
902 trclass->GetName(), trclass->GetMask( ) ) );
905 AliWarning( Form( "Trigger Class (%s) is NOT active, class mask (0x%Lx)",
906 trclass->GetName(), trclass->GetMask( ) ) );
909 // check if condition mask is duplicated
910 if( mask & trclass->GetMask() ) {
911 AliError( Form("Class (%s). The class mask (0x%Lx) is ambiguous. It was already defined",
912 trclass->GetName(), trclass->GetMask() ) );
915 mask |= trclass->GetMask();
921 //_____________________________________________________________________________
922 void AliTriggerConfiguration::Reset()
924 for( Int_t j=0; j<fInputs.GetEntriesFast(); j++ )
925 ((AliTriggerInput*)fInputs.At(j))->Reset();
927 for( Int_t j=0; j<fClasses.GetEntriesFast(); j++ )
928 ((AliTriggerClass*)fClasses.At(j))->Reset();
931 //_____________________________________________________________________________
932 void AliTriggerConfiguration::Print( const Option_t* ) const
935 cout << "#################################################" << endl;
936 cout << "Trigger Configuration:" << endl;
937 cout << " Name: " << GetName() << endl;
938 cout << " Description: " << GetTitle() << endl;
939 cout << " Version: " << GetVersion() << endl;
940 cout << " Active Detectors: " << GetActiveDetectors() << endl;
941 cout << " Trigger Detectors: " << GetTriggeringDetectors() << endl;
943 cout << "#################################################" << endl;
945 cout << "#################################################" << endl;
946 fInteractions.Print();
947 cout << "#################################################" << endl;
949 cout << "#################################################" << endl;
950 fDescriptors.Print();
951 cout << "#################################################" << endl;
953 cout << "#################################################" << endl;
954 fPFProtections.Print();
955 cout << "#################################################" << endl;
957 cout << "#################################################" << endl;
959 cout << "#################################################" << endl;
965 //////////////////////////////////////////////////////////////////////////////
968 //_____________________________________________________________________________
969 Bool_t AliTriggerConfiguration::IsSelected( TString detName, TString& detectors ) const
971 // check whether detName is contained in detectors
972 // if yes, it is removed from detectors
974 // check if all detectors are selected
975 if( (detectors.CompareTo("ALL") == 0 ) ||
976 detectors.BeginsWith("ALL ") ||
977 detectors.EndsWith(" ALL") ||
978 detectors.Contains(" ALL ") ) {
983 // search for the given detector
984 Bool_t result = kFALSE;
985 if( (detectors.CompareTo( detName ) == 0) ||
986 detectors.BeginsWith( detName+" " ) ||
987 detectors.EndsWith( " "+detName ) ||
988 detectors.Contains( " "+detName+" " ) ) {
989 detectors.ReplaceAll( detName, "" );
993 // clean up the detectors string
994 while( detectors.Contains(" ") ) detectors.ReplaceAll( " ", " " );
995 while( detectors.BeginsWith(" ") ) detectors.Remove( 0, 1 );
996 while( detectors.EndsWith(" ") ) detectors.Remove( detectors.Length()-1, 1 );