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():
102 // Default constructor
105 //_____________________________________________________________________________
106 AliTriggerConfiguration::AliTriggerConfiguration( TString & name, TString & description ):
107 TNamed( name, description ),
120 //_____________________________________________________________________________
121 AliTriggerConfiguration::~AliTriggerConfiguration()
126 fInteractions.SetOwner();
127 fInteractions.Delete();
128 fFunctions.SetOwner();
130 fPFProtections.SetOwner();
131 fPFProtections.Delete();
134 fDescriptors.SetOwner();
135 fDescriptors.Delete();
136 fClusters.SetOwner();
142 //_____________________________________________________________________________
143 Bool_t AliTriggerConfiguration::AddInput( AliTriggerInput* input )
145 // Add a trigger input to
146 // the list of the trigger inputs
147 if (fInputs.GetEntries() < kNMaxInputs) {
148 fInputs.AddLast( input );
152 AliError("CTP can handle up to 50 inputs ! Impossible to add the required input !");
157 //_____________________________________________________________________________
158 AliTriggerInput* AliTriggerConfiguration::AddInput( TString &name, TString &det,
159 UChar_t level, UInt_t signature,
162 // Add a trigger input to
163 // the list of the trigger inputs
164 AliTriggerInput *input = new AliTriggerInput(name,det,level,signature,number);
165 if (!AddInput(input)) {
173 //_____________________________________________________________________________
174 AliTriggerInteraction* AliTriggerConfiguration::AddInteraction(TString &name, TString &logic)
176 // Add a trigger interaction object to
177 // the list of the trigger interactions
178 AliTriggerInteraction *interact = new AliTriggerInteraction(name,logic);
179 if (!AddInteraction(interact)) {
187 //_____________________________________________________________________________
188 Bool_t AliTriggerConfiguration::AddInteraction(AliTriggerInteraction *interact)
190 // Add a trigger interaction object to
191 // the list of the trigger interactions
192 if (fInteractions.GetEntries() < kNMaxInteractions) {
193 if (interact->CheckInputs(fInputs)) {
194 fInteractions.AddLast( interact );
198 AliError("Invalid interaction ! Impossible to add it !");
201 AliError("CTP can handle up to 2 interactions ! Impossible to add the required interaction !");
206 //_____________________________________________________________________________
207 AliTriggerInteraction* AliTriggerConfiguration::AddFunction(TString &name, TString &logic)
209 // Add a trigger function object to
210 // the list of the trigger functions
211 AliTriggerInteraction *func = new AliTriggerInteraction(name,logic);
212 if (!AddFunction(func)) {
220 //_____________________________________________________________________________
221 Bool_t AliTriggerConfiguration::AddFunction(AliTriggerInteraction *func)
223 // Add a trigger function object to
224 // the list of the trigger functions
225 if (fFunctions.GetEntries() < kNMaxFunctions) {
226 if (func->CheckInputs(fInputs)) {
227 fFunctions.AddLast( func );
231 AliError("Invalid logical function ! Impossible to add it !");
234 AliError("CTP can handle up to 2 logical functions ! Impossible to add the required interaction !");
239 //_____________________________________________________________________________
240 Bool_t AliTriggerConfiguration::AddPFProtection( AliTriggerPFProtection* pfp )
242 // Add a trigger past-future protection object to
243 // the list of the trigger past-future protections
244 if (fPFProtections.GetEntries() < kNMaxPFProtections) {
245 if (pfp->CheckInteractions(fInteractions)) {
246 fPFProtections.AddLast( pfp );
250 AliError("Invalid past-future protection ! Impossible to add it !");
253 AliError("CTP can handle up to 4 past-future protections ! Impossible to add the required protection !");
258 //_____________________________________________________________________________
259 AliTriggerBCMask* AliTriggerConfiguration::AddMask( TString &name, TString &mask )
261 // Add a trigger bunch-crossing mask object to
262 // the list of the trigger bunch-crossing masks
263 AliTriggerBCMask *bcmask = new AliTriggerBCMask(name,mask);
264 if (!AddMask(bcmask)) {
272 //_____________________________________________________________________________
273 Bool_t AliTriggerConfiguration::AddMask( AliTriggerBCMask* mask )
275 // Add a trigger bunch-crossing mask object to
276 // the list of the trigger bunch-crossing masks
277 if (fMasks.GetEntries() < kNMaxMasks) {
278 fMasks.AddLast( mask );
282 AliError("CTP can handle up to 4 bunch-crossing masks ! Impossible to add the required mask !");
287 //_____________________________________________________________________________
288 AliTriggerCluster* AliTriggerConfiguration::AddCluster( TString &name, UChar_t index, TString &detectors)
290 // Add a trigger detector readout cluster to
291 // the list of the trigger clusters
292 AliTriggerCluster *clust = new AliTriggerCluster(name,index,detectors);
293 if (!AddCluster(clust)) {
302 //_____________________________________________________________________________
303 Bool_t AliTriggerConfiguration::AddCluster( AliTriggerCluster* cluster )
305 // Add a trigger detector readout cluster to
306 // the list of the trigger clusters
307 if (fClusters.GetEntries() < kNMaxClusters) {
308 TString dets(cluster->GetDetectorsInCluster());
309 if (!(dets.IsNull())) {
310 fClusters.AddLast( cluster );
314 AliError("Empty trigger cluster ! Impossible to add it !");
317 AliError("CTP can handle up to 6 different detector clusters ! Impossible to add the required cluster !");
322 //_____________________________________________________________________________
323 TString AliTriggerConfiguration::GetActiveDetectors() const
325 // Return an string with all active detector
328 TString activeDet = "";
330 Int_t nclus = fClusters.GetEntriesFast();
331 if( !nclus ) return activeDet;
333 for( Int_t j=0; j<nclus; j++ ) {
334 TString detStr = ((AliTriggerCluster*)fClusters.At(j))->GetDetectorsInCluster();
335 TObjArray* det = detStr.Tokenize(" ");
336 Int_t ndet = det->GetEntriesFast();
337 for( Int_t j=0; j<ndet; j++ ) {
338 if( activeDet.Contains( ((TObjString*)det->At(j))->String() ) )continue;
339 activeDet.Append( " " );
340 activeDet.Append( ((TObjString*)det->At(j))->String() );
346 //_____________________________________________________________________________
347 TString AliTriggerConfiguration::GetTriggeringDetectors() const
349 // Return an string with all detectors
350 // used for triggering
354 Int_t ninputs = fInputs.GetEntriesFast();
355 if( !ninputs ) return trDet;
357 for( Int_t j=0; j<ninputs; j++ ) {
358 TString detStr = ((AliTriggerInput*)fInputs.At(j))->GetDetector();
359 if( trDet.Contains( detStr ) ) continue;
361 trDet.Append( detStr );
366 //_____________________________________________________________________________
367 TString AliTriggerConfiguration::GetTriggeringModules() const
369 // Return an string with all detectors (modules in the AliRoot
370 // simulation sense) used for triggering
374 Int_t ninputs = fInputs.GetEntriesFast();
375 if( !ninputs ) return trDet;
377 for( Int_t j=0; j<ninputs; j++ ) {
378 TString detStr = ((AliTriggerInput*)fInputs.At(j))->GetModule();
379 if( trDet.Contains( detStr ) ) continue;
381 trDet.Append( detStr );
386 //_____________________________________________________________________________
387 AliTriggerDescriptor* AliTriggerConfiguration::AddDescriptor( TString &name, TString &cond )
389 // Add a trigger descriptor to
390 // the list of the trigger descriptors
391 AliTriggerDescriptor *desc = new AliTriggerDescriptor(name,cond);
392 if (!AddDescriptor(desc)) {
400 //_____________________________________________________________________________
401 Bool_t AliTriggerConfiguration::AddDescriptor( AliTriggerDescriptor *desc )
403 // Add a trigger descriptor to
404 // the list of the trigger descriptors
405 if (fDescriptors.GetEntries() < kNMaxClasses) {
406 if (desc->CheckInputsAndFunctions(fInputs,fFunctions)) {
407 fDescriptors.AddLast( desc );
411 AliError("Invalid trigger desciptor ! Impossible to add it !");
414 AliError("CTP can handle up to 50 different descriptors ! Impossible to add the required descriptor !");
419 //_____________________________________________________________________________
420 Bool_t AliTriggerConfiguration::AddClass( AliTriggerClass *trclass )
422 // Add a trigger class to
423 // the list of the trigger classes
424 if (fClasses.GetEntries() < kNMaxClasses) {
425 if (trclass->CheckClass(this)) {
426 fClasses.AddLast( trclass );
430 AliError("Invalid trigger class ! Impossible to add it !");
433 AliError("CTP can handle up to 50 different classes ! Impossible to add the required class !");
438 //_____________________________________________________________________________
439 AliTriggerClass *AliTriggerConfiguration::AddClass( TString &name, UChar_t index,
440 AliTriggerDescriptor *desc, AliTriggerCluster *clus,
441 AliTriggerPFProtection *pfp, AliTriggerBCMask *mask,
442 UInt_t prescaler, Bool_t allrare)
444 // Add a trigger class to
445 // the list of the trigger classes
446 if (!fDescriptors.FindObject(desc)) {
447 AliError("Invalid descriptor ! Impossible to add the class !");
450 if (!fClusters.FindObject(clus)) {
451 AliError("Invalid cluster ! Impossible to add the class !");
454 if (!fPFProtections.FindObject(pfp)) {
455 AliError("Invalid past-future protection ! Impossible to add the class !");
458 if (!fMasks.FindObject(mask)) {
459 AliError("Invalid bunch-crossing mask ! Impossible to add the class !");
462 AliTriggerClass* trclass = new AliTriggerClass( name,index,desc,clus,pfp,mask,prescaler,allrare );
463 if (!AddClass(trclass)) {
471 //_____________________________________________________________________________
472 AliTriggerClass *AliTriggerConfiguration::AddClass( TString &name, UChar_t index,
473 TString &desc, TString &clus,
474 TString &pfp, TString &mask,
475 UInt_t prescaler, Bool_t allrare)
477 // Add a new trigger class
478 if (!fDescriptors.FindObject(desc)) {
479 AliError("Invalid descriptor ! Impossible to add the class !");
482 if (!fClusters.FindObject(clus)) {
483 AliError("Invalid cluster ! Impossible to add the class !");
486 if (!fPFProtections.FindObject(pfp)) {
487 AliError("Invalid past-future protection ! Impossible to add the class !");
490 if (!fMasks.FindObject(mask)) {
491 AliError("Invalid bunch-crossing mask ! Impossible to add the class !");
494 AliTriggerClass* trclass = new AliTriggerClass( this, name,index,desc,clus,pfp,mask,prescaler,allrare );
495 if (!AddClass(trclass)) {
503 //_____________________________________________________________________________
504 Bool_t AliTriggerConfiguration::ProcessConfigurationLine(const char* line, Int_t& level)
506 // processes one line of configuration
508 TString strLine(line);
510 if (strLine.BeginsWith("#")) return kTRUE;
511 if (strLine.BeginsWith("INPUTS:")) {
515 if (strLine.BeginsWith("INTERACTIONS:")) {
519 if (strLine.BeginsWith("DESCRIPTORS:")) {
523 if (strLine.BeginsWith("CLUSTERS:")) {
527 if (strLine.BeginsWith("PFS:")) {
531 if (strLine.BeginsWith("BCMASKS:")) {
535 if (strLine.BeginsWith("CLASSES:")) {
540 strLine.ReplaceAll("*",'!');
541 TObjArray *tokens = strLine.Tokenize(" \t");
542 Int_t ntokens = tokens->GetEntriesFast();
552 AliError(Form("Invalid trigger input syntax (%s)!",strLine.Data()));
555 AddInput(((TObjString*)tokens->At(0))->String(),
556 ((TObjString*)tokens->At(1))->String(),
557 ((TObjString*)tokens->At(2))->String().Atoi(),
558 ((TObjString*)tokens->At(3))->String().Atoi(),
559 ((TObjString*)tokens->At(4))->String().Atoi());
564 AliError(Form("Invalid trigger interaction syntax (%s)!",strLine.Data()));
567 AddInteraction(((TObjString*)tokens->At(0))->String(),
568 ((TObjString*)tokens->At(1))->String());
571 // Read logical functions and descriptors
573 AliError(Form("Invalid trigger descriptor syntax (%s)!",strLine.Data()));
576 if (((TObjString*)tokens->At(0))->String().BeginsWith("l0f")) {
578 AddFunction(((TObjString*)tokens->At(0))->String(),
579 strLine.ReplaceAll(((TObjString*)tokens->At(0))->String(),""));
582 AddDescriptor(((TObjString*)tokens->At(0))->String(),
583 strLine.ReplaceAll(((TObjString*)tokens->At(0))->String(),""));
589 AliError(Form("Invalid trigger cluster syntax (%s)!",strLine.Data()));
593 for(Int_t i = 2; i < ntokens; i++) {
594 strTemp += ((TObjString*)tokens->At(i))->String();
597 AddCluster(((TObjString*)tokens->At(0))->String(),
598 ((TObjString*)tokens->At(1))->String().Atoi(),
604 AliTriggerPFProtection *pfp = NULL;
605 if (((TObjString*)tokens->At(0))->String().CompareTo("NONE") == 0) {
606 pfp = new AliTriggerPFProtection(((TObjString*)tokens->At(0))->String());
610 AliError(Form("Invalid trigger pfs syntax (%s)!",strLine.Data()));
613 pfp = new AliTriggerPFProtection(((TObjString*)tokens->At(0))->String(),
614 ((TObjString*)tokens->At(1))->String(),
615 ((TObjString*)tokens->At(2))->String(),
616 ((TObjString*)tokens->At(3))->String());
617 pfp->SetNa1(((TObjString*)tokens->At(4))->String().Atoi());
618 pfp->SetNa2(((TObjString*)tokens->At(5))->String().Atoi());
619 pfp->SetNb1(((TObjString*)tokens->At(6))->String().Atoi());
620 pfp->SetNb2(((TObjString*)tokens->At(7))->String().Atoi());
621 pfp->SetTa(((TObjString*)tokens->At(8))->String().Atoi());
622 pfp->SetTb(((TObjString*)tokens->At(9))->String().Atoi());
624 AddPFProtection(pfp);
629 AliError(Form("Invalid trigger bcmasks syntax (%s)!",strLine.Data()));
632 if (((TObjString*)tokens->At(0))->String().CompareTo("NONE") == 0)
633 AddMask(new AliTriggerBCMask(((TObjString*)tokens->At(0))->String()));
635 AddMask(((TObjString*)tokens->At(0))->String(),
636 ((TObjString*)tokens->At(1))->String());
642 AliError(Form("Invalid trigger class syntax (%s)!",strLine.Data()));
645 AliTriggerClass *trclass = new AliTriggerClass(this,
646 ((TObjString*)tokens->At(0))->String(),((TObjString*)tokens->At(1))->String().Atoi(),
647 ((TObjString*)tokens->At(2))->String(),((TObjString*)tokens->At(3))->String(),
648 ((TObjString*)tokens->At(4))->String(),((TObjString*)tokens->At(5))->String(),
649 ((TObjString*)tokens->At(6))->String().Atoi(),(Bool_t)(((TObjString*)tokens->At(7))->String().Atoi()));
660 //_____________________________________________________________________________
661 AliTriggerConfiguration* AliTriggerConfiguration::LoadConfiguration(TString & configuration)
663 // Load one pre-created Configurations from database/file that match
664 // with the input string 'configuration'
665 // Ej: "Pb-Pb" or "p-p-DIMUON CALIBRATION-CENTRAL-BARREL"
666 // By default the files are stored in GRP/CTP folder.
667 // The filename is constructed as: GRP/CTP/<configuration>.cfg
669 // Load the selected configuration
671 if (configuration.EndsWith(".cfg") ||
672 configuration.EndsWith(".shuttle")) {
673 filename = configuration;
676 filename = gSystem->Getenv("ALICE_ROOT");
677 filename += "/GRP/CTP/";
678 filename += configuration;
682 if( gSystem->AccessPathName( filename.Data() ) ) {
683 AliErrorClass( Form( "file (%s) not found", filename.Data() ) );
688 ifstream *file = new ifstream ( filename.Data() );
690 AliErrorClass(Form("Error opening file (%s) !",filename.Data()));
696 AliTriggerConfiguration *cfg = new AliTriggerConfiguration();
701 while (strLine.ReadLine(*file)) {
702 if (cfg->ProcessConfigurationLine(strLine, level) == kFALSE)
716 //_____________________________________________________________________________
717 AliTriggerConfiguration* AliTriggerConfiguration::LoadConfigurationFromString(const char* configuration)
719 // Loads configuration given as parameter <configuration>
724 AliTriggerConfiguration *cfg = new AliTriggerConfiguration();
728 TObjArray* tokens = TString(configuration).Tokenize("\n");
729 for (Int_t i=0; i<tokens->GetEntries(); i++)
731 TObjString* str = dynamic_cast<TObjString*>(tokens->At(i));
735 if (cfg->ProcessConfigurationLine(str->String(), level) == kFALSE)
748 //_____________________________________________________________________________
749 TObjArray* AliTriggerConfiguration::GetAvailableConfigurations( const char* filename )
751 // Return an array of configuration in the file
755 path += gSystem->Getenv( "ALICE_ROOT" );
756 path += fgkConfigurationFileName;
761 if( gSystem->AccessPathName( path.Data() ) ) {
762 AliErrorGeneral( "AliTriggerConfiguration", Form( "file (%s) not found", path.Data() ) );
766 TObjArray* desArray = new TObjArray();
768 TFile file( path.Data(), "READ" );
769 if( file.IsZombie() ) {
770 AliErrorGeneral( "AliTriggerConfiguration", Form( "Error opening file (%s)", path.Data() ) );
777 TIter next( file.GetListOfKeys() );
778 while( (key = (TKey*)next()) ) {
779 TObject* obj = key->ReadObj();
780 if( obj->InheritsFrom( "AliTriggerConfiguration" ) ) {
781 desArray->AddLast( obj );
789 //_____________________________________________________________________________
790 void AliTriggerConfiguration::WriteConfiguration( const char* filename )
792 // Write the configuration
795 path += gSystem->Getenv("ALICE_ROOT");
796 path += fgkConfigurationFileName;
801 TFile file( path.Data(), "UPDATE" );
802 if( file.IsZombie() ) {
803 AliErrorGeneral( "AliTriggerConfiguration",
804 Form( "Can't open file (%s)", path.Data() ) );
808 Bool_t result = (Write( GetName(), TObject::kOverwrite ) != 0);
810 AliErrorGeneral( "AliTriggerConfiguration",
811 Form( "Can't write entry to file <%s>!", path.Data() ) );
815 //_____________________________________________________________________________
816 Bool_t AliTriggerConfiguration::CheckConfiguration( TString& configfile )
818 // To be used on the pre-creation of Configurations to check if the
819 // conditions have valid inputs names.
821 // Initiate detectors modules from a Config file
822 // Ask to each active module present in the fDetectorCluster
823 // to create a Trigger detector and retrive the inputs from it
824 // to create a list of inputs.
825 // Each condition in the configuration is then checked agains
826 // the list of inputs
830 AliError( "no gAlice object. Restart aliroot and try again." );
833 if (gAlice->Modules()->GetEntries() > 0) {
834 AliError( "gAlice was already run. Restart aliroot and try again." );
838 AliInfo( Form( "initializing gAlice with config file %s",
839 configfile.Data() ) );
840 StdoutToAliInfo( StderrToAliError(
841 gAlice->Init( configfile.Data() );
844 AliRunLoader* runLoader = gAlice->GetRunLoader();
846 AliError( Form( "gAlice has no run loader object. "
847 "Check your config file: %s", configfile.Data() ) );
851 // get the possible inputs to check the condition
853 TObjArray* detArray = runLoader->GetAliRun()->Detectors();
855 TString detStr = GetTriggeringModules();
857 for( Int_t iDet = 0; iDet < detArray->GetEntriesFast(); iDet++ ) {
858 AliModule* det = (AliModule*) detArray->At(iDet);
859 if( !det || !det->IsActive() ) continue;
860 if( IsSelected( det->GetName(), detStr ) ) {
861 AliInfo( Form( "Creating inputs for %s", det->GetName() ) );
862 AliTriggerDetector* dtrg = det->CreateTriggerDetector();
863 dtrg->CreateInputs(GetInputs());
864 TObjArray* detInp = dtrg->GetInputs();
865 for( Int_t i=0; i<detInp->GetEntriesFast(); i++ ) {
866 AliInfo( Form( "Adding input %s", ((AliTriggerInput*)detInp->At(i))->GetName() ) );
867 inputs.AddLast( detInp->At(i) );
872 // check if the condition is compatible with the triggers inputs
873 Int_t ndesc = fClasses.GetEntriesFast();
874 Bool_t check = kTRUE;
876 for( Int_t j=0; j<ndesc; j++ ) {
877 AliTriggerClass *trclass = (AliTriggerClass*)fClasses.At( j );
878 if( !(trclass->CheckClass( this )) ) check = kFALSE;
880 if (trclass->IsActive(this->GetInputs(),this->GetFunctions())) {
881 AliInfo( Form( "Trigger Class (%s) OK, class mask (0x%Lx)",
882 trclass->GetName(), trclass->GetMask( ) ) );
885 AliWarning( Form( "Trigger Class (%s) is NOT active, class mask (0x%Lx)",
886 trclass->GetName(), trclass->GetMask( ) ) );
889 // check if condition mask is duplicated
890 if( mask & trclass->GetMask() ) {
891 AliError( Form("Class (%s). The class mask (0x%Lx) is ambiguous. It was already defined",
892 trclass->GetName(), trclass->GetMask() ) );
895 mask |= trclass->GetMask();
901 //_____________________________________________________________________________
902 void AliTriggerConfiguration::Reset()
904 for( Int_t j=0; j<fInputs.GetEntriesFast(); j++ )
905 ((AliTriggerInput*)fInputs.At(j))->Reset();
907 for( Int_t j=0; j<fClasses.GetEntriesFast(); j++ )
908 ((AliTriggerClass*)fClasses.At(j))->Reset();
911 //_____________________________________________________________________________
912 void AliTriggerConfiguration::Print( const Option_t* ) const
915 cout << "#################################################" << endl;
916 cout << "Trigger Configuration:" << endl;
917 cout << " Name: " << GetName() << endl;
918 cout << " Description: " << GetTitle() << endl;
919 cout << " Active Detectors: " << GetActiveDetectors() << endl;
920 cout << " Trigger Detectors: " << GetTriggeringDetectors() << endl;
922 cout << "#################################################" << endl;
924 cout << "#################################################" << endl;
925 fInteractions.Print();
926 cout << "#################################################" << endl;
928 cout << "#################################################" << endl;
929 fDescriptors.Print();
930 cout << "#################################################" << endl;
932 cout << "#################################################" << endl;
933 fPFProtections.Print();
934 cout << "#################################################" << endl;
936 cout << "#################################################" << endl;
938 cout << "#################################################" << endl;
944 //////////////////////////////////////////////////////////////////////////////
947 //_____________________________________________________________________________
948 Bool_t AliTriggerConfiguration::IsSelected( TString detName, TString& detectors ) const
950 // check whether detName is contained in detectors
951 // if yes, it is removed from detectors
953 // check if all detectors are selected
954 if( (detectors.CompareTo("ALL") == 0 ) ||
955 detectors.BeginsWith("ALL ") ||
956 detectors.EndsWith(" ALL") ||
957 detectors.Contains(" ALL ") ) {
962 // search for the given detector
963 Bool_t result = kFALSE;
964 if( (detectors.CompareTo( detName ) == 0) ||
965 detectors.BeginsWith( detName+" " ) ||
966 detectors.EndsWith( " "+detName ) ||
967 detectors.Contains( " "+detName+" " ) ) {
968 detectors.ReplaceAll( detName, "" );
972 // clean up the detectors string
973 while( detectors.Contains(" ") ) detectors.ReplaceAll( " ", " " );
974 while( detectors.BeginsWith(" ") ) detectors.Remove( 0, 1 );
975 while( detectors.EndsWith(" ") ) detectors.Remove( detectors.Length()-1, 1 );